[FFmpeg-devel] Google Summer of Code participation

Ronald S. Bultje rsbultje
Wed Apr 1 05:26:48 CEST 2009


On Tue, Mar 31, 2009 at 11:00 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Wed, Apr 01, 2009 at 02:31:10AM +0200, Thilo Borgmann wrote:
>> The second issue seems more complex. It is easy to pass the packet down to
>> the avcodec_decode_video2() function but this function has to pass it to
>> the decode_frame function which it does by the use of a function pointer
>> which resides in the AVCodec struct. Of course, this struct declares a
>> avcodec_decode_frame() - style pointer for this wich have to be changed
>> into a avcodec_decode_frame2() -style pointer parameterized by an AVPacket
>> instead of a "uint8_t and int" combination.
> and to be honest i prefer bumping the major version than having anyone
> spend a lot of time comming up with some complex woraround. That is if
> theres no easy way to avoid it and simply changing AVCodec doesnt work
> breaks more than a obscure application.

I don't think this is needed anyway. Isn't the common workaround for
this to add the new member to the end of the struct? I know there's
size constraints, but those are easily worked around. If our codec is
a video decoder and .decode_video() is set to NULL, then
.decode_video2() likely exists (if you're affraid of encoding-only
things like libx264, then well, I don't know, maybe create a new

The convenience function av_decode_video2() can then check for the
absence of .decode_video() or presence of the CODEC_CAP flag. If so,
call .decode_video2(frame, pkt);, otherwise (for any other codec, for
now) call .decode_video(frame, pkt->data, pkt->size);. This way, we
can slowly update all codecs to decode_video2() while Thilo focuses on

If nobody else does, I can run a script later on to move all other
video codecs to decode_video() (s/decode_video(frame, data, size)
{/decode_video2(frame, pkt) { data=pkt->data; size=pkt->size;/, and
then s/decode_video2/decode_video/ by another script), and we can
deprecate decode_video() and drop it when we bump version by some
change that actually justifies it. Main point being, let's have Thilo
focus on corePNG P-frames.


More information about the ffmpeg-devel mailing list