Expand description
Audio/video sync harness (M-MEDIA.7 / AUT-103).
Combines GstreamerAudioCapture and GstreamerVideoCapture
into one harness that reports per-stream timing and inter-stream
drift. Synthetic audiotestsrc + videotestsrc sources keep
the assertion deterministic — live capture (M-MEDIA.15 / .16) will
reuse the same harness shape but with autoaudiosrc / autovideosrc.
§What “drift” means here
Each stream stamps its own PTS via MediaTime::from_sample /
MediaTime::from_frame. For synthetic sources, both PTS values
are derived from per-stream counters at construction-time rates, so
the per-stream PTS is the timeline. We report:
first_audio_pts/first_video_pts(≈ 0 s for synthetic sources).last_audio_pts/last_video_pts(= sample_count / rate and frame_count / fps respectively).drift=|last_audio_pts - last_video_pts|. For synthetic sources this is near-zero by construction; for live sources it reports the underlying clock disagreement.
Structs§
- Sync
Config - Tunable parameters for one harness run.
- Sync
Report - Result of a single
runcapture.
Enums§
- Error
- Failure modes for the sync harness.
Functions§
- run
- Run one capture cycle. Spawns both audio + video sources, pulls
audio chunks at
audio_chunk_framesgranularity and one video frame per video tick untildurationis covered. Returns the summarySyncReport. - seconds_
to_ 🔒count - Convert
seconds × rateto au64count, rounding to nearest. Both inputs are finite + non-negative in normal use; clamps to 0 on anything else.