[FFmpeg-devel] [PATCH] HWAccel infrastructure (take 7.1)

Gwenole Beauchesne gbeauchesne
Mon Feb 23 23:42:41 CET 2009

Le 23 f?vr. 09 ? 23:08, Michael Niedermayer a ?crit :

>> Then, please be a bit clearer and tell me how you query the user for
>> the best (and that the player actually supports) HW accelerator.
> i already did, its just:
> pix_fmt= avctx->get_format(avctx, avctx->codec->pix_fmts);

That cannot be for all cases.

>> Please also point me to the patch that replaces the VDPAU PIX_FMTs, I
> what should that patch replace them with?

I don't know, you said "you can't register new pixel formats" and I  
interpreted that as "you can't add new pixel formats", i.e. no HW  
formats in pixfmt.h. Hence the confusion.

>> have just svn update'd the tree and I probably missed it or someone
>> forgot to commit that bit.
>> How is all this supposed to work now, specifically?
> This is very simple and really isnt "now" ...
> each AVCodec has a constant list of pix_fmts, these get passed to  
> get_format()
> the user app through its get_format() chooses one of them and  
> returns it
> the codec looks up the matching AVHWAccel.

Your precondition is not met: the list of pix_fmts is not constant for  
some AVCodecs. see e.g. mpeg12.c, the pix_fmt depends on  
chroma_format. So, it won't be enough to simply fill in pix_fmts for  
all mpeg*_decoder with e.g. {PIX_FMT_VAAPI_MPEG2, PIX_FMT_VDPAU_MPEG2,  
PIX_FMT_YUV420P}. Besides, for someone that doesn't like duplicate  
code, you seem to accept duplicate data very easily. ;-)

Or did you mean an extra hwaccel_pix_fmts[] into AVCodec?

> its exactly what your patch does minus 1 page of useless code. I  
> dont know
> how i missed that this page was useless sooner.

Really, I can't imagine how you could I have missed that... That's  
very surprising and there is strictly no rational path to reach this  

More information about the ffmpeg-devel mailing list