diff mbox

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

Message ID 35b150fc-f427-743b-f0de-f824598a6b7f@gmail.com
State Superseded
Headers show

Commit Message

Jun Zhao Sept. 29, 2017, 1:58 a.m. UTC
From 94604d623de1fec6f363dcda4d61712865257a0a Mon Sep 17 00:00:00 2001
From: Jun Zhao <jun.zhao@intel.com>
Date: Thu, 21 Sep 2017 02:44:42 -0400
Subject: [PATCH V2 2/2] 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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mark Thompson Oct. 1, 2017, 3:47 p.m. UTC | #1
On 29/09/17 02:58, Jun Zhao wrote:
> From 94604d623de1fec6f363dcda4d61712865257a0a Mon Sep 17 00:00:00 2001
> From: Jun Zhao <jun.zhao@intel.com>
> Date: Thu, 21 Sep 2017 02:44:42 -0400
> Subject: [PATCH V2 2/2] 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 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
> index cf58aae4c6..f0dccf481b 100644
> --- a/libavcodec/vaapi_decode.c
> +++ b/libavcodec/vaapi_decode.c
> @@ -328,7 +328,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
>          if (j < profile_count) {
>              if (exact_match)
>                  break;
> -            alt_profile = vaapi_profile_map[i].codec_profile;
> +            alt_profile = vaapi_profile_map[i].va_profile;
>          }
>      }
>      av_freep(&profile_list);
> @@ -348,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 = alt_profile;
>          } else {
>              av_log(avctx, AV_LOG_VERBOSE, "Codec %s profile %d not "
>                     "supported for hardware decode.\n",
> -- 
> 2.11.0
> 

Yeah, that looks right to me now.

The message comes out a bit strange, though, because the two profile values are in different namespaces?  One is an FF_PROFILE_*, the other is a VAProfile* - I think it's better to use the FF_PROFILE_* values in messages, because they match what is actually in the stream (profile_idc, etc.).  Maybe the first of the paired messages should also be WARNING too, so that it makes more sense with default level (info) output.

Thanks,

- Mark
Jun Zhao Oct. 9, 2017, 2:42 a.m. UTC | #2
On 2017/10/1 23:47, Mark Thompson wrote:
> On 29/09/17 02:58, Jun Zhao wrote:
>> From 94604d623de1fec6f363dcda4d61712865257a0a Mon Sep 17 00:00:00 2001
>> From: Jun Zhao <jun.zhao@intel.com>
>> Date: Thu, 21 Sep 2017 02:44:42 -0400
>> Subject: [PATCH V2 2/2] 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 | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
>> index cf58aae4c6..f0dccf481b 100644
>> --- a/libavcodec/vaapi_decode.c
>> +++ b/libavcodec/vaapi_decode.c
>> @@ -328,7 +328,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
>>          if (j < profile_count) {
>>              if (exact_match)
>>                  break;
>> -            alt_profile = vaapi_profile_map[i].codec_profile;
>> +            alt_profile = vaapi_profile_map[i].va_profile;
>>          }
>>      }
>>      av_freep(&profile_list);
>> @@ -348,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 = alt_profile;
>>          } else {
>>              av_log(avctx, AV_LOG_VERBOSE, "Codec %s profile %d not "
>>                     "supported for hardware decode.\n",
>> -- 
>> 2.11.0
>>
> Yeah, that looks right to me now.
>
> The message comes out a bit strange, though, because the two profile values are in different namespaces?  One is an FF_PROFILE_*, the other is a VAProfile* - I think it's better to use the FF_PROFILE_* values in messages, because they match what is actually in the stream (profile_idc, etc.).  Maybe the first of the paired messages should also be WARNING too, so that it makes more sense with default level (info) output.
>
> Thanks,
Will add a WARNING as the comments, Tks
>
> - Mark
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
diff mbox

Patch

diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index cf58aae4c6..f0dccf481b 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -328,7 +328,7 @@  static int vaapi_decode_make_config(AVCodecContext *avctx)
         if (j < profile_count) {
             if (exact_match)
                 break;
-            alt_profile = vaapi_profile_map[i].codec_profile;
+            alt_profile = vaapi_profile_map[i].va_profile;
         }
     }
     av_freep(&profile_list);
@@ -348,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 = alt_profile;
         } else {
             av_log(avctx, AV_LOG_VERBOSE, "Codec %s profile %d not "
                    "supported for hardware decode.\n",