pidgin.vv: bb0c02f7: Wait for local video frame to be realize...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Mon Dec 15 04:10:49 EST 2008


-----------------------------------------------------------------
Revision: bb0c02f78281c46db41ef3efba2896a2edad4441
Ancestor: b85997cb3793c7e2d7f301604f6a80b3ce00b3de
Author: maiku at soc.pidgin.im
Date: 2008-12-14T23:43:52
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/bb0c02f78281c46db41ef3efba2896a2edad4441

Modified files:
        libpurple/media.c pidgin/gtkmedia.c

ChangeLog: 

Wait for local video frame to be realized before starting local video.
This fixes half of the BadWindow errors that have plagued vv.

-------------- next part --------------
============================================================
--- libpurple/media.c	196649e6ba58f5a7a4d4cb4db4e6a4a18ad2b25c
+++ libpurple/media.c	991e0ef1de7f38d1f4744a3408269dcd23e27bae
@@ -738,6 +738,7 @@ purple_media_get_pipeline(PurpleMedia *m
 		gst_bus_add_signal_watch(GST_BUS(bus));
 		g_signal_connect(G_OBJECT(bus), "message",
 				G_CALLBACK(media_bus_call), media);
+		gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, NULL);
 		gst_object_unref(bus);
 
 		gst_bin_add(GST_BIN(media->priv->pipeline), GST_ELEMENT(media->priv->conference));
============================================================
--- pidgin/gtkmedia.c	8934f8348586ca272e15ad89695ec69803703d45
+++ pidgin/gtkmedia.c	3e19f998d2ca9728a9c797c4cb7b7c053279df71
@@ -300,6 +300,12 @@ static void
 }
 
 static void
+realize_cb(GtkWidget *widget, GstElement *element)
+{
+	gst_element_set_state(element, GST_STATE_PLAYING);
+}
+
+static void
 pidgin_media_ready_cb(PurpleMedia *media, PidginMedia *gtkmedia)
 {
 	GstElement *pipeline = purple_media_get_pipeline(media);
@@ -327,7 +333,6 @@ pidgin_media_ready_cb(PurpleMedia *media
 			if (!videosendbin && (type & PURPLE_MEDIA_SEND_VIDEO)) {
 				purple_media_video_init_src(&videosendbin);
 				purple_media_set_src(media, sessions->data, videosendbin);
-				gst_element_set_state(videosendbin, GST_STATE_PLAYING);
 			}
 			if (!videorecvbool && (type & PURPLE_MEDIA_RECV_VIDEO)) {
 				videorecvbool = TRUE;
@@ -373,8 +378,12 @@ pidgin_media_ready_cb(PurpleMedia *media
 		gtk_box_pack_start(GTK_BOX(send_widget), aspect, TRUE, TRUE, 0);
 
 		local_video = gtk_drawing_area_new();
+		g_signal_connect(G_OBJECT(local_video), "realize",
+				G_CALLBACK(realize_cb), videosendbin);
+
 		gtk_container_add(GTK_CONTAINER(aspect), local_video);
 		gtk_widget_set_size_request (GTK_WIDGET(local_video), 100, -1);
+
 		gtk_widget_show(local_video);
 		gtk_widget_show(aspect);
 
@@ -405,8 +414,8 @@ pidgin_media_ready_cb(PurpleMedia *media
 	bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
 
 	if (videorecvbool || videosendbin)
-		gst_bus_set_sync_handler(bus,
-				(GstBusSyncHandler)create_window, gtkmedia);
+		g_signal_connect(bus, "sync-message::element",
+				G_CALLBACK(create_window), gtkmedia);
 
 	if (audiorecvbool || audiosendbin)
 		g_signal_connect(G_OBJECT(bus), "message::element",


More information about the Commits mailing list