[FFmpeg-devel] [PATCH 10/12] avcodec: add MediaCodec encoder

"zhilizhao(赵志立)" quinkblack at foxmail.com
Thu Oct 27 05:49:01 EEST 2022



> On Oct 27, 2022, at 05:17, Tomas Härdin <git at haerdin.se> wrote:
> 
> mån 2022-10-24 klockan 11:16 +0800 skrev Zhao Zhili:
>> 
>> +typedef struct MediaCodecEncContext {
>> +    AVClass *avclass;
>> +    FFAMediaCodec *codec;
>> +    int use_ndk_codec;
>> +    FFANativeWindow *window;
>> +
>> +    int fps;
>> +    int width;
>> +    int height;
>> +
>> +    uint8_t *extradata;
>> +    int extradata_size;
> 
> Why not extradata in AVCodecContext?

The extradata (BUFFER_FLAG_CODEC_CONFIG) is popped after codec
init, I’m not sure if it’s OK to touch AVCodecContext->extradata
after code init.

Secondly, it isn’t specified in Android doc, but better be safe
to handle the case of BUFFER_FLAG_CODEC_CONFIG show up multiple
times.

So BUFFER_FLAG_CODEC_CONFIG is handled as in-band data, without
touch AVCodecContext->extradata too late or multiple times. Did
I overthinking or misunderstood something?

> 
> Some tests would be nice

Did you mean fate test or manual test?

It’s an external codec wrapper, so maybe not in fate.

For NDK MediaCodec wrapper, good news is we can test it with ffmpeg
cmd now. For Java wrapper, it was tested by changing fftool/ffmepg
into a lib: ugly but simple.

https://github.com/quink-black/ffmpeg-ci/tree/master/android

Any suggestion is welcome.

> 
> /Tomas
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-devel mailing list