X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=decklink_capture.cpp;h=5e41da436ef71b0920495e38137390661f4b09fb;hb=d3bb49ae54af97a9d4c3a02765e76d3f437f2ce1;hp=2519caa5ef05034b7ef136d6d769f50b10ba2aca;hpb=add2055b0dbc8a6f6cda986a41481ca0061c1e05;p=nageru diff --git a/decklink_capture.cpp b/decklink_capture.cpp index 2519caa..5e41da4 100644 --- a/decklink_capture.cpp +++ b/decklink_capture.cpp @@ -1,25 +1,30 @@ #include "decklink_capture.h" +#include +#include +#include +#include #include +#ifdef __SSE2__ +#include +#endif #include #include #include #include -#include -#ifdef __SSE2__ -#include -#endif +#include +#include +#include +#include -#include -#include -#include -#include #include "bmusb/bmusb.h" #define FRAME_SIZE (8 << 20) // 8 MB. using namespace std; +using namespace std::chrono; using namespace std::placeholders; +using namespace bmusb; namespace { @@ -58,7 +63,7 @@ size_t memcpy_interleaved_fastpath(uint8_t *dest1, uint8_t *dest2, const uint8_t memcpy_interleaved(dest1, dest2, src, n2); dest1 += n2 / 2; dest2 += n2 / 2; - if (n2 % 1) { + if (n2 % 2) { swap(dest1, dest2); } src = aligned_src; @@ -350,6 +355,8 @@ HRESULT STDMETHODCALLTYPE DeckLinkCapture::VideoInputFrameArrived( video_format.width = width; video_format.height = height; + + current_video_frame.received_timestamp = steady_clock::now(); } } @@ -366,6 +373,8 @@ HRESULT STDMETHODCALLTYPE DeckLinkCapture::VideoInputFrameArrived( audio_format.bits_per_sample = 32; audio_format.num_channels = 2; + + current_audio_frame.received_timestamp = steady_clock::now(); } }