summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <jensg@openismus.com>2012-12-15 12:33:46 +0100
committerJens Georg <jensg@openismus.com>2012-12-17 14:05:22 +0100
commit8641b8175d5ebb57d30a9497d44390f58ef69e2d (patch)
tree56332c122d829ae987d306df076d3a6be64cb80c
parent6dd70a157ed946a55a12274c22d92f9abac10870 (diff)
downloadrygel-8641b8175d5ebb57d30a9497d44390f58ef69e2d.tar.gz
engine-gst,gst-launch: Remove gst-launch hack
-rw-r--r--common.am2
-rw-r--r--configure.ac4
-rw-r--r--src/librygel-server/rygel-engine-loader.vala2
-rw-r--r--src/media-engines/gstreamer/Makefile.am10
-rw-r--r--src/media-engines/gstreamer/rygel-gst-utils.vala10
-rw-r--r--src/plugins/gst-launch/Makefile.am4
-rw-r--r--src/plugins/gst-launch/rygel-gst-launch-audio-item.vala13
-rw-r--r--src/plugins/gst-launch/rygel-gst-launch-item.vala12
-rw-r--r--src/plugins/gst-launch/rygel-gst-launch-root-container.vala5
-rw-r--r--src/plugins/gst-launch/rygel-gst-launch-video-item.vala13
10 files changed, 19 insertions, 56 deletions
diff --git a/common.am b/common.am
index 42332a48..5d3f6971 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 8429eb75..6cdfa809 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 47c26cc2..50f34bc4 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 09e17548..1a351e6d 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 4a440b3b..d7b3dd8e 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 779e87c8..e472455e 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 de9e62df..ed696f8b 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 c00dd9fa..965ef92d 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 897e97c5..b917c91d 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 7f7d4338..be29c618 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 ();
}
}