[testing] audio timestamp stream generator and detector
Submitted by Edward Hervey
Currently, in order to test the correctness of timestamp handling for various audio elements we only rely on the GstBuffer timestamps.
The problem with this is that we rely on the fact that all elements properly handle/read/set/modify buffer timestamps properly. And that's the only thing we use to check for errors/regressions/stream-validity in unit-tests. In other words... lots of errors can be introduced which can't be detected by any other means than by human detection.
In order to properly verify the correctness of audio elements, we need
- an audio generating element (maybe an extra mode to audiotestsrc?) that will create a pattern in the stream which embeds the timestamp with a more or less good accuracy.
- an audio pattern detection element that can detect those embedded timestamps in buffers and emit messages accordingly ("at this stream running time I saw this original timestamp").
That pattern should:
- be more or less robust to rate/depth conversion
- have a sync point that is as accurate as possible (to detect shifts by a few samples),
- contain the full timestamp information within as little samples as possible, either before or after the sync point
- ideally be resistant to various audio encoding techniques (so we can still detect the pattern after a encode/decode pass)
Keywords for searching relevant documentation/material : watermarking, fingerprinting