diff options
Diffstat (limited to 'ffmpeg/libavcodec/libutvideodec.cpp')
| -rw-r--r-- | ffmpeg/libavcodec/libutvideodec.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/ffmpeg/libavcodec/libutvideodec.cpp b/ffmpeg/libavcodec/libutvideodec.cpp index bc491e2..60dbd15 100644 --- a/ffmpeg/libavcodec/libutvideodec.cpp +++ b/ffmpeg/libavcodec/libutvideodec.cpp @@ -21,7 +21,8 @@ /** * @file * Known FOURCCs: - * 'ULY0' (YCbCr 4:2:0), 'ULY2' (YCbCr 4:2:2), 'ULRG' (RGB), 'ULRA' (RGBA) + * 'ULY0' (YCbCr 4:2:0), 'ULY2' (YCbCr 4:2:2), 'ULRG' (RGB), 'ULRA' (RGBA), + * 'ULH0' (YCbCr 4:2:0 BT.709), 'ULH2' (YCbCr 4:2:2 BT.709) */ extern "C" { @@ -51,6 +52,18 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx) /* Pick format based on FOURCC */ switch (avctx->codec_tag) { +#ifdef UTV_BT709 + case MKTAG('U', 'L', 'H', '0'): + avctx->pix_fmt = AV_PIX_FMT_YUV420P; + avctx->colorspace = AVCOL_SPC_BT709; + format = UTVF_YV12; + break; + case MKTAG('U', 'L', 'H', '2'): + avctx->pix_fmt = AV_PIX_FMT_YUYV422; + avctx->colorspace = AVCOL_SPC_BT709; + format = UTVF_YUY2; + break; +#endif case MKTAG('U', 'L', 'Y', '0'): avctx->pix_fmt = AV_PIX_FMT_YUV420P; format = UTVF_YV12; @@ -83,7 +96,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx) } /* Allocate the output frame */ - avctx->coded_frame = avcodec_alloc_frame(); + avctx->coded_frame = av_frame_alloc(); /* Ut Video only supports 8-bit */ avctx->bits_per_raw_sample = 8; @@ -151,7 +164,7 @@ static int utvideo_decode_frame(AVCodecContext *avctx, void *data, } *got_frame = 1; - *(AVFrame *)data = *pic; + av_frame_move_ref((AVFrame*)data, pic); return avpkt->size; } @@ -161,7 +174,7 @@ static av_cold int utvideo_decode_close(AVCodecContext *avctx) UtVideoContext *utv = (UtVideoContext *)avctx->priv_data; /* Free output */ - av_freep(&avctx->coded_frame); + av_frame_free(&avctx->coded_frame); av_freep(&utv->buffer); /* Finish decoding and clean up the instance */ |
