summaryrefslogtreecommitdiff
path: root/libavcodec/libopenh264dec.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-09-11 13:57:23 -0300
committerJames Almer <jamrial@gmail.com>2018-09-11 13:57:23 -0300
commitff44c2d4f483cda53859ce019f3815c69239a7e0 (patch)
tree3db5484de8ef73e184ecff0550204a613156a038 /libavcodec/libopenh264dec.c
parentef71ef5f30ddf1cd61e46628a04608892caf76d2 (diff)
parent83678dbbae64ad8c501e0c732c1117e642c25dae (diff)
downloadffmpeg-ff44c2d4f483cda53859ce019f3815c69239a7e0.tar.gz
Merge commit '83678dbbae64ad8c501e0c732c1117e642c25dae'
* commit '83678dbbae64ad8c501e0c732c1117e642c25dae': libopenh264dec: Export the decoded profile and level in AVCodecContext Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/libopenh264dec.c')
-rw-r--r--libavcodec/libopenh264dec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
index 3acc3696da..f9b91ce3c0 100644
--- a/libavcodec/libopenh264dec.c
+++ b/libavcodec/libopenh264dec.c
@@ -95,6 +95,9 @@ static int svc_decode_frame(AVCodecContext *avctx, void *data,
int ret, linesize[3];
AVFrame *avframe = data;
DECODING_STATE state;
+#if OPENH264_VER_AT_LEAST(1, 7)
+ int opt;
+#endif
if (!avpkt->data) {
#if OPENH264_VER_AT_LEAST(1, 9)
@@ -138,6 +141,12 @@ FF_DISABLE_DEPRECATION_WARNINGS
avframe->pkt_pts = avpkt->pts;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
+#if OPENH264_VER_AT_LEAST(1, 7)
+ (*s->decoder)->GetOption(s->decoder, DECODER_OPTION_PROFILE, &opt);
+ avctx->profile = opt;
+ (*s->decoder)->GetOption(s->decoder, DECODER_OPTION_LEVEL, &opt);
+ avctx->level = opt;
+#endif
*got_frame = 1;
return avpkt->size;