summaryrefslogtreecommitdiff
path: root/libavcodec/v210enc.c
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@ltnglobal.com>2018-09-07 15:40:27 -0400
committerMarton Balint <cus@passwd.hu>2018-09-09 22:42:26 +0200
commitfb9d4f5c3e27be34d13958325ff84fffa0dea70f (patch)
tree316be0a8bd91621c51d3db5d617f1b75b59da523 /libavcodec/v210enc.c
parent35498c124a81d4207e34e115840138d71307c2e3 (diff)
avcodec/v210enc: Pass through Active Format Description (AFD) data
When encoding to V210, make sure the AFD side data makes it through in the resulting AVPacket. This is needed so the decklink output module can put out AFD when in 10-bit mode. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavcodec/v210enc.c')
-rw-r--r--libavcodec/v210enc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index b9dcf9a672..b024806d0b 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -242,6 +242,14 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
memcpy(buf, side_data->data, side_data->size);
}
+ side_data = av_frame_get_side_data(pic, AV_FRAME_DATA_AFD);
+ if (side_data && side_data->size) {
+ uint8_t *buf = av_packet_new_side_data(pkt, AV_PKT_DATA_AFD, side_data->size);
+ if (!buf)
+ return AVERROR(ENOMEM);
+ memcpy(buf, side_data->data, side_data->size);
+ }
+
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
return 0;