]> git.0d.be Git - empathy.git/commitdiff
Merge branch 'gnome-3-4'
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 21 May 2012 13:24:26 +0000 (15:24 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 21 May 2012 13:24:26 +0000 (15:24 +0200)
Conflicts:
NEWS
configure.ac
src/empathy-audio-src.c

1  2 
src/empathy-audio-src.c
src/empathy-call-window.c

diff --combined src/empathy-audio-src.c
index 590c65b66abb83caba1d7d4bfb65fbf98b3d5fbb,ca086148f7937113d6c26d13678676c9da322c04..79139bc9d570a7ad048a1a56b5b75b509449a1a5
@@@ -23,7 -23,7 +23,7 @@@
  #include <stdio.h>
  #include <stdlib.h>
  
- #include <gst/interfaces/mixer.h>
+ #include <gst/interfaces/streamvolume.h>
  
  #include <libempathy/empathy-utils.h>
  #include <libempathy-gtk/empathy-call-utils.h>
@@@ -61,6 -61,7 +61,7 @@@ struct _EmpathyGstAudioSrcPrivat
    gboolean dispose_has_run;
    GstElement *src;
    GstElement *level;
+   GstElement *volume_element;
  
    EmpathyMicMonitor *mic_monitor;
  
  
    gdouble volume;
    gboolean mute;
-   /* the mixer track on src we follow and adjust */
-   GstMixerTrack *track;
+   gboolean have_stream_volume;
  
 -  GMutex *lock;
 +  GMutex lock;
    guint level_idle_id;
    guint volume_idle_id;
  };
    (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMPATHY_TYPE_GST_AUDIO_SRC, \
    EmpathyGstAudioSrcPrivate))
  
- /* There is no predefined maximum channels by gstreamer, just pick 32, which is
-  * the same as the pulseaudio maximum */
- #define MAX_MIC_CHANNELS 32
+ static gboolean
+ empathy_audio_src_volume_changed (GObject *object,
+   GParamSpec *pspec,
+   gpointer user_data);
  
  static void
  empathy_audio_set_hw_mute (EmpathyGstAudioSrc *self, gboolean mute)
  {
-   g_mutex_lock (&self->priv->lock);
-   /* If there is no mixer available ignore the setting */
-   if (self->priv->track == NULL)
-     goto out;
+   if (mute == self->priv->mute)
+     return;
  
-   gst_mixer_set_mute (GST_MIXER (self->priv->src), self->priv->track, mute);
+   if (self->priv->have_stream_volume)
+     g_object_set (self->priv->src, "mute", mute, NULL);
+   /* Belt and braces: If for some reason the underlying src doesn't mute
+    * correctly or doesn't update us when it unmutes correctly enforce it using
+    * our own volume element. Our UI can in no circumstances be made to think
+    * the input is muted while it's not */
+   g_object_set (self->priv->volume_element, "mute", mute, NULL);
  
- out:
-   g_mutex_unlock (&self->priv->lock);
    self->priv->mute = mute;
  }
  
  static gboolean
  empathy_audio_src_get_hw_mute (EmpathyGstAudioSrc *self)
  {
-   gboolean result = self->priv->mute;
-   g_mutex_lock (&self->priv->lock);
-   if (self->priv->track == NULL)
-     goto out;
-   result = GST_MIXER_TRACK_HAS_FLAG (self->priv->track, GST_MIXER_TRACK_MUTE);
- out:
-   g_mutex_unlock (&self->priv->lock);
+   gboolean result;
+   g_object_get (self->priv->src, "mute", &result, NULL);
  
    return result;
  }
@@@ -125,42 -123,19 +123,19 @@@ static voi
  empathy_audio_src_set_hw_volume (EmpathyGstAudioSrc *self,
      gdouble volume)
  {
-   gint volumes[MAX_MIC_CHANNELS];
-   int i;
-   g_mutex_lock (&self->priv->lock);
-   /* If there is no mixer available ignore the setting */
-   if (self->priv->track == NULL)
-     goto out;
-   for (i = 0; i < MAX_MIC_CHANNELS; i++)
-     volumes[i] = self->priv->track->max_volume * volume;
-   gst_mixer_set_volume (GST_MIXER (self->priv->src),
-     self->priv->track, volumes);
- out:
-    g_mutex_unlock (&self->priv->lock);
+   if (volume == self->priv->volume)
+     return;
  
+   if (self->priv->have_stream_volume)
+     g_object_set (self->priv->src, "volume", volume, NULL);
    self->priv->volume = volume;
  }
  
  static gdouble
  empathy_audio_src_get_hw_volume (EmpathyGstAudioSrc *self)
  {
-   gint volumes[MAX_MIC_CHANNELS];
-   gdouble result = self->priv->volume;
-   g_mutex_lock (&self->priv->lock);
-   if (self->priv->track == NULL)
-     goto out;
-   gst_mixer_get_volume (GST_MIXER (self->priv->src),
-     self->priv->track, volumes);
-   result = volumes[0]/(gdouble)self->priv->track->max_volume;
- out:
-   g_mutex_unlock (&self->priv->lock);
+   gdouble result;
+   g_object_get (self->priv->src, "volume", &result, NULL);
  
    return result;
  }
@@@ -265,43 -240,6 +240,6 @@@ empathy_audio_src_source_output_index_n
        source_output_idx, empathy_audio_src_get_current_mic_cb, self);
  }
  
- static GstMixerTrack *
- empathy_audio_src_get_track (GstElement *src)
- {
-   const GList *t;
-   GstMixerTrack *track = NULL;
-   if (!gst_element_implements_interface (src, GST_TYPE_MIXER))
-     {
-       g_warning ("No mixer interface implementation, can't control volume");
-       return NULL;
-     }
-   for (t = gst_mixer_list_tracks (GST_MIXER (src));
-       t != NULL; t = g_list_next (t))
-     {
-       GstMixerTrack *tr = t->data;
-       if (!tp_strdiff (tr->label, "Master"))
-         {
-           track = tr;
-           break;
-         }
-     }
-   if (track == NULL)
-     {
-       g_warning ("No suitable track found");
-     }
-   else if (track->num_channels > MAX_MIC_CHANNELS)
-     {
-       g_warning ("Microphones with more then %d channels not supported ",
-         MAX_MIC_CHANNELS);
-       track = NULL;
-     }
-   return track;
- }
  static GstElement *
  create_src (void)
  {
@@@ -347,14 -285,45 +285,46 @@@ empathy_audio_src_init (EmpathyGstAudio
  
    obj->priv = priv;
    priv->peak_level = -G_MAXDOUBLE;
 -  priv->lock = g_mutex_new ();
 +  g_mutex_init (&priv->lock);
 +
    priv->volume = 1.0;
  
    priv->src = create_src ();
    if (priv->src == NULL)
      return;
  
+   if (GST_IS_STREAM_VOLUME (priv->src))
+     {
+       gdouble volume;
+       gboolean mute;
+       priv->have_stream_volume = TRUE;
+       /* We can't do a bidirection bind as the ::notify comes from another
+        * thread, for other bits of empathy it's most simpler if it comes from
+        * the main thread */
+       g_object_bind_property (obj, "volume", priv->src, "volume",
+         G_BINDING_DEFAULT);
+       g_object_bind_property (obj, "mute", priv->src, "mute",
+         G_BINDING_DEFAULT);
+       /* sync and callback for bouncing */
+       g_object_get (priv->src, "volume", &volume, NULL);
+       g_object_set (obj, "volume", volume, NULL);
+       g_object_get (priv->src, "mute", &mute, NULL);
+       g_object_set (obj, "mute", mute, NULL);
+       g_signal_connect (priv->src, "notify::volume",
+         G_CALLBACK (empathy_audio_src_volume_changed), obj);
+       g_signal_connect (priv->src, "notify::mute",
+         G_CALLBACK (empathy_audio_src_volume_changed), obj);
+     }
+   else
+     {
+       g_message ("No stream volume available :(, mute will work though");
+       priv->have_stream_volume = FALSE;
+     }
    gst_bin_add (GST_BIN (obj), priv->src);
  
    /* Explicitly state what format we want from pulsesrc. This pushes resampling
    gst_bin_add (GST_BIN (obj), capsfilter);
    gst_element_link (priv->src, capsfilter);
  
+   priv->volume_element = gst_element_factory_make ("volume", NULL);
+   gst_bin_add (GST_BIN (obj), priv->volume_element);
+   gst_element_link (capsfilter, priv->volume_element);
    priv->level = gst_element_factory_make ("level", NULL);
    gst_bin_add (GST_BIN (obj), priv->level);
-   gst_element_link (capsfilter, priv->level);
+   gst_element_link (priv->volume_element, priv->level);
  
    src = gst_element_get_static_pad (priv->level, "src");
  
@@@ -440,14 -413,14 +414,14 @@@ empathy_audio_src_get_property (GObjec
          g_value_set_boolean (value, priv->mute);
          break;
        case PROP_PEAK_LEVEL:
 -        g_mutex_lock (priv->lock);
 +        g_mutex_lock (&priv->lock);
          g_value_set_double (value, priv->peak_level);
 -        g_mutex_unlock (priv->lock);
 +        g_mutex_unlock (&priv->lock);
          break;
        case PROP_RMS_LEVEL:
 -        g_mutex_lock (priv->lock);
 +        g_mutex_lock (&priv->lock);
          g_value_set_double (value, priv->rms_level);
 -        g_mutex_unlock (priv->lock);
 +        g_mutex_unlock (&priv->lock);
          break;
        case PROP_MICROPHONE:
          g_value_set_uint (value, priv->source_idx);
@@@ -553,7 -526,7 +527,7 @@@ empathy_audio_src_finalize (GObject *ob
    EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self);
  
    /* free any data held directly by the object here */
 -  g_mutex_free (priv->lock);
 +  g_mutex_clear (&priv->lock);
  
    G_OBJECT_CLASS (empathy_audio_src_parent_class)->finalize (object);
  }
@@@ -564,28 -537,28 +538,28 @@@ empathy_audio_src_levels_updated (gpoin
    EmpathyGstAudioSrc *self = EMPATHY_GST_AUDIO_SRC (user_data);
    EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self);
  
 -  g_mutex_lock (priv->lock);
 +  g_mutex_lock (&priv->lock);
  
    g_signal_emit (self, signals[PEAK_LEVEL_CHANGED], 0, priv->peak_level);
    g_signal_emit (self, signals[RMS_LEVEL_CHANGED], 0, priv->rms_level);
    priv->level_idle_id = 0;
  
 -  g_mutex_unlock (priv->lock);
 +  g_mutex_unlock (&priv->lock);
  
    return FALSE;
  }
  
  static gboolean
- empathy_audio_src_volume_changed (gpointer user_data)
+ empathy_audio_src_volume_changed_idle (gpointer user_data)
  {
    EmpathyGstAudioSrc *self = EMPATHY_GST_AUDIO_SRC (user_data);
    EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self);
    gdouble volume;
    gboolean mute;
  
 -  g_mutex_lock (priv->lock);
 +  g_mutex_lock (&priv->lock);
    priv->volume_idle_id = 0;
 -  g_mutex_unlock (priv->lock);
 +  g_mutex_unlock (&priv->lock);
  
    volume = empathy_audio_src_get_hw_volume (self);
  
    if (mute != priv->mute)
      {
        priv->mute = mute;
+       /* hw mute changed, follow with own volume */
+       g_object_set (self->priv->volume_element, "mute", mute, NULL);
        g_object_notify (G_OBJECT (self), "mute");
      }
  
    return FALSE;
  }
  
+ static gboolean
+ empathy_audio_src_volume_changed (GObject *object,
+   GParamSpec *pspec,
+   gpointer user_data)
+ {
+   EmpathyGstAudioSrc *self = EMPATHY_GST_AUDIO_SRC (user_data);
+   g_mutex_lock (self->priv->lock);
+   if (self->priv->volume_idle_id == 0)
+     self->priv->volume_idle_id = g_idle_add (
+       empathy_audio_src_volume_changed_idle, self);
+   g_mutex_unlock (self->priv->lock);
+   return FALSE;
+ }
  static void
  empathy_audio_src_handle_message (GstBin *bin, GstMessage *message)
  {
            rms = MAX (db, rms);
          }
  
 -      g_mutex_lock (priv->lock);
 +      g_mutex_lock (&priv->lock);
  
        priv->peak_level = peak;
        priv->rms_level = rms;
          priv->level_idle_id = g_idle_add (
            empathy_audio_src_levels_updated, self);
  
 -      g_mutex_unlock (priv->lock);
 +      g_mutex_unlock (&priv->lock);
      }
-   else if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ELEMENT &&
-         GST_MESSAGE_SRC (message) == GST_OBJECT (priv->src))
-     {
-       GstMixerTrack *track = NULL;
-       /* Listen for mute or volume changes on the src element */
-       if (gst_mixer_message_get_type (message) ==
-           GST_MIXER_MESSAGE_VOLUME_CHANGED)
-         gst_mixer_message_parse_volume_changed (message, &track,
-             NULL, NULL);
-       if (gst_mixer_message_get_type (message) ==
-           GST_MIXER_MESSAGE_MUTE_TOGGLED)
-         gst_mixer_message_parse_mute_toggled (message, &track, NULL);
-       g_mutex_lock (&priv->lock);
-       if (track != NULL && track == priv->track && priv->volume_idle_id == 0)
-         priv->volume_idle_id = g_idle_add (
-             empathy_audio_src_volume_changed, self);
-       g_mutex_unlock (&priv->lock);
-     }
-   else if  (GST_MESSAGE_TYPE (message) == GST_MESSAGE_STATE_CHANGED &&
-       GST_MESSAGE_SRC (message) == GST_OBJECT (priv->src))
-     {
-       GstState old, new;
-       gst_message_parse_state_changed (message, &old, &new, NULL);
-       /* GstMixer is only available in state >= READY, so only start
-        * controlling the source element when going to ready state and stop
-        * doing so when going below ready. Furthermore once we have mixer read
-        * the current volume level from it and remove the settings done by
-        * Empathy. We want to pick up the level pulseaudio saved */
-       if (old == GST_STATE_NULL && new == GST_STATE_READY)
-         {
-           g_mutex_lock (&priv->lock);
-           priv->track = empathy_audio_src_get_track (priv->src);
-           if (priv->track != NULL)
-             priv->volume_idle_id = g_idle_add (
-               empathy_audio_src_volume_changed, self);
-           g_mutex_unlock (&priv->lock);
-         }
-       else if (old == GST_STATE_READY && new == GST_STATE_NULL)
-         {
-           g_mutex_lock (&priv->lock);
-           priv->track = NULL;
-           g_mutex_unlock (&priv->lock);
-         }
-     }
  out:
     GST_BIN_CLASS (empathy_audio_src_parent_class)->handle_message (bin,
      message);
index 1081efa0d7f54a351cb56aa503e83b825f57a6a5,bd206786502e2a90d06dc305f6010e5a72ad75b5..d9641fdf95e8a7aa062116039976b66a7ebf7a69
@@@ -43,6 -43,7 +43,6 @@@
  
  #include <libempathy/empathy-camera-monitor.h>
  #include <libempathy/empathy-gsettings.h>
 -#include <libempathy/empathy-tp-contact-factory.h>
  #include <libempathy/empathy-request-util.h>
  #include <libempathy/empathy-utils.h>
  
@@@ -60,6 -61,7 +60,6 @@@
  #include "empathy-call-window.h"
  #include "empathy-call-window-fullscreen.h"
  #include "empathy-call-factory.h"
 -#include "empathy-video-widget.h"
  #include "empathy-about-dialog.h"
  #include "empathy-audio-src.h"
  #include "empathy-audio-sink.h"
  #include "empathy-rounded-texture.h"
  #include "empathy-camera-menu.h"
  
- #define CONTENT_HBOX_BORDER_WIDTH 6
  #define CONTENT_HBOX_SPACING 3
- #define CONTENT_HBOX_CHILDREN_PACKING_PADDING 3
+ #define CONTENT_HBOX_CHILDREN_PACKING_PADDING 0
+ #define OVERLAY_MARGIN 6
  
 +#define REMOTE_VIDEO_DEFAULT_WIDTH 320
 +#define REMOTE_VIDEO_DEFAULT_HEIGHT 240
 +
  #define SELF_VIDEO_SECTION_WIDTH 120
  #define SELF_VIDEO_SECTION_HEIGHT 90
  #define SELF_VIDEO_SECTION_MARGIN 2
@@@ -88,8 -87,9 +88,8 @@@
  
  /* The avatar's default width and height are set to the same value because we
     want a square icon. */
 -#define REMOTE_CONTACT_AVATAR_DEFAULT_WIDTH EMPATHY_VIDEO_WIDGET_DEFAULT_HEIGHT
 -#define REMOTE_CONTACT_AVATAR_DEFAULT_HEIGHT \
 -  EMPATHY_VIDEO_WIDGET_DEFAULT_HEIGHT
 +#define REMOTE_CONTACT_AVATAR_DEFAULT_HEIGHT REMOTE_VIDEO_DEFAULT_HEIGHT
 +#define REMOTE_CONTACT_AVATAR_DEFAULT_WIDTH REMOTE_VIDEO_DEFAULT_HEIGHT
  
  #define SMALL_TOOLBAR_SIZE 36
  
@@@ -161,6 -161,7 +161,7 @@@ struct _EmpathyCallWindowPri
    GtkWidget *remote_user_avatar_widget;
    GtkWidget *remote_user_avatar_toolbar;
    GtkWidget *remote_user_name_toolbar;
+   GtkWidget *remote_user_status_toolbar;
    GtkWidget *status_label;
    GtkWidget *hangup_button;
    GtkWidget *audio_call_button;
    ClutterActor *video_box;
    ClutterLayoutManager *video_layout;
  
-   /* A Box layout manager containing a bin for previews
+   /* A bin layout manager containing a bin for previews
     * and the floating toolbar */
-   ClutterActor *overlay_box;
+   ClutterActor *overlay_bin;
    ClutterLayoutManager *overlay_layout;
  
    /* Bin layout for the previews */
    GTimer *timer;
    guint timer_id;
  
 -  GMutex *lock;
 +  GMutex lock;
    gboolean call_started;
    gboolean sending_video;
    CameraState camera_state;
    GSettings *settings;
    EmpathyMicMenu *mic_menu;
    EmpathyCameraMenu *camera_menu;
+   gboolean muted;
  };
  
  #define GET_PRIV(o) (EMPATHY_CALL_WINDOW (o)->priv)
@@@ -323,6 -326,8 +326,8 @@@ static void empathy_call_window_status_
  static gboolean empathy_call_window_bus_message (GstBus *bus,
    GstMessage *message, gpointer user_data);
  
+ static gboolean empathy_call_window_update_timer (gpointer user_data);
  static void
  make_background_transparent (GtkClutterActor *actor)
  {
@@@ -385,7 -390,7 +390,7 @@@ empathy_call_window_show_video_output (
  
    gtk_widget_set_visible (self->priv->remote_user_avatar_widget, !show);
  
-   clutter_actor_raise_top (self->priv->overlay_box);
+   clutter_actor_raise_top (self->priv->overlay_bin);
  }
  
  static void
@@@ -460,6 -465,20 +465,20 @@@ element_volume_to_audio_control (GBindi
    return TRUE;
  }
  
+ static void
+ audio_input_mute_notify_cb (GObject *obj, GParamSpec *spec,
+   EmpathyCallWindow *self)
+ {
+   gboolean muted;
+   g_object_get (obj, "mute", &muted, NULL);
+   self->priv->muted = muted;
+   if (muted && self->priv->transitions)
+     clutter_state_set_state (self->priv->transitions, "fade-in");
+   empathy_call_window_update_timer (self);
+ }
  static void
  create_audio_input (EmpathyCallWindow *self)
  {
    priv->audio_input = empathy_audio_src_new ();
    gst_object_ref_sink (priv->audio_input);
  
+   g_signal_connect (priv->audio_input, "notify::mute",
+     G_CALLBACK (audio_input_mute_notify_cb), self);
    g_object_bind_property (priv->mic_button, "active",
      priv->audio_input, "mute",
      G_BINDING_BIDIRECTIONAL |
        G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE);
  }
  
  static void
@@@ -653,9 -676,9 +676,9 @@@ empathy_call_window_create_preview_rect
        CLUTTER_BIN_ALIGNMENT_CENTER, CLUTTER_BIN_ALIGNMENT_CENTER);
    self->priv->preview_box = box = clutter_box_new (self->priv->preview_layout);
  
-   clutter_box_layout_pack (CLUTTER_BOX_LAYOUT (self->priv->overlay_layout),
-       box, TRUE, TRUE, TRUE,
-       CLUTTER_BOX_ALIGNMENT_CENTER, CLUTTER_BOX_ALIGNMENT_START);
+   clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (self->priv->overlay_layout),
+       box,
+       CLUTTER_BIN_ALIGNMENT_FILL, CLUTTER_BIN_ALIGNMENT_FILL);
  
    self->priv->preview_rectangle1 =
        empathy_call_window_create_preview_rectangle (self,
@@@ -843,51 -866,28 +866,28 @@@ empathy_call_window_move_video_preview 
    g_settings_set_enum (self->priv->settings, "camera-position", pos);
  }
  
- static void
- _clutter_color_from_rgba (ClutterColor *color,
-                           const GdkRGBA *rgba)
- {
-   color->red = (guint8) floor (rgba->red * 255);
-   color->green = (guint8) floor (rgba->green * 255);
-   color->blue = (guint8) floor (rgba->blue * 255);
-   color->alpha = (guint8) floor (rgba->alpha * 255);
- }
  static void
  empathy_call_window_highlight_preview_rectangle (EmpathyCallWindow *self,
      PreviewPosition pos)
  {
    ClutterActor *rectangle;
-   GtkStyleContext *context;
-   GdkRGBA rgba;
-   ClutterColor color, highlight;
+   ClutterColor white = { 0xff, 0xff, 0xff, 0xff};
  
    rectangle = empathy_call_window_get_preview_rectangle (self, pos);
-   context = gtk_widget_get_style_context (GTK_WIDGET (self));
-   gtk_style_context_get_color (context, 0, &rgba);
-   _clutter_color_from_rgba (&color, &rgba);
-   clutter_color_shade (&color, 1.4, &highlight);
  
    empathy_rounded_rectangle_set_border_width (
        EMPATHY_ROUNDED_RECTANGLE (rectangle), 2 * SELF_VIDEO_SECTION_MARGIN);
    empathy_rounded_rectangle_set_border_color (
-       EMPATHY_ROUNDED_RECTANGLE (rectangle), &highlight);
+       EMPATHY_ROUNDED_RECTANGLE (rectangle), &white);
  }
  
  static void
  empathy_call_window_darken_preview_rectangle (EmpathyCallWindow *self,
      ClutterActor *rectangle)
  {
-   GtkStyleContext *context;
-   GdkRGBA rgba;
-   ClutterColor color, darker;
+   ClutterColor white = { 0xff, 0xff, 0xff, 0xff}, darker;
  
-   context = gtk_widget_get_style_context (GTK_WIDGET (self));
-   gtk_style_context_get_background_color (context, 0, &rgba);
-   _clutter_color_from_rgba (&color, &rgba);
-   clutter_color_shade (&color, 0.55, &darker);
+   clutter_color_shade (&white, 0.55, &darker);
  
    empathy_rounded_rectangle_set_border_width (
        EMPATHY_ROUNDED_RECTANGLE (rectangle), 1);
@@@ -1381,9 -1381,11 +1381,11 @@@ empathy_call_window_toolbar_timeout (gp
    EmpathyCallWindow *self = data;
  
    /* We don't want to hide the toolbar if we're not in a call, as
-    * to show the call status all the time. */
+    * to show the call status all the time. Also don't hide if we're muted
+    * to prevent the awkward, talking when muted situation */
    if (self->priv->call_state != CONNECTING &&
-       self->priv->call_state != DISCONNECTED)
+       self->priv->call_state != DISCONNECTED &&
+       !self->priv->muted)
      clutter_state_set_state (self->priv->transitions, "fade-out");
  
    return TRUE;
@@@ -1548,15 -1550,16 +1550,16 @@@ empathy_call_window_init (EmpathyCallWi
    gchar *filename;
    ClutterConstraint *constraint;
    ClutterActor *remote_avatar;
-   GtkStyleContext *context;
    GtkCssProvider *provider;
-   GdkRGBA rgba;
-   ClutterColor bg;
+   ClutterColor black = { 0, 0, 0, 0 };
+   ClutterMargin overlay_margin = { OVERLAY_MARGIN, OVERLAY_MARGIN,
+     OVERLAY_MARGIN, OVERLAY_MARGIN };
  
    priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
      EMPATHY_TYPE_CALL_WINDOW, EmpathyCallWindowPriv);
  
    priv->settings = g_settings_new (EMPATHY_PREFS_CALL_SCHEMA);
+   priv->timer = g_timer_new ();
  
    filename = empathy_file_lookup ("empathy-call-window.ui", "src");
    gui = empathy_builder_get_file (filename,
      "errors_vbox", &priv->errors_vbox,
      "pane", &priv->pane,
      "remote_user_name_toolbar", &priv->remote_user_name_toolbar,
+     "remote_user_status_toolbar", &priv->remote_user_status_toolbar,
      "remote_user_avatar_toolbar", &priv->remote_user_avatar_toolbar,
      "status_label", &priv->status_label,
      "audiocall", &priv->audio_call_button,
    g_signal_connect (priv->camera_monitor, "removed",
        G_CALLBACK (empathy_call_window_camera_removed_cb), self);
  
 -  priv->lock = g_mutex_new ();
 +  g_mutex_init (&priv->lock);
  
    gtk_container_add (GTK_CONTAINER (self), top_vbox);
  
    priv->content_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL,
        CONTENT_HBOX_SPACING);
-   gtk_container_set_border_width (GTK_CONTAINER (priv->content_hbox),
-                                   CONTENT_HBOX_BORDER_WIDTH);
    gtk_box_pack_start (GTK_BOX (priv->pane), priv->content_hbox,
        TRUE, TRUE, 0);
  
    /* main contents remote avatar/video box */
-   priv->video_layout = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
-       CLUTTER_BIN_ALIGNMENT_CENTER);
+   priv->video_layout = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_FILL,
+       CLUTTER_BIN_ALIGNMENT_FILL);
  
    priv->video_box = clutter_box_new (priv->video_layout);
  
    priv->video_container = gtk_clutter_embed_new ();
  
    gtk_widget_set_size_request (priv->video_container,
 -      EMPATHY_VIDEO_WIDGET_DEFAULT_WIDTH, EMPATHY_VIDEO_WIDGET_DEFAULT_HEIGHT);
 +      REMOTE_VIDEO_DEFAULT_WIDTH, REMOTE_VIDEO_DEFAULT_HEIGHT);
  
-   /* Set the background color to that of the rest of the window */
-   context = gtk_widget_get_style_context (priv->content_hbox);
-   gtk_style_context_get_background_color (context,
-       GTK_STATE_FLAG_NORMAL, &rgba);
-   bg.red = CLAMP (rgba.red * 255.0, 0, 255);
-   bg.green = CLAMP (rgba.green * 255.0, 0, 255);
-   bg.blue = CLAMP (rgba.blue * 255.0, 0, 255);
-   bg.alpha = CLAMP (rgba.alpha * 255.0, 0, 255);
+   /* Set the background black */
    clutter_stage_set_color (
        CLUTTER_STAGE (gtk_clutter_embed_get_stage (
            GTK_CLUTTER_EMBED (priv->video_container))),
-       &bg);
+       &black);
  
    clutter_container_add (
        CLUTTER_CONTAINER (gtk_clutter_embed_get_stage (
    priv->remote_user_avatar_widget = gtk_image_new ();
    remote_avatar = gtk_clutter_actor_new_with_contents (
        priv->remote_user_avatar_widget);
+   make_background_transparent (GTK_CLUTTER_ACTOR (remote_avatar));
  
    clutter_container_add_actor (CLUTTER_CONTAINER (priv->video_box),
        remote_avatar);
  
-   /* create the overlay box */
-   priv->overlay_layout = clutter_box_layout_new ();
-   clutter_box_layout_set_vertical (
-       CLUTTER_BOX_LAYOUT (priv->overlay_layout), TRUE);
-   priv->overlay_box = clutter_box_new (priv->overlay_layout);
+   /* create the overlay bin */
+   priv->overlay_layout = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
+     CLUTTER_BIN_ALIGNMENT_CENTER);
+   priv->overlay_bin = clutter_actor_new ();
+   clutter_actor_set_layout_manager (priv->overlay_bin, priv->overlay_layout);
+   clutter_actor_set_margin (priv->overlay_bin, &overlay_margin);
  
    clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (priv->video_layout),
-       priv->overlay_box,
+       priv->overlay_bin,
        CLUTTER_BIN_ALIGNMENT_FILL, CLUTTER_BIN_ALIGNMENT_FILL);
  
    empathy_call_window_create_preview_rectangles (self);
    gtk_widget_reparent (priv->bottom_toolbar,
        gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (priv->floating_toolbar)));
  
-   clutter_box_layout_pack (CLUTTER_BOX_LAYOUT (priv->overlay_layout),
-       priv->floating_toolbar, FALSE, FALSE, FALSE,
-       CLUTTER_BOX_ALIGNMENT_CENTER, CLUTTER_BOX_ALIGNMENT_END);
+   clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (priv->overlay_layout),
+       priv->floating_toolbar,
+       CLUTTER_BIN_ALIGNMENT_CENTER, CLUTTER_BIN_ALIGNMENT_END);
  
    clutter_actor_set_opacity (priv->floating_toolbar, FLOATING_TOOLBAR_OPACITY);
  
    g_signal_connect (self, "motion-notify-event",
        G_CALLBACK (empathy_call_window_motion_notify_cb), self);
  
-   priv->timer = g_timer_new ();
    g_object_ref (priv->ui_manager);
    g_object_unref (gui);
  
@@@ -1873,12 -1869,20 +1869,20 @@@ set_remote_user_name (EmpathyCallWindo
  {
    const gchar *alias = empathy_contact_get_alias (contact);
    const gchar *status = empathy_contact_get_status (contact);
-   gchar *label;
  
-   label = g_strdup_printf ("%s\n<small>%s</small>", alias, status);
-   gtk_label_set_markup (GTK_LABEL (self->priv->remote_user_name_toolbar),
-       label);
-   g_free (label);
+   gtk_label_set_text (GTK_LABEL (self->priv->remote_user_name_toolbar), alias);
+   if (status != NULL) {
+     gchar *markup;
+     markup = g_markup_printf_escaped ("<small>%s</small>", status);
+     gtk_label_set_markup (GTK_LABEL (self->priv->remote_user_status_toolbar),
+       markup);
+     g_free (markup);
+   } else {
+     gtk_label_set_markup (GTK_LABEL (self->priv->remote_user_status_toolbar),
+       "");
+   }
  }
  
  static void
@@@ -2369,7 -2373,7 +2373,7 @@@ empathy_call_window_finalize (GObject *
    disconnect_video_output_motion_handler (self);
  
    /* free any data held directly by the object here */
 -  g_mutex_free (priv->lock);
 +  g_mutex_clear (&priv->lock);
  
    g_timer_destroy (priv->timer);
  
@@@ -2542,7 -2546,7 +2546,7 @@@ empathy_call_window_disconnected (Empat
  
    if (could_reset_pipeline)
      {
 -      g_mutex_lock (priv->lock);
 +      g_mutex_lock (&priv->lock);
  
        g_timer_stop (priv->timer);
  
          g_source_remove (priv->timer_id);
        priv->timer_id = 0;
  
 -      g_mutex_unlock (priv->lock);
 +      g_mutex_unlock (&priv->lock);
  
        if (!restart)
          /* We are about to destroy the window, no need to update it or create
@@@ -3200,12 -3204,12 +3204,12 @@@ empathy_call_window_state_changed_cb (E
  
    g_object_unref (call);
  
 -  g_mutex_lock (priv->lock);
 +  g_mutex_lock (&priv->lock);
  
    priv->timer_id = g_timeout_add_seconds (1,
      empathy_call_window_update_timer, self);
  
 -  g_mutex_unlock (priv->lock);
 +  g_mutex_unlock (&priv->lock);
  
    empathy_call_window_update_timer (self);
  
@@@ -3221,7 -3225,7 +3225,7 @@@ empathy_call_window_show_video_output_c
      {
        gtk_widget_hide (self->priv->remote_user_avatar_widget);
        clutter_actor_show (self->priv->video_output);
-       clutter_actor_raise_top (self->priv->overlay_box);
+       clutter_actor_raise_top (self->priv->overlay_bin);
      }
  
    return FALSE;
@@@ -3279,7 -3283,7 +3283,7 @@@ empathy_call_window_src_added_cb (Empat
  
    GstPad *pad;
  
 -  g_mutex_lock (priv->lock);
 +  g_mutex_lock (&priv->lock);
  
    g_object_get (content, "media-type", &media_type, NULL);
  
      }
  
  
 -  g_mutex_unlock (priv->lock);
 +  g_mutex_unlock (&priv->lock);
  
    return TRUE;
  }
@@@ -3830,8 -3834,6 +3834,6 @@@ show_borders (EmpathyCallWindow *window
  {
    EmpathyCallWindowPriv *priv = GET_PRIV (window);
  
-   gtk_container_set_border_width (GTK_CONTAINER (priv->content_hbox),
-       set_fullscreen ? 0 : CONTENT_HBOX_BORDER_WIDTH);
    gtk_box_set_spacing (GTK_BOX (priv->content_hbox),
        set_fullscreen ? 0 : CONTENT_HBOX_SPACING);