summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2012-06-07 21:13:43 +0200
committerJens Georg <mail@jensge.org>2012-07-03 09:53:49 +0200
commitca85361f2b017450642acbffec4798ce9cba8b8b (patch)
tree8863ace2e48636b53e1c4272f7570f4e3465cc6a
parentda3cf04956ee9614bf841e2f40bb9553efc16ac1 (diff)
downloadrygel-ca85361f2b017450642acbffec4798ce9cba8b8b.tar.gz
examples: Add standalone player
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac1
-rw-r--r--examples/Makefile.am11
-rw-r--r--examples/standalone-renderer.c80
-rw-r--r--src/plugins/playbin/Makefile.am1
5 files changed, 93 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 94395e99..95492508 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = src data tests po doc
+SUBDIRS = src data tests po doc examples
pkgconfig_DATA= rygel-1.0.pc
pkgconfigdir = $(libdir)/pkgconfig
diff --git a/configure.ac b/configure.ac
index 06d14470..62f105bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -223,6 +223,7 @@ doc/Makefile
po/Makefile.in
rygel-1.0.pc
tests/Makefile
+examples/Makefile
])
AC_OUTPUT
diff --git a/examples/Makefile.am b/examples/Makefile.am
new file mode 100644
index 00000000..25309a13
--- /dev/null
+++ b/examples/Makefile.am
@@ -0,0 +1,11 @@
+include ../common.am
+
+AM_CFLAGS += \
+ -I$(top_builddir)/src/plugins/playbin \
+ -I$(top_builddir)/src/rygel
+
+noinst_PROGRAMS = standalone-renderer
+standalone_renderer_SOURCES = standalone-renderer.c
+standalone_renderer_LDADD = \
+ $(top_builddir)/src/plugins/playbin/librygel-renderer.la \
+ $(RYGEL_COMMON_LIBS)
diff --git a/examples/standalone-renderer.c b/examples/standalone-renderer.c
new file mode 100644
index 00000000..f9f52014
--- /dev/null
+++ b/examples/standalone-renderer.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2012 Openismus GmbH.
+ *
+ * Author: Jens Georg <jensg@openismus.com>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel 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 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel 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 this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+ * Demo application for librygel-renderer.
+ *
+ * Creates a simple stand-alone UPnP renderer that renders any visual content
+ * in ASCII-art using GStreamer's cacasink element.
+ *
+ * Usage:
+ * standalone-renderer [<network device>]
+ *
+ * If no network device is given on the commandline, the program falls back to
+ * eth0.
+ *
+ * To do anything useful, another UPnP server + UPnP controller is necessary
+ * to tell it which media file to show.
+ */
+
+#include "rygel-renderer.h"
+#include "rygel-core.h"
+
+int main(int argc, char *argv[])
+{
+ GstElement *sink, *asink;
+ RygelPlaybinPlayer *player;
+ RygelPlaybinRenderer *renderer;
+ GError *error = NULL;
+ GMainLoop *loop;
+
+ g_type_init ();
+ gst_init (&argc, &argv);
+
+ g_set_application_name ("Standalone-Renderer");
+
+ renderer = rygel_playbin_renderer_new ("LibRygel renderer demo");
+ player = rygel_playbin_player_get_default ();
+ sink = gst_element_factory_make ("cacasink", NULL);
+ g_object_set (G_OBJECT (sink),
+ "dither", 53,
+ "anti-aliasing", TRUE,
+ NULL);
+
+ asink = gst_element_factory_make ("pulsesink", NULL);
+
+ g_object_set (G_OBJECT (rygel_playbin_player_get_playbin (player)),
+ "video-sink", sink,
+ "audio-sink", asink,
+ NULL);
+
+ if (argc >= 2) {
+ rygel_playbin_renderer_add_interface (renderer, argv[1]);
+ } else {
+ rygel_playbin_renderer_add_interface (renderer, "eth0");
+ }
+
+ loop = g_main_loop_new (NULL, FALSE);
+ g_main_loop_run (loop);
+
+ return 0;
+}
diff --git a/src/plugins/playbin/Makefile.am b/src/plugins/playbin/Makefile.am
index 5e85ee5b..9f48800a 100644
--- a/src/plugins/playbin/Makefile.am
+++ b/src/plugins/playbin/Makefile.am
@@ -11,7 +11,6 @@ librygel_renderer_la_VALAFLAGS = \
-H rygel-renderer.h --library=rygel-renderer-1.0 \
$(RYGEL_COMMON_PLUGIN_VALAFLAGS)
librygel_renderer_la_LIBADD = $(RYGEL_COMMON_LIBS)
-#librygel_renderer_la_LDFLAGS = $(RYGEL_PLUGIN_LINKER_FLAGS)
plugin_LTLIBRARIES = librygel-playbin.la