[rygel-gst-0-10-fullscreen-renderer] Compile a plug-in for rygel
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel-gst-0-10-fullscreen-renderer] Compile a plug-in for rygel
- Date: Fri, 15 Feb 2013 10:18:19 +0000 (UTC)
commit 7bfda1410b1a340f0d7a97ee6ed84bcb3e818154
Author: Jens Georg <mail jensge org>
Date: Thu Feb 14 12:49:51 2013 +0100
Compile a plug-in for rygel
configure.ac | 13 +++++
src/Makefile.am | 19 +++++++
src/gstreamer-legacy-renderer-plugin.c | 92 ++++++++++++++++++++++++++++++++
src/gstreamer-legacy-renderer-plugin.h | 59 ++++++++++++++++++++
4 files changed, 183 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4b8ff17..1adf9f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,18 @@ if test "x$enable_strict_cc" = "xyes"; then
CFLAGS="$CFLAGS -Wall -Werror"
fi
+dnl Compile Rygel plug-in
+AC_ARG_ENABLE([plugin],
+ AS_HELP_STRING([--enable-plugin],[Build a Rygel plugin]),,
+ [enable_plugin=no])
+AM_CONDITIONAL([BUILD_PLUGIN], [test "x$[]enable_plugin" = "xyes"])
+AS_IF([test "x$[]enable_plugin" = "xyes"],
+ [
+ RYGEL_PLUGIN_LINKER_FLAGS="`$PKG_CONFIG --variable=plugin_ldflags rygel-core-2.0`"
+ AC_SUBST(RYGEL_PLUGIN_LINKER_FLAGS)
+ RYGEL_PLUGIN_DIR="`$PKG_CONFIG --variable=plugindir rygel-core-2.0`"
+ AC_SUBST(RYGEL_PLUGIN_DIR)
+ ])
dnl Gettext
GETTEXT_PACKAGE=rygel-gst-0-10-fullscreen-renderer
@@ -84,4 +96,5 @@ echo "
Source code location: ${srcdir}
Compiler: ${CC}
CFLAGS: ${CFLAGS}
+ Plugin: ${enable_plugin}
"
diff --git a/src/Makefile.am b/src/Makefile.am
index 750a84a..c4c0c49 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,3 +12,22 @@ fullscreen_renderer_CFLAGS = \
fullscreen_renderer_LDADD = \
$(DEPS_LIBS)
+
+if BUILD_PLUGIN
+plugindir = $(RYGEL_PLUGIN_DIR)
+plugin_LTLIBRARIES = libgstreamer-legacy-renderer.la
+libgstreamer_legacy_renderer_la_SOURCES = \
+ rygel-playbin-player.c \
+ rygel-playbin-player.h \
+ gstreamer-legacy-renderer-plugin.c \
+ gstreamer-legacy-renderer-plugin.h
+
+libgstreamer_legacy_renderer_la_CFLAGS = \
+ $(DEPS_CFLAGS)
+
+libgstreamer_legacy_renderer_la_LDFLAGS = \
+ $(RYGEL_PLUGIN_LINKER_FLAGS)
+
+libgstreamer_legacy_renderer_la_LIBADD = \
+ $(DEPS_LIBS)
+endif
diff --git a/src/gstreamer-legacy-renderer-plugin.c b/src/gstreamer-legacy-renderer-plugin.c
new file mode 100644
index 0000000..230e82d
--- /dev/null
+++ b/src/gstreamer-legacy-renderer-plugin.c
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ */
+
+#include "gstreamer-legacy-renderer-plugin.h"
+#include "rygel-playbin-player.h"
+
+#define RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_NAME "GStreamerLegacyRendererPlugin"
+
+enum {
+ RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_DUMMY_PROPERTY
+};
+
+#define RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_TITLE "GStreamerLegacy Render Plugin"
+#define RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_DESCRIPTION "An GStreamer-legacy Rygel renderer plugin
implemented in C."
+
+G_DEFINE_TYPE (RygelGStreamerLegacyRendererPlugin, rygel_gstreamer_legacy_renderer_plugin,
RYGEL_TYPE_MEDIA_RENDERER_PLUGIN)
+
+static RygelPlaybinPlayer *player;
+
+void
+module_init (RygelPluginLoader* loader) {
+ RygelGStreamerLegacyRendererPlugin* plugin;
+
+ g_return_if_fail (loader != NULL);
+
+ if (rygel_plugin_loader_plugin_disabled (loader, RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_NAME)) {
+ g_message ("Plugin '%s' disabled by user. Ignoring.",
+ RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_NAME);
+ return;
+ }
+
+ plugin = rygel_gstreamer_legacy_renderer_plugin_new ();
+ rygel_plugin_loader_add_plugin (loader, RYGEL_PLUGIN (plugin));
+ g_object_unref (plugin);
+}
+
+
+static RygelGStreamerLegacyRendererPlugin*
+rygel_gstreamer_legacy_renderer_plugin_construct (GType object_type) {
+ RygelGStreamerLegacyRendererPlugin *self;
+
+ self = (RygelGStreamerLegacyRendererPlugin*) rygel_media_renderer_plugin_construct (object_type,
+ RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_NAME, NULL, RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_DESCRIPTION,
+ RYGEL_PLUGIN_CAPABILITIES_NONE);
+
+ return self;
+}
+
+
+RygelGStreamerLegacyRendererPlugin*
+rygel_gstreamer_legacy_renderer_plugin_new (void) {
+ return rygel_gstreamer_legacy_renderer_plugin_construct (RYGEL_GSTREAMER_LEGACY_TYPE_RENDERER_PLUGIN);
+}
+
+
+static RygelMediaPlayer *
+rygel_gstreamer_legacy_renderer_plugin_get_player (RygelMediaRendererPlugin* plugin)
+{
+ return RYGEL_MEDIA_PLAYER (rygel_playbin_player_get_default ());
+}
+
+static void
+rygel_gstreamer_legacy_renderer_plugin_class_init (RygelGStreamerLegacyRendererPluginClass *klass) {
+ RygelMediaRendererPluginClass *plugin_class;
+
+ plugin_class = RYGEL_MEDIA_RENDERER_PLUGIN_CLASS (klass);
+ plugin_class->get_player = rygel_gstreamer_legacy_renderer_plugin_get_player;
+}
+
+
+static void
+rygel_gstreamer_legacy_renderer_plugin_init (RygelGStreamerLegacyRendererPlugin *self) {
+}
+
+
diff --git a/src/gstreamer-legacy-renderer-plugin.h b/src/gstreamer-legacy-renderer-plugin.h
new file mode 100644
index 0000000..6a9135f
--- /dev/null
+++ b/src/gstreamer-legacy-renderer-plugin.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+#ifndef __RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_H__
+#define __RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include <rygel-renderer.h>
+
+G_BEGIN_DECLS
+
+#define RYGEL_GSTREAMER_LEGACY_TYPE_RENDERER_PLUGIN (rygel_gstreamer_legacy_renderer_plugin_get_type ())
+#define RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
RYGEL_GSTREAMER_LEGACY_TYPE_RENDERER_PLUGIN, RygelGStreamerLegacyRendererPlugin))
+#define RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),
RYGEL_GSTREAMER_LEGACY_TYPE_RENDERER_PLUGIN, RygelGStreamerLegacyRendererPluginClass))
+#define RYGEL_GSTREAMER_LEGACY_IS_RENDERER_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
RYGEL_GSTREAMER_LEGACY_TYPE_RENDERER_PLUGIN))
+#define RYGEL_GSTREAMER_LEGACY_IS_RENDERER_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
RYGEL_GSTREAMER_LEGACY_TYPE_RENDERER_PLUGIN))
+#define RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
RYGEL_GSTREAMER_LEGACY_TYPE_RENDERER_PLUGIN, RygelGStreamerLegacyRendererPluginClass))
+
+typedef struct _RygelGStreamerLegacyRendererPlugin RygelGStreamerLegacyRendererPlugin;
+typedef struct _RygelGStreamerLegacyRendererPluginClass RygelGStreamerLegacyRendererPluginClass;
+typedef struct _RygelGStreamerLegacyRendererPluginPrivate RygelGStreamerLegacyRendererPluginPrivate;
+
+struct _RygelGStreamerLegacyRendererPlugin {
+ RygelMediaRendererPlugin parent_instance;
+ RygelGStreamerLegacyRendererPluginPrivate * priv;
+};
+
+struct _RygelGStreamerLegacyRendererPluginClass {
+ RygelMediaRendererPluginClass parent_class;
+};
+
+GType rygel_gstreamer_legacy_renderer_plugin_get_type (void) G_GNUC_CONST;
+
+RygelGStreamerLegacyRendererPlugin* rygel_gstreamer_legacy_renderer_plugin_new (void);
+
+void module_init (RygelPluginLoader* loader);
+
+G_END_DECLS
+
+#endif /* __RYGEL_GSTREAMER_LEGACY_RENDERER_PLUGIN_H__ */
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]