X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bmusb.cpp;h=9decbc9664d5c6931e94e4bd32a486ccdd0b941d;hb=c7466ef67f76efdd9e8a151e8d0f38281199c2a9;hp=2900709fd296339777263ea4dbbf7908a0836a99;hpb=1066d2975e1c824bef6b9c9555c7d9f4f1a890a9;p=bmusb diff --git a/bmusb.cpp b/bmusb.cpp index 2900709..9decbc9 100644 --- a/bmusb.cpp +++ b/bmusb.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -37,6 +38,7 @@ #include using namespace std; +using namespace std::chrono; using namespace std::placeholders; #define USB_VENDOR_BLACKMAGIC 0x1edb @@ -362,6 +364,8 @@ void BMUSBCapture::start_new_frame(const uint8_t *start) uint16_t timecode = (start[1] << 8) | start[0]; if (current_video_frame.len > 0) { + current_video_frame.received_timestamp = steady_clock::now(); + // If format is 0x0800 (no signal), add a fake (empty) audio // frame to get it out of the queue. // TODO: Figure out if there are other formats that come with @@ -405,6 +409,7 @@ void BMUSBCapture::start_new_audio_block(const uint8_t *start) uint16_t format = (start[3] << 8) | start[2]; uint16_t timecode = (start[1] << 8) | start[0]; if (current_audio_frame.len > 0) { + current_audio_frame.received_timestamp = steady_clock::now(); //dump_audio_block(); queue_frame(format, timecode, current_audio_frame, &pending_audio_frames); }