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

Nicolas George nicolas.george at normalesup.org
Wed Aug 1 13:50:23 CEST 2012


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.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120801/b62e970a/attachment.asc>


More information about the ffmpeg-devel mailing list