diff mbox series

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

Message ID 20220619090242.11655-1-ffmpeg@gyani.pro
State New
Headers show
Series [FFmpeg-devel,v2] avcodec/mfenc: set variable frame size flag. | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

Gyan Doshi June 19, 2022, 9:02 a.m. UTC
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(-)

Comments

Andreas Rheinhardt June 19, 2022, 9:18 a.m. UTC | #1
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.

- Andreas
Andreas Rheinhardt June 19, 2022, 9:24 a.m. UTC | #2
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?

- Andreas
Gyan Doshi June 19, 2022, 10:06 a.m. UTC | #3
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.

Regards,
Gyan
Gyan Doshi June 19, 2022, 10:10 a.m. UTC | #4
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.

Regards,
Gyan
Andreas Rheinhardt June 19, 2022, 10:12 a.m. UTC | #5
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
diff mbox series

Patch

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,                           \
     };