[FFmpeg-soc] [soc]: r286 - in libavfilter: Makefile filter_test.c

koorogi subversion at mplayerhq.hu
Fri Jun 29 19:08:49 CEST 2007


Author: koorogi
Date: Fri Jun 29 19:08:49 2007
New Revision: 286

Log:
Simple filter test program


Added:
   libavfilter/Makefile
   libavfilter/filter_test.c

Added: libavfilter/Makefile
==============================================================================
--- (empty file)
+++ libavfilter/Makefile	Fri Jun 29 19:08:49 2007
@@ -0,0 +1,17 @@
+CC = gcc
+CFLAGS = -g -I../libavcodec -I../libavutil
+LIBS = ../libavcodec/libavcodec.a ../libavutil/libavutil.a -lm -lSDL
+
+OBJECTS = avfilter.o          \
+          vsrc_dummy.o        \
+		  vo_sdl.o            \
+		  vf_crop.o           \
+		  vf_passthrough.o    \
+
+all: filter_test
+
+filter_test: $(OBJECTS) filter_test.c
+	$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
+
+$(OBJECTS): %.o: %.c
+	$(CC) $(CFLAGS) -c $<

Added: libavfilter/filter_test.c
==============================================================================
--- (empty file)
+++ libavfilter/filter_test.c	Fri Jun 29 19:08:49 2007
@@ -0,0 +1,56 @@
+/*
+ * Video filter test program
+ * copyright (c) 2007 Bobby Bingham
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <unistd.h>
+
+#include "avfilter.h"
+
+void sdl_display(AVFilterContext *ctx);
+
+int main()
+{
+    int i;
+    AVFilterContext *src, *crop, *out;
+
+    avfilter_init();
+
+    src  = avfilter_create_by_name("dummy");
+    crop = avfilter_create_by_name("crop");
+    out  = avfilter_create_by_name("sdl");
+
+    avfilter_link(src,  0, crop, 0);
+    avfilter_link(crop, 0, out,  0);
+    avfilter_init_filter(src);
+    avfilter_init_filter(crop);
+    avfilter_init_filter(out);
+
+    for(i = 0; i < 10; i ++) {
+        sdl_display(out);
+        sleep(1);
+    }
+
+    avfilter_destroy(src);
+    avfilter_destroy(crop);
+    avfilter_destroy(out);
+
+    return 0;
+}
+



More information about the FFmpeg-soc mailing list