[FFmpeg-devel] [PATCH] lavfi: add thumb video filter.

Michael Niedermayer michaelni at gmx.at
Tue Dec 6 03:34:07 CET 2011


On Mon, Dec 05, 2011 at 05:41:10PM +0100, Clément Bœsch wrote:
[...]
> +AVFilter avfilter_vf_thumbnail = {
> +    .name          = "thumbnail",
> +    .description   = NULL_IF_CONFIG_SMALL("Thumbnail selection filter"),
> +    .priv_size     = sizeof(ThumbContext),
> +    .init          = init,
> +    .uninit        = uninit,
> +    .query_formats = query_formats,
> +    .inputs        = (const AVFilterPad[]) {
> +        {   .name             = "default",
> +            .type             = AVMEDIA_TYPE_VIDEO,
> +            .get_video_buffer = avfilter_null_get_video_buffer,
> +            .start_frame      = null_start_frame,
> +            .draw_slice       = draw_slice,
> +            .end_frame        = end_frame,
> +        },{ .name = NULL }
> +    },
> +    .outputs       = (const AVFilterPad[]) {
> +        {   .name             = "default",
> +            .type             = AVMEDIA_TYPE_VIDEO,
> +            .rej_perms        = AV_PERM_REUSE2,
> +        },{ .name = NULL }

you need to implement request and poll_frame() as the defaults are
wrong for this filter

request should call the sources request in a loop until a frame is
output from thumbnail

poll_frame() is a bit more tricky, if the sources filters poll returns
0, it should return 0 too
otherwise it has to call request frame from the source filter until
either its poll_frame returns 0 or the next input frame would cause a
frame to be output in which case it should return 1
see vf_yadif

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

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- 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/20111206/172e9a69/attachment.asc>


More information about the ffmpeg-devel mailing list