[FFmpeg-devel] [PATCH] HWAccel infrastructure (take 4)
Reimar Döffinger
Reimar.Doeffinger
Thu Feb 19 16:02:55 CET 2009
On Thu, Feb 19, 2009 at 03:53:22PM +0100, Michael Niedermayer wrote:
> On Thu, Feb 19, 2009 at 10:03:13AM +0100, Gwenole Beauchesne 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.
Well, if we could get rid of codecs implementing only
hardware-accelerated decoding that would not be any issue,
avcodec_default_get_format could remain as it is...
Also what is the problem with avctx->get_format ==
avcodec_default_get_format, as long as it doesn't crash let the user do
what they want, particularly since this check might actually not work
reliably e.g. on Windows or when -Bsymbolic is used.
I'd be in favour of a clear remark in the documentation instead of this.
More information about the ffmpeg-devel
mailing list