[FFmpeg-devel] [PATCH] HWAccel infrastructure

Gwenole Beauchesne gbeauchesne
Tue Feb 17 17:34:22 CET 2009


Hi,

This patch implements a hardware acceleration infrastructure for FFmpeg. 
It works for both VA API and VDPAU. As an extra benefit, this also fixes a 
VDPAU HW decoding bug with some MPEG-2 bitstreams I have here.

The user is expected to override AVCodecContext::get_format() to select 
the proper hardware accelerator. The pix_fmts[] arg is a list constructed 
from registered AVHWAccelCodec (allcodecs.c: REGISTER_HWACCEL_CODEC()).

As a side note, and in order to illustrate this, an mplayer -va arg 
controls what accelerator to use actually. Then get_format() checks that 
user (human) requested accelerator and only selects the matching IMGFMT.

AVHWAccelCodec::pix_fmt is no longer an array so that to implement HW 
acceleration case 3 (as "specified" by Reimar earlier). That is, 
avctx->hwaccel_codec->pix_fmt will stick to the HW accelerated pixel 
format whereas avctx->pix_fmt could be YV12 if the user wants to readback 
pixels in that format. Otherwise, both are equal by default.

WDYT?

Regards,
Gwenole.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg.hwaccel.patch
Type: text/x-diff
Size: 20835 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090217/881b0b54/attachment.patch>



More information about the ffmpeg-devel mailing list