7 void check_frame_stability(uint16_t timecode,
8 FrameAllocator::Frame video_frame, size_t video_offset, uint16_t video_format,
9 FrameAllocator::Frame audio_frame, size_t audio_offset, uint16_t audio_format)
11 //printf("0x%04x: %d video bytes (format 0x%04x), %d audio bytes (format 0x%04x)\n",
12 // timecode, video_end - video_start, video_format, audio_end - audio_start, audio_format);
14 static uint16_t last_timecode = 0;
15 static size_t last_video_bytes = 0;
16 static size_t last_audio_bytes = 0;
18 if (!(last_timecode == 0 && last_video_bytes == 0 && last_audio_bytes == 0)) {
19 if (timecode != (uint16_t)(last_timecode + 1)) {
20 printf("0x%04x: Dropped %d frames\n", timecode, timecode - last_timecode - 1);
21 } else if (last_video_bytes != video_frame.len - video_offset) {
22 printf("0x%04x: Video frame size changed (old=%d, cur=%d)\n", timecode,
23 last_video_bytes, video_frame.len - video_offset);
24 } else if (last_audio_bytes != audio_frame.len - audio_offset) {
25 printf("0x%04x: Audio block size changed (old=%d, cur=%d)\n", timecode,
26 last_audio_bytes, audio_frame.len - audio_offset);
29 last_timecode = timecode;
30 last_video_bytes = video_frame.len - video_offset;
31 last_audio_bytes = audio_frame.len - audio_offset;
33 get_video_frame_allocator()->release_frame(video_frame);
34 get_audio_frame_allocator()->release_frame(audio_frame);
37 int main(int argc, char **argv)
39 set_frame_callback(check_frame_stability);