From 006aa1a4c2307209ad11c3ad0ad1d888c8df98fe Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sat, 16 Jan 2010 11:05:36 +0000 Subject: [PATCH] Implement null video sink. Originally committed as revision 21242 to svn://svn.ffmpeg.org/ffmpeg/trunk --- doc/libavfilter.texi | 10 +++++++ libavfilter/Makefile | 2 ++ libavfilter/allfilters.c | 2 ++ libavfilter/avfilter.h | 2 +- libavfilter/{allfilters.c => vsink_nullsink.c} | 41 +++++++++++++------------- 5 files changed, 35 insertions(+), 22 deletions(-) copy libavfilter/{allfilters.c => vsink_nullsink.c} (53%) diff --git a/doc/libavfilter.texi b/doc/libavfilter.texi index 28f24bce9f..5bb5235898 100644 --- a/doc/libavfilter.texi +++ b/doc/libavfilter.texi @@ -213,4 +213,14 @@ the configured source. The default values of ``width'' and ``height'' are respectively 352 and 288 (corresponding to the CIF size format). +@chapter Available video sinks + +Below is a description of the currently available video sinks. + +@section nullsink + +Null video sink, do absolutely nothing with the input video. It is +mainly useful as a template and to be employed in analysis / debugging +tools. + @bye diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 08d60800f4..fd95e35c80 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -22,4 +22,6 @@ OBJS-$(CONFIG_VFLIP_FILTER) += vf_vflip.o OBJS-$(CONFIG_NULLSRC_FILTER) += vsrc_nullsrc.o +OBJS-$(CONFIG_NULLSINK_FILTER) += vsink_nullsink.o + include $(SUBDIR)../subdir.mak diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 81eec21598..4be7642da9 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -43,4 +43,6 @@ void avfilter_register_all(void) REGISTER_FILTER (VFLIP, vflip, vf); REGISTER_FILTER (NULLSRC, nullsrc, vsrc); + + REGISTER_FILTER(NULLSINK, nullsink, vsink); } diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 5b85427ac1..832f421bee 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -25,7 +25,7 @@ #include "libavutil/avutil.h" #define LIBAVFILTER_VERSION_MAJOR 1 -#define LIBAVFILTER_VERSION_MINOR 16 +#define LIBAVFILTER_VERSION_MINOR 17 #define LIBAVFILTER_VERSION_MICRO 0 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ diff --git a/libavfilter/allfilters.c b/libavfilter/vsink_nullsink.c similarity index 53% copy from libavfilter/allfilters.c copy to libavfilter/vsink_nullsink.c index 81eec21598..d87f20400b 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/vsink_nullsink.c @@ -1,7 +1,4 @@ /* - * filter registration - * copyright (c) 2008 Vitor Sessak - * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or @@ -21,26 +18,28 @@ #include "avfilter.h" +static void start_frame(AVFilterLink *link, AVFilterPicRef *picref) +{ +} -#define REGISTER_FILTER(X,x,y) { \ - extern AVFilter avfilter_##y##_##x ; \ - if(CONFIG_##X##_FILTER ) avfilter_register(&avfilter_##y##_##x ); } - -void avfilter_register_all(void) +static void end_frame(AVFilterLink *link) { - static int initialized; +} - if (initialized) - return; - initialized = 1; +AVFilter avfilter_vsink_nullsink = { + .name = "nullsink", + .description = "Do absolutely nothing with the input video.", - REGISTER_FILTER (CROP, crop, vf); - REGISTER_FILTER (FORMAT, format, vf); - REGISTER_FILTER (NOFORMAT, noformat, vf); - REGISTER_FILTER (NULL, null, vf); - REGISTER_FILTER (SCALE, scale, vf); - REGISTER_FILTER (SLICIFY, slicify, vf); - REGISTER_FILTER (VFLIP, vflip, vf); + .priv_size = 0, - REGISTER_FILTER (NULLSRC, nullsrc, vsrc); -} + .inputs = (AVFilterPad[]) { + { + .name = "default", + .type = CODEC_TYPE_VIDEO, + .start_frame = start_frame, + .end_frame = end_frame, + }, + { .name = NULL}, + }, + .outputs = (AVFilterPad[]) {{ .name = NULL }}, +}; -- 2.11.0