[vlc-commits] vaapi/vp9: use ffmpeg context to read the profile

Mathieu Velten git at videolan.org
Tue Jan 2 09:43:15 CET 2018


vlc | branch: master | Mathieu Velten <matmaul at gmail.com> | Wed Dec 27 12:54:43 2017 +0100| [16f01fa1cda4f38bed4aae68b1ed5f26d4638d34] | committer: Thomas Guillem

vaapi/vp9: use ffmpeg context to read the profile

Sometimes the profile is not available in the container metadatas (WebM)
and the VP9 packetizer (AVParser) doesn't report this value.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/codec/avcodec/vaapi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index ee7fdf892c..dccdefe772 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -103,11 +103,14 @@ static int GetVaProfile(AVCodecContext *ctx, const es_format_t *fmt,
         count = 5;
         break;
     case AV_CODEC_ID_VP9:
-        if (fmt->i_profile == FF_PROFILE_VP9_0)
+        if (ctx->profile == FF_PROFILE_VP9_0)
             i_profile = VAProfileVP9Profile0;
 #if VA_CHECK_VERSION( 0, 39, 0 )
-        else if (fmt->i_profile == FF_PROFILE_VP9_2)
+        else if (ctx->profile == FF_PROFILE_VP9_2)
+        {
             i_profile = VAProfileVP9Profile2;
+            i_vlc_chroma = VLC_CODEC_VAAPI_420_10BPP;
+        }
 #endif
         else
             return VLC_EGENERIC;



More information about the vlc-commits mailing list