[FFmpeg-cvslog] hevc: export stream parameters from extradata
Anton Khirnov
git at videolan.org
Fri Apr 3 21:36:36 CEST 2015
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Mar 29 14:15:41 2015 +0200| [7693ba0a0eecdcdba71b7fbd9a4a12d1ba7b82aa] | committer: Anton Khirnov
hevc: export stream parameters from extradata
This allows the callers to have a hint of the probable stream parameters
without actually decoding anything.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7693ba0a0eecdcdba71b7fbd9a4a12d1ba7b82aa
---
libavcodec/hevc.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 7b2b382..4c06fb8 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -3138,7 +3138,7 @@ static int hevc_decode_extradata(HEVCContext *s)
{
AVCodecContext *avctx = s->avctx;
GetByteContext gb;
- int ret;
+ int ret, i;
bytestream2_init(&gb, avctx->extradata, avctx->extradata_size);
@@ -3195,6 +3195,16 @@ static int hevc_decode_extradata(HEVCContext *s)
if (ret < 0)
return ret;
}
+
+ /* export stream parameters from the first SPS */
+ for (i = 0; i < FF_ARRAY_ELEMS(s->sps_list); i++) {
+ if (s->sps_list[i]) {
+ const HEVCSPS *sps = (const HEVCSPS*)s->sps_list[i]->data;
+ export_stream_params(s->avctx, s, sps);
+ break;
+ }
+ }
+
return 0;
}
More information about the ffmpeg-cvslog
mailing list