History

avdevice/decklink_dec: do not copy video data

Create a buffer from the data instead and use the buffer destructor to free the DeckLink frame. This avoids a memcpy of the frame data.

Marton Balint committed 8 years ago

Commit 75d15291 parent 70336541 file · +12 −0Browse files

Unified · Split

libavdevice/decklink_dec.cpp+12−0
@@ -98,6 +98,14 @@ static VANCLineNumber vanc_line_numbers[] = { · 97 unmodified lines
9898 {bmdModeUnknown, 0, -1, -1, -1}
9999 };
100100
101+extern "C" {
102+static void decklink_object_free(void *opaque, uint8_t *data)
103+{
104+ IUnknown *obj = (class IUnknown *)opaque;
105+ obj->Release();
106+}
107+}
108+
101109 static int get_vanc_line_idx(BMDDisplayMode mode)
102110 {
103111 unsigned int i;
@@ -797,6 +805,10 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( · 693 unmodified lines
797805 }
798806 }
799807
808+ pkt.buf = av_buffer_create(pkt.data, pkt.size, decklink_object_free, videoFrame, 0);
809+ if (pkt.buf)
810+ videoFrame->AddRef();
811+
800812 if (avpacket_queue_put(&ctx->queue, &pkt) < 0) {
801813 ++ctx->dropped;
802814 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t