diff options
author | Jens Georg <mail@jensge.org> | 2015-08-28 23:58:35 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2015-08-28 23:59:01 +0200 |
commit | 1b7f6d2c025417729636af737063f7211061ab68 (patch) | |
tree | ac052aa34de0f10cac1229a2a8f5fe53f78717c0 /src | |
parent | 12ef090a70a938562d05193cd103e00d514f323f (diff) | |
download | rygel-1b7f6d2c025417729636af737063f7211061ab68.tar.gz |
gst-launch,engine-gst: Fix gst-launch plugin
Signed-off-by: Jens Georg <mail@jensge.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/media-engines/gstreamer/rygel-gst-media-engine.vala | 3 | ||||
-rw-r--r-- | src/plugins/gst-launch/Makefile.am | 1 | ||||
-rw-r--r-- | src/plugins/gst-launch/rygel-gst-launch-audio-item.vala | 24 | ||||
-rw-r--r-- | src/plugins/gst-launch/rygel-gst-launch-item.vala | 41 | ||||
-rw-r--r-- | src/plugins/gst-launch/rygel-gst-launch-video-item.vala | 10 |
5 files changed, 20 insertions, 59 deletions
diff --git a/src/media-engines/gstreamer/rygel-gst-media-engine.vala b/src/media-engines/gstreamer/rygel-gst-media-engine.vala index 11e05b77..c8ea4887 100644 --- a/src/media-engines/gstreamer/rygel-gst-media-engine.vala +++ b/src/media-engines/gstreamer/rygel-gst-media-engine.vala @@ -135,7 +135,8 @@ public class Rygel.GstMediaEngine : Rygel.MediaEngine { source_uri, parts[0]); - if (!Gst.URI.protocol_is_supported (URIType.SRC, parts[0])) { + if (!Gst.URI.protocol_is_supported (URIType.SRC, parts[0]) && + parts[0] != "gst-launch") { warning (_("Can't process URI %s with protocol %s"), source_uri, parts[0]); diff --git a/src/plugins/gst-launch/Makefile.am b/src/plugins/gst-launch/Makefile.am index bfccfd58..437c8f94 100644 --- a/src/plugins/gst-launch/Makefile.am +++ b/src/plugins/gst-launch/Makefile.am @@ -6,7 +6,6 @@ plugin_DATA = gst-launch.plugin librygel_gst_launch_la_SOURCES = \ rygel-gst-launch-plugin.vala \ rygel-gst-launch-root-container.vala \ - rygel-gst-launch-item.vala \ rygel-gst-launch-audio-item.vala \ rygel-gst-launch-video-item.vala 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 9d24e213..4b60ab09 100644 --- a/src/plugins/gst-launch/rygel-gst-launch-audio-item.vala +++ b/src/plugins/gst-launch/rygel-gst-launch-audio-item.vala @@ -28,9 +28,7 @@ /** * Audio item that serves data from a gst-launch commandline. */ -public class Rygel.GstLaunch.AudioItem : Rygel.AudioItem, Item { - public string launch_line { get; protected set; } - +public class Rygel.GstLaunch.AudioItem : Rygel.AudioItem { public AudioItem (string id, MediaContainer parent, string title, @@ -39,11 +37,21 @@ public class Rygel.GstLaunch.AudioItem : Rygel.AudioItem, Item { base (id, parent, title); this.mime_type = mime_type; - this.launch_line = launch_line; - } + this.add_uri ("gst-launch://" + launch_line); - public override DataSource? create_stream_source_for_resource (HTTPRequest request, - MediaResource resource) { - return this.create_source (); + // Call the MediaEngine to determine which item representations it can support + var media_engine = MediaEngine.get_default ( ); + media_engine.get_resources_for_item.begin ( this, + (obj, res) => { + var added_resources = media_engine + .get_resources_for_item.end (res); + debug ("Adding %d resources to item source %s", + added_resources.size, this.get_primary_uri ()); + foreach (var resrc in added_resources) { + debug ("Media-export item media resource %s", + resrc.get_name ()); + } + this.get_resource_list ().add_all (added_resources); + }); } } diff --git a/src/plugins/gst-launch/rygel-gst-launch-item.vala b/src/plugins/gst-launch/rygel-gst-launch-item.vala deleted file mode 100644 index 8b57de12..00000000 --- a/src/plugins/gst-launch/rygel-gst-launch-item.vala +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2009 Thijs Vermeir <thijsvermeir@gmail.com> - * Copyright (C) 2010 Nokia Corporation. - * - * Author: Thijs Vermeir <thijsvermeir@gmail.com> - * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org> - * <zeeshan.ali@nokia.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. - */ - -/** - * Item that serves data from a gst-launch commandline. - */ -public interface Rygel.GstLaunch.Item : Rygel.MediaFileItem { - public abstract string launch_line { get; protected set; } - - protected DataSource? create_source () { - var engine = MediaEngine.get_default (); - try { - return engine.create_data_source_for_uri ("gst-launch://" + this.launch_line); - } catch (Error error) { - return null; - } - } -} - 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 90c4554d..a2a4f751 100644 --- a/src/plugins/gst-launch/rygel-gst-launch-video-item.vala +++ b/src/plugins/gst-launch/rygel-gst-launch-video-item.vala @@ -28,8 +28,7 @@ /** * Video item that serves data from a gst-launch commandline. */ -public class Rygel.GstLaunch.VideoItem : Rygel.VideoItem, Item { - public string launch_line { get; protected set; } +public class Rygel.GstLaunch.VideoItem : Rygel.VideoItem { public VideoItem (string id, MediaContainer parent, @@ -39,11 +38,6 @@ public class Rygel.GstLaunch.VideoItem : Rygel.VideoItem, Item { base (id, parent, title); this.mime_type = mime_type; - this.launch_line = launch_line; - } - - public override DataSource? create_stream_source_for_resource (HTTPRequest request, - MediaResource resource) { - return this.create_source (); + this.add_uri ("gst-launch://" + launch_line); } } |