[FFmpeg-devel] [PATCH] AVHWAccel infrastructure v2 (take 4)

Gwenole Beauchesne gbeauchesne
Mon Jan 4 16:39:02 CET 2010


On Mon, 4 Jan 2010, Michael Niedermayer wrote:

>> In the new model I wanted to use, hwaccel_context was to be solely
>> maintained by libavcodec. However, it still needed a way to get some
>> hwaccel context initialized by the user-application. e.g. a VADisplay (void
>> I felt interesting to pass this information through hwaccel attrs along
>> with other int attributes.
> We have existing means to pass information, that is through AVCodecContext
> and using AVOption where appropriate
> As well as using AVFrame instead of AVCodecContext where its per frame
> data

OK, I nuked the hwaccel attrs and replaced it with 
AVCodecContext.hwaccel_{id,flags}. hwaccel_flags is handled by AVOption. I 
left hwaccel_id as is to match existing practise (pix_fmt et al.).

I haven't tested with MPlayer yet but this new approach still works with 
my modified ffplay.

So, HW accelerator selection works as is:
- Set AVCodecContext.hwaccel_id to the desired accelerator
- Set AVCodecContext.hwaccel_flags to HWACCEL_CAP_GET_PIXELS if the user 
wants AVFrame.data[0-2] populated with YV12 or NV12 pixels

This means we can handle multiple accelerators automatically at once. 
Anyway, this lived in an ideal world without practical use since the 
user-application would still have to handle the HW accelerator 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg.hwaccel.v2.4.patch
Type: text/x-diff
Size: 13884 bytes
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100104/3d742562/attachment.patch>

More information about the ffmpeg-devel mailing list