X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=decklink_capture.cpp;h=a0e890fcbcdd4fdc7c8bbb55e8212e8039980192;hb=a18cfe79e996811cba2acc3d04cbf26120c39c13;hp=92fd6ae296e567a402928bb3fd15a7e4f9300042;hpb=a0083c1e4712a6e9f7c468f0961b292cfd9b69b0;p=nageru diff --git a/decklink_capture.cpp b/decklink_capture.cpp index 92fd6ae..a0e890f 100644 --- a/decklink_capture.cpp +++ b/decklink_capture.cpp @@ -8,6 +8,7 @@ #ifdef __SSE2__ #include #endif +#include #include #include #include @@ -301,12 +302,17 @@ HRESULT STDMETHODCALLTYPE DeckLinkCapture::VideoInputFrameArrived( IDeckLinkAudioInputPacket *audio_frame) { if (!done_init) { + char thread_name[16]; + snprintf(thread_name, sizeof(thread_name), "DeckLink_C_%d", card_index); + pthread_setname_np(pthread_self(), thread_name); if (has_dequeue_callbacks) { dequeue_init_callback(); } done_init = true; } + steady_clock::time_point now = steady_clock::now(); + FrameAllocator::Frame current_video_frame, current_audio_frame; VideoFormat video_format; AudioFormat audio_format; @@ -353,7 +359,7 @@ HRESULT STDMETHODCALLTYPE DeckLinkCapture::VideoInputFrameArrived( video_format.width = width; video_format.height = height; - current_video_frame.received_timestamp = steady_clock::now(); + current_video_frame.received_timestamp = now; } } @@ -371,7 +377,7 @@ HRESULT STDMETHODCALLTYPE DeckLinkCapture::VideoInputFrameArrived( audio_format.bits_per_sample = 32; audio_format.num_channels = 2; - current_audio_frame.received_timestamp = steady_clock::now(); + current_audio_frame.received_timestamp = now; } }