[vlc-commits] vda: use avcodec context parameters

Rémi Denis-Courmont git at videolan.org
Sun Sep 27 21:57:47 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Sep 27 15:04:11 2015 +0300| [1bb171dad3be5e3387233cba347a6eea68e0a763] | committer: Rémi Denis-Courmont

vda: use avcodec context parameters

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1bb171dad3be5e3387233cba347a6eea68e0a763
---

 modules/codec/Makefile.am   |    1 -
 modules/codec/avcodec/vda.c |   31 ++++++++++---------------------
 2 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index b66da01..868bdcc 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -367,7 +367,6 @@ endif
 
 libvda_plugin_la_SOURCES = \
 	video_chroma/copy.c video_chroma/copy.h \
-	packetizer/h264_nal.c packetizer/h264_nal.h \
 	codec/avcodec/vda.c
 libvda_plugin_la_CFLAGS = $(AM_CFLAGS) $(AVCODEC_CFLAGS)
 libvda_plugin_la_LDFLAGS = -Wl,-framework,CoreFoundation,-framework,VideoDecodeAcceleration,-framework,QuartzCore
diff --git a/modules/codec/avcodec/vda.c b/modules/codec/avcodec/vda.c
index 2f248d2..e5ff1b5 100644
--- a/modules/codec/avcodec/vda.c
+++ b/modules/codec/avcodec/vda.c
@@ -37,7 +37,6 @@
 
 #include "avcodec.h"
 #include "va.h"
-#include "../../packetizer/h264_nal.h"
 #include "../../video_chroma/copy.h"
 
 #include <libavcodec/vda.h>
@@ -102,41 +101,31 @@ static int Open(vlc_va_t *va,
 
     (void) fmt;
     (void) p_sys;
-    VLC_UNUSED(avctx);
 
     size_t i_profile = 0xFFFF, i_level = 0xFFFF;
-    bool b_ret = false;
-
-    switch (fmt->i_codec) {
-        case VLC_CODEC_H264:
-            b_ret = h264_get_profile_level(fmt, &i_profile, &i_level, NULL);
-            if (!b_ret) {
-                msg_Warn( va, "H264 profile and level parsing failed because it didn't arrive yet");
-                return VLC_EGENERIC;
-            }
 
-            msg_Dbg( va, "trying to decode MPEG-4 Part 10: profile %zu, level %zu", i_profile, i_level);
+    switch (avctx->codec_id) {
+        case AV_CODEC_ID_H264:
+            msg_Dbg( va, "trying to decode MPEG-4 Part 10: profile %d, level %d", avctx->profile, avctx->level);
 
-            switch (i_profile) {
-                case PROFILE_H264_BASELINE:
-                case PROFILE_H264_MAIN:
-                case PROFILE_H264_HIGH:
+            switch (avctx->profile & ~FF_PROFILE_H264_INTRA) {
+                case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+                case FF_PROFILE_H264_BASELINE:
+                case FF_PROFILE_H264_MAIN:
+                case FF_PROFILE_H264_HIGH:
                     break;
 
                 default:
-                {
-                    msg_Dbg( va, "unsupported H264 profile %zu", i_profile);
+                    msg_Dbg( va, "unsupported H264 profile %d", avctx->profile);
                     return -1;
-                }
             }
             break;
 
         default:
 #ifndef NDEBUG
-            msg_Err( va, "'%4.4s' is not supported", (char *)&fmt->i_codec);
+            msg_Err( va, "codec %d is not supported", avctx->codec_id);
 #endif
             return VLC_EGENERIC;
-            break;
     }
 
     vlc_va_sys_t *sys = calloc(1, sizeof (*sys));



More information about the vlc-commits mailing list