[FFmpeg-devel] [PATCH] Implement avfilter_copy_picref_props()

Stefano Sabatini stefano.sabatini-lala
Sun Jul 4 00:26:47 CEST 2010


On date Tuesday 2010-06-22 02:22:51 +0200, Michael Niedermayer encoded:
> On Mon, Jun 21, 2010 at 11:25:29PM +0200, Stefano Sabatini wrote:
> [...]
> > +static int config_props(AVFilterLink *inlink)
> > +{
> > +    PixdescTestContext *priv = inlink->dst->priv;
> > +
> > +    priv->pix_desc = &av_pix_fmt_descriptors[inlink->format];
> > +
> > +    if (!(priv->line = av_malloc(sizeof(*priv->line) * inlink->w)))
> > +        return AVERROR(ENOMEM);
> > +
> > +    return 0;
> > +}
> > +
> > +static void start_frame(AVFilterLink *inlink, AVFilterPicRef *picref)
> > +{
> > +    PixdescTestContext *priv = inlink->dst->priv;
> > +    AVFilterLink *outlink    = inlink->dst->outputs[0];
> > +    AVFilterPicRef *outpicref;
> > +    int i;
> > +
> > +    outlink->outpic = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
> > +                                                outlink->w, outlink->h);
> > +    outpicref = outlink->outpic;
> 
> > +    outpicref->pts             = picref->pts;
> > +    outpicref->pos             = picref->pos;
> > +    outpicref->pixel_aspect    = picref->pixel_aspect;
> > +    outpicref->interlaced      = picref->interlaced;
> > +    outpicref->top_field_first = picref->top_field_first;
> 
> this code should be factored into its own function it likely is duplicated
> over a few filters

Check attached.
-- 
FFmpeg = Friendly and Fancy Monstrous Problematic Evil Gnome



More information about the ffmpeg-devel mailing list