[FFmpeg-devel] [RFC] av_decode_video and CODEC_CAP_DR1

Michael Niedermayer michaelni
Mon Jun 7 22:38:52 CEST 2010


On Mon, Jun 07, 2010 at 04:44:45PM +0200, Cyril Russo wrote:
>
> Hi all,
>
>   From the documentation, it's not possible to prevent av_decode_video2 
> from reusing allocated frame, unless these two conditions are set:
> 1) Codec support CAP_DR1 capability
> 2) codecContext's get_buffer et al are overridden
>
> As I understand it, some codec might not have the flag set and in that 
> case, one must copy/duplicate the frame if it's stored for later 
> consumption (like in another thread)
>
> I've checked all source tree to find out which video decoder doesn't have 
> this flag set, and only libschrodinger & libdirac doesn't.
> So what about inverting/dropping the flag, and thus simplifying the code ?
> Precisely, I think about adding some code in libschro&dirac like this:
> // Pseudo code
> int decode_frame(...)
> {
>     [... Previous decoding code...]
>     if (codecContext.get_buffer != default_get_buffer)
>     {
>         // If user overriden get_buffer, let's call it and copy the data in 
> the generated buffer
>        frame = codecContext.get_buffer(...)
>        copyFrame(frame, frameFromOriginalCode);
>     }
> }
> This would result in easier documentation, and less complexity in user 
> code.

it would lead to slower code and unneeded copying, this is not how lavc
is designed.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100607/fcba6727/attachment.pgp>



More information about the ffmpeg-devel mailing list