rygel-renderer-gst-2.0.pc
tests/Makefile
examples/Makefile
+examples/renderer-plugins/Makefile
+examples/renderer-plugins/vala/Makefile
examples/server-plugins/Makefile
examples/server-plugins/vala/Makefile
])
# if they are not enabled, to avoid
# installing them.
if BUILD_EXAMPLE_PLUGINS
-EXAMPLE_PLUGINS = server-plugins
+EXAMPLE_PLUGINS = renderer-plugins server-plugins
endif
SUBDIRS = $(EXAMPLE_PLUGINS)
--- /dev/null
+SUBDIRS = vala
+
--- /dev/null
+include $(top_srcdir)/common.am
+
+plugin_LTLIBRARIES = librygel-example-renderer-plugin.la
+
+AM_CFLAGS += -DG_LOG_DOMAIN='"Example"'
+
+librygel_example_renderer_plugin_la_SOURCES = \
+ example-renderer-plugin.vala \
+ example-player.vala
+
+librygel_example_renderer_plugin_la_VALAFLAGS = \
+ --pkg gstreamer-0.10 \
+ $(RYGEL_COMMON_RENDERER_PLUGIN_VALAFLAGS)
+
+librygel_example_renderer_plugin_la_LIBADD = \
+ $(LIBGSTREAMER_LIBS) \
+ $(RYGEL_COMMON_RENDERER_LIBS)
+
+librygel_example_renderer_plugin_la_LDFLAGS = \
+ $(RYGEL_PLUGIN_LINKER_FLAGS)
--- /dev/null
+/*
+ * Copyright (C) 2012 Intel Corporation
+ *
+ * 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.
+ */
+
+using GUPnP;
+
+/**
+ * Implementation of RygelMediaPlayer.
+ *
+ * This is an incredibly simple example that does no real rendering,
+ * and does not attempt to support audio or video formats. It just prints out
+ * the URI that is received from the UPnP control point.
+ *
+ * RygelPlaybinPlayer, from librygel-renderer-gst, is a more complete example.
+ */
+public class Rygel.Example.Player : GLib.Object, Rygel.MediaPlayer {
+ private const string[] PROTOCOLS = { "http-get" };
+ private const string[] MIME_TYPES = {"image/jpeg",
+ "image/png" };
+ private static Player player;
+
+ private Player () {
+ }
+
+ public static Player get_default () {
+ if (player == null) {
+ player = new Player ();
+ }
+
+ return player;
+ }
+
+ private string _playback_state = "NO_MEDIA_PRESENT";
+ public string playback_state {
+ owned get {
+ return this._playback_state;
+ }
+
+ set {
+ this._playback_state = value;
+ }
+ }
+
+ private string _uri = "";
+ public string? uri {
+ owned get {
+ return _uri;
+ }
+
+ set {
+ this._uri = value;
+ debug ("URI set to %s.", value);
+ }
+ }
+
+ private string _mime_type = "";
+ public string? mime_type {
+ owned get {
+ return this._mime_type;
+ }
+
+ set {
+ this._mime_type = value;
+ }
+ }
+
+ private string _metadata = "";
+ public string? metadata {
+ owned get {
+ return this._metadata;
+ }
+
+ set {
+ this._metadata = value;
+ }
+ }
+
+ private string _content_features = "";
+ public string? content_features {
+ owned get {
+ return this._content_features;
+ }
+
+ set {
+ this._content_features = value;
+ }
+ }
+
+ private double _volume = 0;
+ public double volume {
+ get {
+ return this._volume;
+ }
+
+ set {
+ this._volume = value;
+ debug ("volume set to %f.", value);
+ }
+ }
+
+ private int64 _duration = 0;
+ public int64 duration {
+ get {
+ return this._duration;
+ }
+ }
+
+ private int64 _position = 0;
+ public int64 position {
+ get {
+ return this._position;
+ }
+ }
+
+ public bool seek (int64 time) {
+ return false;
+ }
+
+ public string[] get_protocols () {
+ return PROTOCOLS;
+ }
+
+ public string[] get_mime_types () {
+ return MIME_TYPES;
+ }
+
--- /dev/null
+/*
+ * Copyright (C) 2012 Intel Corporation
+ *
+ * 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.
+ */
+
+using Rygel;
+using GUPnP;
+
+public void module_init (PluginLoader loader) {
+ if (loader.plugin_disabled (Rygel.Example.RendererPlugin.NAME)) {
+ message ("Plugin '%s' disabled by user, ignoring..",
+ Rygel.Example.RendererPlugin.NAME);
+
+ return;
+ }
+
+ var plugin = new Rygel.Example.RendererPlugin ();
+ loader.add_plugin (plugin);
+}
+
+
+/*
+ * Our derived Plugin class.
+ *
+ * To use this plugin, you must enable it in your rygel.conf file like so:
+ * [ExampleRendererPluginVala]
+ * enabled=false
+ */
+public class Rygel.Example.RendererPlugin : Rygel.MediaRendererPlugin {
+ /*
+ * The non-human-readable name for the service:
+ * Note that this should currently not contain spaces.
+ * See https://bugzilla.gnome.org/show_bug.cgi?id=679673
+ */
+ public const string NAME = "ExampleRendererPluginVala";
+
+ /* Optional human-readable name for the service: */
+ public const string TITLE = "Example Renderer Plugin Vala";
+
+ /* Optional human-readable description for the service: */
+ public const string DESCRIPTION = "An example Rygel renderer plugin implemented in vala.";
+
+ public RendererPlugin () {
+ base (NAME, TITLE, DESCRIPTION);
+ }
+
+ public override MediaPlayer? get_player () {
+ return Example.Player.get_default ();
+ }
+}
* Create an instance of the plugin.
*
* @param name The non-human-readable name for the plugin and its renderer, used in UPnP messages and in the Rygel configuration file.
- * @param title An optional human-readable name (friendlyName) of the UpnP renderer provided by the plugin. If the title is empty then the name will be used.
+ * @param title An optional human-readable name (friendlyName) of the UPnP renderer provided by the plugin. If the title is empty then the name will be used.
* @param description An optional human-readable description (modelDescription) of the UPnP renderer provided by the plugin.
*/
public MediaRendererPlugin (string name,