[FFmpeg-devel] [PATCH 4/4] avcodec/v210dec: Pass on the Closed Captions Side Data
Hendrik Leppkes
h.leppkes at gmail.com
Thu Aug 31 12:32:01 EEST 2017
On Thu, Aug 31, 2017 at 10:36 AM, <kjeyapal at akamai.com> wrote:
> From: Karthick J <kjeyapal at akamai.com>
>
> Signed-off-by: Karthick J <kjeyapal at akamai.com>
> ---
> libavcodec/v210dec.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
> index 9af9af6..7b0b68b 100644
> --- a/libavcodec/v210dec.c
> +++ b/libavcodec/v210dec.c
> @@ -73,6 +73,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
> AVFrame *pic = data;
> const uint8_t *psrc = avpkt->data;
> uint16_t *y, *u, *v;
> + uint8_t *cc_data;
> + int cc_size;
>
> if (s->custom_stride )
> stride = s->custom_stride;
> @@ -149,6 +151,16 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
> pic->top_field_first = 1;
> }
>
> + if ((cc_data = av_packet_get_side_data(avpkt, AV_PKT_DATA_A53_CC, &cc_size)) != NULL) {
> +
> + AVFrameSideData *sd = av_frame_new_side_data(pic,
> + AV_FRAME_DATA_A53_CC,
> + cc_size);
> + if (sd)
> + memcpy(sd->data, cc_data, cc_size);
> + avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
> + }
> +
> *got_frame = 1;
>
> return avpkt->size;
Maybe this should be handled somewhere in generic code? This is hardly
a v210 property at all.
- Hendrik
More information about the ffmpeg-devel
mailing list