[rygel] all: Add sidecar file support for plugins



commit a68c54abc946e60c70514299a071090ad408bff0
Author: Jens Georg <jensg openismus com>
Date:   Tue Apr 23 14:59:39 2013 +0200

    all: Add sidecar file support for plugins
    
    Install a .plugin file with each plugin that provides some meta-information
    about the plugin, allowing us to not load the module if the user has disabled
    it instead blindly loading each .so we come across and let the module check
    whether it's enabled or not
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693658

 configure.ac                                       |    6 ++
 examples/renderer-plugins/C/Makefile.am            |    2 +
 .../C/example-renderer-c.plugin.in                 |    7 ++
 examples/renderer-plugins/vala/Makefile.am         |    3 +
 .../vala/example-renderer-vala.plugin.in           |    7 ++
 examples/server-plugins/C/Makefile.am              |    3 +
 .../server-plugins/C/example-server-c.plugin.in    |    7 ++
 examples/server-plugins/vala/Makefile.am           |    3 +
 .../vala/example-server-vala.plugin.in             |    7 ++
 m4/rygel.m4                                        |    1 +
 po/POTFILES.in                                     |    1 +
 po/POTFILES.skip                                   |    1 +
 src/librygel-core/filelist.am                      |    3 +-
 src/librygel-core/rygel-plugin-information.vala    |   86 ++++++++++++++++++++
 src/librygel-core/rygel-plugin-loader.vala         |   20 +++--
 .../rygel-recursive-module-loader.vala             |   18 +++--
 src/librygel-server/rygel-engine-loader.vala       |    4 +
 src/media-engines/gstreamer/Makefile.am            |    2 +
 .../gstreamer/media-engine-gst.plugin.in           |    7 ++
 src/media-engines/simple/Makefile.am               |    3 +
 .../simple/media-engine-simple.plugin.in           |    7 ++
 src/plugins/external/Makefile.am                   |    3 +
 src/plugins/external/external.plugin.in            |    7 ++
 .../external/rygel-external-plugin-factory.vala    |    7 --
 src/plugins/gst-launch/Makefile.am                 |    3 +
 src/plugins/gst-launch/gst-launch.plugin.in        |    7 ++
 .../gst-launch/rygel-gst-launch-plugin.vala        |    7 --
 src/plugins/media-export/Makefile.am               |    2 +
 src/plugins/media-export/media-export.plugin.in    |    7 ++
 .../media-export/rygel-media-export-plugin.vala    |    7 --
 src/plugins/mediathek/Makefile.am                  |    3 +
 src/plugins/mediathek/mediathek.plugin.in          |    7 ++
 src/plugins/mediathek/rygel-mediathek-plugin.vala  |    7 --
 src/plugins/mpris/Makefile.am                      |    3 +
 src/plugins/mpris/mpris.plugin.in                  |    7 ++
 src/plugins/mpris/rygel-mpris-plugin-factory.vala  |    7 --
 src/plugins/playbin/Makefile.am                    |    3 +
 src/plugins/playbin/playbin.plugin.in              |    7 ++
 src/plugins/tracker/Makefile.am                    |    3 +
 src/plugins/tracker/tracker.plugin.in              |    7 ++
 40 files changed, 254 insertions(+), 48 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index eb9af22..06d3a23 100644
--- a/configure.ac
+++ b/configure.ac
@@ -394,7 +394,9 @@ src/rygel/Makefile
 src/ui/Makefile
 src/media-engines/Makefile
 src/media-engines/gstreamer/Makefile
+src/media-engines/gstreamer/media-engine-gst.plugin
 src/media-engines/simple/Makefile
+src/media-engines/simple/media-engine-simple.plugin
 src/plugins/Makefile
 data/Makefile
 data/xml/Makefile
@@ -423,10 +425,14 @@ tests/Makefile
 examples/Makefile
 examples/renderer-plugins/Makefile
 examples/renderer-plugins/vala/Makefile
+examples/renderer-plugins/vala/example-renderer-vala.plugin
 examples/renderer-plugins/C/Makefile
+examples/renderer-plugins/C/example-renderer-c.plugin
 examples/server-plugins/Makefile
 examples/server-plugins/vala/Makefile
+examples/server-plugins/vala/example-server-vala.plugin
 examples/server-plugins/C/Makefile
+examples/server-plugins/C/example-server-c.plugin
 ])
 AC_OUTPUT
 
diff --git a/examples/renderer-plugins/C/Makefile.am b/examples/renderer-plugins/C/Makefile.am
index f77c225..b952bc8 100644
--- a/examples/renderer-plugins/C/Makefile.am
+++ b/examples/renderer-plugins/C/Makefile.am
@@ -1,6 +1,7 @@
 include $(top_srcdir)/common.am
 
 plugin_LTLIBRARIES = librygel-example-renderer-plugin-c.la
+plugin_DATA = example-renderer-c.plugin
 
 librygel_example_renderer_plugin_c_la_SOURCES = \
        example-renderer-plugin.h \
@@ -21,3 +22,4 @@ librygel_example_renderer_plugin_c_la_LIBADD = \
 librygel_example_renderer_plugin_c_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
 
+EXTRA_DIST = example-renderer-c.plugin.in
diff --git a/examples/renderer-plugins/C/example-renderer-c.plugin.in 
b/examples/renderer-plugins/C/example-renderer-c.plugin.in
new file mode 100644
index 0000000..f629bf5
--- /dev/null
+++ b/examples/renderer-plugins/C/example-renderer-c.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = example-renderer-plugin-c
+Name = ExampleRendererPluginC
+License = LGPL
+Description = Example of implementing a renderer plug-in in C
+Copyright = Copyright © Intel Corporation
diff --git a/examples/renderer-plugins/vala/Makefile.am b/examples/renderer-plugins/vala/Makefile.am
index 2aa2b8d..a9e9090 100644
--- a/examples/renderer-plugins/vala/Makefile.am
+++ b/examples/renderer-plugins/vala/Makefile.am
@@ -1,6 +1,7 @@
 include $(top_srcdir)/common.am
 
 plugin_LTLIBRARIES = librygel-example-renderer-plugin-vala.la
+plugin_DATA = example-renderer-vala.plugin
 
 librygel_example_renderer_plugin_vala_la_SOURCES = \
        example-renderer-plugin-vala.vala \
@@ -20,3 +21,5 @@ librygel_example_renderer_plugin_vala_la_LIBADD = \
        
 librygel_example_renderer_plugin_vala_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
+
+EXTRA_DIST = example-renderer-vala.plugin.in
diff --git a/examples/renderer-plugins/vala/example-renderer-vala.plugin.in 
b/examples/renderer-plugins/vala/example-renderer-vala.plugin.in
new file mode 100644
index 0000000..cb9c888
--- /dev/null
+++ b/examples/renderer-plugins/vala/example-renderer-vala.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = example-renderer-plugin-vala
+Name = ExampleRendererPluginVala
+License = LGPL
+Description = Example of implementing a renderer plug-in in Vala
+Copyright = Copyright © Intel Corporation
diff --git a/examples/server-plugins/C/Makefile.am b/examples/server-plugins/C/Makefile.am
index f9230f7..8312f2b 100644
--- a/examples/server-plugins/C/Makefile.am
+++ b/examples/server-plugins/C/Makefile.am
@@ -1,6 +1,7 @@
 include $(top_srcdir)/common.am
 
 plugin_LTLIBRARIES = librygel-example-server-plugin-c.la
+plugin_DATA = example-server-c.plugin
 
 librygel_example_server_plugin_c_la_SOURCES = \
        example-server-plugin.h \
@@ -20,3 +21,5 @@ librygel_example_server_plugin_c_la_LIBADD = \
        
 librygel_example_server_plugin_c_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
+
+EXTRA_DIST = example-server-c.plugin.in
diff --git a/examples/server-plugins/C/example-server-c.plugin.in 
b/examples/server-plugins/C/example-server-c.plugin.in
new file mode 100644
index 0000000..75234c7
--- /dev/null
+++ b/examples/server-plugins/C/example-server-c.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = example-server-plugin-c
+Name = ExampleServerPluginC
+License = LGPL
+Description = Example of implementing a server plug-in in C
+Copyright = Copyright © Intel Corporation
diff --git a/examples/server-plugins/vala/Makefile.am b/examples/server-plugins/vala/Makefile.am
index 7c82b3c..424075c 100644
--- a/examples/server-plugins/vala/Makefile.am
+++ b/examples/server-plugins/vala/Makefile.am
@@ -1,6 +1,7 @@
 include $(top_srcdir)/common.am
 
 plugin_LTLIBRARIES = librygel-example-server-plugin-vala.la
+plugin_DATA = example-server-vala.plugin
 
 # Note that we must have these Vala prefixes on the
 # class names (and therefore on the file names)
@@ -24,3 +25,5 @@ librygel_example_server_plugin_vala_la_LIBADD = \
        
 librygel_example_server_plugin_vala_la_LDFLAGS = \
   $(RYGEL_PLUGIN_LINKER_FLAGS)
+
+EXTRA_DIST = example-server-vala.plugin.in
diff --git a/examples/server-plugins/vala/example-server-vala.plugin.in 
b/examples/server-plugins/vala/example-server-vala.plugin.in
new file mode 100644
index 0000000..2d82d83
--- /dev/null
+++ b/examples/server-plugins/vala/example-server-vala.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = example-server-plugin-vala
+Name = ExampleServerPluginVala
+License = LGPL
+Description = Example of implementing a server plug-in in Vala
+Copyright = Copyright © Intel Corporation
diff --git a/m4/rygel.m4 b/m4/rygel.m4
index b1a5a32..3152ba2 100644
--- a/m4/rygel.m4
+++ b/m4/rygel.m4
@@ -57,6 +57,7 @@ AC_DEFUN([_RYGEL_ADD_PLUGIN_INTERNAL],
     AC_CONFIG_FILES([src/plugins/$1/Makefile])
     AM_CONDITIONAL(m4_toupper(build_$2_plugin), test "x$[]enable_$2_plugin" = "xyes")
     RYGEL_ADD_STAMP([src/plugins/$1/librygel_$2_la_vala.stamp])
+    AC_CONFIG_FILES([src/plugins/$1/$1.plugin])
 ])
 
 # _RYGEL_ADD_PLUGIN_INTERNAL(NAME-OF-PLUGIN,
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e4ab836..74b4e62 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -70,6 +70,7 @@ src/librygel-core/rygel-connection-manager.vala
 src/librygel-core/rygel-icon-info.vala
 src/librygel-core/rygel-log-handler.vala
 src/librygel-core/rygel-meta-config.vala
+src/librygel-core/rygel-plugin-information.vala
 src/librygel-core/rygel-plugin-loader.vala
 src/librygel-core/rygel-plugin.vala
 src/librygel-core/rygel-recursive-module-loader.vala
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index bc0d9e1..c349530 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -26,6 +26,7 @@ src/librygel-core/rygel-media-device.c
 src/librygel-core/rygel-meta-config.c
 src/librygel-core/rygel-plugin.c
 src/librygel-core/rygel-plugin-loader.c
+src/librygel-core/rygel-plugin-information.c
 src/librygel-core/rygel-recursive-module-loader.c
 src/librygel-core/rygel-resource-info.c
 src/librygel-core/rygel-root-device.c
diff --git a/src/librygel-core/filelist.am b/src/librygel-core/filelist.am
index a37467e..bea3b1e 100644
--- a/src/librygel-core/filelist.am
+++ b/src/librygel-core/filelist.am
@@ -19,4 +19,5 @@ LIBRYGEL_CORE_VAPI_SOURCE_FILES = \
 
 LIBRYGEL_CORE_NONVAPI_SOURCE_FILES = \
        rygel-icon-info.vala \
-       rygel-xml-utils.vala
+       rygel-xml-utils.vala \
+       rygel-plugin-information.vala
diff --git a/src/librygel-core/rygel-plugin-information.vala b/src/librygel-core/rygel-plugin-information.vala
new file mode 100644
index 0000000..3338bf1
--- /dev/null
+++ b/src/librygel-core/rygel-plugin-information.vala
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2013 Jens Georg.
+ *
+ * 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.
+ */
+
+/**
+ * Parse plugin sidecar file and provide path to the module.
+ *
+ * Sidecar files are keyfiles, loosely compatible with the files used by
+ * libpeas.
+ *
+ * A minimal file for the plugin librygel-sompelugin.so looks like this:
+ *
+ * {{{
+ * [Plugin]
+ * Name = SomeNameForThePlugin
+ * Module = someplugin
+ * }}}
+ *
+ * Name must not contain any whitespaces.
+ */
+public class Rygel.PluginInformation : Object {
+    /// Full path to the loadable module file
+    public string module_path { get; construct; }
+
+    /// Name of this module
+    public string name { get; construct; }
+
+    private PluginInformation (string module_path, string name) {
+        Object (module_path: module_path, name : name);
+    }
+
+    /**
+     * Factory method to create a #RygelPluginInformation from #GFile.
+     *
+     * @param file a #GFile pointing to the sidecar file
+     * @return A new instance of #RygelPluginInformation
+     */
+    public static PluginInformation new_from_file (File file) throws Error {
+        var keyfile = new KeyFile ();
+        keyfile.load_from_file (file.get_path (), KeyFileFlags.NONE);
+        if (!keyfile.has_group ("Plugin")) {
+            throw new KeyFileError.GROUP_NOT_FOUND
+                                        (_("[Plugin] group not found"));
+        }
+
+        var name = keyfile.get_string ("Plugin", "Name");
+        var module = keyfile.get_string ("Plugin", "Module");
+
+        var module_dir = file.get_parent ();
+        var module_file = module_dir.get_child ("librygel-%s.%s".printf (
+                                                module,
+                                                Module.SUFFIX));
+
+        if (!module_file.query_exists ()) {
+            // try .libs for uninstalled
+            module_file = module_dir.get_child (".libs%clibrygel-%s.%s".printf (
+                                                Path.DIR_SEPARATOR,
+                                                module,
+                                                Module.SUFFIX));
+            if (!module_file.query_exists ()) {
+                throw new FileError.EXIST (_("Plugin module %s does not exist"),
+                                           module_file.get_path ());
+            }
+        }
+
+        return new PluginInformation (module_file.get_path (), name);
+    }
+}
diff --git a/src/librygel-core/rygel-plugin-loader.vala b/src/librygel-core/rygel-plugin-loader.vala
index 36544fa..7c00b2c 100644
--- a/src/librygel-core/rygel-plugin-loader.vala
+++ b/src/librygel-core/rygel-plugin-loader.vala
@@ -32,15 +32,10 @@ using Gee;
  * It probes for shared library files in a specific directory, tries to 
  * find a module_init() function with this signature:
  * ``void module_init (RygelPluginLoader* loader);``
- * 
+ *
  * It then calls that function, passing a pointer to itself. The loaded
  * module can then add plugins to Rygel by calling the
  * rygel_plugin_loader_add_plugin() function.
- *
- * NOTE: The module SHOULD make sure that the plugin has not been
- * disabled by the user, by using the 
- * rygel_plugin_loader_plugin_disabled() function before creating the plugin
- * instance, and before creating any resources related to that instance.
  */
 public class Rygel.PluginLoader : RecursiveModuleLoader {
     private delegate void ModuleInitFunc (PluginLoader loader);
@@ -139,6 +134,19 @@ public class Rygel.PluginLoader : RecursiveModuleLoader {
         return true;
     }
 
+    protected override bool load_module_from_info (PluginInformation info) {
+        if (this.plugin_disabled (info.name)) {
+            debug ("Module '%s' disabled by user. Ignoring…",
+                   info.name);
+
+            return true;
+        }
+
+        var module_file = File.new_for_path (info.module_path);
+
+        return this.load_module_from_file (module_file);
+    }
+
     private static string get_config_path () {
         var path = BuildConfig.PLUGIN_DIR;
         try {
diff --git a/src/librygel-core/rygel-recursive-module-loader.vala 
b/src/librygel-core/rygel-recursive-module-loader.vala
index 4e143d0..66a11fc 100644
--- a/src/librygel-core/rygel-recursive-module-loader.vala
+++ b/src/librygel-core/rygel-recursive-module-loader.vala
@@ -114,6 +114,8 @@ public abstract class Rygel.RecursiveModuleLoader : Object {
      */
     protected abstract bool load_module_from_file (File file);
 
+    protected abstract bool load_module_from_info (PluginInformation info);
+
     /**
      * Process children of a folder.
      *
@@ -172,15 +174,19 @@ public abstract class Rygel.RecursiveModuleLoader : Object {
                                    FileInfo      info,
                                    FolderHandler handler) {
             var file = folder.get_child (info.get_name ());
-            string content_type = info.get_content_type ();
-            string mime = ContentType.get_mime_type (content_type);
 
             if (this.is_folder_eligible (info)) {
                 handler (file);
-            } else if (mime == "application/x-sharedlib") {
-                // Seems like we found a module
-                if (!this.load_module_from_file (file)) {
-                    this.done = true;
+            } else if (info.get_name ().has_suffix (".plugin")) {
+                try {
+                    var plugin_info = PluginInformation.new_from_file (file);
+
+                    if (!this.load_module_from_info (plugin_info)) {
+                        this.done = true;
+                    }
+                } catch (Error error) {
+                    warning (_("Could not load plugin: %s"),
+                             error.message);
                 }
             }
 
diff --git a/src/librygel-server/rygel-engine-loader.vala b/src/librygel-server/rygel-engine-loader.vala
index 784882a..9331bb7 100644
--- a/src/librygel-server/rygel-engine-loader.vala
+++ b/src/librygel-server/rygel-engine-loader.vala
@@ -98,6 +98,10 @@ internal class Rygel.EngineLoader : RecursiveModuleLoader {
         return false;
     }
 
+    protected override bool load_module_from_info (PluginInformation info) {
+        return load_module_from_file (File.new_for_path (info.module_path));
+    }
+
     private static string get_config () {
         var path = BuildConfig.ENGINE_DIR;
         var config = MetaConfig.get_default ();
diff --git a/src/media-engines/gstreamer/Makefile.am b/src/media-engines/gstreamer/Makefile.am
index 1a351e6..d0f7268 100644
--- a/src/media-engines/gstreamer/Makefile.am
+++ b/src/media-engines/gstreamer/Makefile.am
@@ -1,6 +1,7 @@
 include $(top_srcdir)/common.am
 
 engine_LTLIBRARIES = librygel-media-engine-gst.la
+engine_DATA = media-engine-gst.plugin
 
 librygel_media_engine_gst_la_SOURCES = \
        rygel-aac-transcoder.vala \
@@ -36,3 +37,4 @@ librygel_media_engine_gst_la_LIBADD = \
 librygel_media_engine_gst_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
 
+EXTRA_DIST = media-engine-gst.plugin.in
diff --git a/src/media-engines/gstreamer/media-engine-gst.plugin.in 
b/src/media-engines/gstreamer/media-engine-gst.plugin.in
new file mode 100644
index 0000000..71001f3
--- /dev/null
+++ b/src/media-engines/gstreamer/media-engine-gst.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = media-engine-gst
+Name = media-engine-gst
+License = LGPL
+Description = Streaming and transcoding engine using GStreamer
+Copyright = Copyright © Rygel maintainers
diff --git a/src/media-engines/simple/Makefile.am b/src/media-engines/simple/Makefile.am
index 78779b7..3a6aa8e 100644
--- a/src/media-engines/simple/Makefile.am
+++ b/src/media-engines/simple/Makefile.am
@@ -1,6 +1,7 @@
 include $(top_srcdir)/common.am
 
 engine_LTLIBRARIES = librygel-media-engine-simple.la
+engine_DATA = media-engine-simple.plugin
 
 librygel_media_engine_simple_la_SOURCES = \
        rygel-simple-media-engine.vala \
@@ -19,3 +20,5 @@ librygel_media_engine_simple_la_LIBADD = \
        $(RYGEL_COMMON_LIBRYGEL_SERVER_LIBS)
 librygel_media_engine_simple_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
+
+EXTRA_DIST = media-engine-simple.plugin.in
diff --git a/src/media-engines/simple/media-engine-simple.plugin.in 
b/src/media-engines/simple/media-engine-simple.plugin.in
new file mode 100644
index 0000000..77b28a7
--- /dev/null
+++ b/src/media-engines/simple/media-engine-simple.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = media-engine-simple
+Name = media-engine-simple
+License = LGPL
+Description = Simple media streaming engine
+Copyright = Copyright © Rygel maintainers
diff --git a/src/plugins/external/Makefile.am b/src/plugins/external/Makefile.am
index 7cfe122..7097309 100644
--- a/src/plugins/external/Makefile.am
+++ b/src/plugins/external/Makefile.am
@@ -1,6 +1,7 @@
 include ../../../common.am
 
 plugin_LTLIBRARIES = librygel-external.la
+plugin_DATA = external.plugin
 
 librygel_external_la_SOURCES = \
        rygel-external-container.vala \
@@ -26,3 +27,5 @@ librygel_external_la_LIBADD = \
        $(RYGEL_COMMON_LIBRYGEL_SERVER_LIBS)
 librygel_external_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
+
+EXTRA_DIST=external.plugin.in
diff --git a/src/plugins/external/external.plugin.in b/src/plugins/external/external.plugin.in
new file mode 100644
index 0000000..bd6da7c
--- /dev/null
+++ b/src/plugins/external/external.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = external
+Name = External
+License = LGPL
+Description = Implementation of the MediaServer2 DBus specification
+Copyright = Copyright © Rygel maintainers
diff --git a/src/plugins/external/rygel-external-plugin-factory.vala 
b/src/plugins/external/rygel-external-plugin-factory.vala
index f31be7c..273a684 100644
--- a/src/plugins/external/rygel-external-plugin-factory.vala
+++ b/src/plugins/external/rygel-external-plugin-factory.vala
@@ -29,13 +29,6 @@ using FreeDesktop;
 private External.PluginFactory plugin_factory;
 
 public void module_init (PluginLoader loader) {
-    if (loader.plugin_disabled (External.Plugin.MODULE_NAME)) {
-        message ("Module '%s' disabled by user. Ignoring…",
-                 External.Plugin.MODULE_NAME);
-
-        return;
-    }
-
     try {
         plugin_factory = new External.PluginFactory (loader);
     } catch (Error error) {
diff --git a/src/plugins/gst-launch/Makefile.am b/src/plugins/gst-launch/Makefile.am
index e472455..bfccfd5 100644
--- a/src/plugins/gst-launch/Makefile.am
+++ b/src/plugins/gst-launch/Makefile.am
@@ -1,6 +1,7 @@
 include $(top_srcdir)/common.am
 
 plugin_LTLIBRARIES = librygel-gst-launch.la
+plugin_DATA = gst-launch.plugin
 
 librygel_gst_launch_la_SOURCES = \
        rygel-gst-launch-plugin.vala \
@@ -23,3 +24,5 @@ librygel_gst_launch_la_LIBADD = \
        $(RYGEL_COMMON_LIBRYGEL_SERVER_LIBS)
 librygel_gst_launch_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
+
+EXTRA_DIST = gst-launch.plugin.in
diff --git a/src/plugins/gst-launch/gst-launch.plugin.in b/src/plugins/gst-launch/gst-launch.plugin.in
new file mode 100644
index 0000000..d8bbec5
--- /dev/null
+++ b/src/plugins/gst-launch/gst-launch.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = gst-launch
+Name = GstLaunch
+License = LGPL
+Description = Share GStreamer gst-launch compatible pipelines
+Copyright = Copyright © Rygel maintainers
diff --git a/src/plugins/gst-launch/rygel-gst-launch-plugin.vala 
b/src/plugins/gst-launch/rygel-gst-launch-plugin.vala
index 70a72e5..636e890 100644
--- a/src/plugins/gst-launch/rygel-gst-launch-plugin.vala
+++ b/src/plugins/gst-launch/rygel-gst-launch-plugin.vala
@@ -24,13 +24,6 @@ using Rygel;
 using Gee;
 
 public void module_init (PluginLoader loader) {
-    if (loader.plugin_disabled (GstLaunch.Plugin.NAME)) {
-        message ("Plugin '%s' disabled by user, ignoring..",
-                 GstLaunch.Plugin.NAME);
-
-        return;
-    }
-
     var plugin = new GstLaunch.Plugin ();
 
     loader.add_plugin (plugin);
diff --git a/src/plugins/media-export/Makefile.am b/src/plugins/media-export/Makefile.am
index 7c7b11a..470fed6 100644
--- a/src/plugins/media-export/Makefile.am
+++ b/src/plugins/media-export/Makefile.am
@@ -1,6 +1,7 @@
 include $(top_srcdir)/common.am
 
 plugin_LTLIBRARIES = librygel-media-export.la
+plugin_DATA = media-export.plugin
 
 librygel_media_export_la_SOURCES = \
        rygel-media-export-plugin.vala \
@@ -58,3 +59,4 @@ librygel_media_export_la_LIBADD = \
 librygel_media_export_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
 
+EXTRA_DIST = media-export.plugin.in
diff --git a/src/plugins/media-export/media-export.plugin.in b/src/plugins/media-export/media-export.plugin.in
new file mode 100644
index 0000000..d07b74e
--- /dev/null
+++ b/src/plugins/media-export/media-export.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = media-export
+Name = MediaExport
+License = LGPL
+Description = SQLite-based locate file sharing
+Copyright = Copyright © Rygel maintainers
diff --git a/src/plugins/media-export/rygel-media-export-plugin.vala 
b/src/plugins/media-export/rygel-media-export-plugin.vala
index 503f07b..db05fdc 100644
--- a/src/plugins/media-export/rygel-media-export-plugin.vala
+++ b/src/plugins/media-export/rygel-media-export-plugin.vala
@@ -28,13 +28,6 @@ private const string TRACKER_PLUGIN = "Tracker";
  *
  */
 public void module_init (PluginLoader loader) {
-    if (loader.plugin_disabled (MediaExport.Plugin.NAME)) {
-        message ("Plugin '%s' disabled by user, ignoring..",
-                 MediaExport.Plugin.NAME);
-
-        return;
-    }
-
     try {
         // Instantiate the plugin object (it may fail if loading
         // database did not succeed):
diff --git a/src/plugins/mediathek/Makefile.am b/src/plugins/mediathek/Makefile.am
index 10f3730..9e7faa3 100644
--- a/src/plugins/mediathek/Makefile.am
+++ b/src/plugins/mediathek/Makefile.am
@@ -1,6 +1,7 @@
 include ../../../common.am
 
 plugin_LTLIBRARIES = librygel-mediathek.la
+plugin_DATA = mediathek.plugin
 
 librygel_mediathek_la_SOURCES = \
        rygel-mediathek-asx-playlist-parser.vala \
@@ -25,3 +26,5 @@ librygel_mediathek_la_LIBADD = \
        $(RYGEL_COMMON_LIBRYGEL_SERVER_LIBS)
 librygel_mediathek_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
+
+EXTRA_DIST = mediathek.plugin.in
diff --git a/src/plugins/mediathek/mediathek.plugin.in b/src/plugins/mediathek/mediathek.plugin.in
new file mode 100644
index 0000000..caf1f4f
--- /dev/null
+++ b/src/plugins/mediathek/mediathek.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = mediathek
+Name = ZDFMediathek
+License = LGPL
+Description = Share videos from ZDF online services
+Copyright = Copyright © Rygel maintainers
diff --git a/src/plugins/mediathek/rygel-mediathek-plugin.vala 
b/src/plugins/mediathek/rygel-mediathek-plugin.vala
index e9d4313..64c0a7c 100644
--- a/src/plugins/mediathek/rygel-mediathek-plugin.vala
+++ b/src/plugins/mediathek/rygel-mediathek-plugin.vala
@@ -29,13 +29,6 @@ using GUPnP;
 internal extern void xpath_free_object (Xml.XPath.Object *object);
 
 public void module_init (PluginLoader loader) {
-    if (loader.plugin_disabled (Mediathek.Plugin.NAME)) {
-        message ("Plugin '%s' disabled by user, ignoring..",
-                 Mediathek.Plugin.NAME);
-
-        return;
-    }
-
     var plugin = new Mediathek.Plugin ();
 
     loader.add_plugin (plugin);
diff --git a/src/plugins/mpris/Makefile.am b/src/plugins/mpris/Makefile.am
index d2bb3a7..e886ea7 100644
--- a/src/plugins/mpris/Makefile.am
+++ b/src/plugins/mpris/Makefile.am
@@ -1,6 +1,7 @@
 include ../../../common.am
 
 plugin_LTLIBRARIES = librygel-mpris.la
+plugin_DATA = mpris.plugin
 
 librygel_mpris_la_SOURCES = \
        rygel-mpris-player.vala \
@@ -20,3 +21,5 @@ librygel_mpris_la_LIBADD = \
        $(RYGEL_COMMON_LIBRYGEL_RENDERER_LIBS)
 librygel_mpris_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
+
+EXTRA_DIST = mpris.plugin.in
diff --git a/src/plugins/mpris/mpris.plugin.in b/src/plugins/mpris/mpris.plugin.in
new file mode 100644
index 0000000..e8febf0
--- /dev/null
+++ b/src/plugins/mpris/mpris.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = mpris
+Name = MPRIS
+License = LGPL
+Description = Bridge DLNA to MPRIS2
+Copyright = Copyright © Rygel maintainers
diff --git a/src/plugins/mpris/rygel-mpris-plugin-factory.vala 
b/src/plugins/mpris/rygel-mpris-plugin-factory.vala
index 42c008c..91c4714 100644
--- a/src/plugins/mpris/rygel-mpris-plugin-factory.vala
+++ b/src/plugins/mpris/rygel-mpris-plugin-factory.vala
@@ -29,13 +29,6 @@ using FreeDesktop;
 private MPRIS.PluginFactory plugin_factory;
 
 public void module_init (PluginLoader loader) {
-    if (loader.plugin_disabled (MPRIS.Plugin.MODULE_NAME)) {
-        message ("Module '%s' disabled by user. Ignoring…",
-                 MPRIS.Plugin.MODULE_NAME);
-
-        return;
-    }
-
     try {
         plugin_factory = new MPRIS.PluginFactory (loader);
     } catch (IOError error) {
diff --git a/src/plugins/playbin/Makefile.am b/src/plugins/playbin/Makefile.am
index e17365c..f0628be 100644
--- a/src/plugins/playbin/Makefile.am
+++ b/src/plugins/playbin/Makefile.am
@@ -1,6 +1,7 @@
 include ../../../common.am
 
 plugin_LTLIBRARIES = librygel-playbin.la
+plugin_DATA = playbin.plugin
 
 librygel_playbin_la_SOURCES = rygel-playbin-module.vala rygel-playbin-plugin.vala
 librygel_playbin_la_VALAFLAGS = \
@@ -17,3 +18,5 @@ librygel_playbin_la_LIBADD = \
        $(RYGEL_COMMON_LIBRYGEL_RENDERER_GST_LIBS)
 librygel_playbin_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
+
+EXTRA_DIST = playbin.plugin.in
diff --git a/src/plugins/playbin/playbin.plugin.in b/src/plugins/playbin/playbin.plugin.in
new file mode 100644
index 0000000..e5720e2
--- /dev/null
+++ b/src/plugins/playbin/playbin.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = playbin
+Name = Playbin
+License = LGPL
+Description = A DLNA renderer based on GStreamer's playbin element
+Copyright = Copyright © Rygel maintainers
diff --git a/src/plugins/tracker/Makefile.am b/src/plugins/tracker/Makefile.am
index 3dfcf99..d206230 100644
--- a/src/plugins/tracker/Makefile.am
+++ b/src/plugins/tracker/Makefile.am
@@ -1,6 +1,7 @@
 include $(top_srcdir)/common.am
 
 plugin_LTLIBRARIES = librygel-tracker.la
+plugin_DATA = tracker.plugin
 
 librygel_tracker_la_SOURCES = \
        rygel-tracker-root-container.vala \
@@ -52,3 +53,5 @@ librygel_tracker_la_LIBADD = \
        $(RYGEL_COMMON_LIBRYGEL_SERVER_LIBS)
 librygel_tracker_la_LDFLAGS = \
        $(RYGEL_PLUGIN_LINKER_FLAGS)
+
+EXTRA_DIST = tracker.plugin.in
diff --git a/src/plugins/tracker/tracker.plugin.in b/src/plugins/tracker/tracker.plugin.in
new file mode 100644
index 0000000..51a50a1
--- /dev/null
+++ b/src/plugins/tracker/tracker.plugin.in
@@ -0,0 +1,7 @@
+[Plugin]
+Version = @VERSION@
+Module = tracker
+Name = Tracker
+License = LGPL
+Description = Share media using the Tracker meta-data store
+Copyright = Copyright © Rygel maintainers


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