]> git.sesse.net Git - ffmpeg/commitdiff
libopenh264dec: Export the decoded profile and level in AVCodecContext
authorMartin Storsjö <martin@martin.st>
Fri, 31 Aug 2018 09:25:40 +0000 (12:25 +0300)
committerMartin Storsjö <martin@martin.st>
Fri, 31 Aug 2018 10:25:25 +0000 (13:25 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/libopenh264dec.c

index 5990a72ff9cb8d3a05e162561bc0e63a39fd0df0..60e4b028ecbca8955c5d3e35faaa7fee1b29775e 100644 (file)
@@ -95,6 +95,9 @@ static int svc_decode_frame(AVCodecContext *avctx, void *data,
     int 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)
@@ -135,6 +138,12 @@ static int svc_decode_frame(AVCodecContext *avctx, void *data,
 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;