X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=main.cpp;h=7506962329d26e2e6e334db48c350ba09e3e0370;hb=89136643760d7da0c94c4d4fb1ec778f9cefb97f;hp=a605b1a75c208cc790d5d2eaac2d898732d5f2db;hpb=1339024634446f28d169c3010fede7227318dd62;p=bmusb diff --git a/main.cpp b/main.cpp index a605b1a..7506962 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,8 @@ #include "bmusb.h" using namespace std; + +BMUSBCapture *usb; void check_frame_stability(uint16_t timecode, FrameAllocator::Frame video_frame, size_t video_offset, uint16_t video_format, @@ -30,14 +32,17 @@ void check_frame_stability(uint16_t timecode, last_video_bytes = video_frame.len - video_offset; last_audio_bytes = audio_frame.len - audio_offset; - get_video_frame_allocator()->release_frame(video_frame); - get_audio_frame_allocator()->release_frame(audio_frame); + usb->get_video_frame_allocator()->release_frame(video_frame); + usb->get_audio_frame_allocator()->release_frame(audio_frame); } int main(int argc, char **argv) { - set_frame_callback(check_frame_stability); - start_bm_capture(); + usb = new BMUSBCapture; + usb->set_frame_callback(check_frame_stability); + usb->configure_card(); + BMUSBCapture::start_bm_thread(); + usb->start_bm_capture(); sleep(1000000); }