[FFmpeg-devel] [PATCH][VAAPI][2/6] Add common data structures and helpers

Gwenole Beauchesne gbeauchesne
Fri Feb 27 11:17:53 CET 2009

On Fri, 27 Feb 2009, Reimar D?ffinger wrote:

> I consider it an abomination to have half of the AVFrame data allocated
> in one place and the other half in another place and somewhen we'd then
> add some other allocation in yet another place.

So, you'd prefer make alloc_picture() include all the get_buffer() + 
hwaccel_data allocation? You'd also have to note that free_picture() is 
called at the end of the bitstream, so alloc_picture()/free_picture() are 
not symetrically called. That's why I wanted to merge 
s->avctx->release_buffer() into a single place.

Michael suggested to request the user to chain to a default get_buffer() 
provided by FFmpeg but I fear they wouldn't do it in practise.

> Also about the MPlayer part: IMO this is a giant hack. Since it is a
> hack anyway, it should not be spread all over MPlayer, just set
> mpi->priv to something that contains all the information and make
> vd_ffmpeg analyze the internals and fill in whatever needs to be filled
> it in AVFrame.

Setting mpi->priv to the HW accel data and let vd_ffmpeg parse and 
recompose it into the hwaccel_data on a per-accelerator basis is not a 
very clean approach either.

> Btw. why is "surface" in vaapi_render_state, is that pure lazyness/bad
> design as in XvMC and VDPAU or does FFmpeg actually use it?

Yes. I will check if I can allocate it in ff_alloc_vaapi_render_state() 
instead. So that user only has to set va_context to something sensible 

More information about the ffmpeg-devel mailing list