rpms/rhythmbox/devel rhythmbox-0.11.3-add-missing-plugins-support.patch, NONE, 1.1 rhythmbox.spec, 1.146, 1.147

Bastien Nocera (hadess) fedora-extras-commits at redhat.com
Tue Nov 13 12:21:55 UTC 2007


Author: hadess

Update of /cvs/pkgs/rpms/rhythmbox/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18854

Modified Files:
	rhythmbox.spec 
Added Files:
	rhythmbox-0.11.3-add-missing-plugins-support.patch 
Log Message:
* Tue Nov 13 2007 - Bastien Nocera <bnocera at redhat.com> - 0.11.3-2
- Add upstream patch to implement missing plugins support


rhythmbox-0.11.3-add-missing-plugins-support.patch:

--- NEW FILE rhythmbox-0.11.3-add-missing-plugins-support.patch ---
diff --git a/backends/gstreamer/Makefile.am b/backends/gstreamer/Makefile.am
index 01cb788..093a02d 100644
--- a/backends/gstreamer/Makefile.am
+++ b/backends/gstreamer/Makefile.am
@@ -8,6 +8,7 @@ librbbackendsgstreamer_la_SOURCES =			\
 	$(NULL)
 
 librbbackendsgstreamer_la_LIBADD =			\
+	-lgstpbutils-0.10				\
 	$(RHYTHMBOX_LIBS)
 
 librbbackendsgstreamer_la_LDFLAGS = -export-dynamic
diff --git a/backends/gstreamer/rb-player-gst-xfade.c b/backends/gstreamer/rb-player-gst-xfade.c
index 0dd55e9..e3d625a 100644
--- a/backends/gstreamer/rb-player-gst-xfade.c
+++ b/backends/gstreamer/rb-player-gst-xfade.c
@@ -141,6 +141,10 @@
 #include <gst/controller/gstcontroller.h>
 #include <gst/base/gstbasetransform.h>
 
+#ifdef HAVE_GSTREAMER_0_10_MISSING_PLUGINS
+#include <gst/pbutils/pbutils.h>
+#endif /* HAVE_GSTREAMER_0_10_MISSING_PLUGINS */
+
 #include "rb-player.h"
 #include "rb-player-gst-xfade.h"
 #include "rb-debug.h"
@@ -218,6 +222,7 @@ enum
 {
 	CAN_REUSE_STREAM,
 	REUSE_STREAM,
+	MISSING_PLUGINS,
 	LAST_SIGNAL
 };
 
@@ -298,6 +303,10 @@ typedef struct
 	gboolean emitted_error;
 	gulong error_idle_id;
 	GError *error;
+#ifdef HAVE_GSTREAMER_0_10_MISSING_PLUGINS
+	GSList *missing_plugins;
+	gulong  emit_missing_plugins_id;
+#endif
 } RBXFadeStream;
 
 #define RB_TYPE_XFADE_STREAM 	(rb_xfade_stream_get_type ())
@@ -636,6 +645,18 @@ rb_player_gst_xfade_class_init (RBPlayerGstXFadeClass *klass)
 			      G_TYPE_NONE,
 			      3,
 			      G_TYPE_STRING, G_TYPE_STRING, GST_TYPE_ELEMENT);
+#ifdef HAVE_GSTREAMER_0_10_MISSING_PLUGINS
+	signals[MISSING_PLUGINS] =
+		g_signal_new ("missing-plugins",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_LAST,
+			      0,	/* no point handling this internally */
+			      NULL, NULL,
+			      rb_marshal_VOID__POINTER_POINTER_POINTER,
+			      G_TYPE_NONE,
+			      3,
+			      G_TYPE_POINTER, G_TYPE_STRV, G_TYPE_STRV);
+#endif
 
 	g_type_class_add_private (klass, sizeof (RBPlayerGstXFadePrivate));
 }
@@ -1362,6 +1383,84 @@ process_tag (const GstTagList *list, const gchar *tag, RBXFadeStream *stream)
 	g_value_unset (&newval);
 }
 
+#ifdef HAVE_GSTREAMER_0_10_MISSING_PLUGINS
+
+static gboolean
+emit_missing_plugins (RBXFadeStream *stream)
+{
+	char **details;
+	char **descriptions;
+	int count;
+	GSList *t;
+	int i;
+
+	stream->emit_missing_plugins_id = 0;
+	count = g_slist_length (stream->missing_plugins);
+
+	details = g_new0 (char *, count + 1);
+	descriptions = g_new0 (char *, count + 1);
+	i = 0;
+	for (t = stream->missing_plugins; t != NULL; t = t->next) {
+		GstMessage *msg = GST_MESSAGE (t->data);
+		char *detail;
+		char *description;
+
+		detail = gst_missing_plugin_message_get_installer_detail (msg);
+		description = gst_missing_plugin_message_get_description (msg);
+		details[i] = g_strdup (detail);
+		descriptions[i] = g_strdup (description);
+		i++;
+
+		gst_message_unref (msg);
+	}
+
+	g_signal_emit (stream->player, signals[MISSING_PLUGINS], 0, stream->stream_data, details, descriptions);
+	g_strfreev (details);
+	g_strfreev (descriptions);
+
+	g_slist_free (stream->missing_plugins);
+	stream->missing_plugins = NULL;
+
+	return FALSE;
+}
+
+
+static void
+rb_player_gst_xfade_handle_missing_plugin_message (RBPlayerGstXFade *player, RBXFadeStream *stream, GstMessage *message)
+{
+	if (stream == NULL) {
+		rb_debug ("got missing-plugin message from unknown stream");
+		return;
+	}
+
+	rb_debug ("got missing-plugin message from %s: %s",
+		  stream->uri,
+		  gst_missing_plugin_message_get_installer_detail (message));
+
+	/* can only handle missing-plugins while prerolling */
+	switch (stream->state) {
+	case PREROLLING:
+	case PREROLL_PLAY:
+		stream->missing_plugins = g_slist_prepend (stream->missing_plugins,
+							   gst_message_ref (message));
+		if (stream->emit_missing_plugins_id == 0) {
+			stream->emit_missing_plugins_id =
+				g_idle_add ((GSourceFunc) emit_missing_plugins,
+					    g_object_ref (stream));
+		}
+
+		/* what do we do now?  if we're missing the decoder
+		 * or something, it'll never preroll..
+		 */
+		break;
+
+	default:
+		rb_debug ("can't process missing-plugin messages for this stream now");
+		break;
+	}
+}
+#endif
+
 /* gstreamer message bus callback */
 static gboolean
 rb_player_gst_xfade_bus_cb (GstBus *bus, GstMessage *message, RBPlayerGstXFade *player)
@@ -1504,25 +1603,29 @@ rb_player_gst_xfade_bus_cb (GstBus *bus, GstMessage *message, RBPlayerGstXFade *
 	}
 	case GST_MESSAGE_ELEMENT:
 	{
-		/* currently only used to report imperfect stream messages */
 		const GstStructure *s;
 		const char *name;
 
+#ifdef HAVE_GSTREAMER_0_10_MISSING_PLUGINS
+		if (gst_is_missing_plugin_message (message)) {
+			rb_player_gst_xfade_handle_missing_plugin_message (player, stream, message);
+			break;
+		}
+#endif
+
 		s = gst_message_get_structure (message);
 		name = gst_structure_get_name (s);
 		if ((strcmp (name, "imperfect-timestamp") == 0) ||
 		    (strcmp (name, "imperfect-offset") == 0)) {
 			char *details;
-			RBXFadeStream *stream;
-			const char *uri = "unknown stream";;
+			const char *uri = "unknown-stream";
 
-			stream = find_stream_by_element (player, GST_ELEMENT (GST_MESSAGE_SRC (message)));
 			if (stream != NULL) {
 				uri = stream->uri;
 			}
 
 			details = gst_structure_to_string (s);
-			rb_debug_real ("check-imperfect", __FILE__, __LINE__, TRUE, "%s: %s", uri, details);
+			rb_debug_real ("check-imperfect", __FILE__, __LINE__, TRUE, "%s: %s", stream->uri, details);
 			g_free (details);
 		}
 		break;
diff --git a/backends/gstreamer/rb-player-gst.c b/backends/gstreamer/rb-player-gst.c
index e737b86..90f3a2a 100644
--- a/backends/gstreamer/rb-player-gst.c
+++ b/backends/gstreamer/rb-player-gst.c
@@ -32,6 +32,10 @@
 #include <libgnomevfs/gnome-vfs-ops.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
 
+#ifdef HAVE_GSTREAMER_0_10_MISSING_PLUGINS
+#include <gst/pbutils/pbutils.h>
+#endif /* HAVE_GSTREAMER_0_10_MISSING_PLUGINS */
+
 #include "rb-debug.h"
 #include "rb-marshal.h"
[...1795 lines suppressed...]
+/* rb-missing-plugins.h
+
+   Copyright (C) 2007 Tim-Philipp Müller <tim centricular net>
+
+   The Gnome Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The Gnome Library 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the Gnome Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+
+   Author: Tim-Philipp Müller <tim centricular net>
+ */
+
+#ifndef RB_MISSING_PLUGINS_H
+#define RB_MISSING_PLUGINS_H
+
+#include "rb-shell.h"
+
+G_BEGIN_DECLS
+
+void rb_missing_plugins_init (RBShell *shell);
+
+G_END_DECLS
+
+#endif /* RB_MISSING_PLUGINS_H */
diff --git a/shell/rb-shell-player.c b/shell/rb-shell-player.c
index 4b554c4..2d6b12a 100644
--- a/shell/rb-shell-player.c
+++ b/shell/rb-shell-player.c
@@ -129,6 +129,9 @@ static void rb_shell_player_sync_replaygain (RBShellPlayer *player,
                                              RhythmDBEntry *entry);
 static void tick_cb (RBPlayer *player, RhythmDBEntry *entry, long elapsed, long duration, gpointer data);
 static void error_cb (RBPlayer *player, RhythmDBEntry *entry, const GError *err, gpointer data);
+#ifdef HAVE_GSTREAMER_0_10_MISSING_PLUGINS
+static void missing_plugins_cb (RBPlayer *player, RhythmDBEntry *entry, const char **details, const char **descriptions, RBShellPlayer *sp);
+#endif
 static void playing_stream_cb (RBPlayer *player, RhythmDBEntry *entry, RBShellPlayer *shell_player);
 static void rb_shell_player_error (RBShellPlayer *player, gboolean async, const GError *err);
 
@@ -277,6 +280,7 @@ enum
 	PLAYING_SONG_CHANGED,
 	PLAYING_URI_CHANGED,
 	PLAYING_SONG_PROPERTY_CHANGED,
+	MISSING_PLUGINS,
 	LAST_SIGNAL
 };
 
@@ -503,6 +507,20 @@ rb_shell_player_class_init (RBShellPlayerClass *klass)
 			      G_TYPE_STRING, G_TYPE_STRING,
 			      G_TYPE_VALUE, G_TYPE_VALUE);
 
+#ifdef HAVE_GSTREAMER_0_10_MISSING_PLUGINS
+	rb_shell_player_signals[MISSING_PLUGINS] =
+		g_signal_new ("missing-plugins",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_LAST,
+			      0,	/* no need for an internal handler */
+			      NULL, NULL,
+			      rb_marshal_BOOLEAN__POINTER_POINTER_POINTER,
+			      G_TYPE_BOOLEAN,
+			      3,
+			      G_TYPE_STRV, G_TYPE_STRV, G_TYPE_CLOSURE);
+#endif
+
+
 	g_type_class_add_private (klass, sizeof (RBShellPlayerPrivate));
 }
 
@@ -835,6 +853,13 @@ rb_shell_player_init (RBShellPlayer *player)
 				 G_CALLBACK (playing_stream_cb),
 				 player, 0);
 
+#ifdef HAVE_GSTREAMER_0_10_MISSING_PLUGINS
+	g_signal_connect_object (player->priv->mmplayer,
+				 "missing-plugins",
+				 G_CALLBACK (missing_plugins_cb),
+				 player, 0);
+#endif
+
 	g_signal_connect (G_OBJECT (gnome_vfs_get_volume_monitor ()),
 			  "volume-pre-unmount",
 			  G_CALLBACK (volume_pre_unmount_cb),
@@ -3180,6 +3205,87 @@ tick_cb (RBPlayer *mmplayer,
 	GDK_THREADS_LEAVE ();
 }
 
+#ifdef HAVE_GSTREAMER_0_10_MISSING_PLUGINS
+
+typedef struct {
+	RhythmDBEntry *entry;
+	RBShellPlayer *player;
+} MissingPluginRetryData;
+
+static void
+missing_plugins_retry_cb (gpointer inst,
+			  gboolean retry,
+			  MissingPluginRetryData *retry_data)
+{
+	GError *error = NULL;
+	if (retry == FALSE) {
+		/* next?  or stop playback? */
+		rb_debug ("not retrying playback; stopping player");
+		rb_player_close (retry_data->player->priv->mmplayer, NULL, NULL);
+		return;
+	}
+
+	rb_debug ("retrying playback");
+	rb_shell_player_set_playing_entry (retry_data->player,
+					   retry_data->entry,
+					   FALSE, FALSE,
+					   &error);
+	if (error != NULL) {
+		rb_shell_player_error (retry_data->player, FALSE, error);
+		g_clear_error (&error);
+	}
+}
+
+static void
+missing_plugins_retry_cleanup (MissingPluginRetryData *retry)
+{
+	retry->player->priv->handling_error = FALSE;
+
+	g_object_unref (retry->player);
+	rhythmdb_entry_unref (retry->entry);
+	g_free (retry);
+}
+
+
+static void
+missing_plugins_cb (RBPlayer *player,
+		    RhythmDBEntry *entry,
+		    const char **details,
+		    const char **descriptions,
+		    RBShellPlayer *sp)
+{
+	gboolean processing;
+	GClosure *retry;
+	MissingPluginRetryData *retry_data;
+
+	retry_data = g_new0 (MissingPluginRetryData, 1);
+	retry_data->player = g_object_ref (sp);
+	retry_data->entry = rhythmdb_entry_ref (entry);
+
+	retry = g_cclosure_new ((GCallback) missing_plugins_retry_cb,
+				retry_data,
+				(GClosureNotify) missing_plugins_retry_cleanup);
+	g_closure_set_marshal (retry, g_cclosure_marshal_VOID__BOOLEAN);
+	g_signal_emit (sp,
+		       rb_shell_player_signals[MISSING_PLUGINS], 0,
+		       details, descriptions, retry,
+		       &processing);
+	if (processing) {
+		/* don't handle any further errors */
+		sp->priv->handling_error = TRUE;
+
+		/* probably specify the URI here.. */
+		rb_debug ("stopping player while processing missing plugins");
+		rb_player_close (retry_data->player->priv->mmplayer, NULL, NULL);
+	} else {
+		rb_debug ("not processing missing plugins; simulating EOS");
+		rb_shell_player_handle_eos (NULL, NULL, retry_data->player);
+	}
+
+	g_closure_sink (retry);
+}
+#endif
+
 gboolean
 rb_shell_player_get_playing_path (RBShellPlayer *shell_player,
 				  const gchar **path,
diff --git a/shell/rb-shell.c b/shell/rb-shell.c
index 247a34a..37797fb 100644
--- a/shell/rb-shell.c
+++ b/shell/rb-shell.c
@@ -84,6 +84,7 @@
 #include "rb-sourcelist-model.h"
 #include "rb-song-info.h"
 #include "rb-marshal.h"
+#include "rb-missing-plugins.h"
 
 #define PLAYING_ENTRY_NOTIFY_TIME 4
 
@@ -1372,6 +1373,8 @@ rb_shell_constructor (GType type,
 
 	rb_plugins_engine_init (shell);
 
+	rb_missing_plugins_init (shell);
+
 	g_idle_add ((GSourceFunc)_scan_idle, shell);
 
 	/* GO GO GO! */


Index: rhythmbox.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rhythmbox/devel/rhythmbox.spec,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -r1.146 -r1.147
--- rhythmbox.spec	12 Nov 2007 04:16:30 -0000	1.146
+++ rhythmbox.spec	13 Nov 2007 12:21:20 -0000	1.147
@@ -3,7 +3,7 @@
 Name: rhythmbox
 Summary: Music Management Application 
 Version: 0.11.3
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2+ and GFDL+
 Group: Applications/Multimedia
 URL: http://www.gnome.org/projects/rhythmbox/
@@ -53,6 +53,8 @@
 Patch1: rb-delete-ipod-tracks.patch
 # http://bugzilla.gnome.org/show_bug.cgi?id=484768
 Patch2: rb-use-newer-plparser-7.patch
+# http://bugzilla.gnome.org/show_bug.cgi?id=338308
+Patch3: rhythmbox-0.11.3-add-missing-plugins-support.patch
 
 %description
 Rhythmbox is an integrated music management application based on the powerful
@@ -85,6 +87,8 @@
 %patch1 -p0 -b .ipod-trash
 popd
 %patch2 -p0 -b .podcast
+%patch3 -p1 -b .missing-plugins
+autoconf
 automake
 
 %build
@@ -197,6 +201,9 @@
 %{_libdir}/rhythmbox/plugins/upnp_coherence
 
 %changelog
+* Tue Nov 13 2007 - Bastien Nocera <bnocera at redhat.com> - 0.11.3-2
+- Add upstream patch to implement missing plugins support
+
 * Mon Nov 12 2007 - Bastien Nocera <bnocera at redhat.com> - 0.11.3-1
 - Update to 0.11.3
 - Remove a whole load of upstreamed patches




More information about the fedora-extras-commits mailing list