diff mbox

[FFmpeg-devel,V2,1/2] ffmpeg: re-enable hwaccel_lax_profile_check use hwaccel_flags.

Message ID dbc10fae-b6d5-7b06-e386-83a638ae8db6@gmail.com
State New
Headers show

Commit Message

Jun Zhao Sept. 29, 2017, 1:58 a.m. UTC
From e2a7cce88d2a47c7e598b59d24258fea8d809c22 Mon Sep 17 00:00:00 2001
From: Jun Zhao <jun.zhao@intel.com>
Date: Thu, 21 Sep 2017 02:41:29 -0400
Subject: [PATCH V2 1/2] ffmpeg: re-enable hwaccel_lax_profile_check use
 hwaccel_flags.

re-enable hwaccel_lax_profile_check option use hwaccel_flags.

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

Comments

Mark Thompson Oct. 1, 2017, 3:20 p.m. UTC | #1
On 29/09/17 02:58, Jun Zhao wrote:
> From e2a7cce88d2a47c7e598b59d24258fea8d809c22 Mon Sep 17 00:00:00 2001
> From: Jun Zhao <jun.zhao@intel.com>
> Date: Thu, 21 Sep 2017 02:41:29 -0400
> Subject: [PATCH V2 1/2] ffmpeg: re-enable hwaccel_lax_profile_check use
>  hwaccel_flags.
> 
> re-enable hwaccel_lax_profile_check option use hwaccel_flags.
> 
> Signed-off-by: Jun Zhao <jun.zhao@intel.com>
> ---
>  ffmpeg.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 1d248bc269..4f2b9d69d9 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -2859,6 +2859,9 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat
>  
>          ist->active_hwaccel_id = hwaccel->id;
>          ist->hwaccel_pix_fmt   = *p;
> +
> +        if (hwaccel_lax_profile_check)
> +            s->hwaccel_flags |= AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH;
>          break;
>      }
>  
> -- 
> 2.11.0
> 

I'm inclined to say we should just remove the ad-hoc global lax_profile_check option (which was previously implemented only in ffmpeg.c code for VAAPI) and add a per-stream -hwaccel_flags option to set AVCodecContext.hwaccel_flags directly instead.  That can contain "ignore_level" and "allow_profile_mismatch" together, and maybe future flags if appropriate.

What do you think?

- Mark
Jun Zhao Oct. 9, 2017, 2:40 a.m. UTC | #2
On 2017/10/1 23:20, Mark Thompson wrote:
> On 29/09/17 02:58, Jun Zhao wrote:
>> From e2a7cce88d2a47c7e598b59d24258fea8d809c22 Mon Sep 17 00:00:00 2001
>> From: Jun Zhao <jun.zhao@intel.com>
>> Date: Thu, 21 Sep 2017 02:41:29 -0400
>> Subject: [PATCH V2 1/2] ffmpeg: re-enable hwaccel_lax_profile_check use
>>  hwaccel_flags.
>>
>> re-enable hwaccel_lax_profile_check option use hwaccel_flags.
>>
>> Signed-off-by: Jun Zhao <jun.zhao@intel.com>
>> ---
>>  ffmpeg.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/ffmpeg.c b/ffmpeg.c
>> index 1d248bc269..4f2b9d69d9 100644
>> --- a/ffmpeg.c
>> +++ b/ffmpeg.c
>> @@ -2859,6 +2859,9 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat
>>  
>>          ist->active_hwaccel_id = hwaccel->id;
>>          ist->hwaccel_pix_fmt   = *p;
>> +
>> +        if (hwaccel_lax_profile_check)
>> +            s->hwaccel_flags |= AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH;
>>          break;
>>      }
>>  
>> -- 
>> 2.11.0
>>
> I'm inclined to say we should just remove the ad-hoc global lax_profile_check option (which was previously implemented only in ffmpeg.c code for VAAPI) and add a per-stream -hwaccel_flags option to set AVCodecContext.hwaccel_flags directly instead.  That can contain "ignore_level" and "allow_profile_mismatch" together, and maybe future flags if appropriate.
>
> What do you think?
>
> - Mark
I agree, will re-submit with the new option/flags.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
diff mbox

Patch

diff --git a/ffmpeg.c b/ffmpeg.c
index 1d248bc269..4f2b9d69d9 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2859,6 +2859,9 @@  static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat
 
         ist->active_hwaccel_id = hwaccel->id;
         ist->hwaccel_pix_fmt   = *p;
+
+        if (hwaccel_lax_profile_check)
+            s->hwaccel_flags |= AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH;
         break;
     }