[FFmpeg-devel] hwaccel infrastructure in libavcodec

Gregor Riepl onitake
Wed Mar 16 19:44:33 CET 2011


>> But is hwaccel really designed to do decoding, instead of playback? The
>> device specific (virtual) pixfmts exist exactly for this reason, I
>> believe.
> 
> hwaccel is designed to handle everything that does not touch a
> display/screen/whatever you call it. In particular, this does decode
> only, since libavcodec is... a codec library. No playback stuff is in.
> 
> The goals (implemented in v2):
> - do as much decoding as possible in libavcodec
> - allow cases where fast readback (as YUV pixels) is possible
> - initialize display-independent parts of the decoder in libavcodec
> - initialize display-dependent parts of the decoder in the player
> 
> The latter is generally less than 5 lines. e.g. vaGetDisplay() for
> VA-API, VdpDeviceCreateX11() for VDPAU, etc.

Pixel readback is reasonable, since libavcodec is primarily a decoding
library, admittedly.

Maybe I'm too fixed on VDA here, but there might be other cases where a
decoding library doesn't offer pixel readback. This should be accounted for.
Also, I'm bringing this initialization process up, because certain
libraries (XvBA is one such candidate too, AFAIK) need frame reordering,
and I think this is something that should be done in the decoder, not
the media player.
Is there some example code on how to accomplish this? I've written a
small library that can do frame queueing and reordering, but I have no
idea on how to pass those frames back to the caller...
Or maybe everyone is doing that in their player after all?




More information about the ffmpeg-devel mailing list