]> git.0d.be Git - empathy.git/blobdiff - src/empathy-call-window.c
Merge branch 'gnome-3-4'
[empathy.git] / src / empathy-call-window.c
index 39ae6f3978c927e927a8631abf1816d00f04361b..d9641fdf95e8a7aa062116039976b66a7ebf7a69 100644 (file)
 #include <telepathy-farstream/telepathy-farstream.h>
 #include <telepathy-glib/util.h>
 
-#include <gst/farsight/fs-element-added-notifier.h>
-#include <gst/farsight/fs-utils.h>
+#include <farstream/fs-element-added-notifier.h>
+#include <farstream/fs-utils.h>
 
 #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>
 
@@ -53,6 +52,7 @@
 #include <libempathy-gtk/empathy-sound-manager.h>
 #include <libempathy-gtk/empathy-geometry.h>
 #include <libempathy-gtk/empathy-images.h>
+#include <libempathy-gtk/empathy-call-utils.h>
 
 #define DEBUG_FLAG EMPATHY_DEBUG_VOIP
 #include <libempathy/empathy-debug.h>
@@ -60,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 10
+#define SELF_VIDEO_SECTION_MARGIN 2
+#define SELF_VIDEO_SECTION_BORDER SELF_VIDEO_SECTION_MARGIN*2
 
 #define FLOATING_TOOLBAR_OPACITY 192
-#define FLOATING_TOOLBAR_WIDTH 280
-#define FLOATING_TOOLBAR_HEIGHT 36
 #define FLOATING_TOOLBAR_SPACING 20
 
 /* 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
 
@@ -99,6 +99,9 @@
 /* The time interval in milliseconds between 2 outgoing rings */
 #define MS_BETWEEN_RING 500
 
+/* The roundedness of preview box and placeholders */
+#define PREVIEW_ROUND_FACTOR 16
+
 G_DEFINE_TYPE(EmpathyCallWindow, empathy_call_window, GTK_TYPE_WINDOW)
 
 enum {
@@ -152,21 +155,19 @@ struct _EmpathyCallWindowPriv
   ClutterActor *preview_rectangle2;
   ClutterActor *preview_rectangle3;
   ClutterActor *preview_rectangle4;
-  ClutterActor *preview_rectangle_box1;
-  ClutterActor *preview_rectangle_box2;
-  ClutterActor *preview_rectangle_box3;
-  ClutterActor *preview_rectangle_box4;
   ClutterActor *preview_spinner_actor;
   GtkWidget *preview_spinner_widget;
   GtkWidget *video_container;
   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;
   GtkWidget *video_call_button;
   GtkWidget *mic_button;
+  GtkWidget *volume_button;
   GtkWidget *camera_button;
   GtkWidget *dialpad_button;
   GtkWidget *toolbar;
@@ -178,11 +179,19 @@ struct _EmpathyCallWindowPriv
 
   ClutterState *transitions;
 
-  /* The box that contains self and remote avatar and video
-     input/output. When we redial, we destroy and re-create the box */
+  /* The main box covering all the stage, contaning remote avatar/video */
   ClutterActor *video_box;
   ClutterLayoutManager *video_layout;
 
+  /* A bin layout manager containing a bin for previews
+   * and the floating toolbar */
+  ClutterActor *overlay_bin;
+  ClutterLayoutManager *overlay_layout;
+
+  /* Bin layout for the previews */
+  ClutterActor *preview_box;
+  ClutterLayoutManager *preview_layout;
+
   /* Coordinates of the preview drag event's start. */
   PreviewPosition preview_pos;
 
@@ -193,19 +202,13 @@ struct _EmpathyCallWindowPriv
   /* These are used to accept or reject an incoming call when the status
      is RINGING. */
   GtkWidget *incoming_call_dialog;
-  TpyCallChannel *pending_channel;
+  TpCallChannel *pending_channel;
   TpChannelDispatchOperation *pending_cdo;
   TpAddDispatchOperationContext *pending_context;
 
   gulong video_output_motion_handler_id;
   guint bus_message_source_id;
 
-  gdouble volume;
-
-  /* String that contains the queued tones to send after the current ones
-     are sent */
-  GString *tones;
-  gboolean sending_tones;
   GtkWidget *dtmf_panel;
 
   /* Details vbox */
@@ -229,6 +232,7 @@ struct _EmpathyCallWindowPriv
   GstElement *video_output_sink;
   GstElement *audio_input;
   GstElement *audio_output;
+  gboolean audio_output_added;
   GstElement *pipeline;
   GstElement *video_tee;
 
@@ -239,7 +243,7 @@ struct _EmpathyCallWindowPriv
   GTimer *timer;
   guint timer_id;
 
-  GMutex *lock;
+  GMutex lock;
   gboolean call_started;
   gboolean sending_video;
   CameraState camera_state;
@@ -271,6 +275,8 @@ struct _EmpathyCallWindowPriv
   GSettings *settings;
   EmpathyMicMenu *mic_menu;
   EmpathyCameraMenu *camera_menu;
+
+  gboolean muted;
 };
 
 #define GET_PRIV(o) (EMPATHY_CALL_WINDOW (o)->priv)
@@ -287,9 +293,6 @@ static gboolean empathy_call_window_state_event_cb (GtkWidget *widget,
 static void empathy_call_window_set_send_video (EmpathyCallWindow *window,
   CameraState state);
 
-static void empathy_call_window_mic_toggled_cb (
-  GtkToggleToolButton *toggle, EmpathyCallWindow *window);
-
 static void empathy_call_window_hangup_cb (gpointer object,
   EmpathyCallWindow *window);
 
@@ -323,9 +326,17 @@ static void empathy_call_window_status_message (EmpathyCallWindow *window,
 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
-empathy_call_window_volume_changed_cb (GtkScaleButton *button,
-  gdouble value, EmpathyCallWindow *window);
+make_background_transparent (GtkClutterActor *actor)
+{
+  GdkRGBA transparent = { 0., 0., 0., 0. };
+  GtkWidget *widget;
+
+  widget = gtk_clutter_actor_get_widget (actor);
+  gtk_widget_override_background_color (widget, GTK_STATE_FLAG_NORMAL, &transparent);
+}
 
 static void
 empathy_call_window_show_hangup_button (EmpathyCallWindow *self,
@@ -353,105 +364,21 @@ empathy_call_window_video_call_cb (GtkToggleToolButton *button,
   empathy_call_window_restart_call (self);
 }
 
-static void
-empathy_call_window_emit_tones (EmpathyCallWindow *self)
-{
-  TpChannel *channel;
-
-  if (tp_str_empty (self->priv->tones->str))
-    return;
-
-  g_object_get (self->priv->handler, "call-channel", &channel, NULL);
-
-  DEBUG ("Emitting multiple tones: %s", self->priv->tones->str);
-
-  tp_cli_channel_interface_dtmf_call_multiple_tones (channel, -1,
-      self->priv->tones->str,
-      NULL, NULL, NULL, NULL);
-
-  self->priv->sending_tones = TRUE;
-
-  g_string_set_size (self->priv->tones, 0);
-
-  g_object_unref (channel);
-}
-
-static void
-empathy_call_window_maybe_emit_tones (EmpathyCallWindow *self)
-{
-  if (self->priv->sending_tones)
-    return;
-
-  empathy_call_window_emit_tones (self);
-}
-
-static void
-empathy_call_window_tones_stopped_cb (TpChannel *proxy,
-    gboolean arg_cancelled,
-    gpointer user_data,
-    GObject *weak_object)
-{
-  EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
-
-  self->priv->sending_tones = FALSE;
-
-  empathy_call_window_emit_tones (self);
-}
-
 static void
 dtmf_start_tone_cb (EmpathyDialpadWidget *dialpad,
     TpDTMFEvent event,
     EmpathyCallWindow *self)
 {
-  EmpathyCallWindowPriv *priv = GET_PRIV (self);
-
-  g_string_append_c (priv->tones, tp_dtmf_event_to_char (event));
-
-  empathy_call_window_maybe_emit_tones (self);
-}
-
-static void
-empathy_call_window_mic_volume_changed (EmpathyCallWindow *self)
-{
-  EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  gdouble volume;
-
-  volume = g_settings_get_double (priv->settings,
-      EMPATHY_PREFS_CALL_SOUND_VOLUME) / 100.0;
+  TpCallChannel *call;
+  gchar tones[2];
 
-  /* Don't store the volume because of muting */
-  if (volume > 0 || gtk_toggle_tool_button_get_active (
-        GTK_TOGGLE_TOOL_BUTTON (priv->mic_button)))
-    priv->volume = volume;
+  g_object_get (self->priv->handler, "call-channel", &call, NULL);
 
-  /* Ensure that the toggle button is active if the volume is > 0 and inactive
-   * if it's smaller than 0 */
-  if ((volume > 0) != gtk_toggle_tool_button_get_active (
-        GTK_TOGGLE_TOOL_BUTTON (priv->mic_button)))
-    gtk_toggle_tool_button_set_active (
-      GTK_TOGGLE_TOOL_BUTTON (priv->mic_button), volume > 0);
-
-  empathy_audio_src_set_volume (EMPATHY_GST_AUDIO_SRC (priv->audio_input),
-    volume);
-}
+  tones[0] = tp_dtmf_event_to_char (event);
+  tones[1] = '\0';
+  tp_call_channel_send_tones_async (call, tones, NULL, NULL, NULL);
 
-static void
-empathy_call_window_prefs_volume_changed_cb (GSettings *settings,
-    gchar *key,
-    EmpathyCallWindow *self)
-{
-  empathy_call_window_mic_volume_changed (self);
-}
-
-static void
-empathy_call_window_raise_actors (EmpathyCallWindow *self)
-{
-  clutter_actor_raise_top (self->priv->floating_toolbar);
-
-  clutter_actor_raise_top (self->priv->preview_rectangle_box1);
-  clutter_actor_raise_top (self->priv->preview_rectangle_box2);
-  clutter_actor_raise_top (self->priv->preview_rectangle_box3);
-  clutter_actor_raise_top (self->priv->preview_rectangle_box4);
+  g_object_unref (call);
 }
 
 static void
@@ -463,7 +390,7 @@ empathy_call_window_show_video_output (EmpathyCallWindow *self,
 
   gtk_widget_set_visible (self->priv->remote_user_avatar_widget, !show);
 
-  empathy_call_window_raise_actors (self);
+  clutter_actor_raise_top (self->priv->overlay_bin);
 }
 
 static void
@@ -479,8 +406,11 @@ create_video_output_widget (EmpathyCallWindow *self)
   clutter_texture_set_keep_aspect_ratio (CLUTTER_TEXTURE (priv->video_output),
       TRUE);
 
-  priv->video_output_sink = clutter_gst_video_sink_new (
-      CLUTTER_TEXTURE (priv->video_output));
+  priv->video_output_sink = gst_element_factory_make ("cluttersink", NULL);
+  if (priv->video_output_sink == NULL)
+    g_error ("Missing cluttersink");
+  else
+    g_object_set (priv->video_output_sink, "texture", priv->video_output, NULL);
 
   clutter_container_add_actor (CLUTTER_CONTAINER (priv->video_box),
       priv->video_output);
@@ -498,8 +428,55 @@ create_video_input (EmpathyCallWindow *self)
 
   g_assert (priv->video_input == NULL);
   priv->video_input = empathy_video_src_new ();
-  gst_object_ref (priv->video_input);
-  gst_object_sink (priv->video_input);
+  gst_object_ref_sink (priv->video_input);
+}
+
+static gboolean
+audio_control_volume_to_element (GBinding *binding,
+  const GValue *source_value,
+  GValue *target_value,
+  gpointer user_data)
+{
+  /* AudioControl volume is 0-255, with -1 for unknown */
+  gint hv;
+
+  hv = g_value_get_int (source_value);
+  if (hv < 0)
+    return FALSE;
+
+  hv = MIN (hv, 255);
+  g_value_set_double (target_value, hv/255.0);
+
+  return TRUE;
+}
+
+static gboolean
+element_volume_to_audio_control (GBinding *binding,
+  const GValue *source_value,
+  GValue *target_value,
+  gpointer user_data)
+{
+  gdouble ev;
+
+  ev = g_value_get_double (source_value);
+  ev = CLAMP (ev, 0.0, 1.0);
+
+  g_value_set_int (target_value, ev * 255);
+  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
@@ -509,8 +486,16 @@ create_audio_input (EmpathyCallWindow *self)
 
   g_assert (priv->audio_input == NULL);
   priv->audio_input = empathy_audio_src_new ();
-  gst_object_ref (priv->audio_input);
-  gst_object_sink (priv->audio_input);
+  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
@@ -666,48 +651,17 @@ empathy_call_window_preview_hidden_button_clicked_cb (GtkButton *button,
 
 static ClutterActor *
 empathy_call_window_create_preview_rectangle (EmpathyCallWindow *self,
-    ClutterActor **box,
     ClutterBinAlignment x,
     ClutterBinAlignment y)
 {
-  ClutterLayoutManager *layout1, *layout2;
   ClutterActor *rectangle;
-  ClutterActor *box1, *box2;
-
-  layout1 = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
-      CLUTTER_BIN_ALIGNMENT_START);
-
-  box1 = clutter_box_new (layout1);
-
-  *box = box1;
 
-  rectangle = empathy_rounded_rectangle_new (
-      SELF_VIDEO_SECTION_WIDTH + 5,
-      SELF_VIDEO_SECTION_HEIGHT + 5);
-
-  clutter_actor_set_size (box1,
-      SELF_VIDEO_SECTION_WIDTH + 2 * SELF_VIDEO_SECTION_MARGIN,
-      SELF_VIDEO_SECTION_HEIGHT + 2 * SELF_VIDEO_SECTION_MARGIN +
-      FLOATING_TOOLBAR_HEIGHT + FLOATING_TOOLBAR_SPACING);
-
-  layout2 = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
-      CLUTTER_BIN_ALIGNMENT_CENTER);
-
-  /* We have a box with the margins and the video in the middle inside
-   * a bigger box with an extra bottom margin so we're not on top of
-   * the floating toolbar. */
-  box2 = clutter_box_new (layout2);
-
-  clutter_actor_set_size (box2,
-      SELF_VIDEO_SECTION_WIDTH + 2 * SELF_VIDEO_SECTION_MARGIN,
-      SELF_VIDEO_SECTION_HEIGHT + 2 * SELF_VIDEO_SECTION_MARGIN);
-
-  clutter_container_add_actor (CLUTTER_CONTAINER (box1), box2);
-  clutter_container_add_actor (CLUTTER_CONTAINER (box2), rectangle);
-
-  clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (self->priv->video_layout),
-      box1, x, y);
+  rectangle = CLUTTER_ACTOR (empathy_rounded_rectangle_new (
+      SELF_VIDEO_SECTION_WIDTH, SELF_VIDEO_SECTION_HEIGHT,
+      PREVIEW_ROUND_FACTOR));
 
+  clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (self->priv->preview_layout),
+      rectangle, x, y);
   clutter_actor_hide (rectangle);
 
   return rectangle;
@@ -716,21 +670,27 @@ empathy_call_window_create_preview_rectangle (EmpathyCallWindow *self,
 static void
 empathy_call_window_create_preview_rectangles (EmpathyCallWindow *self)
 {
+  ClutterActor *box;
+
+  self->priv->preview_layout = clutter_bin_layout_new (
+      CLUTTER_BIN_ALIGNMENT_CENTER, CLUTTER_BIN_ALIGNMENT_CENTER);
+  self->priv->preview_box = box = clutter_box_new (self->priv->preview_layout);
+
+  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,
-          &self->priv->preview_rectangle_box1,
           CLUTTER_BIN_ALIGNMENT_START, CLUTTER_BIN_ALIGNMENT_START);
   self->priv->preview_rectangle2 =
       empathy_call_window_create_preview_rectangle (self,
-          &self->priv->preview_rectangle_box2,
           CLUTTER_BIN_ALIGNMENT_START, CLUTTER_BIN_ALIGNMENT_END);
   self->priv->preview_rectangle3 =
       empathy_call_window_create_preview_rectangle (self,
-          &self->priv->preview_rectangle_box3,
           CLUTTER_BIN_ALIGNMENT_END, CLUTTER_BIN_ALIGNMENT_START);
   self->priv->preview_rectangle4 =
       empathy_call_window_create_preview_rectangle (self,
-          &self->priv->preview_rectangle_box4,
           CLUTTER_BIN_ALIGNMENT_END, CLUTTER_BIN_ALIGNMENT_END);
 }
 
@@ -753,10 +713,10 @@ empathy_call_window_get_preview_coordinates (EmpathyCallWindow *self,
   guint ret_x = 0, ret_y = 0;
   ClutterGeometry box;
 
-  if (!clutter_actor_has_allocation (self->priv->video_box))
+  if (!clutter_actor_has_allocation (self->priv->preview_box))
     goto out;
 
-  clutter_actor_get_geometry (self->priv->video_box, &box);
+  clutter_actor_get_geometry (self->priv->preview_box, &box);
 
   switch (pos)
     {
@@ -771,15 +731,13 @@ empathy_call_window_get_preview_coordinates (EmpathyCallWindow *self,
       case PREVIEW_POS_BOTTOM_LEFT:
         ret_x = SELF_VIDEO_SECTION_MARGIN;
         ret_y = box.height - SELF_VIDEO_SECTION_MARGIN
-            - SELF_VIDEO_SECTION_HEIGHT
-            - FLOATING_TOOLBAR_HEIGHT - FLOATING_TOOLBAR_SPACING;
+            - SELF_VIDEO_SECTION_HEIGHT;
         break;
       case PREVIEW_POS_BOTTOM_RIGHT:
         ret_x = box.width - SELF_VIDEO_SECTION_MARGIN
             - SELF_VIDEO_SECTION_WIDTH;
         ret_y = box.height - SELF_VIDEO_SECTION_MARGIN
-            - SELF_VIDEO_SECTION_HEIGHT - FLOATING_TOOLBAR_HEIGHT
-            - FLOATING_TOOLBAR_SPACING;
+            - SELF_VIDEO_SECTION_HEIGHT;
         break;
       default:
         g_warn_if_reached ();
@@ -801,10 +759,10 @@ empathy_call_window_get_preview_position (EmpathyCallWindow *self,
   ClutterGeometry box;
   PreviewPosition pos = PREVIEW_POS_NONE;
 
-  if (!clutter_actor_has_allocation (self->priv->video_box))
+  if (!clutter_actor_has_allocation (self->priv->preview_box))
     return pos;
 
-  clutter_actor_get_geometry (self->priv->video_box, &box);
+  clutter_actor_get_geometry (self->priv->preview_box, &box);
 
   if (0 + SELF_VIDEO_SECTION_MARGIN <= event_x &&
       event_x <= (0 + SELF_VIDEO_SECTION_MARGIN + (gint) SELF_VIDEO_SECTION_WIDTH) &&
@@ -822,15 +780,15 @@ empathy_call_window_get_preview_position (EmpathyCallWindow *self,
     }
   else if (0 + SELF_VIDEO_SECTION_MARGIN <= event_x &&
       event_x <= (0 + SELF_VIDEO_SECTION_MARGIN + (gint) SELF_VIDEO_SECTION_WIDTH) &&
-      box.height - SELF_VIDEO_SECTION_MARGIN - FLOATING_TOOLBAR_HEIGHT - FLOATING_TOOLBAR_SPACING >= event_y &&
-      event_y >= (box.height - SELF_VIDEO_SECTION_MARGIN - FLOATING_TOOLBAR_HEIGHT - FLOATING_TOOLBAR_SPACING - (gint) SELF_VIDEO_SECTION_HEIGHT))
+      box.height - SELF_VIDEO_SECTION_MARGIN >= event_y &&
+      event_y >= (box.height - SELF_VIDEO_SECTION_MARGIN - (gint) SELF_VIDEO_SECTION_HEIGHT))
     {
       pos = PREVIEW_POS_BOTTOM_LEFT;
     }
   else if (box.width - SELF_VIDEO_SECTION_MARGIN >= event_x &&
       event_x >= (box.width - SELF_VIDEO_SECTION_MARGIN - (gint) SELF_VIDEO_SECTION_WIDTH) &&
-      box.height - SELF_VIDEO_SECTION_MARGIN - SELF_VIDEO_SECTION_MARGIN - FLOATING_TOOLBAR_HEIGHT - FLOATING_TOOLBAR_SPACING >= event_y &&
-      event_y >= (box.height - SELF_VIDEO_SECTION_MARGIN - FLOATING_TOOLBAR_HEIGHT - FLOATING_TOOLBAR_SPACING - (gint) SELF_VIDEO_SECTION_HEIGHT))
+      box.height - 2 * SELF_VIDEO_SECTION_MARGIN >= event_y &&
+      event_y >= (box.height - SELF_VIDEO_SECTION_MARGIN - (gint) SELF_VIDEO_SECTION_HEIGHT))
     {
       pos = PREVIEW_POS_BOTTOM_RIGHT;
     }
@@ -869,7 +827,7 @@ static void
 empathy_call_window_move_video_preview (EmpathyCallWindow *self,
     PreviewPosition pos)
 {
-  ClutterBinLayout *layout = CLUTTER_BIN_LAYOUT (self->priv->video_layout);
+  ClutterBinLayout *layout = CLUTTER_BIN_LAYOUT (self->priv->preview_layout);
 
   DEBUG ("moving the video preview to %d", pos);
 
@@ -913,23 +871,28 @@ empathy_call_window_highlight_preview_rectangle (EmpathyCallWindow *self,
     PreviewPosition pos)
 {
   ClutterActor *rectangle;
+  ClutterColor white = { 0xff, 0xff, 0xff, 0xff};
 
   rectangle = empathy_call_window_get_preview_rectangle (self, pos);
 
   empathy_rounded_rectangle_set_border_width (
-      EMPATHY_ROUNDED_RECTANGLE (rectangle), 5);
+      EMPATHY_ROUNDED_RECTANGLE (rectangle), 2 * SELF_VIDEO_SECTION_MARGIN);
   empathy_rounded_rectangle_set_border_color (
-      EMPATHY_ROUNDED_RECTANGLE (rectangle), CLUTTER_COLOR_Red);
+      EMPATHY_ROUNDED_RECTANGLE (rectangle), &white);
 }
 
 static void
 empathy_call_window_darken_preview_rectangle (EmpathyCallWindow *self,
     ClutterActor *rectangle)
 {
+  ClutterColor white = { 0xff, 0xff, 0xff, 0xff}, darker;
+
+  clutter_color_shade (&white, 0.55, &darker);
+
   empathy_rounded_rectangle_set_border_width (
       EMPATHY_ROUNDED_RECTANGLE (rectangle), 1);
   empathy_rounded_rectangle_set_border_color (
-      EMPATHY_ROUNDED_RECTANGLE (rectangle), CLUTTER_COLOR_Black);
+      EMPATHY_ROUNDED_RECTANGLE (rectangle), &darker);
 }
 
 static void
@@ -1098,14 +1061,12 @@ static void
 create_video_preview (EmpathyCallWindow *self)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  ClutterLayoutManager *layout, *layout_center, *layout_end;
+  ClutterLayoutManager *layout;
   ClutterActor *preview;
-  ClutterActor *box;
   ClutterActor *b;
   ClutterAction *action;
   GtkWidget *button;
   PreviewPosition pos;
-  GdkRGBA transparent = { 0., 0., 0., 0. };
 
   g_assert (priv->video_preview == NULL);
 
@@ -1114,29 +1075,27 @@ create_video_preview (EmpathyCallWindow *self)
   preview = empathy_rounded_texture_new ();
   clutter_actor_set_size (preview,
       SELF_VIDEO_SECTION_WIDTH, SELF_VIDEO_SECTION_HEIGHT);
-  priv->video_preview_sink = clutter_gst_video_sink_new (
-      CLUTTER_TEXTURE (preview));
+
+  priv->video_preview_sink = gst_element_factory_make ("cluttersink", NULL);
+  if (priv->video_preview_sink == NULL)
+      g_error ("Missing cluttersink, check your clutter-gst installation");
+  g_object_set (priv->video_preview_sink, "texture", preview, NULL);
+  g_object_add_weak_pointer (G_OBJECT (priv->video_preview_sink), (gpointer) &priv->video_preview_sink);
 
   /* Add a little offset to the video preview */
   layout = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
-      CLUTTER_BIN_ALIGNMENT_START);
+      CLUTTER_BIN_ALIGNMENT_CENTER);
   priv->video_preview = clutter_box_new (layout);
   clutter_actor_set_size (priv->video_preview,
       SELF_VIDEO_SECTION_WIDTH + 2 * SELF_VIDEO_SECTION_MARGIN,
-      SELF_VIDEO_SECTION_HEIGHT + 2 * SELF_VIDEO_SECTION_MARGIN +
-      FLOATING_TOOLBAR_HEIGHT + FLOATING_TOOLBAR_SPACING);
+      SELF_VIDEO_SECTION_HEIGHT + 2 * SELF_VIDEO_SECTION_MARGIN);
 
   /* Spinner for when changing the camera device */
   priv->preview_spinner_widget = gtk_spinner_new ();
-  priv->preview_spinner_actor = empathy_rounded_actor_new ();
-  empathy_rounded_actor_set_round_factor (
-      EMPATHY_ROUNDED_ACTOR (priv->preview_spinner_actor), 16);
+  priv->preview_spinner_actor = empathy_rounded_actor_new (PREVIEW_ROUND_FACTOR);
 
   g_object_set (priv->preview_spinner_widget, "expand", TRUE, NULL);
-  gtk_widget_override_background_color (
-      gtk_clutter_actor_get_widget (
-          GTK_CLUTTER_ACTOR (priv->preview_spinner_actor)),
-      GTK_STATE_FLAG_NORMAL, &transparent);
+  make_background_transparent (GTK_CLUTTER_ACTOR (priv->preview_spinner_actor));
   gtk_widget_show (priv->preview_spinner_widget);
 
   gtk_container_add (
@@ -1148,20 +1107,10 @@ create_video_preview (EmpathyCallWindow *self)
   clutter_actor_set_opacity (priv->preview_spinner_actor, 128);
   clutter_actor_hide (priv->preview_spinner_actor);
 
-  /* We have a box with the margins and the video in the middle inside
-   * a bigger box with an extra bottom margin so we're not on top of
-   * the floating toolbar. */
-  layout_center = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
-      CLUTTER_BIN_ALIGNMENT_CENTER);
-  box = clutter_box_new (layout_center);
-  clutter_actor_set_size (box,
-      SELF_VIDEO_SECTION_WIDTH + 2 * SELF_VIDEO_SECTION_MARGIN,
-      SELF_VIDEO_SECTION_HEIGHT + 2 * SELF_VIDEO_SECTION_MARGIN);
-
-  clutter_container_add_actor (CLUTTER_CONTAINER (box), preview);
-  clutter_container_add_actor (CLUTTER_CONTAINER (box),
+  clutter_container_add_actor (CLUTTER_CONTAINER (priv->video_preview),
+      preview);
+  clutter_container_add_actor (CLUTTER_CONTAINER (priv->video_preview),
       priv->preview_spinner_actor);
-  clutter_container_add_actor (CLUTTER_CONTAINER (priv->video_preview), box);
 
   g_object_set (priv->video_preview_sink,
       "sync", FALSE,
@@ -1171,21 +1120,14 @@ create_video_preview (EmpathyCallWindow *self)
   /* Translators: this is an "Info" label. It should be as short
    * as possible. */
   button = gtk_button_new_with_label (_("i"));
-  priv->preview_shown_button = b = empathy_rounded_actor_new ();
-  gtk_container_add (
-      GTK_CONTAINER (gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (b))),
-      button);
+  priv->preview_shown_button = b = gtk_clutter_actor_new_with_contents (button);
   clutter_actor_set_size (b, 24, 24);
+  clutter_actor_set_margin_right (b, 4);
+  clutter_actor_set_margin_bottom (b, 2);
+  make_background_transparent (GTK_CLUTTER_ACTOR (b));
 
-  layout_end = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_END,
-      CLUTTER_BIN_ALIGNMENT_END);
-  box = clutter_box_new (layout_end);
-  clutter_actor_set_size (box,
-      SELF_VIDEO_SECTION_WIDTH,
-      SELF_VIDEO_SECTION_HEIGHT + SELF_VIDEO_SECTION_MARGIN);
-
-  clutter_container_add_actor (CLUTTER_CONTAINER (box), b);
-  clutter_container_add_actor (CLUTTER_CONTAINER (priv->video_preview), box);
+  clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (layout), b,
+      CLUTTER_BIN_ALIGNMENT_END, CLUTTER_BIN_ALIGNMENT_END);
 
   g_signal_connect (button, "clicked",
       G_CALLBACK (empathy_call_window_preview_button_clicked_cb),
@@ -1194,14 +1136,11 @@ create_video_preview (EmpathyCallWindow *self)
   /* Translators: this is an "Info" label. It should be as short
    * as possible. */
   button = gtk_button_new_with_label (_("i"));
-  b = empathy_rounded_actor_new ();
-  gtk_container_add (
-      GTK_CONTAINER (gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (b))),
-      button);
+  priv->preview_hidden_button = b = gtk_clutter_actor_new_with_contents (button);
   clutter_actor_set_size (b, 24, 24);
-  priv->preview_hidden_button = b;
+  make_background_transparent (GTK_CLUTTER_ACTOR (b));
 
-  clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (priv->video_layout),
+  clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (priv->preview_layout),
       priv->preview_hidden_button,
       CLUTTER_BIN_ALIGNMENT_START,
       CLUTTER_BIN_ALIGNMENT_END);
@@ -1214,7 +1153,7 @@ create_video_preview (EmpathyCallWindow *self)
       G_CALLBACK (empathy_call_window_preview_hidden_button_clicked_cb),
       self);
 
-  clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (priv->video_layout),
+  clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (priv->preview_layout),
       priv->video_preview,
       CLUTTER_BIN_ALIGNMENT_START,
       CLUTTER_BIN_ALIGNMENT_END);
@@ -1392,8 +1331,7 @@ create_pipeline (EmpathyCallWindow *self)
   priv->pipeline_playing = FALSE;
 
   priv->video_tee = gst_element_factory_make ("tee", NULL);
-  gst_object_ref (priv->video_tee);
-  gst_object_sink (priv->video_tee);
+  gst_object_ref_sink (priv->video_tee);
 
   gst_bin_add (GST_BIN (priv->pipeline), priv->video_tee);
 
@@ -1420,7 +1358,7 @@ static void
 empathy_call_window_contents_cb (GtkAction *action,
     EmpathyCallWindow *self)
 {
-  empathy_url_show (GTK_WIDGET (self), "ghelp:empathy?audio-video");
+  empathy_url_show (GTK_WIDGET (self), "help:empathy/audio-video");
 }
 
 static void
@@ -1443,9 +1381,11 @@ empathy_call_window_toolbar_timeout (gpointer data)
   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;
@@ -1502,20 +1442,6 @@ empathy_call_window_destroyed_cb (GtkWidget *object,
     }
 }
 
-static void
-empathy_call_window_stage_allocation_changed_cb (ClutterActor *stage,
-    GParamSpec *pspec,
-    ClutterBindConstraint *constraint)
-{
-  ClutterActorBox allocation;
-
-  clutter_actor_get_allocation_box (stage, &allocation);
-
-  clutter_bind_constraint_set_offset (constraint,
-      allocation.y2 - allocation.y1 -
-      FLOATING_TOOLBAR_SPACING - FLOATING_TOOLBAR_HEIGHT);
-}
-
 static void
 empathy_call_window_incoming_call_response_cb (GtkDialog *dialog,
     gint response_id,
@@ -1551,7 +1477,7 @@ empathy_call_window_set_state_ringing (EmpathyCallWindow *self)
 
   g_assert (self->priv->call_state != CONNECTED);
 
-  video = tpy_call_channel_has_initial_video (self->priv->pending_channel);
+  video = tp_call_channel_has_initial_video (self->priv->pending_channel, NULL);
 
   empathy_call_window_status_message (self, _("Incoming call"));
   self->priv->call_state = RINGING;
@@ -1595,7 +1521,7 @@ empathy_call_window_cdo_invalidated_cb (TpProxy *channel,
 
 void
 empathy_call_window_start_ringing (EmpathyCallWindow *self,
-    TpyCallChannel *channel,
+    TpCallChannel *channel,
     TpChannelDispatchOperation *dispatch_operation,
     TpAddDispatchOperationContext *context)
 {
@@ -1624,14 +1550,16 @@ empathy_call_window_init (EmpathyCallWindow *self)
   gchar *filename;
   ClutterConstraint *constraint;
   ClutterActor *remote_avatar;
-  GtkStyleContext *context;
-  GdkRGBA rgba;
-  ClutterColor bg;
+  GtkCssProvider *provider;
+  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,
@@ -1639,11 +1567,13 @@ empathy_call_window_init (EmpathyCallWindow *self)
     "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,
     "videocall", &priv->video_call_button,
     "microphone", &priv->mic_button,
+    "volume", &priv->volume_button,
     "camera", &priv->camera_button,
     "hangup", &priv->hangup_button,
     "dialpad", &priv->dialpad_button,
@@ -1672,8 +1602,6 @@ empathy_call_window_init (EmpathyCallWindow *self)
     "hangup", "clicked", empathy_call_window_hangup_cb,
     "audiocall", "clicked", empathy_call_window_audio_call_cb,
     "videocall", "clicked", empathy_call_window_video_call_cb,
-    "volume", "value-changed", empathy_call_window_volume_changed_cb,
-    "microphone", "toggled", empathy_call_window_mic_toggled_cb,
     "camera", "toggled", empathy_call_window_camera_toggled_cb,
     "dialpad", "toggled", empathy_call_window_dialpad_cb,
     "menufullscreen", "activate", empathy_call_window_fullscreen_cb,
@@ -1687,6 +1615,17 @@ empathy_call_window_init (EmpathyCallWindow *self)
     "menupreviewswap", "activate", empathy_call_window_swap_camera_cb,
     NULL);
 
+  /* FIXME: we should use a stock "OSD" style class for the toolbar,
+   * once it's available in GTK+/Adwaita.
+   */
+  provider = gtk_css_provider_new ();
+  gtk_css_provider_load_from_data (provider,
+      "#CallFloatingToolbar { border-radius: 6px; }", -1, NULL);
+  gtk_style_context_add_provider (
+      gtk_widget_get_style_context (priv->bottom_toolbar),
+      GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+  g_object_unref (provider);
+
   gtk_action_set_sensitive (priv->menu_fullscreen, FALSE);
 
   priv->camera_monitor = empathy_camera_monitor_dup_singleton ();
@@ -1700,36 +1639,31 @@ empathy_call_window_init (EmpathyCallWindow *self)
   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_hbox_new (FALSE, CONTENT_HBOX_SPACING);
-  gtk_container_set_border_width (GTK_CONTAINER (priv->content_hbox),
-                                  CONTENT_HBOX_BORDER_WIDTH);
+  priv->content_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL,
+      CONTENT_HBOX_SPACING);
   gtk_box_pack_start (GTK_BOX (priv->pane), priv->content_hbox,
       TRUE, TRUE, 0);
 
-  /* avatar/video box */
-  priv->video_layout = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
-      CLUTTER_BIN_ALIGNMENT_CENTER);
+  /* main contents remote avatar/video box */
+  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 ();
 
-  /* 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);
+  gtk_widget_set_size_request (priv->video_container,
+      REMOTE_VIDEO_DEFAULT_WIDTH, REMOTE_VIDEO_DEFAULT_HEIGHT);
+
+  /* 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 (
@@ -1745,10 +1679,23 @@ empathy_call_window_init (EmpathyCallWindow *self)
   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 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_bin,
+      CLUTTER_BIN_ALIGNMENT_FILL, CLUTTER_BIN_ALIGNMENT_FILL);
+
   empathy_call_window_create_preview_rectangles (self);
 
   gtk_box_pack_start (GTK_BOX (priv->content_hbox),
@@ -1760,32 +1707,19 @@ empathy_call_window_init (EmpathyCallWindow *self)
   create_audio_input (self);
   create_video_input (self);
 
-  priv->floating_toolbar = empathy_rounded_actor_new ();
+  priv->floating_toolbar = gtk_clutter_actor_new ();
+  clutter_actor_set_reactive (priv->floating_toolbar, TRUE);
+  make_background_transparent (GTK_CLUTTER_ACTOR (priv->floating_toolbar));
 
   gtk_widget_reparent (priv->bottom_toolbar,
       gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (priv->floating_toolbar)));
 
-  constraint = clutter_bind_constraint_new (
-      gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (priv->video_container)),
-      CLUTTER_BIND_Y, 0);
-
-  clutter_actor_add_constraint (priv->floating_toolbar, constraint);
-
-  g_signal_connect (
-      gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (priv->video_container)),
-      "notify::allocation",
-      G_CALLBACK (empathy_call_window_stage_allocation_changed_cb),
-      constraint);
+  clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (priv->overlay_layout),
+      priv->floating_toolbar,
+      CLUTTER_BIN_ALIGNMENT_CENTER, CLUTTER_BIN_ALIGNMENT_END);
 
-  clutter_actor_set_size (priv->floating_toolbar,
-      FLOATING_TOOLBAR_WIDTH, FLOATING_TOOLBAR_HEIGHT);
   clutter_actor_set_opacity (priv->floating_toolbar, FLOATING_TOOLBAR_OPACITY);
 
-  clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (priv->video_layout),
-      priv->floating_toolbar,
-      CLUTTER_BIN_ALIGNMENT_CENTER,
-      CLUTTER_BIN_ALIGNMENT_END);
-
   clutter_actor_raise_top (priv->floating_toolbar);
 
   /* Transitions for the floating toolbar */
@@ -1816,8 +1750,6 @@ empathy_call_window_init (EmpathyCallWindow *self)
   g_signal_connect (priv->dtmf_panel, "start-tone",
       G_CALLBACK (dtmf_start_tone_cb), self);
 
-  priv->tones = g_string_new ("");
-
   gtk_box_pack_start (GTK_BOX (priv->pane), priv->dtmf_panel,
       FALSE, FALSE, 6);
 
@@ -1859,8 +1791,6 @@ empathy_call_window_init (EmpathyCallWindow *self)
   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);
 
@@ -1870,13 +1800,6 @@ empathy_call_window_init (EmpathyCallWindow *self)
 
   empathy_call_window_show_hangup_button (self, TRUE);
 
-  /* Retrieve initial volume */
-  priv->volume = g_settings_get_double (priv->settings,
-      EMPATHY_PREFS_CALL_SOUND_VOLUME) / 100.0;
-
-  g_signal_connect (priv->settings, "changed::"EMPATHY_PREFS_CALL_SOUND_VOLUME,
-      G_CALLBACK (empathy_call_window_prefs_volume_changed_cb), self);
-
   empathy_geometry_bind (GTK_WINDOW (self), "call-window");
   /* These signals are used to track the window position and save it
    * when the window is destroyed. We need to do this as we don't want
@@ -1946,12 +1869,20 @@ set_remote_user_name (EmpathyCallWindow *self,
 {
   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
@@ -2252,18 +2183,19 @@ empathy_call_window_constructed (GObject *object)
 {
   EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (object);
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  TpyCallChannel *call;
-  TpyCallState state;
+  TpCallChannel *call;
+  TpCallState state;
 
   g_assert (priv->handler != NULL);
 
   g_object_get (priv->handler, "call-channel", &call, NULL);
-  state = tpy_call_channel_get_state (call, NULL, NULL);
-  priv->outgoing = (state == TPY_CALL_STATE_PENDING_INITIATOR);
+  state = tp_call_channel_get_state (call, NULL, NULL, NULL);
+  priv->outgoing = (state == TP_CALL_STATE_PENDING_INITIATOR);
   tp_clear_object (&call);
 
-  g_object_get (priv->handler, "target-contact", &priv->contact, NULL);
+  priv->contact = empathy_call_handler_get_contact (priv->handler);
   g_assert (priv->contact != NULL);
+  g_object_ref (priv->contact);
 
   if (!empathy_contact_can_voip_video (priv->contact))
     {
@@ -2406,6 +2338,7 @@ empathy_call_window_dispose (GObject *object)
   tp_clear_object (&priv->sound_mgr);
   tp_clear_object (&priv->mic_menu);
   tp_clear_object (&priv->camera_menu);
+  tp_clear_object (&priv->transitions);
 
   g_list_free_full (priv->notifiers, g_object_unref);
 
@@ -2413,12 +2346,7 @@ empathy_call_window_dispose (GObject *object)
     g_source_remove (priv->timer_id);
   priv->timer_id = 0;
 
-  if (priv->contact != NULL)
-    {
-      g_signal_handlers_disconnect_by_func (priv->contact,
-          contact_name_changed_cb, self);
-      priv->contact = NULL;
-    }
+  tp_clear_object (&priv->contact);
 
   G_OBJECT_CLASS (empathy_call_window_parent_class)->dispose (object);
 }
@@ -2445,12 +2373,10 @@ empathy_call_window_finalize (GObject *object)
   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);
 
-  g_string_free (priv->tones, TRUE);
-
   G_OBJECT_CLASS (empathy_call_window_parent_class)->finalize (object);
 }
 
@@ -2468,12 +2394,17 @@ empathy_call_window_present (EmpathyCallWindow *self,
 {
   g_return_if_fail (EMPATHY_IS_CALL_HANDLER (handler));
 
-  tp_clear_object (&self->priv->handler);
-  self->priv->handler = g_object_ref (handler);
-  empathy_call_window_connect_handler (self);
-
   empathy_window_present (GTK_WINDOW (self));
-  empathy_call_window_restart_call (self);
+
+  if (self->priv->call_state == DISCONNECTED)
+    {
+      /* start a new call if one is not already in progress */
+      tp_clear_object (&self->priv->handler);
+      self->priv->handler = g_object_ref (handler);
+      empathy_call_window_connect_handler (self);
+
+      empathy_call_window_restart_call (self);
+    }
 }
 
 static void
@@ -2540,6 +2471,7 @@ empathy_call_window_reset_pipeline (EmpathyCallWindow *self)
       if (priv->audio_output != NULL)
         g_object_unref (priv->audio_output);
       priv->audio_output = NULL;
+      priv->audio_output_added = FALSE;
 
       if (priv->video_tee != NULL)
         g_object_unref (priv->video_tee);
@@ -2601,9 +2533,6 @@ empathy_call_window_disconnected (EmpathyCallWindow *self,
   gtk_action_set_sensitive (priv->menu_fullscreen, FALSE);
   gtk_widget_set_sensitive (priv->dtmf_panel, FALSE);
 
-  priv->sending_tones = FALSE;
-  g_string_set_size (priv->tones, 0);
-
   could_reset_pipeline = empathy_call_window_reset_pipeline (self);
 
   if (priv->call_state == CONNECTING)
@@ -2617,7 +2546,7 @@ empathy_call_window_disconnected (EmpathyCallWindow *self,
 
   if (could_reset_pipeline)
     {
-      g_mutex_lock (priv->lock);
+      g_mutex_lock (&priv->lock);
 
       g_timer_stop (priv->timer);
 
@@ -2625,7 +2554,7 @@ empathy_call_window_disconnected (EmpathyCallWindow *self,
         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
@@ -2691,15 +2620,34 @@ empathy_call_window_channel_closed_cb (EmpathyCallHandler *handler,
 }
 
 static gboolean
-empathy_call_window_sink_removed_cb (EmpathyCallHandler *handler,
-    GstPad *sink,
-    FsMediaType media_type,
+empathy_call_window_content_is_raw (TfContent *content)
+{
+  FsConference *conference;
+  gboolean israw;
+
+  g_object_get (content, "fs-conference", &conference, NULL);
+  g_assert (conference != NULL);
+
+  /* FIXME: Ugly hack, update when moving a packetization property into
+   * farstream */
+  israw = g_str_has_prefix (GST_OBJECT_NAME (conference), "fsrawconf");
+  gst_object_unref (conference);
+
+  return israw;
+}
+
+static gboolean
+empathy_call_window_content_removed_cb (EmpathyCallHandler *handler,
+    TfContent *content,
     EmpathyCallWindow *self)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
+  FsMediaType media_type;
 
   DEBUG ("removing content");
 
+  g_object_get (content, "media-type", &media_type, NULL);
+
   /*
    * This assumes that there is only one video stream per channel...
    */
@@ -2718,7 +2666,6 @@ empathy_call_window_sink_removed_cb (EmpathyCallHandler *handler,
           gst_bin_remove (GST_BIN (priv->pipeline), output);
           gst_bin_remove (GST_BIN (priv->pipeline), priv->funnel);
           priv->funnel = NULL;
-          return TRUE;
         }
     }
   else if (media_type == FS_MEDIA_TYPE_AUDIO)
@@ -2727,13 +2674,18 @@ empathy_call_window_sink_removed_cb (EmpathyCallHandler *handler,
         {
           gst_element_set_state (priv->audio_output, GST_STATE_NULL);
 
-          gst_bin_remove (GST_BIN (priv->pipeline), priv->audio_output);
+          if (priv->audio_output_added)
+            gst_bin_remove (GST_BIN (priv->pipeline), priv->audio_output);
           priv->audio_output = NULL;
-          return TRUE;
+          priv->audio_output_added = FALSE;
         }
     }
+  else
+    {
+      g_assert_not_reached ();
+    }
 
-  return FALSE;
+  return TRUE;
 }
 
 static void
@@ -2847,17 +2799,15 @@ empathy_call_window_get_video_sink_pad (EmpathyCallWindow *self)
 
 /* Called with global lock held */
 static GstPad *
-empathy_call_window_get_audio_sink_pad (EmpathyCallWindow *self)
+empathy_call_window_get_audio_sink_pad (EmpathyCallWindow *self,
+  TfContent *content)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
   GstPad *pad;
   GstPadTemplate *template;
 
-  if (priv->audio_output == NULL)
+  if (!priv->audio_output_added)
     {
-      priv->audio_output = empathy_audio_sink_new ();
-      g_object_ref_sink (priv->audio_output);
-
       if (!gst_bin_add (GST_BIN (priv->pipeline), priv->audio_output))
         {
           g_warning ("Could not add audio sink to pipeline");
@@ -2986,7 +2936,7 @@ display_error (EmpathyCallWindow *self,
   content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (info_bar));
 
   /* hbox containing the image and the messages vbox */
-  hbox = gtk_hbox_new (FALSE, 3);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
   gtk_container_add (GTK_CONTAINER (content_area), hbox);
 
   /* Add image */
@@ -2994,7 +2944,7 @@ display_error (EmpathyCallWindow *self,
   gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
 
   /* vbox containing the main message and the details expander */
-  vbox = gtk_vbox_new (FALSE, 3);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
   gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
 
   /* Add text */
@@ -3038,7 +2988,7 @@ display_error (EmpathyCallWindow *self,
 #if 0
 static gchar *
 media_stream_error_to_txt (EmpathyCallWindow *self,
-    TpyCallChannel *call,
+    TpCallChannel *call,
     gboolean audio,
     TpMediaStreamError error)
 {
@@ -3110,7 +3060,7 @@ media_stream_error_to_txt (EmpathyCallWindow *self,
 
 static void
 empathy_call_window_stream_error (EmpathyCallWindow *self,
-    TpyCallChannel *call,
+    TpCallChannel *call,
     gboolean audio,
     guint code,
     const gchar *msg,
@@ -3134,7 +3084,7 @@ empathy_call_window_stream_error (EmpathyCallWindow *self,
 }
 
 static void
-empathy_call_window_audio_stream_error (TpyCallChannel *call,
+empathy_call_window_audio_stream_error (TpCallChannel *call,
     guint code,
     const gchar *msg,
     EmpathyCallWindow *self)
@@ -3144,7 +3094,7 @@ empathy_call_window_audio_stream_error (TpyCallChannel *call,
 }
 
 static void
-empathy_call_window_video_stream_error (TpyCallChannel *call,
+empathy_call_window_video_stream_error (TpCallChannel *call,
     guint code,
     const gchar *msg,
     EmpathyCallWindow *self)
@@ -3203,22 +3153,24 @@ show_balance_error (EmpathyCallWindow *self)
 
 static void
 empathy_call_window_state_changed_cb (EmpathyCallHandler *handler,
-    TpyCallState state,
+    TpCallState state,
     gchar *reason,
     EmpathyCallWindow *self)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  TpyCallChannel *call;
+  TpCallChannel *call;
   gboolean can_send_video;
 
-  if (state == TPY_CALL_STATE_ENDED &&
-      !tp_strdiff (reason, TP_ERROR_STR_INSUFFICIENT_BALANCE))
+  if (state == TP_CALL_STATE_ENDED)
     {
-      show_balance_error (self);
+      DEBUG ("Call ended: %s", (reason != NULL && reason[0] != '\0') ? reason : "unspecified reason");
+      empathy_call_window_disconnected (self, TRUE);
+      if (!tp_strdiff (reason, TP_ERROR_STR_INSUFFICIENT_BALANCE))
+          show_balance_error (self);
       return;
     }
 
-  if (state != TPY_CALL_STATE_ACCEPTED)
+  if (state != TP_CALL_STATE_ACCEPTED)
     return;
 
   if (priv->call_state == CONNECTED)
@@ -3235,7 +3187,7 @@ empathy_call_window_state_changed_cb (EmpathyCallHandler *handler,
 
   g_object_get (priv->handler, "call-channel", &call, NULL);
 
-  if (tpy_call_channel_has_dtmf (call))
+  if (tp_call_channel_has_dtmf (call))
     gtk_widget_set_sensitive (priv->dtmf_panel, TRUE);
 
   if (priv->video_input == NULL)
@@ -3252,12 +3204,12 @@ empathy_call_window_state_changed_cb (EmpathyCallHandler *handler,
 
   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);
 
@@ -3273,7 +3225,7 @@ empathy_call_window_show_video_output_cb (gpointer user_data)
     {
       gtk_widget_hide (self->priv->remote_user_avatar_widget);
       clutter_actor_show (self->priv->video_output);
-      empathy_call_window_raise_actors (self);
+      clutter_actor_raise_top (self->priv->overlay_bin);
     }
 
   return FALSE;
@@ -3322,20 +3274,23 @@ empathy_call_window_video_probe_cb (GstPad *pad,
 /* Called from the streaming thread */
 static gboolean
 empathy_call_window_src_added_cb (EmpathyCallHandler *handler,
-  GstPad *src, guint media_type, gpointer user_data)
+  TfContent *content, GstPad *src, gpointer user_data)
 {
   EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
   gboolean retval = FALSE;
+  guint media_type;
 
   GstPad *pad;
 
-  g_mutex_lock (priv->lock);
+  g_mutex_lock (&priv->lock);
+
+  g_object_get (content, "media-type", &media_type, NULL);
 
   switch (media_type)
     {
       case TP_MEDIA_STREAM_TYPE_AUDIO:
-        pad = empathy_call_window_get_audio_sink_pad (self);
+        pad = empathy_call_window_get_audio_sink_pad (self, content);
         break;
       case TP_MEDIA_STREAM_TYPE_VIDEO:
         g_idle_add (empathy_call_window_show_video_output_cb, self);
@@ -3345,7 +3300,7 @@ empathy_call_window_src_added_cb (EmpathyCallHandler *handler,
             G_CALLBACK (empathy_call_window_video_probe_cb), self);
         if (priv->got_video_src > 0)
           g_source_remove (priv->got_video_src);
-        priv->got_video_src = g_timeout_add_seconds (5,
+        priv->got_video_src = g_timeout_add_seconds (1,
             empathy_call_window_check_video_cb, self);
         break;
       default:
@@ -3395,23 +3350,93 @@ empathy_call_window_src_added_cb (EmpathyCallHandler *handler,
     }
 
 
-  g_mutex_unlock (priv->lock);
+  g_mutex_unlock (&priv->lock);
 
   return TRUE;
 }
 
+static void
+empathy_call_window_prepare_audio_output (EmpathyCallWindow *self,
+  TfContent *content)
+{
+  EmpathyCallWindowPriv *priv = self->priv;
+
+  g_assert (priv->audio_output_added == FALSE);
+  g_assert (priv->audio_output == FALSE);
+
+  priv->audio_output = empathy_audio_sink_new ();
+  g_object_ref_sink (priv->audio_output);
+
+  /* volume button to output volume linking */
+  g_object_bind_property (priv->audio_output, "volume",
+    priv->volume_button, "value",
+    G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+
+  g_object_bind_property_full (content, "requested-output-volume",
+    priv->audio_output, "volume",
+    G_BINDING_DEFAULT,
+    audio_control_volume_to_element,
+    element_volume_to_audio_control,
+    NULL, NULL);
+
+  /* Link volumes together, sync the current audio input volume property
+    * back to farstream first */
+  g_object_bind_property_full (priv->audio_output, "volume",
+    content, "reported-output-volume",
+    G_BINDING_SYNC_CREATE,
+    element_volume_to_audio_control,
+    audio_control_volume_to_element,
+    NULL, NULL);
+
+  /* For raw audio conferences assume that the producer of the raw data
+   * has already processed it, so turn off any echo cancellation and any
+   * other audio improvements that come with it */
+  empathy_audio_sink_set_echo_cancel (
+    EMPATHY_GST_AUDIO_SINK (priv->audio_output),
+    !empathy_call_window_content_is_raw (content));
+}
+
+
 static gboolean
-empathy_call_window_sink_added_cb (EmpathyCallHandler *handler,
-  GstPad *sink, FsMediaType media_type, gpointer user_data)
+empathy_call_window_content_added_cb (EmpathyCallHandler *handler,
+  TfContent *content, gpointer user_data)
 {
   EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  GstPad *pad;
+  GstPad *sink, *pad;
+  FsMediaType media_type;
   gboolean retval = FALSE;
 
+  g_object_get (content, "media-type", &media_type, "sink-pad", &sink, NULL);
+  g_assert (sink != NULL);
+
   switch (media_type)
     {
       case FS_MEDIA_TYPE_AUDIO:
+
+        /* For raw audio conferences assume that the receiver of the raw data
+         * wants it unprocessed, so turn off any echo cancellation and any
+         * other audio improvements that come with it */
+        empathy_audio_src_set_echo_cancel (
+          EMPATHY_GST_AUDIO_SRC (priv->audio_input),
+          !empathy_call_window_content_is_raw (content));
+
+        /* Link volumes together, sync the current audio input volume property
+         * back to farstream first */
+        g_object_bind_property_full (content, "requested-input-volume",
+          priv->audio_input, "volume",
+          G_BINDING_DEFAULT,
+          audio_control_volume_to_element,
+          element_volume_to_audio_control,
+          NULL, NULL);
+
+        g_object_bind_property_full (priv->audio_input, "volume",
+          content, "reported-input-volume",
+          G_BINDING_SYNC_CREATE,
+          element_volume_to_audio_control,
+          audio_control_volume_to_element,
+          NULL, NULL);
+
         if (!gst_bin_add (GST_BIN (priv->pipeline), priv->audio_input))
           {
             g_warning ("Could not add audio source to pipeline");
@@ -3429,9 +3454,11 @@ empathy_call_window_sink_added_cb (EmpathyCallHandler *handler,
         if (GST_PAD_LINK_FAILED (gst_pad_link (pad, sink)))
           {
             gst_bin_remove (GST_BIN (priv->pipeline), priv->audio_input);
+            gst_object_unref (pad);
             g_warning ("Could not link audio source to farsight");
             break;
           }
+        gst_object_unref (pad);
 
         if (gst_element_set_state (priv->audio_input, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE)
           {
@@ -3441,6 +3468,9 @@ empathy_call_window_sink_added_cb (EmpathyCallHandler *handler,
             break;
           }
 
+        /* Prepare our audio output, not added yet though */
+        empathy_call_window_prepare_audio_output (self, content);
+
         retval = TRUE;
         break;
       case FS_MEDIA_TYPE_VIDEO:
@@ -3461,6 +3491,7 @@ empathy_call_window_sink_added_cb (EmpathyCallHandler *handler,
         g_assert_not_reached ();
     }
 
+  gst_object_unref (sink);
   return retval;
 }
 
@@ -3503,14 +3534,20 @@ start_call (EmpathyCallWindow *self)
 
   if (empathy_call_handler_has_initial_video (priv->handler))
     {
-      TpyCallChannel *call;
-      TpySendingState s;
+      TpCallChannel *call;
+      TpSendingState s;
 
       g_object_get (priv->handler, "call-channel", &call, NULL);
-      s = tpy_call_channel_get_video_state (call);
+      /* If the call channel isn't set yet we're requesting it, if we're
+       * requesting it with initial video it should be PENDING_SEND when we get
+       * it */
+      if (call == NULL)
+        s = TP_SENDING_STATE_PENDING_SEND;
+      else
+        s = empathy_call_channel_get_video_state (call);
 
-      if (s == TPY_SENDING_STATE_PENDING_SEND ||
-          s == TPY_SENDING_STATE_SENDING)
+      if (s == TP_SENDING_STATE_PENDING_SEND ||
+          s == TP_SENDING_STATE_SENDING)
         {
           /* Enable 'send video' buttons and display the preview */
           gtk_toggle_tool_button_set_active (
@@ -3528,7 +3565,8 @@ start_call (EmpathyCallWindow *self)
             }
         }
 
-      g_object_unref (call);
+      if (call != NULL)
+        g_object_unref (call);
     }
 }
 
@@ -3562,7 +3600,8 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
                   start_call (self);
               }
           }
-        if (GST_MESSAGE_SRC (message) == GST_OBJECT (priv->video_preview_sink))
+        if (priv->video_preview_sink != NULL &&
+            GST_MESSAGE_SRC (message) == GST_OBJECT (priv->video_preview_sink))
           {
             gst_message_parse_state_changed (message, NULL, &newstate,
                 &pending);
@@ -3577,14 +3616,15 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
           GError *error = NULL;
           GstElement *gst_error;
           gchar *debug;
+          gchar *name;
 
           gst_message_parse_error (message, &error, &debug);
           gst_error = GST_ELEMENT (GST_MESSAGE_SRC (message));
 
           g_message ("Element error: %s -- %s\n", error->message, debug);
 
-          if (g_str_has_prefix (gst_element_get_name (gst_error),
-                VIDEO_INPUT_ERROR_PREFIX))
+          name = gst_element_get_name (gst_error);
+          if (g_str_has_prefix (name, VIDEO_INPUT_ERROR_PREFIX))
             {
               /* Remove the video input and continue */
               if (priv->video_input != NULL)
@@ -3595,6 +3635,7 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
             {
               empathy_call_window_disconnected (self, TRUE);
             }
+          g_free (name);
           g_error_free (error);
           g_free (debug);
         }
@@ -3625,8 +3666,10 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
 }
 
 static void
-empathy_call_window_members_changed_cb (TpyCallChannel *call,
-    GHashTable *members,
+empathy_call_window_members_changed_cb (TpCallChannel *call,
+    GHashTable *updates,
+    GPtrArray *removed,
+    TpCallStateReason *reason,
     EmpathyCallWindow *self)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
@@ -3634,10 +3677,10 @@ empathy_call_window_members_changed_cb (TpyCallChannel *call,
   gpointer key, value;
   gboolean held = FALSE;
 
-  g_hash_table_iter_init (&iter, members);
+  g_hash_table_iter_init (&iter, updates);
   while (g_hash_table_iter_next (&iter, &key, &value))
     {
-      if (GPOINTER_TO_INT (value) & TPY_CALL_MEMBER_FLAG_HELD)
+      if (GPOINTER_TO_INT (value) & TP_CALL_MEMBER_FLAG_HELD)
         {
           /* This assumes this is a 1-1 call, otherwise one participant
            * putting the call on hold wouldn't mean the call is on hold
@@ -3659,7 +3702,7 @@ call_handler_notify_call_cb (EmpathyCallHandler *handler,
     EmpathyCallWindow *self)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  TpyCallChannel *call;
+  TpCallChannel *call;
 
   g_object_get (priv->handler, "call-channel", &call, NULL);
   if (call == NULL)
@@ -3675,10 +3718,6 @@ call_handler_notify_call_cb (EmpathyCallHandler *handler,
   tp_g_signal_connect_object (call, "members-changed",
       G_CALLBACK (empathy_call_window_members_changed_cb), self, 0);
 
-  tp_cli_channel_interface_dtmf_connect_to_stopped_tones (TP_CHANNEL (call),
-      empathy_call_window_tones_stopped_cb, self, NULL,
-      G_OBJECT (call), NULL);
-
   g_object_unref (call);
 }
 
@@ -3686,7 +3725,7 @@ static void
 empathy_call_window_connect_handler (EmpathyCallWindow *self)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  TpyCallChannel *call;
+  TpCallChannel *call;
 
   g_signal_connect (priv->handler, "state-changed",
     G_CALLBACK (empathy_call_window_state_changed_cb), self);
@@ -3698,10 +3737,10 @@ empathy_call_window_connect_handler (EmpathyCallWindow *self)
     G_CALLBACK (empathy_call_window_channel_closed_cb), self);
   g_signal_connect (priv->handler, "src-pad-added",
     G_CALLBACK (empathy_call_window_src_added_cb), self);
-  g_signal_connect (priv->handler, "sink-pad-added",
-    G_CALLBACK (empathy_call_window_sink_added_cb), self);
-  g_signal_connect (priv->handler, "sink-pad-removed",
-    G_CALLBACK (empathy_call_window_sink_removed_cb), self);
+  g_signal_connect (priv->handler, "content-added",
+    G_CALLBACK (empathy_call_window_content_added_cb), self);
+  g_signal_connect (priv->handler, "content-removed",
+    G_CALLBACK (empathy_call_window_content_removed_cb), self);
 
   /* We connect to ::call-channel unconditionally since we'll
    * get new channels if we hangup and redial or if we reuse the
@@ -3795,8 +3834,6 @@ show_borders (EmpathyCallWindow *window, gboolean set_fullscreen)
 {
   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);
 
@@ -3899,7 +3936,7 @@ empathy_call_window_set_send_video (EmpathyCallWindow *window,
   CameraState state)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (window);
-  TpyCallChannel *call;
+  TpCallChannel *call;
 
   priv->sending_video = (state == CAMERA_STATE_ON);
 
@@ -3919,51 +3956,18 @@ empathy_call_window_set_send_video (EmpathyCallWindow *window,
 
   g_object_get (priv->handler, "call-channel", &call, NULL);
   DEBUG ("%s sending video", priv->sending_video ? "start": "stop");
-  tpy_call_channel_send_video (call, priv->sending_video);
+  empathy_call_channel_send_video (call, priv->sending_video);
   g_object_unref (call);
 }
 
-static void
-empathy_call_window_mic_toggled_cb (GtkToggleToolButton *toggle,
-  EmpathyCallWindow *self)
-{
-  EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  gboolean active;
-
-  active = (gtk_toggle_tool_button_get_active (toggle));
-
-  /* We don't want the settings callback to react to this change to avoid
-   * a loop. */
-  g_signal_handlers_block_by_func (priv->settings,
-      empathy_call_window_prefs_volume_changed_cb, self);
-
-  if (active)
-    {
-      g_settings_set_double (priv->settings, EMPATHY_PREFS_CALL_SOUND_VOLUME,
-          priv->volume * 100);
-    }
-  else
-    {
-      /* TODO, Instead of setting the input volume to 0 we should probably
-       * stop sending but this would cause the audio call to drop if both
-       * sides mute at the same time on certain CMs AFAIK. Need to revisit this
-       * in the future. GNOME #574574
-       */
-      g_settings_set_double (priv->settings, EMPATHY_PREFS_CALL_SOUND_VOLUME,
-          0);
-    }
-
-    g_signal_handlers_unblock_by_func (priv->settings,
-      empathy_call_window_prefs_volume_changed_cb, self);
-}
-
 static void
 empathy_call_window_hangup_cb (gpointer object,
     EmpathyCallWindow *self)
 {
+  /* stopping the call will put it the ENDED state and
+   * from state_changed_cb we'll reconfigure the window
+   */
   empathy_call_handler_stop_call (self->priv->handler);
-
-  empathy_call_window_disconnected (self, TRUE);
 }
 
 static void
@@ -3976,12 +3980,6 @@ empathy_call_window_restart_call (EmpathyCallWindow *window)
       (GtkCallback) gtk_widget_destroy, NULL);
 
   create_video_output_widget (window);
-
-  /* While the call was disconnected, the input volume might have changed.
-   * However, since the audio_input source was destroyed, its volume has not
-   * been updated during that time. That's why we manually update it here */
-  empathy_call_window_mic_volume_changed (window);
-
   priv->outgoing = TRUE;
   empathy_call_window_set_state_connecting (window);
 
@@ -4093,19 +4091,6 @@ empathy_call_window_status_message (EmpathyCallWindow *self,
   gtk_label_set_label (GTK_LABEL (self->priv->status_label), message);
 }
 
-static void
-empathy_call_window_volume_changed_cb (GtkScaleButton *button,
-  gdouble value, EmpathyCallWindow *window)
-{
-  EmpathyCallWindowPriv *priv = GET_PRIV (window);
-
-  if (priv->audio_output == NULL)
-    return;
-
-  empathy_audio_sink_set_volume (EMPATHY_GST_AUDIO_SINK (priv->audio_output),
-    value);
-}
-
 GtkUIManager *
 empathy_call_window_get_ui_manager (EmpathyCallWindow *window)
 {
@@ -4127,3 +4112,23 @@ empathy_call_window_get_video_src (EmpathyCallWindow *self)
 {
   return EMPATHY_GST_VIDEO_SRC (self->priv->video_input);
 }
+
+void
+empathy_call_window_change_webcam (EmpathyCallWindow *self,
+    const gchar *device)
+{
+  EmpathyGstVideoSrc *video;
+  gboolean running;
+
+  /* Restart the camera only if it's already running */
+  running = (self->priv->video_preview != NULL);
+  video = empathy_call_window_get_video_src (self);
+
+  if (running)
+    empathy_call_window_play_camera (self, FALSE);
+
+  empathy_video_src_change_device (video, device);
+
+  if (running)
+    empathy_call_window_play_camera (self, TRUE);
+}