[banshee] [libbanshee] Don't use filersc element explicitly
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] [libbanshee] Don't use filersc element explicitly
- Date: Fri, 14 May 2010 19:19:32 +0000 (UTC)
commit 25fc28801570cd34b4f23eae26fddf6f6c6d8e5b
Author: MichaÅ? Sawicz <michal sawicz net>
Date: Fri May 14 17:59:06 2010 +0200
[libbanshee] Don't use filersc element explicitly
Now that Banshee is gio/gvfs-aware, it might not only hold file paths
but also URIs. The transcoder was explicitly using the filesrc element,
which can't handle URIs. This patch makes it use the
gst_element_make_from_uri() on the URI retrieved by SafeUri.AbsoluteUri
instead of SafeUri.LocalPath. (bgo#618585)
Signed-off-by: Gabriel Burt <gabriel burt gmail com>
libbanshee/banshee-transcoder.c | 13 +++++--------
.../Banshee.GStreamer/Transcoder.cs | 4 ++--
2 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/libbanshee/banshee-transcoder.c b/libbanshee/banshee-transcoder.c
index f40ab9b..824a723 100644
--- a/libbanshee/banshee-transcoder.c
+++ b/libbanshee/banshee-transcoder.c
@@ -219,7 +219,7 @@ gst_transcoder_new_decoded_pad(GstElement *decodebin, GstPad *pad,
static gboolean
gst_transcoder_create_pipeline(GstTranscoder *transcoder,
- const char *input_file, const char *output_file,
+ const char *input_uri, const char *output_uri,
const gchar *encoder_pipeline)
{
GstElement *source_elem;
@@ -235,9 +235,9 @@ gst_transcoder_create_pipeline(GstTranscoder *transcoder,
transcoder->pipeline = gst_pipeline_new("pipeline");
- source_elem = gst_element_factory_make("filesrc", "source");
+ source_elem = gst_element_make_from_uri(GST_URI_SRC, input_uri, "source");
if(source_elem == NULL) {
- gst_transcoder_raise_error(transcoder, _("Could not create 'filesrc' plugin"), NULL);
+ gst_transcoder_raise_error(transcoder, _("Could not create source element"), NULL);
return FALSE;
}
@@ -247,9 +247,9 @@ gst_transcoder_create_pipeline(GstTranscoder *transcoder,
return FALSE;
}
- sink_elem = gst_element_factory_make("filesink", "sink");
+ sink_elem = gst_element_make_from_uri(GST_URI_SINK, output_uri, "sink");
if(sink_elem == NULL) {
- gst_transcoder_raise_error(transcoder, _("Could not create 'filesink' plugin"), NULL);
+ gst_transcoder_raise_error(transcoder, _("Could not create sink element"), NULL);
return FALSE;
}
@@ -288,9 +288,6 @@ gst_transcoder_create_pipeline(GstTranscoder *transcoder,
gst_element_link(source_elem, decoder_elem);
- g_object_set(source_elem, "location", input_file, NULL);
- g_object_set(sink_elem, "location", output_file, NULL);
-
g_signal_connect(decoder_elem, "new-decoded-pad",
G_CALLBACK(gst_transcoder_new_decoded_pad), transcoder);
diff --git a/src/Backends/Banshee.GStreamer/Banshee.GStreamer/Transcoder.cs b/src/Backends/Banshee.GStreamer/Banshee.GStreamer/Transcoder.cs
index ffc079b..792cf39 100644
--- a/src/Backends/Banshee.GStreamer/Banshee.GStreamer/Transcoder.cs
+++ b/src/Backends/Banshee.GStreamer/Banshee.GStreamer/Transcoder.cs
@@ -95,8 +95,8 @@ namespace Banshee.GStreamer
Log.DebugFormat ("Transcoding {0} to {1}", track.Uri, outputUri);
SafeUri inputUri = track.Uri;
managed_output_uri = outputUri;
- IntPtr input_uri = GLib.Marshaller.StringToPtrGStrdup(inputUri.LocalPath);
- IntPtr output_uri = GLib.Marshaller.StringToPtrGStrdup(outputUri.LocalPath);
+ IntPtr input_uri = GLib.Marshaller.StringToPtrGStrdup(inputUri.AbsoluteUri);
+ IntPtr output_uri = GLib.Marshaller.StringToPtrGStrdup(outputUri.AbsoluteUri);
error_message = null;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]