[aravis] gst: add a sample application.



commit 97ea89bec6870d5d4e83b39461c207f3113259d0
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Sat Apr 24 11:57:59 2010 +0200

    gst: add a sample application.

 gst/.gitignore             |    1 +
 gst/Makefile.am            |    8 ++++++--
 gst/gst-aravis-test        |    3 ---
 gst/gst-aravis-test-theora |    3 ---
 gst/gstaravistest.c        |   28 ++++++++++++++++++++++++++++
 5 files changed, 35 insertions(+), 8 deletions(-)
---
diff --git a/gst/.gitignore b/gst/.gitignore
new file mode 100644
index 0000000..513fd7e
--- /dev/null
+++ b/gst/.gitignore
@@ -0,0 +1 @@
+gst-aravis-test
diff --git a/gst/Makefile.am b/gst/Makefile.am
index 5931c9f..316ccfe 100644
--- a/gst/Makefile.am
+++ b/gst/Makefile.am
@@ -14,8 +14,7 @@ if ARAVIS_WITH_GSTREAMER
 
 gstplugin_LTLIBRARIES = libgstaravis.la
 
-libgstaravis_la_SOURCES = gstaravis.c
-libgstaravis_la_HEADERS = gstaravis.h
+libgstaravis_la_SOURCES = gstaravis.c gstaravis.h
 libgstaravis_la_CFLAGS = $(ARAVIS_CFLAGS)
 libgstaravis_la_LIBADD = $(ARAVIS_LIBS)
 libgstaravis_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
@@ -25,4 +24,9 @@ libgstaravis_ladir = $(includedir)/aravis
 
 noinst_HEADERS = gstaravis.h
 
+bin_PROGRAMS = gst-aravis-test
+
+gst_aravis_test_SOURCES = gstaravistest.c
+gst_aravis_test_LDADD = $(ARAVIS_LIBS) ../src/libaravis.la
+
 endif
diff --git a/gst/gstaravistest.c b/gst/gstaravistest.c
new file mode 100644
index 0000000..09b837b
--- /dev/null
+++ b/gst/gstaravistest.c
@@ -0,0 +1,28 @@
+#include <arv.h>
+#include <gst/gst.h>
+
+int
+main (int argc, char **argv)
+{
+	GstElement *pipeline, *source, *sink;
+	GMainLoop *loop;
+
+	gst_init (&argc, &argv);
+
+	pipeline = gst_pipeline_new ("pipeline");
+	source = gst_element_factory_make ("videotestsrc", "source");
+	sink = gst_element_factory_make ("autovideosink", "sink");
+
+	gst_bin_add_many (GST_BIN (pipeline), source, sink, NULL);
+	gst_element_link_many (source, sink, NULL);
+
+	gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
+
+	loop = g_main_loop_new (NULL, FALSE);
+	g_main_loop_run (loop);
+
+	gst_object_unref (pipeline);
+	g_main_loop_unref (loop);
+
+	return 0;
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]