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

Jun Zhao mypopydev at gmail.com
Thu Sep 28 10:51:54 EEST 2017



On 2017/9/28 5:40, Mark Thompson wrote:
> On 21/09/17 08:22, Jun Zhao wrote:
>> From d7dc5c00692302e810412dea44ae3d2f122fb9a4 Mon Sep 17 00:00:00 2001
>> From: Jun Zhao <jun.zhao at intel.com>
>> Date: Thu, 21 Sep 2017 02:44:42 -0400
>> Subject: [PATCH 2/2] lavc/vaapi_decode: fix profile search when disable exact
>>  profile match.
>>
>> When disable exact profile match, alway use the profile found by
>> codecid.
>>
>> Signed-off-by: Jun Zhao <jun.zhao at intel.com>
>> ---
>>  libavcodec/vaapi_decode.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
>> index cf58aae4c6..98b00e3637 100644
>> --- a/libavcodec/vaapi_decode.c
>> +++ b/libavcodec/vaapi_decode.c
>> @@ -329,6 +329,10 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
>>              if (exact_match)
>>                  break;
>>              alt_profile = vaapi_profile_map[i].codec_profile;
>> +
>> +            if (avctx->hwaccel_flags &
>> +                AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH)
>> +                break;
>>          }
>>      }
>>      av_freep(&profile_list);
>> -- 
>> 2.11.0
>>
> An exact match might exist later in the list.  Consider an H.264 high input - this change can choose H.264 constrained baseline instead even if H.264 high is present.
>
> - Mark
I will double-check the logic in this case
BTW, the original issue is I found a HEVC clip use a wrong profile with
0 (avctx->profile == 0),
then FFmpeg VAAPI hwaccel will use VaProfileHEVCMain10 in Skylake lead to
vaCreateConfig fail, because Skylake don't support HEVC 10 bits decoding.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list