[FFmpeg-devel] [PATCH v8 12/15] avcodec/vaapi_encode: extract a free funtion to base layer

Wu, Tong1 tong1.wu at intel.com
Mon May 20 18:10:21 EEST 2024


>Subject: Re: [FFmpeg-devel] [PATCH v8 12/15] avcodec/vaapi_encode: extract a
>free funtion to base layer
>
>On 18/04/2024 09:59, tong1.wu-at-intel.com at ffmpeg.org wrote:
>> From: Tong Wu <tong1.wu at intel.com>
>>
>> Signed-off-by: Tong Wu <tong1.wu at intel.com>
>> ---
>>  libavcodec/hw_base_encode.c | 11 +++++++++++
>>  libavcodec/hw_base_encode.h |  2 ++
>>  libavcodec/vaapi_encode.c   |  6 +-----
>>  3 files changed, 14 insertions(+), 5 deletions(-)
>
>"... free funtion to ..."
>
>While I do approve of fun, maybe this should be a function.
>

Hi Mark,

I've sent patch v9 which addressed multiple concerns of yours.
1. AVClass definition is put in the first patch.
2. Used "base_foo = &foo->base_field"
3. Used vaapi_pic and pic instead of pic and base_pic in vaapi_encode_*.c to simplify code lines.
4. Squashed init and close into one patch.

However, I did not change the way for .alloc and .free since I feel like the malloc(sizeof(VAAPIEncodePicture)) and ctx->codec are both part of vaapi context and should not be moved to base. 
As for the .free function I have this patch to extract a base layer free function which avoid the mix of two layer parameters. 

Feel free to comment on V9. Thanks.

-Tong





More information about the ffmpeg-devel mailing list