summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264dec.c
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2017-11-10 12:18:35 -0800
committerAman Gupta <aman@tmm1.net>2017-11-13 14:32:48 -0800
commit872add08540fb36b2d2ca75df86da7d8ac9579a1 (patch)
tree63654dc33b85c2eda64682eaaca8cbacf18e7825 /libavcodec/h264dec.c
parent76f169368da4928308b932eaea528b841bc34f9e (diff)
downloadffmpeg-streaming-872add08540fb36b2d2ca75df86da7d8ac9579a1.zip
ffmpeg-streaming-872add08540fb36b2d2ca75df86da7d8ac9579a1.tar.gz
avcodec/h264: implement new decode_params callback for PPS/SPS
This callback will be used by the VideoToolbox H264 hwaccel so that it can receive SPS and PPS NALUs. VideoToolbox requires PPS changes to be fed into the decoder session, and for the session to be recreated when the SPS changes. Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavcodec/h264dec.c')
-rw-r--r--libavcodec/h264dec.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 517f6ac..be187eb 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -713,6 +713,14 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
break;
case H264_NAL_SPS: {
GetBitContext tmp_gb = nal->gb;
+ if (avctx->hwaccel && avctx->hwaccel->decode_params) {
+ ret = avctx->hwaccel->decode_params(avctx,
+ nal->type,
+ nal->raw_data,
+ nal->raw_size);
+ if (ret < 0)
+ goto end;
+ }
if (ff_h264_decode_seq_parameter_set(&tmp_gb, avctx, &h->ps, 0) >= 0)
break;
av_log(h->avctx, AV_LOG_DEBUG,
@@ -724,6 +732,14 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
break;
}
case H264_NAL_PPS:
+ if (avctx->hwaccel && avctx->hwaccel->decode_params) {
+ ret = avctx->hwaccel->decode_params(avctx,
+ nal->type,
+ nal->raw_data,
+ nal->raw_size);
+ if (ret < 0)
+ goto end;
+ }
ret = ff_h264_decode_picture_parameter_set(&nal->gb, avctx, &h->ps,
nal->size_bits);
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
OpenPOWER on IntegriCloud