[Libav-user] decoding to external buffers, AV_CODEC_CAP_DR1
KNU
knu at free.fr
Thu Nov 4 12:59:40 EET 2021
Hi all,
I'm working on a decoder specifically geared towards QTRLE and PCM (in
MOV container).
In order to avoid time consumming copies, I'd like to provide my own
output buffers to the codecs.
I can see in the sources that both codecs support external buffers :
FFmpeg/libavcodec/qtrle.c > line 594 > ".capabilities=AV_CODEC_CAP_DR1"
FFmpeg/libavcodec/pcm.c > line 559 > ".capabilities=AV_CODEC_CAP_DR1"
Unfortunately, the "flags" parameter of my get_buffer2 callback do not
have the AV_CODEC_CAP_DR1 flag set.
So, according to
https://ffmpeg.org/doxygen/3.3/structAVCodecContext.html#a7c93198032a3a728b13cb7d7e637d295
"If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call
avcodec_default_get_buffer2() instead of providing buffers allocated by
some other means." ;-(
I tried to set the "flags" property of my AVCodecContexts to
AV_CODEC_CAP_DR1 (codec_ctx->flags = AV_CODEC_CAP_DR1) but it does not help.
What am I doing wrong ? Is there something that I don't understand ?
Thanks for your help !
Fred
More information about the Libav-user
mailing list