diff mbox

[FFmpeg-devel,V3,4/4] lavc/vaapi_decode: fix profile search when disable exact profile match.

Message ID 874cc5fa-806e-9542-0909-bf25f1bbdb16@gmail.com
State Accepted
Commit 217a723b4e0573129c4ec9c31ca3ee666a2a64f6
Headers show

Commit Message

Jun Zhao Oct. 9, 2017, 7:50 a.m. UTC
From ef75f07943ff51c63bf7735a90c38a11559cad33 Mon Sep 17 00:00:00 2001
From: Jun Zhao <jun.zhao@intel.com>
Date: Thu, 21 Sep 2017 02:44:42 -0400
Subject: [V3 4/4] lavc/vaapi_decode: fix profile search when disable exact
 profile match.

when disable exact profile, use the alt_profile for VAAPI HWAccel
decoder.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
---
 libavcodec/vaapi_decode.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Mark Thompson Oct. 9, 2017, 11:52 a.m. UTC | #1
On 09/10/17 08:50, Jun Zhao wrote:
> 
> From ef75f07943ff51c63bf7735a90c38a11559cad33 Mon Sep 17 00:00:00 2001
> From: Jun Zhao <jun.zhao@intel.com>
> Date: Thu, 21 Sep 2017 02:44:42 -0400
> Subject: [V3 4/4] lavc/vaapi_decode: fix profile search when disable exact
>  profile match.
> 
> when disable exact profile, use the alt_profile for VAAPI HWAccel
> decoder.
> 
> Signed-off-by: Jun Zhao <jun.zhao@intel.com>
> ---
>  libavcodec/vaapi_decode.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
> index 5a555b2bd3..27ef33837c 100644
> --- a/libavcodec/vaapi_decode.c
> +++ b/libavcodec/vaapi_decode.c
> @@ -281,7 +281,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
>      VAStatus vas;
>      int err, i, j;
>      const AVCodecDescriptor *codec_desc;
> -    VAProfile profile, *profile_list = NULL;
> +    VAProfile profile, va_profile, *profile_list = NULL;
>      int profile_count, exact_match, alt_profile;
>      const AVPixFmtDescriptor *sw_desc, *desc;
>  
> @@ -328,6 +328,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
>              if (exact_match)
>                  break;
>              alt_profile = vaapi_profile_map[i].codec_profile;
> +            va_profile = vaapi_profile_map[i].va_profile;
>          }
>      }
>      av_freep(&profile_list);
> @@ -347,6 +348,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
>              av_log(avctx, AV_LOG_WARNING, "Using possibly-"
>                     "incompatible profile %d instead.\n",
>                     alt_profile);
> +            profile = va_profile;
>          } else {
>              av_log(avctx, AV_LOG_VERBOSE, "Codec %s profile %d not "
>                     "supported for hardware decode.\n",
> -- 
> 2.11.0
> 

LGTM, will push later.

Thanks,

- Mark
Mark Thompson Oct. 9, 2017, 10:25 p.m. UTC | #2
On 09/10/17 12:52, Mark Thompson wrote:
> On 09/10/17 08:50, Jun Zhao wrote:
>>
>> From ef75f07943ff51c63bf7735a90c38a11559cad33 Mon Sep 17 00:00:00 2001
>> From: Jun Zhao <jun.zhao@intel.com>
>> Date: Thu, 21 Sep 2017 02:44:42 -0400
>> Subject: [V3 4/4] lavc/vaapi_decode: fix profile search when disable exact
>>  profile match.
>>
>> when disable exact profile, use the alt_profile for VAAPI HWAccel
>> decoder.
>>
>> Signed-off-by: Jun Zhao <jun.zhao@intel.com>
>> ---
>>  libavcodec/vaapi_decode.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
>> index 5a555b2bd3..27ef33837c 100644
>> --- a/libavcodec/vaapi_decode.c
>> +++ b/libavcodec/vaapi_decode.c
>> @@ -281,7 +281,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
>>      VAStatus vas;
>>      int err, i, j;
>>      const AVCodecDescriptor *codec_desc;
>> -    VAProfile profile, *profile_list = NULL;
>> +    VAProfile profile, va_profile, *profile_list = NULL;
>>      int profile_count, exact_match, alt_profile;
>>      const AVPixFmtDescriptor *sw_desc, *desc;
>>  
>> @@ -328,6 +328,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
>>              if (exact_match)
>>                  break;
>>              alt_profile = vaapi_profile_map[i].codec_profile;
>> +            va_profile = vaapi_profile_map[i].va_profile;
>>          }
>>      }
>>      av_freep(&profile_list);
>> @@ -347,6 +348,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
>>              av_log(avctx, AV_LOG_WARNING, "Using possibly-"
>>                     "incompatible profile %d instead.\n",
>>                     alt_profile);
>> +            profile = va_profile;
>>          } else {
>>              av_log(avctx, AV_LOG_VERBOSE, "Codec %s profile %d not "
>>                     "supported for hardware decode.\n",
>> -- 
>> 2.11.0
>>
> 
> LGTM, will push later.

Patches 2 and 4 applied.

Thanks,

- Mark
diff mbox

Patch

diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index 5a555b2bd3..27ef33837c 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -281,7 +281,7 @@  static int vaapi_decode_make_config(AVCodecContext *avctx)
     VAStatus vas;
     int err, i, j;
     const AVCodecDescriptor *codec_desc;
-    VAProfile profile, *profile_list = NULL;
+    VAProfile profile, va_profile, *profile_list = NULL;
     int profile_count, exact_match, alt_profile;
     const AVPixFmtDescriptor *sw_desc, *desc;
 
@@ -328,6 +328,7 @@  static int vaapi_decode_make_config(AVCodecContext *avctx)
             if (exact_match)
                 break;
             alt_profile = vaapi_profile_map[i].codec_profile;
+            va_profile = vaapi_profile_map[i].va_profile;
         }
     }
     av_freep(&profile_list);
@@ -347,6 +348,7 @@  static int vaapi_decode_make_config(AVCodecContext *avctx)
             av_log(avctx, AV_LOG_WARNING, "Using possibly-"
                    "incompatible profile %d instead.\n",
                    alt_profile);
+            profile = va_profile;
         } else {
             av_log(avctx, AV_LOG_VERBOSE, "Codec %s profile %d not "
                    "supported for hardware decode.\n",