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

Steve Lhomme robux4 at videolabs.io
Tue Jul 12 16:46:43 CEST 2016


---
 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 fd915e3..0c05601 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,
@@ -494,6 +495,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;
-- 
2.8.2



More information about the vlc-devel mailing list