]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/v210enc: Pass through Active Format Description (AFD) data
authorDevin Heitmueller <dheitmueller@ltnglobal.com>
Fri, 7 Sep 2018 19:40:27 +0000 (15:40 -0400)
committerMarton Balint <cus@passwd.hu>
Sun, 9 Sep 2018 20:42:26 +0000 (22:42 +0200)
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>
libavcodec/v210enc.c

index b9dcf9a672551b95d6e03c344e1bcdf2de5c248f..b024806d0b455d12b9f3b346f4a1ed18461e4a9b 100644 (file)
@@ -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;