diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index f9c6096406..63d74c851a 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "gstav.h" #include "gstavcodecmap.h" @@ -1635,6 +1636,19 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec, GST_VIDEO_BUFFER_FLAG_INTERLACED); } + { + AVFrameSideData *side_data = + av_frame_get_side_data (ffmpegdec->picture, AV_FRAME_DATA_A53_CC); + if (side_data) { + GST_LOG_OBJECT (ffmpegdec, "Found CC of size %d", side_data->size); + GST_MEMDUMP ("A53 CC", side_data->data, side_data->size); + out_frame->output_buffer = + gst_buffer_make_writable (out_frame->output_buffer); + gst_buffer_add_video_caption_meta (out_frame->output_buffer, + GST_VIDEO_CAPTION_TYPE_CEA708_RAW, side_data->data, side_data->size); + } + } + /* cleaning time */ /* so we decoded this frame, frames preceding it in decoding order * that still do not have a buffer allocated seem rather useless,