uint16_t video_timecode = pending_video_frames.front().timecode;
uint16_t audio_timecode = pending_audio_frames.front().timecode;
+ AudioFormat audio_format;
+ audio_format.bits_per_sample = 24;
+ audio_format.num_channels = 8;
if (uint16_less_than_with_wraparound(video_timecode, audio_timecode)) {
printf("Video block 0x%04x without corresponding audio block, dropping.\n",
video_timecode);
QueuedFrame audio_frame = pending_audio_frames.front();
pending_audio_frames.pop_front();
lock.unlock();
+ audio_format.id = audio_frame.format;
frame_callback(audio_timecode,
FrameAllocator::Frame(), 0, VideoFormat(),
- audio_frame.frame, AUDIO_HEADER_SIZE, audio_frame.format);
+ audio_frame.frame, AUDIO_HEADER_SIZE, audio_format);
} else {
QueuedFrame video_frame = pending_video_frames.front();
QueuedFrame audio_frame = pending_audio_frames.front();
#endif
VideoFormat video_format;
+ audio_format.id = audio_frame.format;
if (decode_video_format(video_frame.format, &video_format)) {
frame_callback(video_timecode,
video_frame.frame, HEADER_SIZE, video_format,
- audio_frame.frame, AUDIO_HEADER_SIZE, audio_frame.format);
+ audio_frame.frame, AUDIO_HEADER_SIZE, audio_format);
} else {
frame_callback(video_timecode,
FrameAllocator::Frame(), 0, video_format,
- audio_frame.frame, AUDIO_HEADER_SIZE, audio_frame.format);
+ audio_frame.frame, AUDIO_HEADER_SIZE, audio_format);
}
}
}
bool has_signal = false;
};
+struct AudioFormat {
+ uint16_t id = 0; // For debugging/logging only.
+ unsigned bits_per_sample = 0;
+ unsigned num_channels = 0;
+};
+
typedef std::function<void(uint16_t timecode,
FrameAllocator::Frame video_frame, size_t video_offset, VideoFormat video_format,
- FrameAllocator::Frame audio_frame, size_t audio_offset, uint16_t audio_format)>
+ FrameAllocator::Frame audio_frame, size_t audio_offset, AudioFormat audio_format)>
frame_callback_t;
class CaptureInterface {