[FFmpeg-devel] [PATCH v2] avcodec/mfenc: set variable frame size flag.

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Jun 19 13:12:05 EEST 2022


Gyan Doshi:
> 
> 
> On 2022-06-19 03:36 pm, Gyan Doshi wrote:
>>
>>
>> On 2022-06-19 02:54 pm, Andreas Rheinhardt wrote:
>>> Andreas Rheinhardt:
>>>> Gyan Doshi:
>>>>> Default avctx->frame_size is 0 which led to init failure for
>>>>> audio MediaFoundation encoders since 827d6fe73d.
>>>>>
>>>>> The MF audio encoders accept variable frame size input buffers.
>>>>>
>>>>> Fixes #9802
>>>>> ---
>>>>>   libavcodec/mfenc.c | 2 +-
>>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c
>>>>> index 13ed7b3e11..8618e54ea3 100644
>>>>> --- a/libavcodec/mfenc.c
>>>>> +++ b/libavcodec/mfenc.c
>>>>> @@ -1239,7 +1239,7 @@ static int mf_init(AVCodecContext *avctx)
>>>>> FF_CODEC_RECEIVE_PACKET_CB(mf_receive_packet), \
>>>>> EXTRA \
>>>>>           .p.capabilities = AV_CODEC_CAP_DELAY |
>>>>> AV_CODEC_CAP_HYBRID |           \
>>>>> - AV_CODEC_CAP_DR1,                                    \
>>>>> +                          AV_CODEC_CAP_DR1 |
>>>>> AV_CODEC_CAP_VARIABLE_FRAME_SIZE, \
>>>>>           .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE
>>>>> |                       \
>>>>> FF_CODEC_CAP_INIT_CLEANUP,                           \
>>>>>       };
>>>> This will add this capability to both audio and video encoders,
>>>> although
>>>> it makes no sense for the latter.
>>>>
>>> This should actually been covered by the libavcodec-avcodec FATE test.
>>> How did you test your patch?
>>
>> Manually. I didn't expect HW / ext lib encoders to be covered by FATE,
>> and indeed I don't find anything for MF.
> 
> And Patchwork FATE does not show any fails for v2.
> I do see lavc/avcodec testprog, but I rarely do avcodec so didn't
> remember that.
> 

Patchwork doesn't have a Windows box, i.e. mediafoundation is not
covered by them.

- Andreas


More information about the ffmpeg-devel mailing list