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

Michael Niedermayer michaelni
Mon Feb 23 21:10:15 CET 2009


On Mon, Feb 23, 2009 at 07:44:59PM +0100, Gwenole Beauchesne wrote:
> Le 23 f?vr. 09 ? 18:59, Michael Niedermayer a ?crit :
> 
> > what do you and others think about doing instead:
> >
> > +    if (CONFIG_HWACCEL && avctx->hwaccel) {
> > +        if (avctx->hwaccel->end_frame(avctx) < 0)
> > +            return -1;
> > +    }
> >
> > ?
> > its not speed relevant but it would safe a few bytes on embeded  
> > systems ...
> 
> What kind of embeddd systems? Because there are some "embedded"  
> systems that have decoders. ;-)

the kind that fits in your pocket (no car battery to supply the huge
grafix card thus no hw accel)


> 
> > [...]
> >> +enum PixelFormat ff_query_pixfmt(AVCodecContext *avctx, enum  
> >> CodecID codec_id)
> >> +{
> >> +    AVCodec *c;
> >> +    AVHWAccel *hwaccel;
> >> +    enum PixelFormat pix_fmts[PIX_FMT_NB + 1];
> >> +    int i, n_pix_fmts = 0;
> >> +
> >> +    /* 1. Finds hardware accelerated formats */
> >> +    for (hwaccel = first_hwaccel; hwaccel; hwaccel = hwaccel- 
> >> >next) {
> >> +        if (hwaccel->id == codec_id)
> >> +            pix_fmts[n_pix_fmts++] = hwaccel->pix_fmt;
> >> +    }
> >> +
> >> +    /* 2. Append default codec formats, or YUV420P */
> >> +    for (c = first_avcodec; c; c = c->next) {
> >> +        if (c->id == codec_id) {
> >> +            if (c->pix_fmts) {
> >> +                for (i = 0; c->pix_fmts[i] != PIX_FMT_NONE; i++)
> >> +                    pix_fmts[n_pix_fmts++] = c->pix_fmts[i];
> >> +            }
> >> +            else
> >> +                pix_fmts[n_pix_fmts++] = PIX_FMT_YUV420P;
> >> +            break;
> >> +        }
> >> +    }
> >> +
> >> +    pix_fmts[n_pix_fmts] = PIX_FMT_NONE;
> >> +    return avctx->get_format(avctx, pix_fmts);
> >> +}
> >
> > this is broken actually, and ive not realized this until now ....
> > AVCodec.pix_fmts is the full and authrative list of suported pix_fmts
> >
> > thus all calls to this function can be replaced by
> > return avctx->get_format(avctx, avctx->codec->pix_fmts);
> >
> > and ff_query_pixfmt() droped
> 
> What? How do you deal with registered HW accelerated codecs then?

Its a list of pixel formats not hw decoders, you cant register new pixel
formats

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090223/952b262d/attachment.pgp>



More information about the ffmpeg-devel mailing list