[FFmpeg-devel] [PATCH]Allow MPEG4 VDPAU decoding

Reimar Döffinger Reimar.Doeffinger
Mon Nov 9 23:16:18 CET 2009


On Mon, Nov 09, 2009 at 09:43:52PM +0100, Michael Niedermayer wrote:
> On Fri, Nov 06, 2009 at 11:00:37PM +0100, Carl Eugen Hoyos wrote:
> > On Friday 06 November 2009 14:40:04 Michael Niedermayer wrote:
> > 
> > > > +        if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities
> > > > & CODEC_CAP_HWACCEL_VDPAU))  
> > > > +            avctx->codec->pix_fmts = (enum 
> > > > PixelFormat[]){PIX_FMT_VDPAU_MPEG4, PIX_FMT_NONE}; break;
> > > >      case CODEC_ID_MSMPEG4V1:
> > > >          s->h263_msmpeg4 = 1;
> > >
> > > you cant do that, avctx->codec is shared amongth all instances of mpeg4
> > > decoders
> > 
> > Hopefully improved.
> > 
> > New patch attached, Carl Eugen
> 
> [...]
> > @@ -835,3 +844,19 @@
> >      .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"),
> >      .pix_fmts= ff_pixfmt_list_420,
> >  };
> > +
> > +#if CONFIG_MPEG4_VDPAU_DECODER
> > +AVCodec mpeg4_vdpau_decoder = {
> > +    "mpeg4_vdpau",
> > +    CODEC_TYPE_VIDEO,
> > +    CODEC_ID_MPEG4,
> > +    sizeof(MpegEncContext),
> > +    ff_h263_decode_init,
> > +    NULL,
> > +    ff_h263_decode_end,
> > +    ff_h263_decode_frame,
> > +    CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
> > +    .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 (VDPAU)"),
> 
> > +    .pix_fmts= (enum PixelFormat[]){PIX_FMT_NONE}
>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> this looks wrong, no pixel formats

And please use (const enum PixelFormat[]), I had a lot of effort fixing
them all :-)



More information about the ffmpeg-devel mailing list