[FFmpeg-devel] [PATCH] lavfi/testsrc: extend logic in request_frame, support static image output

Stefano Sabatini stefasab at gmail.com
Wed Aug 1 22:51:52 CEST 2012


On date Wednesday 2012-08-01 13:50:23 +0200, Nicolas George encoded:
> Le quintidi 15 thermidor, an CCXX, Stefano Sabatini a écrit :
> > +    if (test->draw_once) {
> > +        if (!test->picref) {
> > +            test->picref =
> > +                ff_get_video_buffer(outlink, AV_PERM_WRITE|AV_PERM_PRESERVE|AV_PERM_REUSE,
> > +                                    test->w, test->h);
> > +            if (!test->picref)
> > +                return AVERROR(ENOMEM);
> > +            test->fill_picture_fn(outlink->src, test->picref);
> > +        }
> > +        outpicref = avfilter_ref_buffer(test->picref, ~AV_PERM_WRITE);
> > +    } else
> > +        outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE, test->w, test->h);
> > +
> > +    if (!outpicref)
> > +        return AVERROR(ENOMEM);
> > +    outpicref->pts = test->pts;
> > +    outpicref->pos = -1;
> > +    outpicref->video->key_frame = 1;
> > +    outpicref->video->interlaced = 0;
> > +    outpicref->video->pict_type = AV_PICTURE_TYPE_I;
> > +    outpicref->video->sample_aspect_ratio = test->sar;
> > +    if (!test->draw_once)
> > +        test->fill_picture_fn(outlink->src, outpicref);
> > +
> > +    test->pts++;
> 
> I was rather thinking of moving the second "test->fill_picture_fn()" just
> after "outpicref = ff_get_video_buffer()". The test of success needs to be
> moved too, though.
> 
> But any version is fine with me, choose the one you like better.

Applied.
-- 
FFmpeg = Faithless and Frightening Mournful Peaceful Educated God


More information about the ffmpeg-devel mailing list