From ac4247270c055ecc56e6aca94fbb13a3f8aab3ce Mon Sep 17 00:00:00 2001 From: Devin Heitmueller Date: Fri, 30 Jun 2023 17:14:39 -0400 Subject: avdevice/decklink_enc: add support for SMPTE 2038 VANC packet output Support decoding and embedding VANC packets delivered via SMPTE 2038 into the SDI output. We leverage an intermediate queue because data packets are announced separately from video but we need to embed the data into the video frame when it is output. Note that this patch has some additional abstraction for data streams in general as opposed to just SMPTE 2038 packets. This is because subsequent patches will introduce support for other data codecs. Thanks to Marton Balint for review/feedback. Signed-off-by: Devin Heitmueller Signed-off-by: Marton Balint --- libavdevice/decklink_common.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libavdevice/decklink_common.cpp') diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp index b3b83f53b8..47de7ef6b0 100644 --- a/libavdevice/decklink_common.cpp +++ b/libavdevice/decklink_common.cpp @@ -484,6 +484,22 @@ int ff_decklink_packet_queue_get(DecklinkPacketQueue *q, AVPacket *pkt, int bloc return ret; } +int64_t ff_decklink_packet_queue_peekpts(DecklinkPacketQueue *q) +{ + PacketListEntry *pkt1; + int64_t pts = -1; + + pthread_mutex_lock(&q->mutex); + pkt1 = q->pkt_list.head; + if (pkt1) { + pts = pkt1->pkt.pts; + } + pthread_mutex_unlock(&q->mutex); + + return pts; +} + + int ff_decklink_list_devices(AVFormatContext *avctx, struct AVDeviceInfoList *device_list, int show_inputs, int show_outputs) -- cgit v1.2.3