X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=main.cpp;h=a50363ab8cab6286df19f4237786c5d510c0fe62;hb=e0837a17b5a497476d67237c768836e51f8a4ce7;hp=7506962329d26e2e6e334db48c350ba09e3e0370;hpb=dfaf0700aefbcede0d058254f1f0a456ad46de03;p=bmusb diff --git a/main.cpp b/main.cpp index 7506962..a50363a 100644 --- a/main.cpp +++ b/main.cpp @@ -1,17 +1,18 @@ #include #include -#include "bmusb.h" +#include "bmusb/bmusb.h" using namespace std; +using namespace bmusb; BMUSBCapture *usb; void check_frame_stability(uint16_t timecode, - FrameAllocator::Frame video_frame, size_t video_offset, uint16_t video_format, - FrameAllocator::Frame audio_frame, size_t audio_offset, uint16_t audio_format) + FrameAllocator::Frame video_frame, size_t video_offset, VideoFormat video_format, + FrameAllocator::Frame audio_frame, size_t audio_offset, AudioFormat audio_format) { //printf("0x%04x: %d video bytes (format 0x%04x), %d audio bytes (format 0x%04x)\n", - // timecode, video_end - video_start, video_format, audio_end - audio_start, audio_format); + // timecode, video_end - video_start, video_format.id, audio_end - audio_start, audio_format.id); static uint16_t last_timecode = 0; static size_t last_video_bytes = 0; @@ -21,10 +22,10 @@ void check_frame_stability(uint16_t timecode, if (timecode != (uint16_t)(last_timecode + 1)) { printf("0x%04x: Dropped %d frames\n", timecode, timecode - last_timecode - 1); } else if (last_video_bytes != video_frame.len - video_offset) { - printf("0x%04x: Video frame size changed (old=%d, cur=%d)\n", timecode, + printf("0x%04x: Video frame size changed (old=%ld, cur=%ld)\n", timecode, last_video_bytes, video_frame.len - video_offset); } else if (last_audio_bytes != audio_frame.len - audio_offset) { - printf("0x%04x: Audio block size changed (old=%d, cur=%d)\n", timecode, + printf("0x%04x: Audio block size changed (old=%ld, cur=%ld)\n", timecode, last_audio_bytes, audio_frame.len - audio_offset); } } @@ -38,7 +39,7 @@ void check_frame_stability(uint16_t timecode, int main(int argc, char **argv) { - usb = new BMUSBCapture; + usb = new BMUSBCapture(0); // First card. usb->set_frame_callback(check_frame_stability); usb->configure_card(); BMUSBCapture::start_bm_thread();