History

libavdevice/decklink: configurablity to set max queue size

Ravindra committed 9 years ago

Commit f3913dc1 parent 6f03ffb6 files · +17 −3Browse files

Showing the changes to libavdevice/decklink_dec.cpp (1 of 6 files). Show all

Unified · Split

libavdevice/decklink_dec.cpp+5−2
@@ -1,6 +1,7 @@
1/*1/*
2 * Blackmagic DeckLink input2 * Blackmagic DeckLink input
3 * Copyright (c) 2013-2014 Luca Barbato, Deti Fliegl3 * Copyright (c) 2013-2014 Luca Barbato, Deti Fliegl
4 * Copyright (c) 2017 Akamai Technologies, Inc.
4 *5 *
5 * This file is part of FFmpeg.6 * This file is part of FFmpeg.
6 *7 *
@@ -187,10 +188,12 @@ static uint8_t* teletext_data_unit_from_vanc_data(uint8_t *src, uint8_t *tgt, in · 180 unmodified lines
187 188
188static void avpacket_queue_init(AVFormatContext *avctx, AVPacketQueue *q)189static void avpacket_queue_init(AVFormatContext *avctx, AVPacketQueue *q)
189{190{
191 struct decklink_cctx *ctx = (struct decklink_cctx *)avctx->priv_data;
190 memset(q, 0, sizeof(AVPacketQueue));192 memset(q, 0, sizeof(AVPacketQueue));
191 pthread_mutex_init(&q->mutex, NULL);193 pthread_mutex_init(&q->mutex, NULL);
192 pthread_cond_init(&q->cond, NULL);194 pthread_cond_init(&q->cond, NULL);
193 q->avctx = avctx;195 q->avctx = avctx;
196 q->max_q_size = ctx->queue_size;
194}197}
195 198
196static void avpacket_queue_flush(AVPacketQueue *q)199static void avpacket_queue_flush(AVPacketQueue *q)
@@ -230,8 +233,8 @@ static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt) · 33 unmodified lines
230{233{
231 AVPacketList *pkt1;234 AVPacketList *pkt1;
232 235
233 // Drop Packet if queue size is > 1GB236 // Drop Packet if queue size is > maximum queue size
234 if (avpacket_queue_size(q) > 1024 * 1024 * 1024 ) {237 if (avpacket_queue_size(q) > q->max_q_size) {
235 av_log(q->avctx, AV_LOG_WARNING, "Decklink input buffer overrun!\n");238 av_log(q->avctx, AV_LOG_WARNING, "Decklink input buffer overrun!\n");
236 return -1;239 return -1;
237 }240 }

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