X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fdecklink_capture.cpp;h=f7016dce7c07f607455481c9d00a34e2d379ac99;hb=575f6eb1b052bb1291987753b1a8cccc7f1e3ab3;hp=ea55b4668f3c83e4b5119c7ad63f91bf0d0ecaf9;hpb=eeda8995329601f9f4e35047358400833eeae68e;p=nageru diff --git a/nageru/decklink_capture.cpp b/nageru/decklink_capture.cpp index ea55b46..f7016dc 100644 --- a/nageru/decklink_capture.cpp +++ b/nageru/decklink_capture.cpp @@ -252,21 +252,21 @@ HRESULT STDMETHODCALLTYPE DeckLinkCapture::VideoInputFrameArrived( assert(stride == width * 2); } - current_video_frame = video_frame_allocator->alloc_frame(); + current_video_frame = video_frame_allocator->create_frame(width, height, stride); if (current_video_frame.data != nullptr) { - const uint8_t *frame_bytes; - video_frame->GetBytes((void **)&frame_bytes); + const uint8_t *src; + video_frame->GetBytes((void **)&src); size_t num_bytes = stride * height; if (current_video_frame.interleaved) { uint8_t *data = current_video_frame.data; uint8_t *data2 = current_video_frame.data2; - memcpy_interleaved(data, data2, frame_bytes, num_bytes); + memcpy_interleaved(data, data2, src, num_bytes); } else { - memcpy(current_video_frame.data, frame_bytes, num_bytes); + memcpy(current_video_frame.data, src, num_bytes); } if (current_video_frame.data_copy != nullptr) { - memcpy(current_video_frame.data_copy, frame_bytes, num_bytes); + memcpy(current_video_frame.data_copy, src, num_bytes); } current_video_frame.len += num_bytes; @@ -281,11 +281,11 @@ HRESULT STDMETHODCALLTYPE DeckLinkCapture::VideoInputFrameArrived( current_audio_frame = audio_frame_allocator->alloc_frame(); if (current_audio_frame.data != nullptr) { - const uint8_t *frame_bytes; - audio_frame->GetBytes((void **)&frame_bytes); + const uint8_t *src; + audio_frame->GetBytes((void **)&src); current_audio_frame.len = sizeof(int32_t) * 2 * num_samples; - memcpy(current_audio_frame.data, frame_bytes, current_audio_frame.len); + memcpy(current_audio_frame.data, src, current_audio_frame.len); audio_format.bits_per_sample = 32; audio_format.num_channels = 2;