[rhythmbox] player-gst: add stream reuse signals



commit f951a211240c936682cac9f890d77b4d7609b692
Author: Jonathan Matthew <jonathan d14n org>
Date:   Tue Jun 2 20:00:18 2009 +1000

    player-gst: add stream reuse signals
    
    The playbin backend can handle stream reuse the same way the crossfading
    backend does, which lets us move the cdda specific hackery out to the
    audio CD plugin.
---
 backends/gstreamer/rb-player-gst.c |   22 ++++++++++++++++++++++
 backends/gstreamer/rb-player-gst.h |   22 +++++++++++++++++-----
 2 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/backends/gstreamer/rb-player-gst.c b/backends/gstreamer/rb-player-gst.c
index 5f124c5..6e1f800 100644
--- a/backends/gstreamer/rb-player-gst.c
+++ b/backends/gstreamer/rb-player-gst.c
@@ -73,6 +73,8 @@ enum
 
 enum
 {
+	CAN_REUSE_STREAM,
+	REUSE_STREAM,
 	MISSING_PLUGINS,
 	LAST_SIGNAL
 };
@@ -1396,6 +1398,26 @@ rb_player_gst_class_init (RBPlayerGstClass *klass)
 							    64, MAX_NETWORK_BUFFER_SIZE, 128,
 							    G_PARAM_READWRITE));
 
+	signals[CAN_REUSE_STREAM] =
+		g_signal_new ("can-reuse-stream",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (RBPlayerGstClass, can_reuse_stream),
+			      NULL, NULL,
+			      rb_marshal_BOOLEAN__STRING_STRING_OBJECT,
+			      G_TYPE_BOOLEAN,
+			      3,
+			      G_TYPE_STRING, G_TYPE_STRING, GST_TYPE_ELEMENT);
+	signals[REUSE_STREAM] =
+		g_signal_new ("reuse-stream",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (RBPlayerGstClass, reuse_stream),
+			      NULL, NULL,
+			      rb_marshal_VOID__STRING_STRING_OBJECT,
+			      G_TYPE_NONE,
+			      3,
+			      G_TYPE_STRING, G_TYPE_STRING, GST_TYPE_ELEMENT);
 	signals[MISSING_PLUGINS] =
 		g_signal_new ("missing-plugins",
 			      G_OBJECT_CLASS_TYPE (object_class),
diff --git a/backends/gstreamer/rb-player-gst.h b/backends/gstreamer/rb-player-gst.h
index 62a639d..5decc55 100644
--- a/backends/gstreamer/rb-player-gst.h
+++ b/backends/gstreamer/rb-player-gst.h
@@ -30,6 +30,7 @@
 #define __RB_PLAYER_GST_H__
 
 #include <glib-object.h>
+#include <gst/gst.h>
 
 #include "rb-player.h"
 
@@ -37,20 +38,31 @@ G_BEGIN_DECLS
 
 #define RB_TYPE_PLAYER_GST            (rb_player_gst_get_type ())
 #define RB_PLAYER_GST(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), RB_TYPE_PLAYER, RBPlayerGst))
-#define RB_IS_PLAYERER_GST(obj)       (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RB_TYPE_PLAYER))
+#define RB_IS_PLAYER_GST(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RB_TYPE_PLAYER))
 
 typedef struct _RBPlayerGstPrivate RBPlayerGstPrivate;
+typedef struct _RBPlayerGst RBPlayerGst;
+typedef struct _RBPlayerGstClass RBPlayerGstClass;
 
-typedef struct
+struct _RBPlayerGstClass
 {
 	GObjectClass obj_class;
-} RBPlayerGstClass;
 
-typedef struct
+	gboolean (*can_reuse_stream) (RBPlayerGst *player,
+				      const char *new_uri,
+				      const char *stream_uri,
+				      GstElement *source);
+	void (*reuse_stream) (RBPlayerGst *player,
+			      const char *new_uri,
+			      const char *stream_uri,
+			      GstElement *source);
+};
+
+struct _RBPlayerGst
 {
 	GObject obj;
 	RBPlayerGstPrivate *priv;
-} RBPlayerGst;
+};
 
 RBPlayer*	rb_player_gst_new (GError **error);
 GType		rb_player_gst_get_type (void);



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