aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hevcdec.c
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2017-11-10 12:31:56 -0800
committerAman Gupta <aman@tmm1.net>2017-11-13 14:32:48 -0800
commit3a91b3ae742425c25b9b80708f3c111537e570d3 (patch)
tree9381425b3d984c7e6d99141cb0afcfeadc879ed2 /libavcodec/hevcdec.c
parentbd2d70c0b8f416cf1f70e910ed675c0d46fb0010 (diff)
downloadffmpeg-3a91b3ae742425c25b9b80708f3c111537e570d3.tar.gz
avcodec/hevc: implement new decode_params callback for VideoToolbox
Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r--libavcodec/hevcdec.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 6dd6d0c53c..75960912b1 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -2824,23 +2824,55 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
switch (s->nal_unit_type) {
case HEVC_NAL_VPS:
+ if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) {
+ ret = s->avctx->hwaccel->decode_params(s->avctx,
+ nal->type,
+ nal->raw_data,
+ nal->raw_size);
+ if (ret < 0)
+ goto fail;
+ }
ret = ff_hevc_decode_nal_vps(gb, s->avctx, &s->ps);
if (ret < 0)
goto fail;
break;
case HEVC_NAL_SPS:
+ if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) {
+ ret = s->avctx->hwaccel->decode_params(s->avctx,
+ nal->type,
+ nal->raw_data,
+ nal->raw_size);
+ if (ret < 0)
+ goto fail;
+ }
ret = ff_hevc_decode_nal_sps(gb, s->avctx, &s->ps,
s->apply_defdispwin);
if (ret < 0)
goto fail;
break;
case HEVC_NAL_PPS:
+ if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) {
+ ret = s->avctx->hwaccel->decode_params(s->avctx,
+ nal->type,
+ nal->raw_data,
+ nal->raw_size);
+ if (ret < 0)
+ goto fail;
+ }
ret = ff_hevc_decode_nal_pps(gb, s->avctx, &s->ps);
if (ret < 0)
goto fail;
break;
case HEVC_NAL_SEI_PREFIX:
case HEVC_NAL_SEI_SUFFIX:
+ if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) {
+ ret = s->avctx->hwaccel->decode_params(s->avctx,
+ nal->type,
+ nal->raw_data,
+ nal->raw_size);
+ if (ret < 0)
+ goto fail;
+ }
ret = ff_hevc_decode_nal_sei(gb, s->avctx, &s->sei, &s->ps, s->nal_unit_type);
if (ret < 0)
goto fail;