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

Gwenole Beauchesne gbeauchesne
Fri Feb 20 09:51:37 CET 2009


Hi,

On Thu, 19 Feb 2009, Michael Niedermayer wrote:

>> +AVHWAccel *ff_query_hwaccel_codec(AVCodecContext *avctx, enum CodecID codec_id)
>> +{
>> +    AVHWAccel *hwaccel;
>> +    AVHWAccel *hwaccels[PIX_FMT_NB] = { NULL, };
>> +    enum PixelFormat pix_fmts[PIX_FMT_NB + 1];
>> +    int pix_fmt, n_pix_fmts = 0;
>> +
>
>> +    /* The user shall override ::get_format() with something sensible enough */
>> +    if (!avctx->get_format || avctx->get_format == avcodec_default_get_format)
>> +        return NULL;
>
> 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.

New patch attached with the following changes:
* Filter out HW accelerated formats in avcodec_default_get_format().
* Add ff_is_hwaccel_pix_fmt(() to detect hardware accelerated pix_fmts.
* Cosmetics and documentation improvements.

Thanks,
Gwenole.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg.hwaccel.5.patch
Type: text/x-diff
Size: 29534 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090220/bddc8168/attachment.patch>



More information about the ffmpeg-devel mailing list