[rygel] engine-gst,gst-launch: Remove gst-launch hack



commit 8641b8175d5ebb57d30a9497d44390f58ef69e2d
Author: Jens Georg <jensg openismus com>
Date:   Sat Dec 15 12:33:46 2012 +0100

    engine-gst,gst-launch: Remove gst-launch hack

 common.am                                          |    2 +-
 configure.ac                                       |    4 ++--
 src/librygel-server/rygel-engine-loader.vala       |    2 +-
 src/media-engines/gstreamer/Makefile.am            |   10 ----------
 src/media-engines/gstreamer/rygel-gst-utils.vala   |   10 +++++++++-
 src/plugins/gst-launch/Makefile.am                 |    4 +---
 .../gst-launch/rygel-gst-launch-audio-item.vala    |   13 +------------
 src/plugins/gst-launch/rygel-gst-launch-item.vala  |   12 +++---------
 .../rygel-gst-launch-root-container.vala           |    5 -----
 .../gst-launch/rygel-gst-launch-video-item.vala    |   13 +------------
 10 files changed, 19 insertions(+), 56 deletions(-)
---
diff --git a/common.am b/common.am
index 42332a4..5d3f697 100644
--- a/common.am
+++ b/common.am
@@ -105,7 +105,7 @@ RYGEL_COMMON_VALAFLAGS = \
 	$(COVERAGE_VALAFLAGS)
 
 
-RYGEL_PLUGIN_LINKER_FLAGS = -shared -fPIC -module -avoid-version
+RYGEL_PLUGIN_LINKER_FLAGS = -shared -fPIC -module -avoid-version -Wl,-z,defs
 
 vala-clean:
 	rm -f `find . -name "*.stamp"`
diff --git a/configure.ac b/configure.ac
index 8429eb7..6cdfa80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -165,8 +165,8 @@ AS_IF([test "x$with_media_engine" = "xgstreamer"],
         RYGEL_ADD_PLUGIN([gst-launch],[GStreamer launchline],[no])
         AS_IF([test "x$enable_gst_launch_plugin" = "xyes"],
           [
-            PKG_CHECK_MODULES([RYGEL_PLUGIN_GST_LAUNCH_DEPS], [$RYGEL_COMMON_MODULES gstreamer-1.0 >= $GSTREAMER_REQUIRED])
-            RYGEL_PLUGIN_GST_LAUNCH_DEPS_VALAFLAGS="$RYGEL_COMMON_MODULES_VALAFLAGS --pkg gstreamer-1.0"
+            PKG_CHECK_MODULES([RYGEL_PLUGIN_GST_LAUNCH_DEPS], [$RYGEL_COMMON_MODULES])
+            RYGEL_PLUGIN_GST_LAUNCH_DEPS_VALAFLAGS="$RYGEL_COMMON_MODULES_VALAFLAGS"
             AC_SUBST([RYGEL_PLUGIN_GST_LAUNCH_DEPS_VALAFLAGS])
           ])
 
diff --git a/src/librygel-server/rygel-engine-loader.vala b/src/librygel-server/rygel-engine-loader.vala
index 47c26cc..50f34bc 100644
--- a/src/librygel-server/rygel-engine-loader.vala
+++ b/src/librygel-server/rygel-engine-loader.vala
@@ -60,7 +60,7 @@ internal class Rygel.EngineLoader : RecursiveModuleLoader {
             }
         }
 
-        var module = Module.open (file.get_path (), 0);
+        var module = Module.open (file.get_path (), ModuleFlags.BIND_LOCAL);
         if (module == null) {
             debug ("Failed to load engine %s: %s",
                    file.get_path (),
diff --git a/src/media-engines/gstreamer/Makefile.am b/src/media-engines/gstreamer/Makefile.am
index 09e1754..1a351e6 100644
--- a/src/media-engines/gstreamer/Makefile.am
+++ b/src/media-engines/gstreamer/Makefile.am
@@ -2,7 +2,6 @@ include $(top_srcdir)/common.am
 
 engine_LTLIBRARIES = librygel-media-engine-gst.la
 
-
 librygel_media_engine_gst_la_SOURCES = \
 	rygel-aac-transcoder.vala \
 	rygel-audio-transcoder.vala \
@@ -21,14 +20,9 @@ librygel_media_engine_gst_la_SOURCES = \
 librygel_media_engine_gst_la_VALAFLAGS = \
 	--enable-experimental \
 	$(RYGEL_MEDIA_ENGINE_GSTREAMER_DEPS_VALAFLAGS) \
-	--library rygel-media-engine-gst \
-	--use-header \
-	--header=rygel-media-engine-gst.h \
 	$(RYGEL_COMMON_LIBRYGEL_SERVER_VALAFLAGS) \
 	$(RYGEL_COMMON_VALAFLAGS)
 
-rygel-media-engine-gst.h rygel-media-engine-gstreamer.vapi: librygel_media_engine_gst_la_vala.stamp
-
 librygel_media_engine_gst_la_CFLAGS = \
 	$(RYGEL_MEDIA_ENGINE_GSTREAMER_DEPS_CFLAGS) \
 	$(RYGEL_COMMON_LIBRYGEL_SERVER_CFLAGS) \
@@ -42,7 +36,3 @@ librygel_media_engine_gst_la_LIBADD = \
 librygel_media_engine_gst_la_LDFLAGS = \
 	$(RYGEL_PLUGIN_LINKER_FLAGS)
 
-
-EXTRA_DIST = \
-	rygel-media-engine-gst.vapi \
-	rygel-media-engine-gst.h
diff --git a/src/media-engines/gstreamer/rygel-gst-utils.vala b/src/media-engines/gstreamer/rygel-gst-utils.vala
index 4a440b3..d7b3dd8 100644
--- a/src/media-engines/gstreamer/rygel-gst-utils.vala
+++ b/src/media-engines/gstreamer/rygel-gst-utils.vala
@@ -45,7 +45,15 @@ internal abstract class Rygel.GstUtils {
 
     public static Element? create_source_for_uri (string uri) {
         try {
-            dynamic Element src = Element.make_from_uri (URIType.SRC, uri, null);
+            dynamic Element src;
+
+            if (uri.has_prefix ("gst-launch://")) {
+                var description = uri.replace ("gst-launch://", "");
+
+                src = Gst.parse_bin_from_description (description, true);
+            } else {
+                src = Element.make_from_uri (URIType.SRC, uri, null);
+            }
 
             if (src.get_class ().find_property ("blocksize") != null) {
                 // The default is usually 4KiB which is not really big enough
diff --git a/src/plugins/gst-launch/Makefile.am b/src/plugins/gst-launch/Makefile.am
index 779e87c..e472455 100644
--- a/src/plugins/gst-launch/Makefile.am
+++ b/src/plugins/gst-launch/Makefile.am
@@ -7,8 +7,7 @@ librygel_gst_launch_la_SOURCES = \
 	rygel-gst-launch-root-container.vala \
 	rygel-gst-launch-item.vala \
 	rygel-gst-launch-audio-item.vala \
-	rygel-gst-launch-video-item.vala \
-	$(top_srcdir)/src/media-engines/gstreamer/rygel-media-engine-gst.vapi
+	rygel-gst-launch-video-item.vala
 
 librygel_gst_launch_la_VALAFLAGS = \
 	--enable-experimental \
@@ -18,7 +17,6 @@ librygel_gst_launch_la_VALAFLAGS = \
 librygel_gst_launch_la_CFLAGS = \
 	$(RYGEL_PLUGIN_GST_LAUNCH_DEPS_CFLAGS) \
 	$(RYGEL_COMMON_LIBRYGEL_SERVER_CFLAGS) \
-	-I$(top_srcdir)/src/media-engines/gstreamer \
 	-DG_LOG_DOMAIN='"GstLaunch"'
 librygel_gst_launch_la_LIBADD = \
 	$(RYGEL_PLUGIN_GST_LAUNCH_DEPS_LIBS) \
diff --git a/src/plugins/gst-launch/rygel-gst-launch-audio-item.vala b/src/plugins/gst-launch/rygel-gst-launch-audio-item.vala
index de9e62d..ed696f8 100644
--- a/src/plugins/gst-launch/rygel-gst-launch-audio-item.vala
+++ b/src/plugins/gst-launch/rygel-gst-launch-audio-item.vala
@@ -25,8 +25,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-using Gst;
-
 /**
  * Audio item that serves data from a gst-launch commandline.
  */
@@ -45,15 +43,6 @@ public class Rygel.GstLaunch.AudioItem : Rygel.AudioItem, Item {
     }
 
     public override DataSource? create_stream_source (string? host_ip) {
-        var engine = MediaEngine.get_default ();
-        var gst_engine = engine as GstMediaEngine;
-        if (gst_engine == null) {
-            warning ("The current media engine is not based on GStreamer.");
-
-            return null;
-        }
-
-        return gst_engine.create_data_source_from_element
-                                        (this.create_source ());
+        return this.create_source ();
     }
 }
diff --git a/src/plugins/gst-launch/rygel-gst-launch-item.vala b/src/plugins/gst-launch/rygel-gst-launch-item.vala
index c00dd9f..965ef92 100644
--- a/src/plugins/gst-launch/rygel-gst-launch-item.vala
+++ b/src/plugins/gst-launch/rygel-gst-launch-item.vala
@@ -23,22 +23,16 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-using Gst;
-
 /**
  * Item that serves data from a gst-launch commandline.
  */
 public interface Rygel.GstLaunch.Item : Rygel.MediaItem {
     public abstract string launch_line { get; protected set; }
 
-    protected Element? create_source () {
-        try {
-          return Gst.parse_bin_from_description (this.launch_line, true);
-        } catch (Error err) {
-          warning ("parse launchline failed: %s", err.message);
+    protected DataSource? create_source () {
+        var engine = MediaEngine.get_default ();
 
-          return null;
-        }
+        return engine.create_data_source ("gst-launch://" + this.launch_line);
     }
 }
 
diff --git a/src/plugins/gst-launch/rygel-gst-launch-root-container.vala b/src/plugins/gst-launch/rygel-gst-launch-root-container.vala
index 897e97c..b917c91 100644
--- a/src/plugins/gst-launch/rygel-gst-launch-root-container.vala
+++ b/src/plugins/gst-launch/rygel-gst-launch-root-container.vala
@@ -20,11 +20,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-using Rygel;
-using GUPnP;
-using Gee;
-using Gst;
-
 /**
  * Represents the root container for GstLaunch content hierarchy.
  */
diff --git a/src/plugins/gst-launch/rygel-gst-launch-video-item.vala b/src/plugins/gst-launch/rygel-gst-launch-video-item.vala
index 7f7d433..be29c61 100644
--- a/src/plugins/gst-launch/rygel-gst-launch-video-item.vala
+++ b/src/plugins/gst-launch/rygel-gst-launch-video-item.vala
@@ -25,8 +25,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-using Gst;
-
 /**
  * Video item that serves data from a gst-launch commandline.
  */
@@ -45,15 +43,6 @@ public class Rygel.GstLaunch.VideoItem : Rygel.VideoItem, Item {
     }
 
     public override DataSource? create_stream_source (string? host_ip) {
-        var engine = MediaEngine.get_default ();
-        var gst_engine = engine as GstMediaEngine;
-        if (gst_engine == null) {
-            warning ("The current media engine is not based on GStreamer.");
-
-            return null;
-        }
-
-        return gst_engine.create_data_source_from_element
-                                        (this.create_source ());
+        return this.create_source ();
     }
 }



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