aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-call-window.c
diff options
context:
space:
mode:
authorJonathan Tellier <jonathan.tellier@gmail.com>2009-05-21 01:49:02 +0800
committerjtellier <jonathan.tellier@collabora.co.uk>2009-06-12 20:59:10 +0800
commit62ed123c83ff2de84622abe1e2cb972a409c43ae (patch)
tree5b98ebb58a945c9b16539942cb225bf047f74b70 /src/empathy-call-window.c
parentefd01a1ef0a6be5552cc370e0870c9106fdc2908 (diff)
downloadgsoc2013-empathy-62ed123c83ff2de84622abe1e2cb972a409c43ae.tar
gsoc2013-empathy-62ed123c83ff2de84622abe1e2cb972a409c43ae.tar.gz
gsoc2013-empathy-62ed123c83ff2de84622abe1e2cb972a409c43ae.tar.bz2
gsoc2013-empathy-62ed123c83ff2de84622abe1e2cb972a409c43ae.tar.lz
gsoc2013-empathy-62ed123c83ff2de84622abe1e2cb972a409c43ae.tar.xz
gsoc2013-empathy-62ed123c83ff2de84622abe1e2cb972a409c43ae.tar.zst
gsoc2013-empathy-62ed123c83ff2de84622abe1e2cb972a409c43ae.zip
When no video is received or sent we show contacts' avatars instead of showing
black widgets.
Diffstat (limited to 'src/empathy-call-window.c')
-rw-r--r--src/empathy-call-window.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 0ce80c97c..eec0e5845 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -229,6 +229,9 @@ static void empathy_call_window_restart_call (EmpathyCallWindow *window);
static void empathy_call_window_status_message (EmpathyCallWindow *window,
gchar *message);
+static void empathy_call_window_update_avatars_visibility (EmpathyTpCall *call,
+ EmpathyCallWindow *window);
+
static gboolean empathy_call_window_bus_message (GstBus *bus,
GstMessage *message, gpointer user_data);
@@ -1229,6 +1232,8 @@ empathy_call_window_connected (gpointer user_data)
gtk_action_set_sensitive (priv->redial, FALSE);
gtk_widget_set_sensitive (priv->redial_button, FALSE);
+ empathy_call_window_update_avatars_visibility (call, self);
+
g_object_unref (call);
g_mutex_lock (priv->lock);
@@ -1443,6 +1448,48 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
}
static void
+empathy_call_window_update_avatars_visibility (EmpathyTpCall *call,
+ EmpathyCallWindow *window)
+{
+ EmpathyCallWindowPriv *priv = GET_PRIV (window);
+
+ if (empathy_tp_call_is_receiving_video (call))
+ {
+ gtk_widget_hide (priv->remote_user_avatar_widget);
+ gtk_widget_show (priv->video_output);
+ }
+ else
+ {
+ gtk_widget_hide (priv->video_output);
+ gtk_widget_show (priv->remote_user_avatar_widget);
+ }
+
+ if (empathy_tp_call_is_sending_video (call))
+ {
+ gtk_widget_hide (priv->self_user_avatar_widget);
+ gtk_widget_show (priv->video_preview);
+ }
+ else
+ {
+ gtk_widget_hide (priv->video_preview);
+ gtk_widget_show (priv->self_user_avatar_widget);
+ }
+}
+
+static void
+empathy_call_window_video_stream_changed_cb (EmpathyCallHandler *handler,
+ EmpathyCallWindow *window)
+{
+ EmpathyTpCall *call;
+ EmpathyCallWindowPriv *priv = GET_PRIV (window);
+
+ g_object_get (priv->handler, "tp-call", &call, NULL);
+
+ empathy_call_window_update_avatars_visibility (call, window);
+ g_object_unref (call);
+}
+
+static void
empathy_call_window_realized_cb (GtkWidget *widget, EmpathyCallWindow *window)
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
@@ -1457,6 +1504,8 @@ empathy_call_window_realized_cb (GtkWidget *widget, EmpathyCallWindow *window)
G_CALLBACK (empathy_call_window_src_added_cb), window);
g_signal_connect (priv->handler, "sink-pad-added",
G_CALLBACK (empathy_call_window_sink_added_cb), window);
+ g_signal_connect (priv->handler, "video-stream-changed",
+ G_CALLBACK (empathy_call_window_video_stream_changed_cb), window);
empathy_call_window_setup_video_preview (window);