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.
Showing the changes to libavdevice/decklink_common.cpp (1 of 7 files). Show all
Unified · Split
| @@ -484,6 +484,22 @@ int ff_decklink_packet_queue_get(DecklinkPacketQueue *q, AVPacket *pkt, int bloc · 483 unmodified lines | |||
| 484 | return ret; | 484 | return ret; |
| 485 | } | 485 | } |
| 486 | 486 | ||
| 487 | int64_t ff_decklink_packet_queue_peekpts(DecklinkPacketQueue *q) | ||
| 488 | { | ||
| 489 | PacketListEntry *pkt1; | ||
| 490 | int64_t pts = -1; | ||
| 491 | |||
| 492 | pthread_mutex_lock(&q->mutex); | ||
| 493 | pkt1 = q->pkt_list.head; | ||
| 494 | if (pkt1) { | ||
| 495 | pts = pkt1->pkt.pts; | ||
| 496 | } | ||
| 497 | pthread_mutex_unlock(&q->mutex); | ||
| 498 | |||
| 499 | return pts; | ||
| 500 | } | ||
| 501 | |||
| 502 | |||
| 487 | int ff_decklink_list_devices(AVFormatContext *avctx, | 503 | int ff_decklink_list_devices(AVFormatContext *avctx, |
| 488 | struct AVDeviceInfoList *device_list, | 504 | struct AVDeviceInfoList *device_list, |
| 489 | int show_inputs, int show_outputs) | 505 | int show_inputs, int show_outputs) |