? attachment.cgi?id=70545&action=view
? foo
? backend/.bacon-video-widget-xine.c.swp
? plparse/attachment.cgi?id=70506&action=view
? plparse/m_wwdc_2006_350_ref.mov
Index: totem-mozilla-interface.xml
===================================================================
RCS file: /cvs/gnome/totem/src/totem-mozilla-interface.xml,v
retrieving revision 1.2
diff -u -p -r1.2 totem-mozilla-interface.xml
--- totem-mozilla-interface.xml	19 Jun 2006 11:58:50 -0000	1.2
+++ totem-mozilla-interface.xml	9 Aug 2006 15:28:51 -0000
@@ -8,5 +8,6 @@
     <method name="SetLocalFile">
       <arg type="s"/>
     </method>
+    <signal name="StopSendingData"/>
   </interface>
 </node>
Index: totem-mozilla-plugin.cpp
===================================================================
RCS file: /cvs/gnome/totem/src/totem-mozilla-plugin.cpp,v
retrieving revision 1.57
diff -u -p -r1.57 totem-mozilla-plugin.cpp
--- totem-mozilla-plugin.cpp	8 Aug 2006 15:47:23 -0000	1.57
+++ totem-mozilla-plugin.cpp	9 Aug 2006 15:28:52 -0000
@@ -68,6 +68,15 @@ cb_update_name (DBusGProxy *proxy, char 
 	}
 }
 
+static void
+cb_stop_sending_data (DBusGProxy  *proxy, void *data)
+{
+	TotemPlugin *plugin = (TotemPlugin *) data;
+
+	g_message ("Stop sending data signal received");
+	plugin->stop_sending_data = TRUE;
+}
+
 static gboolean
 is_supported_scheme (const char *url)
 {
@@ -256,6 +265,13 @@ totem_plugin_fork (TotemPlugin *plugin)
 		dbus_g_proxy_new_for_name (plugin->conn, plugin->wait_for_svc,
 					   "/TotemEmbedded",
 					   "org.totem.MozillaPluginInterface");
+	dbus_g_proxy_add_signal (plugin->proxy, "StopSendingData",
+				 G_TYPE_INVALID);
+	dbus_g_proxy_connect_signal (plugin->proxy, "StopSendingData",
+				     G_CALLBACK (cb_stop_sending_data),
+				     plugin, NULL);
+	g_message ("%p plugin", plugin);
+
 	g_free (plugin->wait_for_svc);
 	D("Done forking, new proxy=%p", plugin->proxy);
 
@@ -557,15 +573,16 @@ static int32 totem_plugin_write_ready (N
 
 	D("plugin_write_ready");
 
-	if (instance == NULL) {
-		D("plugin_write_ready instance is NULL");
+	if (instance == NULL)
 		return 0;
-	}
 
 	plugin = (TotemPlugin *) instance->pdata;
 
 	if (is_supported_scheme (plugin->src) == FALSE)
 		return 0;
+
+	if (plugin->stop_sending_data != FALSE)
+		return -1;
 
 	if (plugin->send_fd < 0)
 		return (8 * 1024);
Index: totem-mozilla-scriptable.h
===================================================================
RCS file: /cvs/gnome/totem/src/totem-mozilla-scriptable.h,v
retrieving revision 1.15
diff -u -p -r1.15 totem-mozilla-scriptable.h
--- totem-mozilla-scriptable.h	9 Aug 2006 12:42:25 -0000	1.15
+++ totem-mozilla-scriptable.h	9 Aug 2006 15:28:52 -0000
@@ -47,12 +47,13 @@ typedef struct {
 
 	GByteArray *bytes;
 
-	gboolean got_svc : 1;
-	gboolean controller_hidden : 1;
-	gboolean cache : 1;
-	gboolean hidden : 1;
-	gboolean repeat : 1;
-	gboolean is_playlist : 1;
+	guint got_svc : 1;
+	guint controller_hidden : 1;
+	guint cache : 1;
+	guint hidden : 1;
+	guint repeat : 1;
+	guint is_playlist : 1;
+	guint stop_sending_data : 1;
 } TotemPlugin;
 
 class totemMozillaMix : public nsIClassInfo {
Index: totem-mozilla-viewer.c
===================================================================
RCS file: /cvs/gnome/totem/src/totem-mozilla-viewer.c,v
retrieving revision 1.47
diff -u -p -r1.47 totem-mozilla-viewer.c
--- totem-mozilla-viewer.c	9 Aug 2006 12:42:25 -0000	1.47
+++ totem-mozilla-viewer.c	9 Aug 2006 15:28:52 -0000
@@ -48,6 +48,7 @@
 GtkWidget *totem_volume_create (void);
 
 #define OPTION_IS(x) (strcmp(argv[i], x) == 0)
+#define IS_FD_STREAM (strcmp(emb->filename, "fd://0") == 0)
 
 /* For newer D-Bus version */
 #ifndef DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT
@@ -61,7 +62,12 @@ typedef enum {
 } TotemStates;
 
 #define TOTEM_TYPE_EMBEDDED (totem_embedded_get_type ())
-typedef GObjectClass TotemEmbeddedClass;
+typedef struct {
+	GObjectClass parent_class;
+
+	void (*stop_sending_data) (GObject *emb);
+} TotemEmbeddedClass;
+
 typedef struct _TotemEmbedded {
 	GObject parent;
 
@@ -100,7 +106,6 @@ typedef struct _TotemEmbedded {
 GType totem_embedded_get_type (void);
 
 G_DEFINE_TYPE (TotemEmbedded, totem_embedded, G_TYPE_OBJECT);
-static void totem_embedded_class_init (TotemEmbeddedClass *klass) { }
 static void totem_embedded_init (TotemEmbedded *emb) { }
 
 gboolean totem_embedded_play (TotemEmbedded *emb, GError **err);
@@ -113,6 +118,28 @@ static void on_open1_activate (GtkButton
 
 #include "totem-mozilla-interface.h"
 
+enum {
+	STOP_SENDING_DATA,
+	LAST_SIGNAL
+};
+static int totem_emb_table_signals[LAST_SIGNAL] = { 0 };
+
+static void totem_embedded_class_init (TotemEmbeddedClass *klass)
+{
+	GObjectClass *object_class;
+
+	object_class = (GObjectClass *) klass;
+
+	totem_emb_table_signals[STOP_SENDING_DATA] =
+		g_signal_new ("stop-sending-data",
+				G_TYPE_FROM_CLASS (object_class),
+				G_SIGNAL_RUN_LAST,
+				G_STRUCT_OFFSET (TotemEmbeddedClass, stop_sending_data),
+				NULL, NULL,
+				g_cclosure_marshal_VOID__VOID,
+				G_TYPE_NONE, 0);
+}
+
 static void
 totem_embedded_exit (TotemEmbedded *emb)
 {
@@ -129,6 +156,17 @@ totem_embedded_error_and_exit (char *tit
 }
 
 static void
+totem_embedded_emit_stop_sending_data (TotemEmbedded *emb)
+{
+	g_return_if_fail (emb->filename != NULL);
+	if (IS_FD_STREAM) {
+		g_signal_emit (G_OBJECT (emb),
+				totem_emb_table_signals[STOP_SENDING_DATA],
+				0, NULL);
+	}
+}
+
+static void
 totem_embedded_set_state (TotemEmbedded *emb, TotemStates state)
 {
 	const char *id = NULL;
@@ -186,6 +224,8 @@ totem_embedded_open (TotemEmbedded *emb)
 	{
 		char *msg, *disp;
 
+		totem_embedded_emit_stop_sending_data (emb);
+
 		totem_embedded_set_state (emb, STATE_STOPPED);
 
 		//FIXME if emb->filename is fd://0 or stdin:///
@@ -201,15 +241,15 @@ totem_embedded_open (TotemEmbedded *emb)
 		}
 
 		g_free (msg);
-
 		g_error_free (err);
+
 		totem_embedded_set_pp_state (emb, FALSE);
 	} else {
 		totem_embedded_set_state (emb, STATE_PAUSED);
 		totem_embedded_set_pp_state (emb, TRUE);
 	}
 
-	if (retval == FALSE || strcmp ("fd://0", emb->filename) == 0) {
+	if (retval == FALSE || IS_FD_STREAM) {
 		totem_embedded_set_menu (emb, FALSE);
 	} else {
 		totem_embedded_set_menu (emb, TRUE);
@@ -472,7 +512,7 @@ on_eos_event (GtkWidget *bvw, TotemEmbed
 	gtk_adjustment_set_value (emb->seekadj, 0);
 
 	/* No playlist if we have fd://0, right? */
-	if (strcmp (emb->filename, "fd://0") == 0) {
+	if (IS_FD_STREAM) {
 		totem_embedded_set_pp_state (emb, FALSE);
 	} else if (emb->num_items == 1) {
 		if (g_str_has_prefix (emb->filename, "file://") != FALSE) {
