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

Gwenole Beauchesne gbeauchesne
Fri Feb 20 15:07:00 CET 2009

Le 20 f?vr. 09 ? 11:45, Ivan Kalvachev a ?crit :

>>> avctx->get_format being NULL seems invalid, so no need to check  
>>> for it
>>> also i suspect it would be cleaner to make  
>>> avcodec_default_get_format()
>>> skip hw-accel formats.
>> Implemented with an ff_is_hwaccel_pix_fmt() function. That's  
>> intentionally
>> internal because users are expected to handle the HW accelerated  
>> pix_fmt
>> specifically anyway. IMO, this is only useful for lavc.
> I think this is wrong.
> This makes support for combined (software & hardware) decoders much  
> harder.
> Application may want to try out the hardware accelerated formats first
> then make second pass for fallback non-accelerated.

Then application overrides ::get_format(). We are talking about the  
default get_format() from lavc, it does not have to handle HW  
accelerated formats.

As for a fall-back, it already works, unfortunately. I said  
unfortunately because the fallback was implicitly working so I hadn't  
noticed the init_vo() problem with zero dimensions for h264.c first  
(see mplayer list).

> Without implementing similar function it would have to check the
> array multiple times for each know pix_fmt or check each pix_fmt for  
> the
> multiple known formats.

It fallbacks to non-HW accelerated pix_fmt, by default. It's up to the  
user to return something sensible enough if it does support a  
particular HW accel format. I don't really understand the problem,  
could you please be more specific?


More information about the ffmpeg-devel mailing list