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

Vitor Sessak vitor1001
Thu Feb 19 18:20:31 CET 2009

Gwenole Beauchesne wrote:
> On Thu, 19 Feb 2009, Reimar D?ffinger wrote:
>> On Thu, Feb 19, 2009 at 05:04:27PM +0100, Gwenole Beauchesne wrote:
>>> I don't understand this argument. Actually, ::get_format is a pointer to
>>> function and avcodec_default_get_format() is a function, so IIRC the 
>>> test
>>> should work. However, that would obviously have failed if 
>>> ::get_format was
>>> a pointer. i.e. sizeof(void *) != sizeof(void (*)(void));
>> As I remember it, taking the address of the function in libavcodec will
>> result a pointer to the actual code, whereas in an external program it
>> will point to the start of the stub which on first call activates the
>> dynamic loader.
> Then, there probably is a tool problem. I mean, if you build a shared 
> lib, the address of the function in lavc is also the stub. libavcodec is 
> probably not built correctly on that platform.
> The comparison is valid or could you please tell me the chapter/verse in 
> the normative reference saying otherwise? I will check tonight but I am 
> pretty sure this has to work.
> Anyway, I will probably re-add Ivan's idea to use an extra is_hwaccel 
> bit in PixFmtInfo[] to simplify the check and filter out HW accelerated 
> formats in avcodec_default_get_format(). I am sorry but I believe 
> Michael's suggestion has precedence over yours, unless he tells me 
> otherwise now. ;-)

Why not something like PixFmtInfo.color_type == FF_COLOR_HWACCEL? No 
matter how it is done, there should be a way to check if a pixel format 
is a HW accel one, and I agree it belongs to PixFmtInfo...


More information about the ffmpeg-devel mailing list