[vlc-commits] directx_va: read the HEVC profile to select the right decoder

Steve Lhomme git at videolan.org
Mon Jul 18 06:07:20 CEST 2016


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Jul 12 16:46:43 2016 +0200| [05b132ca0a27563f4a412b641e914b8fabf18623] | committer: Jean-Baptiste Kempf

directx_va: read the HEVC profile to select the right decoder

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/Makefile.am          |    6 ++++--
 modules/codec/avcodec/directx_va.c |    7 +++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index 0a23411..a77476c 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -365,7 +365,8 @@ endif
 
 libdxva2_plugin_la_SOURCES = \
 	codec/avcodec/dxva2.c codec/avcodec/directx_va.c codec/avcodec/directx_va.h \
-	packetizer/h264_nal.c packetizer/h264_nal.h
+	packetizer/h264_nal.c packetizer/h264_nal.h \
+	packetizer/hevc_nal.c packetizer/hevc_nal.h
 libdxva2_plugin_la_LIBADD = -lole32 -lshlwapi -luuid
 if HAVE_AVCODEC_DXVA2
 codec_LTLIBRARIES += libdxva2_plugin.la
@@ -374,7 +375,8 @@ endif
 libd3d11va_plugin_la_SOURCES = \
 	codec/avcodec/d3d11va.c codec/avcodec/directx_va.c codec/avcodec/directx_va.h \
 	video_chroma/dxgi_fmt.c video_chroma/dxgi_fmt.h \
-	packetizer/h264_nal.c packetizer/h264_nal.h
+	packetizer/h264_nal.c packetizer/h264_nal.h \
+	packetizer/hevc_nal.c packetizer/hevc_nal.h
 libd3d11va_plugin_la_LIBADD = -lole32 -luuid
 if HAVE_WINSTORE
 libd3d11va_plugin_la_LIBADD += -ld3d11
diff --git a/modules/codec/avcodec/directx_va.c b/modules/codec/avcodec/directx_va.c
index 17c2db1..5b8a894 100644
--- a/modules/codec/avcodec/directx_va.c
+++ b/modules/codec/avcodec/directx_va.c
@@ -40,6 +40,7 @@
 
 #include "avcodec.h"
 #include "../../packetizer/h264_nal.h"
+#include "../../packetizer/hevc_nal.h"
 
 static const int PROF_MPEG2_SIMPLE[] = { FF_PROFILE_MPEG2_SIMPLE, 0 };
 static const int PROF_MPEG2_MAIN[]   = { FF_PROFILE_MPEG2_SIMPLE,
@@ -498,6 +499,12 @@ static bool profile_supported(const directx_va_mode_t *mode, const es_format_t *
             if ( h264_get_profile_level(fmt, &h264_profile, NULL, NULL) )
                 profile = h264_profile;
         }
+        if (mode->codec == AV_CODEC_ID_HEVC)
+        {
+            uint8_t hevc_profile;
+            if (hevc_get_profile_level(fmt, &hevc_profile, NULL, NULL) )
+                profile = hevc_profile;
+        }
 
         if (profile <= 0)
             is_supported = true;



More information about the vlc-commits mailing list