diff --git a/configure.ac b/configure.ac
index fef5483..d15e72f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,7 +145,6 @@ AC_SUBST(ERROR_CFLAGS)
 PKG_CHECK_MODULES(EMPATHY,
 [
    dbus-glib-1
-   farsight2-0.10
    folks >= $FOLKS_REQUIRED
    folks-telepathy >= $FOLKS_REQUIRED
    gio-2.0 >= $GLIB_REQUIRED
@@ -158,7 +157,6 @@ PKG_CHECK_MODULES(EMPATHY,
    gstreamer-0.10
    gstreamer-interfaces-0.10
    libxml-2.0
-   telepathy-farsight >= $TELEPATHY_FARSIGHT_REQUIRED
    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
    telepathy-logger-0.1 >= $TELEPATHY_LOGGER
    x11
@@ -168,6 +166,12 @@ PKG_CHECK_MODULES(EMPATHY,
    gcr-3 >= $GCR_REQUIRED
 ])
 
+PKG_CHECK_MODULES(EMPATHY_AV,
+[
+   farsight2-0.10
+   telepathy-farsight >= $TELEPATHY_FARSIGHT_REQUIRED
+])
+
 # -----------------------------------------------------------
 # evolution-data-server (about-me)
 # -----------------------------------------------------------
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 4ab3607..c558738 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -34,7 +34,6 @@
 #include <telepathy-glib/account-manager.h>
 #include <telepathy-glib/util.h>
 
-#include <libempathy/empathy-call-factory.h>
 #include <libempathy/empathy-tp-contact-factory.h>
 #include <libempathy/empathy-contact-list.h>
 #include <libempathy/empathy-contact-groups.h>
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c
index 00d83ce..cff1bf4 100644
--- a/libempathy-gtk/empathy-contact-menu.c
+++ b/libempathy-gtk/empathy-contact-menu.c
@@ -27,7 +27,6 @@
 #include <gtk/gtk.h>
 #include <telepathy-logger/log-manager.h>
 
-#include <libempathy/empathy-call-factory.h>
 #include <libempathy/empathy-contact-manager.h>
 #include <libempathy/empathy-dispatcher.h>
 #include <libempathy/empathy-utils.h>
@@ -248,8 +247,8 @@ empathy_contact_audio_call_menu_item_activated (GtkMenuItem *item,
 	EmpathyContact *contact)
 {
 
-	empathy_call_factory_new_call_with_streams (contact, TRUE, FALSE,
-		gtk_get_current_event_time (), NULL);
+	empathy_call_new_with_streams (contact, TRUE, FALSE,
+		gtk_get_current_event_time ());
 }
 
 GtkWidget *
@@ -279,8 +278,8 @@ static void
 empathy_contact_video_call_menu_item_activated (GtkMenuItem *item,
 	EmpathyContact *contact)
 {
-	empathy_call_factory_new_call_with_streams (contact, TRUE, TRUE,
-		gtk_get_current_event_time (), NULL);
+	empathy_call_new_with_streams (contact, TRUE, TRUE,
+		gtk_get_current_event_time ());
 }
 
 GtkWidget *
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index 76d7081..1dc4633 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -31,7 +31,6 @@
 #include <folks/folks.h>
 #include <folks/folks-telepathy.h>
 
-#include <libempathy/empathy-call-factory.h>
 #include <libempathy/empathy-dispatcher.h>
 #include <libempathy/empathy-individual-manager.h>
 #include <libempathy/empathy-chatroom-manager.h>
@@ -543,8 +542,8 @@ empathy_individual_audio_call_menu_item_activated (GtkMenuItem *item,
 {
   g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
-  empathy_call_factory_new_call_with_streams (contact, TRUE, FALSE,
-      gtk_get_current_event_time (), NULL);
+  empathy_call_new_with_streams (contact, TRUE, FALSE,
+      gtk_get_current_event_time ());
 }
 
 GtkWidget *
@@ -585,8 +584,8 @@ empathy_individual_video_call_menu_item_activated (GtkMenuItem *item,
 {
   g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
-  empathy_call_factory_new_call_with_streams (contact, TRUE, TRUE,
-      gtk_get_current_event_time (), NULL);
+  empathy_call_new_with_streams (contact, TRUE, TRUE,
+      gtk_get_current_event_time ());
 }
 
 GtkWidget *
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index d384d78..f257440 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -38,7 +38,6 @@
 #include <folks/folks.h>
 #include <folks/folks-telepathy.h>
 
-#include <libempathy/empathy-call-factory.h>
 #include <libempathy/empathy-individual-manager.h>
 #include <libempathy/empathy-contact-groups.h>
 #include <libempathy/empathy-dispatcher.h>
diff --git a/libempathy-gtk/empathy-new-call-dialog.c b/libempathy-gtk/empathy-new-call-dialog.c
index ab9a86a..2d35fad 100644
--- a/libempathy-gtk/empathy-new-call-dialog.c
+++ b/libempathy-gtk/empathy-new-call-dialog.c
@@ -30,7 +30,6 @@
 
 #include <libempathy/empathy-tp-contact-factory.h>
 #include <libempathy/empathy-contact-manager.h>
-#include <libempathy/empathy-call-factory.h>
 #include <libempathy/empathy-utils.h>
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am
index 0255156..45c09f0 100644
--- a/libempathy/Makefile.am
+++ b/libempathy/Makefile.am
@@ -28,7 +28,6 @@ noinst_LTLIBRARIES = libempathy.la
 libempathy_headers =				\
 	empathy-account-settings.h		\
 	empathy-auth-factory.h			\
-	empathy-call-factory.h			\
 	empathy-chatroom-manager.h		\
 	empathy-chatroom.h			\
 	empathy-connection-managers.h		\
@@ -53,7 +52,6 @@ libempathy_headers =				\
 	empathy-server-sasl-handler.h		\
 	empathy-server-tls-handler.h		\
 	empathy-status-presets.h		\
-	empathy-streamed-media-handler.h	\
 	empathy-time.h				\
 	empathy-tls-certificate.h		\
 	empathy-tls-verifier.h			\
@@ -70,7 +68,6 @@ libempathy_la_SOURCES =					\
 	$(libempathy_headers)				\
 	empathy-account-settings.c			\
 	empathy-auth-factory.c				\
-	empathy-call-factory.c				\
 	empathy-chatroom-manager.c			\
 	empathy-chatroom.c				\
 	empathy-connection-managers.c			\
@@ -93,7 +90,6 @@ libempathy_la_SOURCES =					\
 	empathy-server-sasl-handler.c			\
 	empathy-server-tls-handler.c			\
 	empathy-status-presets.c			\
-	empathy-streamed-media-handler.c		\
 	empathy-time.c					\
 	empathy-tls-certificate.c			\
 	empathy-tls-verifier.c				\
diff --git a/libempathy/empathy-call-factory.c b/libempathy/empathy-call-factory.c
deleted file mode 100644
index 281434c..0000000
--- a/libempathy/empathy-call-factory.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * empathy-call-factory.c - Source for EmpathyCallFactory
- * Copyright (C) 2008 Collabora Ltd.
- * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <telepathy-glib/account-channel-request.h>
-#include <telepathy-glib/simple-handler.h>
-#include <telepathy-glib/interfaces.h>
-#include <telepathy-glib/util.h>
-
-#include "empathy-dispatcher.h"
-#include "empathy-marshal.h"
-#include "empathy-call-factory.h"
-#include "empathy-utils.h"
-
-#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
-#include <libempathy/empathy-debug.h>
-
-G_DEFINE_TYPE(EmpathyCallFactory, empathy_call_factory, G_TYPE_OBJECT)
-
-static void handle_channels_cb (TpSimpleHandler *handler,
-    TpAccount *account,
-    TpConnection *connection,
-    GList *channels,
-    GList *requests_satisfied,
-    gint64 user_action_time,
-    TpHandleChannelsContext *context,
-    gpointer user_data);
-
-/* signal enum */
-enum
-{
-    NEW_STREAMED_MEDIA_HANDLER,
-    LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = {0};
-
-/* private structure */
-typedef struct {
-  TpBaseClient *handler;
-  gboolean dispose_has_run;
-} EmpathyCallFactoryPriv;
-
-#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyCallFactory)
-
-static GObject *call_factory = NULL;
-
-static void
-empathy_call_factory_init (EmpathyCallFactory *obj)
-{
-  EmpathyCallFactoryPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (obj,
-    EMPATHY_TYPE_CALL_FACTORY, EmpathyCallFactoryPriv);
-  TpDBusDaemon *dbus;
-  GError *error = NULL;
-
-  obj->priv = priv;
-
-  dbus = tp_dbus_daemon_dup (&error);
-  if (dbus == NULL)
-    {
-      g_warning ("Failed to get TpDBusDaemon: %s", error->message);
-      g_error_free (error);
-      return;
-    }
-
-  priv->handler = tp_simple_handler_new (dbus, FALSE, FALSE,
-      "Empathy.AudioVideo", FALSE, handle_channels_cb, obj, NULL);
-
-  tp_base_client_take_handler_filter (priv->handler, tp_asv_new (
-        TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
-          TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
-        TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
-        NULL));
-
-  tp_base_client_take_handler_filter (priv->handler, tp_asv_new (
-        TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
-          TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
-        TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
-        TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO, G_TYPE_BOOLEAN, TRUE,
-        NULL));
-
-  tp_base_client_take_handler_filter (priv->handler, tp_asv_new (
-        TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
-          TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
-        TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
-        TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO, G_TYPE_BOOLEAN, TRUE,
-        NULL));
-
-  tp_base_client_add_handler_capabilities_varargs (priv->handler,
-    "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/ice-udp",
-    "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/gtalk-p2p",
-    "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/h264",
-    NULL);
-
-  g_object_unref (dbus);
-}
-
-static GObject *
-empathy_call_factory_constructor (GType type, guint n_construct_params,
-  GObjectConstructParam *construct_params)
-{
-  g_return_val_if_fail (call_factory == NULL, NULL);
-
-  call_factory = G_OBJECT_CLASS (empathy_call_factory_parent_class)->constructor
-          (type, n_construct_params, construct_params);
-  g_object_add_weak_pointer (call_factory, (gpointer)&call_factory);
-
-  return call_factory;
-}
-
-static void
-empathy_call_factory_finalize (GObject *object)
-{
-  /* free any data held directly by the object here */
-
-  if (G_OBJECT_CLASS (empathy_call_factory_parent_class)->finalize)
-    G_OBJECT_CLASS (empathy_call_factory_parent_class)->finalize (object);
-}
-
-static void
-empathy_call_factory_dispose (GObject *object)
-{
-  EmpathyCallFactoryPriv *priv = GET_PRIV (object);
-
-  if (priv->dispose_has_run)
-    return;
-
-  priv->dispose_has_run = TRUE;
-
-  tp_clear_object (&priv->handler);
-
-  if (G_OBJECT_CLASS (empathy_call_factory_parent_class)->dispose)
-    G_OBJECT_CLASS (empathy_call_factory_parent_class)->dispose (object);
-}
-
-static void
-empathy_call_factory_class_init (
-  EmpathyCallFactoryClass *empathy_call_factory_class)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (empathy_call_factory_class);
-
-  g_type_class_add_private (empathy_call_factory_class,
-    sizeof (EmpathyCallFactoryPriv));
-
-  object_class->constructor = empathy_call_factory_constructor;
-  object_class->dispose = empathy_call_factory_dispose;
-  object_class->finalize = empathy_call_factory_finalize;
-
-  signals[NEW_STREAMED_MEDIA_HANDLER] =
-    g_signal_new ("new-streamed-media-handler",
-      G_TYPE_FROM_CLASS (empathy_call_factory_class),
-      G_SIGNAL_RUN_LAST, 0,
-      NULL, NULL,
-      _empathy_marshal_VOID__OBJECT_BOOLEAN,
-      G_TYPE_NONE,
-      2, EMPATHY_TYPE_STREAMED_MEDIA_HANDLER, G_TYPE_BOOLEAN);
-}
-
-EmpathyCallFactory *
-empathy_call_factory_initialise (void)
-{
-  g_return_val_if_fail (call_factory == NULL, NULL);
-
-  return EMPATHY_CALL_FACTORY (g_object_new (EMPATHY_TYPE_CALL_FACTORY, NULL));
-}
-
-EmpathyCallFactory *
-empathy_call_factory_get (void)
-{
-  g_return_val_if_fail (call_factory != NULL, NULL);
-
-  return EMPATHY_CALL_FACTORY (call_factory);
-}
-
-GHashTable *
-empathy_call_factory_create_request (EmpathyContact *contact,
-    gboolean initial_audio,
-    gboolean initial_video)
-{
-  return tp_asv_new (
-      TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
-        TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
-      TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
-      TP_PROP_CHANNEL_TARGET_HANDLE, G_TYPE_UINT,
-        empathy_contact_get_handle (contact),
-      TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO, G_TYPE_BOOLEAN,
-        initial_audio,
-      TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO, G_TYPE_BOOLEAN,
-        initial_video,
-      NULL);
-}
-
-static void
-create_media_channel_cb (GObject *source,
-    GAsyncResult *result,
-    gpointer user_data)
-{
-  GError *error = NULL;
-
-  if (!tp_account_channel_request_create_channel_finish (
-        TP_ACCOUNT_CHANNEL_REQUEST (source), result, &error))
-    {
-      DEBUG ("Failed to create media channel: %s", error->message);
-      g_error_free (error);
-    }
-}
-
-/**
- * empathy_call_factory_new_call_with_streams:
- * @factory: an #EmpathyCallFactory
- * @contact: an #EmpathyContact
- * @initial_audio: if %TRUE the call will be started with audio
- * @initial_video: if %TRUE the call will be started with video
- *
- * Initiate a new call with @contact.
- */
-void
-empathy_call_factory_new_call_with_streams (EmpathyContact *contact,
-    gboolean initial_audio,
-    gboolean initial_video,
-    gint64 timestamp,
-    gpointer user_data)
-{
-  GHashTable *request;
-  TpAccount *account;
-  TpAccountChannelRequest *req;
-
-  request = empathy_call_factory_create_request (contact, initial_audio,
-      initial_video);
-
-  account = empathy_contact_get_account (contact);
-
-  req = tp_account_channel_request_new (account, request, timestamp);
-
-  tp_account_channel_request_create_channel_async (req, NULL, NULL,
-      create_media_channel_cb, NULL);
-
-  g_hash_table_unref (request);
-  g_object_unref (req);
-}
-
-static void
-create_call_handler (EmpathyCallFactory *factory,
-  EmpathyTpStreamedMedia *call)
-{
-  EmpathyStreamedMediaHandler *handler;
-
-  g_return_if_fail (factory != NULL);
-
-  handler = empathy_streamed_media_handler_new_for_channel (call);
-
-  g_signal_emit (factory, signals[NEW_STREAMED_MEDIA_HANDLER], 0,
-    handler, FALSE);
-
-  g_object_unref (handler);
-}
-
-static void
-call_status_changed_cb (EmpathyTpStreamedMedia *call,
-    GParamSpec *spec,
-    EmpathyCallFactory *self)
-{
-  if (empathy_tp_streamed_media_get_status (call) <= EMPATHY_TP_STREAMED_MEDIA_STATUS_READYING)
-    return;
-
-  create_call_handler (self, call);
-
-  g_signal_handlers_disconnect_by_func (call, call_status_changed_cb, self);
-  g_object_unref (call);
-}
-
-static void
-handle_channels_cb (TpSimpleHandler *handler,
-    TpAccount *account,
-    TpConnection *connection,
-    GList *channels,
-    GList *requests_satisfied,
-    gint64 user_action_time,
-    TpHandleChannelsContext *context,
-    gpointer user_data)
-{
-  EmpathyCallFactory *self = user_data;
-  GList *l;
-
-  for (l = channels; l != NULL; l = g_list_next (l))
-    {
-      TpChannel *channel = l->data;
-      EmpathyTpStreamedMedia *call;
-
-      if (tp_proxy_get_invalidated (channel) != NULL)
-        continue;
-
-      if (tp_channel_get_channel_type_id (channel) !=
-          TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA)
-        continue;
-
-      call = empathy_tp_streamed_media_new (account, channel);
-
-      if (empathy_tp_streamed_media_get_status (call) <= EMPATHY_TP_STREAMED_MEDIA_STATUS_READYING)
-        {
-          /* We have to wait that the TpStreamedMedia is ready as the
-           * call-handler rely on it. */
-          tp_g_signal_connect_object (call, "notify::status",
-              G_CALLBACK (call_status_changed_cb), self, 0);
-          continue;
-        }
-
-      create_call_handler (self, call);
-      g_object_unref (call);
-    }
-
-  tp_handle_channels_context_accept (context);
-}
-
-gboolean
-empathy_call_factory_register (EmpathyCallFactory *self,
-    GError **error)
-{
-  EmpathyCallFactoryPriv *priv = GET_PRIV (self);
-
-  return tp_base_client_register (priv->handler, error);
-}
diff --git a/libempathy/empathy-call-factory.h b/libempathy/empathy-call-factory.h
deleted file mode 100644
index 36c0891..0000000
--- a/libempathy/empathy-call-factory.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * empathy-call-factory.h - Header for EmpathyCallFactory
- * Copyright (C) 2008 Collabora Ltd.
- * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef __EMPATHY_CALL_FACTORY_H__
-#define __EMPATHY_CALL_FACTORY_H__
-
-#include <glib-object.h>
-
-#include <libempathy/empathy-streamed-media-handler.h>
-#include <libempathy/empathy-dispatcher.h>
-
-G_BEGIN_DECLS
-
-typedef struct _EmpathyCallFactory EmpathyCallFactory;
-typedef struct _EmpathyCallFactoryClass EmpathyCallFactoryClass;
-
-struct _EmpathyCallFactoryClass {
-    GObjectClass parent_class;
-};
-
-struct _EmpathyCallFactory {
-    GObject parent;
-    gpointer priv;
-};
-
-GType empathy_call_factory_get_type (void);
-
-/* TYPE MACROS */
-#define EMPATHY_TYPE_CALL_FACTORY \
-  (empathy_call_factory_get_type ())
-#define EMPATHY_CALL_FACTORY(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST((obj), EMPATHY_TYPE_CALL_FACTORY, \
-    EmpathyCallFactory))
-#define EMPATHY_CALL_FACTORY_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST((klass), EMPATHY_TYPE_CALL_FACTORY, \
-    EmpathyCallFactoryClass))
-#define EMPATHY_IS_CALL_FACTORY(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE((obj), EMPATHY_TYPE_CALL_FACTORY))
-#define EMPATHY_IS_CALL_FACTORY_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE((klass), EMPATHY_TYPE_CALL_FACTORY))
-#define EMPATHY_CALL_FACTORY_GET_CLASS(obj) \
-  (G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_CALL_FACTORY, \
-    EmpathyCallFactoryClass))
-
-
-EmpathyCallFactory *empathy_call_factory_initialise (void);
-
-EmpathyCallFactory *empathy_call_factory_get (void);
-
-void empathy_call_factory_new_call_with_streams (EmpathyContact *contact,
-  gboolean initial_audio,
-  gboolean initial_video,
-  gint64 timestamp,
-  gpointer user_data);
-
-gboolean empathy_call_factory_register (EmpathyCallFactory *self,
-    GError **error);
-
-GHashTable * empathy_call_factory_create_request (EmpathyContact *contact,
-    gboolean initial_audio,
-    gboolean initial_video);
-
-G_END_DECLS
-
-#endif /* #ifndef __EMPATHY_CALL_FACTORY_H__*/
diff --git a/libempathy/empathy-streamed-media-handler.c b/libempathy/empathy-streamed-media-handler.c
deleted file mode 100644
index 7fa49cd..0000000
--- a/libempathy/empathy-streamed-media-handler.c
+++ /dev/null
@@ -1,924 +0,0 @@
-/*
- * empathy-call-handler.c - Source for EmpathyStreamedMediaHandler
- * Copyright (C) 2008-2009 Collabora Ltd.
- * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <telepathy-glib/account-channel-request.h>
-#include <telepathy-glib/util.h>
-#include <telepathy-glib/interfaces.h>
-
-#include <telepathy-farsight/channel.h>
-#include <telepathy-farsight/stream.h>
-
-#include "empathy-streamed-media-handler.h"
-#include "empathy-call-factory.h"
-#include "empathy-marshal.h"
-#include "empathy-utils.h"
-
-#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
-#include <libempathy/empathy-debug.h>
-
-G_DEFINE_TYPE(EmpathyStreamedMediaHandler, empathy_streamed_media_handler, G_TYPE_OBJECT)
-
-/* signal enum */
-enum {
-  CONFERENCE_ADDED,
-  SRC_PAD_ADDED,
-  SINK_PAD_ADDED,
-  REQUEST_RESOURCE,
-  CLOSED,
-  STREAM_CLOSED,
-  CANDIDATES_CHANGED,
-  LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = {0};
-
-enum {
-  PROP_TP_STREAMED_MEDIA = 1,
-  PROP_GST_BUS,
-  PROP_CONTACT,
-  PROP_INITIAL_AUDIO,
-  PROP_INITIAL_VIDEO,
-  PROP_SEND_AUDIO_CODEC,
-  PROP_SEND_VIDEO_CODEC,
-  PROP_RECV_AUDIO_CODECS,
-  PROP_RECV_VIDEO_CODECS,
-  PROP_AUDIO_REMOTE_CANDIDATE,
-  PROP_VIDEO_REMOTE_CANDIDATE,
-  PROP_AUDIO_LOCAL_CANDIDATE,
-  PROP_VIDEO_LOCAL_CANDIDATE,
-};
-
-/* private structure */
-
-typedef struct {
-  gboolean dispose_has_run;
-  EmpathyTpStreamedMedia *call;
-  EmpathyContact *contact;
-  TfChannel *tfchannel;
-  gboolean initial_audio;
-  gboolean initial_video;
-
-  FsCodec *send_audio_codec;
-  FsCodec *send_video_codec;
-  GList *recv_audio_codecs;
-  GList *recv_video_codecs;
-  FsCandidate *audio_remote_candidate;
-  FsCandidate *video_remote_candidate;
-  FsCandidate *audio_local_candidate;
-  FsCandidate *video_local_candidate;
-} EmpathyStreamedMediaHandlerPriv;
-
-#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyStreamedMediaHandler)
-
-static void
-empathy_streamed_media_handler_dispose (GObject *object)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (object);
-
-  if (priv->dispose_has_run)
-    return;
-
-  priv->dispose_has_run = TRUE;
-
-  if (priv->contact != NULL)
-    g_object_unref (priv->contact);
-
-  priv->contact = NULL;
-
-  if (priv->tfchannel != NULL)
-    g_object_unref (priv->tfchannel);
-
-  priv->tfchannel = NULL;
-
-  if (priv->call != NULL)
-    {
-      empathy_tp_streamed_media_close (priv->call);
-      g_object_unref (priv->call);
-    }
-
-  priv->call = NULL;
-
-  /* release any references held by the object here */
-  if (G_OBJECT_CLASS (empathy_streamed_media_handler_parent_class)->dispose)
-    G_OBJECT_CLASS (empathy_streamed_media_handler_parent_class)->dispose (object);
-}
-
-static void
-empathy_streamed_media_handler_finalize (GObject *object)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (object);
-
-  fs_codec_destroy (priv->send_audio_codec);
-  fs_codec_destroy (priv->send_video_codec);
-  fs_codec_list_destroy (priv->recv_audio_codecs);
-  fs_codec_list_destroy (priv->recv_video_codecs);
-  fs_candidate_destroy (priv->audio_remote_candidate);
-  fs_candidate_destroy (priv->video_remote_candidate);
-  fs_candidate_destroy (priv->audio_local_candidate);
-  fs_candidate_destroy (priv->video_local_candidate);
-
-  if (G_OBJECT_CLASS (empathy_streamed_media_handler_parent_class)->finalize)
-    G_OBJECT_CLASS (empathy_streamed_media_handler_parent_class)->finalize (object);
-}
-
-static void
-empathy_streamed_media_handler_init (EmpathyStreamedMediaHandler *obj)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (obj,
-    EMPATHY_TYPE_STREAMED_MEDIA_HANDLER, EmpathyStreamedMediaHandlerPriv);
-
-  obj->priv = priv;
-}
-
-static void
-empathy_streamed_media_handler_constructed (GObject *object)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (object);
-
-  if (priv->contact == NULL)
-    {
-      g_object_get (priv->call, "contact", &(priv->contact), NULL);
-    }
-}
-
-static void
-empathy_streamed_media_handler_set_property (GObject *object,
-  guint property_id, const GValue *value, GParamSpec *pspec)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (object);
-
-  switch (property_id)
-    {
-      case PROP_CONTACT:
-        priv->contact = g_value_dup_object (value);
-        break;
-      case PROP_TP_STREAMED_MEDIA:
-        priv->call = g_value_dup_object (value);
-        break;
-      case PROP_INITIAL_AUDIO:
-        priv->initial_audio = g_value_get_boolean (value);
-        break;
-      case PROP_INITIAL_VIDEO:
-        priv->initial_video = g_value_get_boolean (value);
-        break;
-      default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-    }
-}
-
-static void
-empathy_streamed_media_handler_get_property (GObject *object,
-  guint property_id, GValue *value, GParamSpec *pspec)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (object);
-
-  switch (property_id)
-    {
-      case PROP_CONTACT:
-        g_value_set_object (value, priv->contact);
-        break;
-      case PROP_TP_STREAMED_MEDIA:
-        g_value_set_object (value, priv->call);
-        break;
-      case PROP_INITIAL_AUDIO:
-        g_value_set_boolean (value, priv->initial_audio);
-        break;
-      case PROP_INITIAL_VIDEO:
-        g_value_set_boolean (value, priv->initial_video);
-        break;
-      case PROP_SEND_AUDIO_CODEC:
-        g_value_set_boxed (value, priv->send_audio_codec);
-        break;
-      case PROP_SEND_VIDEO_CODEC:
-        g_value_set_boxed (value, priv->send_video_codec);
-        break;
-      case PROP_RECV_AUDIO_CODECS:
-        g_value_set_boxed (value, priv->recv_audio_codecs);
-        break;
-      case PROP_RECV_VIDEO_CODECS:
-        g_value_set_boxed (value, priv->recv_video_codecs);
-        break;
-      case PROP_AUDIO_REMOTE_CANDIDATE:
-        g_value_set_boxed (value, priv->audio_remote_candidate);
-        break;
-      case PROP_VIDEO_REMOTE_CANDIDATE:
-        g_value_set_boxed (value, priv->video_remote_candidate);
-        break;
-      case PROP_AUDIO_LOCAL_CANDIDATE:
-        g_value_set_boxed (value, priv->audio_local_candidate);
-        break;
-      case PROP_VIDEO_LOCAL_CANDIDATE:
-        g_value_set_boxed (value, priv->video_local_candidate);
-        break;
-      default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-    }
-}
-
-
-static void
-empathy_streamed_media_handler_class_init (EmpathyStreamedMediaHandlerClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  GParamSpec *param_spec;
-
-  g_type_class_add_private (klass, sizeof (EmpathyStreamedMediaHandlerPriv));
-
-  object_class->constructed = empathy_streamed_media_handler_constructed;
-  object_class->set_property = empathy_streamed_media_handler_set_property;
-  object_class->get_property = empathy_streamed_media_handler_get_property;
-  object_class->dispose = empathy_streamed_media_handler_dispose;
-  object_class->finalize = empathy_streamed_media_handler_finalize;
-
-  param_spec = g_param_spec_object ("contact",
-    "contact", "The remote contact",
-    EMPATHY_TYPE_CONTACT,
-    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_CONTACT, param_spec);
-
-  param_spec = g_param_spec_object ("tp-call",
-    "tp-call", "The calls channel wrapper",
-    EMPATHY_TYPE_TP_STREAMED_MEDIA,
-    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_TP_STREAMED_MEDIA, param_spec);
-
-  param_spec = g_param_spec_boolean ("initial-audio",
-    "initial-audio", "Whether the call should start with audio",
-    TRUE,
-    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_INITIAL_AUDIO,
-      param_spec);
-
-  param_spec = g_param_spec_boolean ("initial-video",
-    "initial-video", "Whether the call should start with video",
-    FALSE,
-    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_INITIAL_VIDEO,
-    param_spec);
-
-  param_spec = g_param_spec_boxed ("send-audio-codec",
-    "send audio codec", "Codec used to encode the outgoing video stream",
-    FS_TYPE_CODEC,
-    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_SEND_AUDIO_CODEC,
-    param_spec);
-
-  param_spec = g_param_spec_boxed ("send-video-codec",
-    "send video codec", "Codec used to encode the outgoing video stream",
-    FS_TYPE_CODEC,
-    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_SEND_VIDEO_CODEC,
-    param_spec);
-
-  param_spec = g_param_spec_boxed ("recv-audio-codecs",
-    "recvs audio codec", "Codecs used to decode the incoming audio stream",
-    FS_TYPE_CODEC_LIST,
-    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_RECV_AUDIO_CODECS,
-    param_spec);
-
-  param_spec = g_param_spec_boxed ("recv-video-codecs",
-    "recvs video codec", "Codecs used to decode the incoming video stream",
-    FS_TYPE_CODEC_LIST,
-    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_RECV_VIDEO_CODECS,
-    param_spec);
-
-  param_spec = g_param_spec_boxed ("audio-remote-candidate",
-    "audio remote candidate",
-    "Remote candidate used for the audio stream",
-    FS_TYPE_CANDIDATE,
-    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class,
-      PROP_AUDIO_REMOTE_CANDIDATE, param_spec);
-
-  param_spec = g_param_spec_boxed ("video-remote-candidate",
-    "video remote candidate",
-    "Remote candidate used for the video stream",
-    FS_TYPE_CANDIDATE,
-    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class,
-      PROP_VIDEO_REMOTE_CANDIDATE, param_spec);
-
-  param_spec = g_param_spec_boxed ("audio-local-candidate",
-    "audio local candidate",
-    "Local candidate used for the audio stream",
-    FS_TYPE_CANDIDATE,
-    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class,
-      PROP_AUDIO_REMOTE_CANDIDATE, param_spec);
-
-  param_spec = g_param_spec_boxed ("video-local-candidate",
-    "video local candidate",
-    "Local candidate used for the video stream",
-    FS_TYPE_CANDIDATE,
-    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class,
-      PROP_VIDEO_REMOTE_CANDIDATE, param_spec);
-
-  signals[CONFERENCE_ADDED] =
-    g_signal_new ("conference-added", G_TYPE_FROM_CLASS (klass),
-      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
-      g_cclosure_marshal_VOID__OBJECT,
-      G_TYPE_NONE,
-      1, FS_TYPE_CONFERENCE);
-
-  signals[SRC_PAD_ADDED] =
-    g_signal_new ("src-pad-added", G_TYPE_FROM_CLASS (klass),
-      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
-      _empathy_marshal_BOOLEAN__OBJECT_UINT,
-      G_TYPE_BOOLEAN,
-      2, GST_TYPE_PAD, G_TYPE_UINT);
-
-  signals[SINK_PAD_ADDED] =
-    g_signal_new ("sink-pad-added", G_TYPE_FROM_CLASS (klass),
-      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
-      _empathy_marshal_BOOLEAN__OBJECT_UINT,
-      G_TYPE_BOOLEAN,
-      2, GST_TYPE_PAD, G_TYPE_UINT);
-
-  signals[REQUEST_RESOURCE] =
-    g_signal_new ("request-resource", G_TYPE_FROM_CLASS (klass),
-      G_SIGNAL_RUN_LAST, 0,
-      g_signal_accumulator_true_handled, NULL,
-      _empathy_marshal_BOOLEAN__UINT_UINT,
-      G_TYPE_BOOLEAN, 2, G_TYPE_UINT, G_TYPE_UINT);
-
-  signals[CLOSED] =
-    g_signal_new ("closed", G_TYPE_FROM_CLASS (klass),
-      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
-      g_cclosure_marshal_VOID__VOID,
-      G_TYPE_NONE,
-      0);
-
-  signals[STREAM_CLOSED] =
-    g_signal_new ("stream-closed", G_TYPE_FROM_CLASS (klass),
-      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
-      g_cclosure_marshal_VOID__OBJECT,
-      G_TYPE_NONE, 1, TF_TYPE_STREAM);
-
-  signals[CANDIDATES_CHANGED] =
-    g_signal_new ("candidates-changed", G_TYPE_FROM_CLASS (klass),
-      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
-      g_cclosure_marshal_VOID__UINT,
-      G_TYPE_NONE, 1, G_TYPE_UINT);
-}
-
-/**
- * empathy_streamed_media_handler_new_for_contact:
- * @contact: an #EmpathyContact
- *
- * Creates a new #EmpathyStreamedMediaHandler with contact @contact.
- *
- * Return value: a new #EmpathyStreamedMediaHandler
- */
-EmpathyStreamedMediaHandler *
-empathy_streamed_media_handler_new_for_contact (EmpathyContact *contact)
-{
-  return EMPATHY_STREAMED_MEDIA_HANDLER (g_object_new (EMPATHY_TYPE_STREAMED_MEDIA_HANDLER,
-    "contact", contact, NULL));
-}
-
-EmpathyStreamedMediaHandler *
-empathy_streamed_media_handler_new_for_channel (EmpathyTpStreamedMedia *call)
-{
-  return EMPATHY_STREAMED_MEDIA_HANDLER (g_object_new (EMPATHY_TYPE_STREAMED_MEDIA_HANDLER,
-    "tp-call", call,
-    "initial-video", empathy_tp_streamed_media_is_receiving_video (call),
-    NULL));
-}
-
-static void
-update_sending_codec (EmpathyStreamedMediaHandler *self,
-    FsCodec *codec,
-    FsSession *session)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-  FsMediaType type;
-
-  if (codec == NULL || session == NULL)
-    return;
-
-  g_object_get (session, "media-type", &type, NULL);
-
-  if (type == FS_MEDIA_TYPE_AUDIO)
-    {
-      priv->send_audio_codec = fs_codec_copy (codec);
-      g_object_notify (G_OBJECT (self), "send-audio-codec");
-    }
-  else if (type == FS_MEDIA_TYPE_VIDEO)
-    {
-      priv->send_video_codec = fs_codec_copy (codec);
-      g_object_notify (G_OBJECT (self), "send-video-codec");
-    }
-}
-
-static void
-update_receiving_codec (EmpathyStreamedMediaHandler *self,
-    GList *codecs,
-    FsStream *stream)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-  FsSession *session;
-  FsMediaType type;
-
-  if (codecs == NULL || stream == NULL)
-    return;
-
-  g_object_get (stream, "session", &session, NULL);
-  if (session == NULL)
-    return;
-
-  g_object_get (session, "media-type", &type, NULL);
-
-  if (type == FS_MEDIA_TYPE_AUDIO)
-    {
-      priv->recv_audio_codecs = fs_codec_list_copy (codecs);
-      g_object_notify (G_OBJECT (self), "recv-audio-codecs");
-    }
-  else if (type == FS_MEDIA_TYPE_VIDEO)
-    {
-      priv->recv_video_codecs = fs_codec_list_copy (codecs);
-      g_object_notify (G_OBJECT (self), "recv-video-codecs");
-    }
-
-  g_object_unref (session);
-}
-
-static void
-update_candidates (EmpathyStreamedMediaHandler *self,
-    FsCandidate *remote_candidate,
-    FsCandidate *local_candidate,
-    FsStream *stream)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-  FsSession *session;
-  FsMediaType type;
-
-  if (stream == NULL)
-    return;
-
-  g_object_get (stream, "session", &session, NULL);
-  if (session == NULL)
-    return;
-
-  g_object_get (session, "media-type", &type, NULL);
-
-  if (type == FS_MEDIA_TYPE_AUDIO)
-    {
-      if (remote_candidate != NULL)
-        {
-          fs_candidate_destroy (priv->audio_remote_candidate);
-          priv->audio_remote_candidate = fs_candidate_copy (remote_candidate);
-          g_object_notify (G_OBJECT (self), "audio-remote-candidate");
-        }
-
-      if (local_candidate != NULL)
-        {
-          fs_candidate_destroy (priv->audio_local_candidate);
-          priv->audio_local_candidate = fs_candidate_copy (local_candidate);
-          g_object_notify (G_OBJECT (self), "audio-local-candidate");
-        }
-
-      g_signal_emit (G_OBJECT (self), signals[CANDIDATES_CHANGED], 0,
-          FS_MEDIA_TYPE_AUDIO);
-    }
-  else if (type == FS_MEDIA_TYPE_VIDEO)
-    {
-      if (remote_candidate != NULL)
-        {
-          fs_candidate_destroy (priv->video_remote_candidate);
-          priv->video_remote_candidate = fs_candidate_copy (remote_candidate);
-          g_object_notify (G_OBJECT (self), "video-remote-candidate");
-        }
-
-      if (local_candidate != NULL)
-        {
-          fs_candidate_destroy (priv->video_local_candidate);
-          priv->video_local_candidate = fs_candidate_copy (local_candidate);
-          g_object_notify (G_OBJECT (self), "video-local-candidate");
-        }
-
-      g_signal_emit (G_OBJECT (self), signals[CANDIDATES_CHANGED], 0,
-          FS_MEDIA_TYPE_VIDEO);
-    }
-
-  g_object_unref (session);
-}
-
-void
-empathy_streamed_media_handler_bus_message (EmpathyStreamedMediaHandler *handler,
-  GstBus *bus, GstMessage *message)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (handler);
-  const GstStructure *s = gst_message_get_structure (message);
-
-  if (priv->tfchannel == NULL)
-    return;
-
-  if (s != NULL &&
-      gst_structure_has_name (s, "farsight-send-codec-changed"))
-    {
-      const GValue *val;
-      FsCodec *codec;
-      FsSession *session;
-
-      val = gst_structure_get_value (s, "codec");
-      codec = g_value_get_boxed (val);
-
-      val = gst_structure_get_value (s, "session");
-      session = g_value_get_object (val);
-
-      update_sending_codec (handler, codec, session);
-    }
-  else if (s != NULL &&
-      gst_structure_has_name (s, "farsight-recv-codecs-changed"))
-    {
-      const GValue *val;
-      GList *codecs;
-      FsStream *stream;
-
-      val = gst_structure_get_value (s, "codecs");
-      codecs = g_value_get_boxed (val);
-
-      val = gst_structure_get_value (s, "stream");
-      stream = g_value_get_object (val);
-
-      update_receiving_codec (handler, codecs, stream);
-    }
-  else if (s != NULL &&
-      gst_structure_has_name (s, "farsight-new-active-candidate-pair"))
-    {
-      const GValue *val;
-      FsCandidate *remote_candidate, *local_candidate;
-      FsStream *stream;
-
-      val = gst_structure_get_value (s, "remote-candidate");
-      remote_candidate = g_value_get_boxed (val);
-
-      val = gst_structure_get_value (s, "local-candidate");
-      local_candidate = g_value_get_boxed (val);
-
-      val = gst_structure_get_value (s, "stream");
-      stream = g_value_get_object (val);
-
-      update_candidates (handler, remote_candidate, local_candidate, stream);
-    }
-
-  tf_channel_bus_message (priv->tfchannel, message);
-}
-
-static void
-empathy_streamed_media_handler_tf_channel_session_created_cb (TfChannel *tfchannel,
-  FsConference *conference, FsParticipant *participant,
-  EmpathyStreamedMediaHandler *self)
-{
-  g_signal_emit (G_OBJECT (self), signals[CONFERENCE_ADDED], 0,
-    GST_ELEMENT (conference));
-}
-
-static gboolean
-src_pad_added_error_idle (gpointer data)
-{
-  TfStream *stream = data;
-
-  tf_stream_error (stream, TP_MEDIA_STREAM_ERROR_MEDIA_ERROR,
-      "Could not link sink");
-  g_object_unref (stream);
-
-  return FALSE;
-}
-
-static void
-empathy_streamed_media_handler_tf_stream_src_pad_added_cb (TfStream *stream,
-  GstPad *pad, FsCodec *codec, EmpathyStreamedMediaHandler  *handler)
-{
-  guint media_type;
-  gboolean retval;
-
-  g_object_get (stream, "media-type", &media_type, NULL);
-
-  g_signal_emit (G_OBJECT (handler), signals[SRC_PAD_ADDED], 0,
-      pad, media_type, &retval);
-
-  if (!retval)
-    g_idle_add (src_pad_added_error_idle, g_object_ref (stream));
-}
-
-
-static gboolean
-empathy_streamed_media_handler_tf_stream_request_resource_cb (TfStream *stream,
-  guint direction, EmpathyTpStreamedMedia *call)
-{
-  gboolean ret;
-  guint media_type;
-
-  g_object_get (G_OBJECT (stream), "media-type", &media_type, NULL);
-
-  g_signal_emit (G_OBJECT (call),
-    signals[REQUEST_RESOURCE], 0, media_type, direction, &ret);
-
-  return ret;
-}
-
-static void
-empathy_streamed_media_handler_tf_stream_closed_cb (TfStream *stream,
-  EmpathyStreamedMediaHandler *handler)
-{
-  g_signal_emit (handler, signals[STREAM_CLOSED], 0, stream);
-}
-
-static void
-empathy_streamed_media_handler_tf_channel_stream_created_cb (TfChannel *tfchannel,
-  TfStream *stream, EmpathyStreamedMediaHandler *handler)
-{
-  guint media_type;
-  GstPad *spad;
-  gboolean retval;
-  FsStream *fs_stream;
-  GList *codecs;
-  FsSession *session;
-  FsCodec *codec;
-
-  g_signal_connect (stream, "src-pad-added",
-      G_CALLBACK (empathy_streamed_media_handler_tf_stream_src_pad_added_cb), handler);
-  g_signal_connect (stream, "request-resource",
-      G_CALLBACK (empathy_streamed_media_handler_tf_stream_request_resource_cb),
-        handler);
-  g_signal_connect (stream, "closed",
-      G_CALLBACK (empathy_streamed_media_handler_tf_stream_closed_cb), handler);
-
-  g_object_get (stream, "media-type", &media_type,
-    "sink-pad", &spad, NULL);
-
-  g_signal_emit (G_OBJECT (handler), signals[SINK_PAD_ADDED], 0,
-      spad, media_type, &retval);
-
- if (!retval)
-      tf_stream_error (stream, TP_MEDIA_STREAM_ERROR_MEDIA_ERROR,
-          "Could not link source");
-
- /* Get sending codec */
- g_object_get (stream, "farsight-session", &session, NULL);
- g_object_get (session, "current-send-codec", &codec, NULL);
-
- update_sending_codec (handler, codec, session);
-
- tp_clear_object (&session);
- tp_clear_object (&codec);
-
- /* Get receiving codec */
- g_object_get (stream, "farsight-stream", &fs_stream, NULL);
- g_object_get (fs_stream, "current-recv-codecs", &codecs, NULL);
-
- update_receiving_codec (handler, codecs, fs_stream);
-
- fs_codec_list_destroy (codecs);
- tp_clear_object (&fs_stream);
-
- gst_object_unref (spad);
-}
-
-static void
-empathy_streamed_media_handler_tf_channel_closed_cb (TfChannel *tfchannel,
-  EmpathyStreamedMediaHandler *handler)
-{
-  g_signal_emit (G_OBJECT (handler), signals[CLOSED], 0);
-}
-
-static GList *
-empathy_streamed_media_handler_tf_channel_codec_config_cb (TfChannel *channel,
-  guint stream_id, FsMediaType media_type, guint direction, gpointer user_data)
-{
-  gchar *filename = empathy_file_lookup ("codec-preferences", "data");
-  GList *codecs;
-  GError *error = NULL;
-
-  codecs = fs_codec_list_from_keyfile (filename, &error);
-  g_free (filename);
-
-  if (!codecs)
-    {
-      g_warning ("No codec-preferences file: %s",
-          error ? error->message : "No error message");
-    }
-  g_clear_error (&error);
-
-  return codecs;
-}
-
-static void
-empathy_streamed_media_handler_start_tpfs (EmpathyStreamedMediaHandler *self)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-  TpChannel *channel;
-
-  g_object_get (priv->call, "channel", &channel, NULL);
-
-  g_assert (channel != NULL);
-
-  priv->tfchannel = tf_channel_new (channel);
-
-  /* Set up the telepathy farsight channel */
-  g_signal_connect (priv->tfchannel, "session-created",
-      G_CALLBACK (empathy_streamed_media_handler_tf_channel_session_created_cb), self);
-  g_signal_connect (priv->tfchannel, "stream-created",
-      G_CALLBACK (empathy_streamed_media_handler_tf_channel_stream_created_cb), self);
-  g_signal_connect (priv->tfchannel, "closed",
-      G_CALLBACK (empathy_streamed_media_handler_tf_channel_closed_cb), self);
-  g_signal_connect (priv->tfchannel, "stream-get-codec-config",
-      G_CALLBACK (empathy_streamed_media_handler_tf_channel_codec_config_cb), self);
-
-  g_object_unref (channel);
-}
-
-static void
-empathy_streamed_media_handler_request_cb (GObject *source,
-    GAsyncResult *result,
-    gpointer user_data)
-{
-  EmpathyStreamedMediaHandler *self = EMPATHY_STREAMED_MEDIA_HANDLER (user_data);
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-  TpChannel *channel;
-  GError *error = NULL;
-  TpAccountChannelRequest *req = TP_ACCOUNT_CHANNEL_REQUEST (source);
-  TpAccount *account;
-
-  channel = tp_account_channel_request_create_and_handle_channel_finish (req,
-      result, NULL, &error);
-  if (channel == NULL)
-    {
-      DEBUG ("Failed to create the channel: %s", error->message);
-      g_error_free (error);
-      return;
-    }
-
-  account = tp_account_channel_request_get_account (req);
-
-  priv->call = empathy_tp_streamed_media_new (account, channel);
-
-  g_object_notify (G_OBJECT (self), "tp-call");
-
-  empathy_streamed_media_handler_start_tpfs (self);
-
-  g_object_unref (channel);
-}
-
-void
-empathy_streamed_media_handler_start_call (EmpathyStreamedMediaHandler *handler,
-    gint64 timestamp)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (handler);
-  TpAccountChannelRequest *req;
-  TpAccount *account;
-  GHashTable *request;
-
-  if (priv->call != NULL)
-    {
-      empathy_streamed_media_handler_start_tpfs (handler);
-      empathy_tp_streamed_media_accept_incoming_call (priv->call);
-      return;
-    }
-
-  /* No TpStreamedMedia object (we are redialing). Request a new media channel that
-   * will be used to create a new EmpathyTpStreamedMedia. */
-  g_assert (priv->contact != NULL);
-
-  account = empathy_contact_get_account (priv->contact);
-  request = empathy_call_factory_create_request (priv->contact,
-      priv->initial_audio, priv->initial_video);
-
-  req = tp_account_channel_request_new (account, request, timestamp);
-
-  tp_account_channel_request_create_and_handle_channel_async (req, NULL,
-      empathy_streamed_media_handler_request_cb, handler);
-
-  g_object_unref (req);
-  g_hash_table_unref (request);
-}
-
-/**
- * empathy_streamed_media_handler_stop_call:
- * @handler: an #EmpathyStreamedMediaHandler
- *
- * Closes the #EmpathyStreamedMediaHandler's call and frees its resources.
- */
-void
-empathy_streamed_media_handler_stop_call (EmpathyStreamedMediaHandler *handler)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (handler);
-
-  if (priv->call != NULL)
-    {
-      empathy_tp_streamed_media_leave (priv->call);
-      g_object_unref (priv->call);
-    }
-
-  priv->call = NULL;
-}
-
-/**
- * empathy_streamed_media_handler_has_initial_video:
- * @handler: an #EmpathyStreamedMediaHandler
- *
- * Return %TRUE if the call managed by this #EmpathyStreamedMediaHandler was
- * created with video enabled
- *
- * Return value: %TRUE if the call was created as a video conversation.
- */
-gboolean
-empathy_streamed_media_handler_has_initial_video (EmpathyStreamedMediaHandler *handler)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (handler);
-
-  return priv->initial_video;
-}
-
-FsCodec *
-empathy_streamed_media_handler_get_send_audio_codec (EmpathyStreamedMediaHandler *self)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-
-  return priv->send_audio_codec;
-}
-
-FsCodec *
-empathy_streamed_media_handler_get_send_video_codec (EmpathyStreamedMediaHandler *self)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-
-  return priv->send_video_codec;
-}
-
-GList *
-empathy_streamed_media_handler_get_recv_audio_codecs (EmpathyStreamedMediaHandler *self)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-
-  return priv->recv_audio_codecs;
-}
-
-GList *
-empathy_streamed_media_handler_get_recv_video_codecs (EmpathyStreamedMediaHandler *self)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-
-  return priv->recv_video_codecs;
-}
-
-FsCandidate *
-empathy_streamed_media_handler_get_audio_remote_candidate (
-    EmpathyStreamedMediaHandler *self)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-
-  return priv->audio_remote_candidate;
-}
-
-FsCandidate *
-empathy_streamed_media_handler_get_audio_local_candidate (
-    EmpathyStreamedMediaHandler *self)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-
-  return priv->audio_local_candidate;
-}
-
-FsCandidate *
-empathy_streamed_media_handler_get_video_remote_candidate (
-    EmpathyStreamedMediaHandler *self)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-
-  return priv->video_remote_candidate;
-}
-
-FsCandidate *
-empathy_streamed_media_handler_get_video_local_candidate (
-    EmpathyStreamedMediaHandler *self)
-{
-  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
-
-  return priv->video_local_candidate;
-}
diff --git a/libempathy/empathy-streamed-media-handler.h b/libempathy/empathy-streamed-media-handler.h
deleted file mode 100644
index b6d7049..0000000
--- a/libempathy/empathy-streamed-media-handler.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * empathy-call-handler.h - Header for EmpathyStreamedMediaHandler
- * Copyright (C) 2008-2009 Collabora Ltd.
- * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef __EMPATHY_STREAMED_MEDIA_HANDLER_H__
-#define __EMPATHY_STREAMED_MEDIA_HANDLER_H__
-
-#include <glib-object.h>
-
-#include <gst/gst.h>
-#include <gst/farsight/fs-conference-iface.h>
-
-#include <libempathy/empathy-tp-streamed-media.h>
-#include <libempathy/empathy-contact.h>
-
-G_BEGIN_DECLS
-
-typedef struct _EmpathyStreamedMediaHandler EmpathyStreamedMediaHandler;
-typedef struct _EmpathyStreamedMediaHandlerClass EmpathyStreamedMediaHandlerClass;
-
-struct _EmpathyStreamedMediaHandlerClass {
-    GObjectClass parent_class;
-};
-
-struct _EmpathyStreamedMediaHandler {
-    GObject parent;
-    gpointer priv;
-};
-
-GType empathy_streamed_media_handler_get_type (void);
-
-/* TYPE MACROS */
-#define EMPATHY_TYPE_STREAMED_MEDIA_HANDLER \
-  (empathy_streamed_media_handler_get_type ())
-#define EMPATHY_STREAMED_MEDIA_HANDLER(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST((obj), EMPATHY_TYPE_STREAMED_MEDIA_HANDLER, \
-    EmpathyStreamedMediaHandler))
-#define EMPATHY_STREAMED_MEDIA_HANDLER_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST((klass), EMPATHY_TYPE_STREAMED_MEDIA_HANDLER, \
-  EmpathyStreamedMediaHandlerClass))
-#define EMPATHY_IS_STREAMED_MEDIA_HANDLER(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE((obj), EMPATHY_TYPE_STREAMED_MEDIA_HANDLER))
-#define EMPATHY_IS_STREAMED_MEDIA_HANDLER_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE((klass), EMPATHY_TYPE_STREAMED_MEDIA_HANDLER))
-#define EMPATHY_STREAMED_MEDIA_HANDLER_GET_CLASS(obj) \
-  (G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_STREAMED_MEDIA_HANDLER, \
-  EmpathyStreamedMediaHandlerClass))
-
-EmpathyStreamedMediaHandler * empathy_streamed_media_handler_new_for_contact (
-  EmpathyContact *contact);
-
-EmpathyStreamedMediaHandler * empathy_streamed_media_handler_new_for_channel (
-  EmpathyTpStreamedMedia *call);
-
-void empathy_streamed_media_handler_start_call (EmpathyStreamedMediaHandler *handler,
-    gint64 timestamp);
-void empathy_streamed_media_handler_stop_call (EmpathyStreamedMediaHandler *handler);
-
-gboolean empathy_streamed_media_handler_has_initial_video (EmpathyStreamedMediaHandler *handler);
-
-void empathy_streamed_media_handler_bus_message (EmpathyStreamedMediaHandler *handler,
-  GstBus *bus, GstMessage *message);
-
-FsCodec * empathy_streamed_media_handler_get_send_audio_codec (
-    EmpathyStreamedMediaHandler *self);
-
-FsCodec * empathy_streamed_media_handler_get_send_video_codec (
-    EmpathyStreamedMediaHandler *self);
-
-GList * empathy_streamed_media_handler_get_recv_audio_codecs (
-    EmpathyStreamedMediaHandler *self);
-
-GList * empathy_streamed_media_handler_get_recv_video_codecs (
-    EmpathyStreamedMediaHandler *self);
-
-FsCandidate * empathy_streamed_media_handler_get_audio_remote_candidate (
-    EmpathyStreamedMediaHandler *self);
-
-FsCandidate * empathy_streamed_media_handler_get_audio_local_candidate (
-    EmpathyStreamedMediaHandler *self);
-
-FsCandidate * empathy_streamed_media_handler_get_video_remote_candidate (
-    EmpathyStreamedMediaHandler *self);
-
-FsCandidate * empathy_streamed_media_handler_get_video_local_candidate (
-    EmpathyStreamedMediaHandler *self);
-
-G_END_DECLS
-
-#endif /* #ifndef __EMPATHY_STREAMED_MEDIA_HANDLER_H__*/
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index d089c6f..b23071a 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2003-2007 Imendio AB
- * Copyright (C) 2007-2008 Collabora Ltd.
+ * Copyright (C) 2007-2011 Collabora Ltd.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -237,6 +237,66 @@ empathy_xml_node_find_child_prop_value (xmlNodePtr   node,
 	return found;
 }
 
+GHashTable *
+empathy_call_create_streamed_media_request (EmpathyContact *contact,
+					    gboolean initial_audio,
+					    gboolean initial_video)
+{
+	return tp_asv_new (
+		TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
+			TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
+		TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
+			TP_HANDLE_TYPE_CONTACT,
+		TP_PROP_CHANNEL_TARGET_HANDLE, G_TYPE_UINT,
+			empathy_contact_get_handle (contact),
+		TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO, G_TYPE_BOOLEAN,
+			initial_audio,
+		TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO, G_TYPE_BOOLEAN,
+			initial_video,
+		NULL);
+}
+
+static void
+create_media_channel_cb (GObject *source,
+			 GAsyncResult *result,
+			 gpointer user_data)
+{
+	GError *error = NULL;
+
+	if (!tp_account_channel_request_create_channel_finish (TP_ACCOUNT_CHANNEL_REQUEST (source),
+							       result,
+							       &error)) {
+		DEBUG ("Failed to create StreamedMedia channel: %s", error->message);
+		g_error_free (error);
+	}
+}
+
+void
+empathy_call_new_with_streams (EmpathyContact *contact,
+			       gboolean initial_audio,
+			       gboolean initial_video,
+			       gint64 timestamp)
+{
+	GHashTable *request;
+	TpAccount *account;
+	TpAccountChannelRequest *req;
+
+	request = empathy_call_create_streamed_media_request (contact,
+							      initial_audio,
+							      initial_video);
+
+	account = empathy_contact_get_account (contact);
+
+	req = tp_account_channel_request_new (account, request, timestamp);
+
+	tp_account_channel_request_create_channel_async (req, NULL, NULL,
+							 create_media_channel_cb,
+							 NULL);
+
+	g_hash_table_unref (request);
+	g_object_unref (req);
+}
+
 const gchar *
 empathy_presence_get_default_message (TpConnectionPresenceType presence)
 {
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index f0ac666..0f5f968 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -1,7 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * Copyright (C) 2003-2007 Imendio AB
- * Copyright (C) 2007-2008 Collabora Ltd.
+ * Copyright (C) 2007-2011 Collabora Ltd.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -66,6 +66,15 @@ xmlNodePtr   empathy_xml_node_find_child_prop_value (xmlNodePtr       node,
 						    const gchar     *prop_name,
 						    const gchar     *prop_value);
 
+/* Calls */
+void         empathy_call_new_with_streams		(EmpathyContact *contact,
+							 gboolean initial_audio,
+							 gboolean initial_video,
+							 gint64 timestamp);
+GHashTable * empathy_call_create_streamed_media_request (EmpathyContact *contact,
+							 gboolean initial_audio,
+							 gboolean initial_video);
+
 /* Others */
 const gchar * empathy_presence_get_default_message  (TpConnectionPresenceType presence);
 const gchar * empathy_presence_to_str               (TpConnectionPresenceType presence);
diff --git a/src/Makefile.am b/src/Makefile.am
index 72cc541..86aff82 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -80,11 +80,14 @@ bin_PROGRAMS =			\
 	$(NULL)
 
 libexec_PROGRAMS = \
-	empathy-av \
 	empathy-auth-client \
+	empathy-av \
 	empathy-chat
 
-BUILT_SOURCES=
+BUILT_SOURCES = \
+	src-marshal.h \
+	src-marshal.c \
+	src-marshal.list
 
 empathy_accounts_SOURCES =						\
 	empathy-accounts.c empathy-accounts.h				\
@@ -100,16 +103,24 @@ empathy_debugger_SOURCES =						\
 	empathy-debugger.c		 				\
 	$(NULL)
 
-empathy_handwritten_av_source = \
+empathy_av_SOURCES = \
 	empathy-av.c \
-	empathy-streamed-media-window-fullscreen.c empathy-streamed-media-window-fullscreen.h	\
-	empathy-streamed-media-window.c empathy-streamed-media-window.h	\
+	empathy-streamed-media-factory.c \
+	empathy-streamed-media-factory.h \
+	empathy-streamed-media-handler.c \
+	empathy-streamed-media-handler.h \
+	empathy-streamed-media-window-fullscreen.c \
+	empathy-streamed-media-window-fullscreen.h \
+	empathy-streamed-media-window.c \
+	empathy-streamed-media-window.h \
+	ev-sidebar.c \
+	ev-sidebar.h \
 	$(NULL)
 
-empathy_av_SOURCES =						\
-	$(empathy_handwritten_av_source) \
-	ev-sidebar.c ev-sidebar.h \
-	$(NULL)
+nodist_empathy_av_SOURCES = $(BUILT_SOURCES)
+
+empathy_av_CFLAGS = $(EMPATHY_AV_CFLAGS)
+empathy_av_LDFLAGS = $(EMPATHY_AV_LIBS)
 
 empathy_auth_client_SOURCES =						\
 	empathy-auth-client.c \
@@ -205,6 +216,24 @@ dist_man_MANS =			\
 	empathy.1 \
 	empathy-accounts.1
 
+src-marshal.list: $(empathy_SOURCES) Makefile.am
+	$(AM_V_GEN)( cd $(srcdir) && \
+	sed -n -e 's/.*src_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
+	$(wildcard *.c) ) \
+	| sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
+	@if cmp -s $@.tmp $@; then \
+		rm $@.tmp; \
+	else \
+		mv $@.tmp $@; \
+	fi
+
+%-marshal.h: %-marshal.list Makefile
+	$(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
+
+%-marshal.c: %-marshal.list Makefile
+	$(AM_V_GEN)echo "#include \"src-marshal.h\"" > $@ && \
+	$(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
+
 # rules for making the glib enum objects
 %-enumtypes.h: %.h Makefile.in
 	$(AM_V_GEN)glib-mkenums \
diff --git a/src/empathy-av.c b/src/empathy-av.c
index 6aef1fd..37438fe 100644
--- a/src/empathy-av.c
+++ b/src/empathy-av.c
@@ -28,10 +28,10 @@
 
 #include <telepathy-glib/debug-sender.h>
 
-#include <libempathy/empathy-call-factory.h>
 #include <libempathy-gtk/empathy-ui-utils.h>
 
 #include "empathy-streamed-media-window.h"
+#include "empathy-streamed-media-factory.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_VOIP
 #include <libempathy/empathy-debug.h>
@@ -47,17 +47,17 @@ static GtkApplication *app = NULL;
 static gboolean activated = FALSE;
 static gboolean use_timer = TRUE;
 
-static EmpathyCallFactory *call_factory = NULL;
+static EmpathyStreamedMediaFactory *call_factory = NULL;
 
 static void
-new_call_handler_cb (EmpathyCallFactory *factory,
+new_call_handler_cb (EmpathyStreamedMediaFactory *factory,
     EmpathyStreamedMediaHandler *handler,
     gboolean outgoing,
     gpointer user_data)
 {
   EmpathyStreamedMediaWindow *window;
 
-  DEBUG ("Create a new call window");
+  DEBUG ("Create a new StreamedMedia window");
 
   window = empathy_streamed_media_window_new (handler);
 
@@ -86,12 +86,12 @@ activate_cb (GApplication *application)
     }
 
   g_assert (call_factory == NULL);
-  call_factory = empathy_call_factory_initialise ();
+  call_factory = empathy_streamed_media_factory_initialise ();
 
   g_signal_connect (G_OBJECT (call_factory), "new-streamed-media-handler",
       G_CALLBACK (new_call_handler_cb), NULL);
 
-  if (!empathy_call_factory_register (call_factory, &error))
+  if (!empathy_streamed_media_factory_register (call_factory, &error))
     {
       g_critical ("Failed to register Handler: %s", error->message);
       g_error_free (error);
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index ffe8e59..96950c5 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -36,7 +36,6 @@
 #include <libempathy/empathy-tp-streamed-media.h>
 #include <libempathy/empathy-tp-file.h>
 #include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-call-factory.h>
 #include <libempathy/empathy-gsettings.h>
 
 #include <extensions/extensions.h>
diff --git a/src/empathy-streamed-media-factory.c b/src/empathy-streamed-media-factory.c
new file mode 100644
index 0000000..70b2379
--- /dev/null
+++ b/src/empathy-streamed-media-factory.c
@@ -0,0 +1,276 @@
+/*
+ * empathy-streamed-media-factory.c - Source for EmpathyStreamedMediaFactory
+ * Copyright (C) 2008-2011 Collabora Ltd.
+ * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <telepathy-glib/account-channel-request.h>
+#include <telepathy-glib/simple-handler.h>
+#include <telepathy-glib/interfaces.h>
+#include <telepathy-glib/util.h>
+
+#include <libempathy/empathy-utils.h>
+
+#include "empathy-streamed-media-factory.h"
+#include "empathy-streamed-media-handler.h"
+#include "src-marshal.h"
+
+#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
+#include <libempathy/empathy-debug.h>
+
+G_DEFINE_TYPE(EmpathyStreamedMediaFactory, empathy_streamed_media_factory, G_TYPE_OBJECT)
+
+static void handle_channels_cb (TpSimpleHandler *handler,
+    TpAccount *account,
+    TpConnection *connection,
+    GList *channels,
+    GList *requests_satisfied,
+    gint64 user_action_time,
+    TpHandleChannelsContext *context,
+    gpointer user_data);
+
+/* signal enum */
+enum
+{
+    NEW_STREAMED_MEDIA_HANDLER,
+    LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = {0};
+
+/* private structure */
+typedef struct {
+  TpBaseClient *handler;
+  gboolean dispose_has_run;
+} EmpathyStreamedMediaFactoryPriv;
+
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyStreamedMediaFactory)
+
+static GObject *call_factory = NULL;
+
+static void
+empathy_streamed_media_factory_init (EmpathyStreamedMediaFactory *obj)
+{
+  EmpathyStreamedMediaFactoryPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (obj,
+    EMPATHY_TYPE_STREAMED_MEDIA_FACTORY, EmpathyStreamedMediaFactoryPriv);
+  TpDBusDaemon *dbus;
+  GError *error = NULL;
+
+  obj->priv = priv;
+
+  dbus = tp_dbus_daemon_dup (&error);
+  if (dbus == NULL)
+    {
+      g_warning ("Failed to get TpDBusDaemon: %s", error->message);
+      g_error_free (error);
+      return;
+    }
+
+  priv->handler = tp_simple_handler_new (dbus, FALSE, FALSE,
+      "Empathy.AudioVideo", FALSE, handle_channels_cb, obj, NULL);
+
+  tp_base_client_take_handler_filter (priv->handler, tp_asv_new (
+        TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
+          TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
+        TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
+        NULL));
+
+  tp_base_client_take_handler_filter (priv->handler, tp_asv_new (
+        TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
+          TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
+        TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
+        TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO, G_TYPE_BOOLEAN, TRUE,
+        NULL));
+
+  tp_base_client_take_handler_filter (priv->handler, tp_asv_new (
+        TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
+          TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
+        TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
+        TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO, G_TYPE_BOOLEAN, TRUE,
+        NULL));
+
+  tp_base_client_add_handler_capabilities_varargs (priv->handler,
+    "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/ice-udp",
+    "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/gtalk-p2p",
+    "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/h264",
+    NULL);
+
+  g_object_unref (dbus);
+}
+
+static GObject *
+empathy_streamed_media_factory_constructor (GType type, guint n_construct_params,
+  GObjectConstructParam *construct_params)
+{
+  g_return_val_if_fail (call_factory == NULL, NULL);
+
+  call_factory = G_OBJECT_CLASS (empathy_streamed_media_factory_parent_class)->constructor
+          (type, n_construct_params, construct_params);
+  g_object_add_weak_pointer (call_factory, (gpointer)&call_factory);
+
+  return call_factory;
+}
+
+static void
+empathy_streamed_media_factory_finalize (GObject *object)
+{
+  /* free any data held directly by the object here */
+
+  if (G_OBJECT_CLASS (empathy_streamed_media_factory_parent_class)->finalize)
+    G_OBJECT_CLASS (empathy_streamed_media_factory_parent_class)->finalize (object);
+}
+
+static void
+empathy_streamed_media_factory_dispose (GObject *object)
+{
+  EmpathyStreamedMediaFactoryPriv *priv = GET_PRIV (object);
+
+  if (priv->dispose_has_run)
+    return;
+
+  priv->dispose_has_run = TRUE;
+
+  tp_clear_object (&priv->handler);
+
+  if (G_OBJECT_CLASS (empathy_streamed_media_factory_parent_class)->dispose)
+    G_OBJECT_CLASS (empathy_streamed_media_factory_parent_class)->dispose (object);
+}
+
+static void
+empathy_streamed_media_factory_class_init (
+  EmpathyStreamedMediaFactoryClass *empathy_streamed_media_factory_class)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (empathy_streamed_media_factory_class);
+
+  g_type_class_add_private (empathy_streamed_media_factory_class,
+    sizeof (EmpathyStreamedMediaFactoryPriv));
+
+  object_class->constructor = empathy_streamed_media_factory_constructor;
+  object_class->dispose = empathy_streamed_media_factory_dispose;
+  object_class->finalize = empathy_streamed_media_factory_finalize;
+
+  signals[NEW_STREAMED_MEDIA_HANDLER] =
+    g_signal_new ("new-streamed-media-handler",
+      G_TYPE_FROM_CLASS (empathy_streamed_media_factory_class),
+      G_SIGNAL_RUN_LAST, 0,
+      NULL, NULL,
+      _src_marshal_VOID__OBJECT_BOOLEAN,
+      G_TYPE_NONE,
+      2, EMPATHY_TYPE_STREAMED_MEDIA_HANDLER, G_TYPE_BOOLEAN);
+}
+
+EmpathyStreamedMediaFactory *
+empathy_streamed_media_factory_initialise (void)
+{
+  g_return_val_if_fail (call_factory == NULL, NULL);
+
+  return EMPATHY_STREAMED_MEDIA_FACTORY (g_object_new (EMPATHY_TYPE_STREAMED_MEDIA_FACTORY, NULL));
+}
+
+EmpathyStreamedMediaFactory *
+empathy_streamed_media_factory_get (void)
+{
+  g_return_val_if_fail (call_factory != NULL, NULL);
+
+  return EMPATHY_STREAMED_MEDIA_FACTORY (call_factory);
+}
+
+static void
+create_streamed_media_handler (EmpathyStreamedMediaFactory *factory,
+  EmpathyTpStreamedMedia *call)
+{
+  EmpathyStreamedMediaHandler *handler;
+
+  g_return_if_fail (factory != NULL);
+
+  handler = empathy_streamed_media_handler_new_for_channel (call);
+
+  g_signal_emit (factory, signals[NEW_STREAMED_MEDIA_HANDLER], 0,
+    handler, FALSE);
+
+  g_object_unref (handler);
+}
+
+static void
+call_status_changed_cb (EmpathyTpStreamedMedia *call,
+    GParamSpec *spec,
+    EmpathyStreamedMediaFactory *self)
+{
+  if (empathy_tp_streamed_media_get_status (call) <= EMPATHY_TP_STREAMED_MEDIA_STATUS_READYING)
+    return;
+
+  create_streamed_media_handler (self, call);
+
+  g_signal_handlers_disconnect_by_func (call, call_status_changed_cb, self);
+  g_object_unref (call);
+}
+
+static void
+handle_channels_cb (TpSimpleHandler *handler,
+    TpAccount *account,
+    TpConnection *connection,
+    GList *channels,
+    GList *requests_satisfied,
+    gint64 user_action_time,
+    TpHandleChannelsContext *context,
+    gpointer user_data)
+{
+  EmpathyStreamedMediaFactory *self = user_data;
+  GList *l;
+
+  for (l = channels; l != NULL; l = g_list_next (l))
+    {
+      TpChannel *channel = l->data;
+      EmpathyTpStreamedMedia *call;
+
+      if (tp_proxy_get_invalidated (channel) != NULL)
+        continue;
+
+      if (tp_channel_get_channel_type_id (channel) !=
+          TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA)
+        continue;
+
+      call = empathy_tp_streamed_media_new (account, channel);
+
+      if (empathy_tp_streamed_media_get_status (call) <= EMPATHY_TP_STREAMED_MEDIA_STATUS_READYING)
+        {
+          /* We have to wait that the TpStreamedMedia is ready as the
+           * call-handler rely on it. */
+          tp_g_signal_connect_object (call, "notify::status",
+              G_CALLBACK (call_status_changed_cb), self, 0);
+          continue;
+        }
+
+      create_streamed_media_handler (self, call);
+      g_object_unref (call);
+    }
+
+  tp_handle_channels_context_accept (context);
+}
+
+gboolean
+empathy_streamed_media_factory_register (EmpathyStreamedMediaFactory *self,
+    GError **error)
+{
+  EmpathyStreamedMediaFactoryPriv *priv = GET_PRIV (self);
+
+  return tp_base_client_register (priv->handler, error);
+}
diff --git a/src/empathy-streamed-media-factory.h b/src/empathy-streamed-media-factory.h
new file mode 100644
index 0000000..c69073e
--- /dev/null
+++ b/src/empathy-streamed-media-factory.h
@@ -0,0 +1,69 @@
+/*
+ * empathy-streamed-media-factory.h - Header for EmpathyStreamedMediaFactory
+ * Copyright (C) 2008-2011 Collabora Ltd.
+ * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __EMPATHY_STREAMED_MEDIA_FACTORY_H__
+#define __EMPATHY_STREAMED_MEDIA_FACTORY_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+typedef struct _EmpathyStreamedMediaFactory EmpathyStreamedMediaFactory;
+typedef struct _EmpathyStreamedMediaFactoryClass EmpathyStreamedMediaFactoryClass;
+
+struct _EmpathyStreamedMediaFactoryClass {
+    GObjectClass parent_class;
+};
+
+struct _EmpathyStreamedMediaFactory {
+    GObject parent;
+    gpointer priv;
+};
+
+GType empathy_streamed_media_factory_get_type (void);
+
+/* TYPE MACROS */
+#define EMPATHY_TYPE_STREAMED_MEDIA_FACTORY \
+  (empathy_streamed_media_factory_get_type ())
+#define EMPATHY_STREAMED_MEDIA_FACTORY(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), EMPATHY_TYPE_STREAMED_MEDIA_FACTORY, \
+    EmpathyStreamedMediaFactory))
+#define EMPATHY_STREAMED_MEDIA_FACTORY_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass), EMPATHY_TYPE_STREAMED_MEDIA_FACTORY, \
+    EmpathyStreamedMediaFactoryClass))
+#define EMPATHY_IS_STREAMED_MEDIA_FACTORY(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), EMPATHY_TYPE_STREAMED_MEDIA_FACTORY))
+#define EMPATHY_IS_STREAMED_MEDIA_FACTORY_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), EMPATHY_TYPE_STREAMED_MEDIA_FACTORY))
+#define EMPATHY_STREAMED_MEDIA_FACTORY_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_STREAMED_MEDIA_FACTORY, \
+    EmpathyStreamedMediaFactoryClass))
+
+
+EmpathyStreamedMediaFactory *empathy_streamed_media_factory_initialise (void);
+
+EmpathyStreamedMediaFactory *empathy_streamed_media_factory_get (void);
+
+gboolean empathy_streamed_media_factory_register (EmpathyStreamedMediaFactory *self,
+    GError **error);
+
+G_END_DECLS
+
+#endif /* #ifndef __EMPATHY_STREAMED_MEDIA_FACTORY_H__*/
diff --git a/src/empathy-streamed-media-handler.c b/src/empathy-streamed-media-handler.c
new file mode 100644
index 0000000..75007f1
--- /dev/null
+++ b/src/empathy-streamed-media-handler.c
@@ -0,0 +1,924 @@
+/*
+ * empathy-streamed-media-handler.c - Source for EmpathyStreamedMediaHandler
+ * Copyright (C) 2008-2011 Collabora Ltd.
+ * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <telepathy-glib/account-channel-request.h>
+#include <telepathy-glib/util.h>
+#include <telepathy-glib/interfaces.h>
+
+#include <telepathy-farsight/channel.h>
+#include <telepathy-farsight/stream.h>
+
+#include <libempathy/empathy-utils.h>
+
+#include "empathy-streamed-media-handler.h"
+#include "src-marshal.h"
+
+#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
+#include <libempathy/empathy-debug.h>
+
+G_DEFINE_TYPE(EmpathyStreamedMediaHandler, empathy_streamed_media_handler, G_TYPE_OBJECT)
+
+/* signal enum */
+enum {
+  CONFERENCE_ADDED,
+  SRC_PAD_ADDED,
+  SINK_PAD_ADDED,
+  REQUEST_RESOURCE,
+  CLOSED,
+  STREAM_CLOSED,
+  CANDIDATES_CHANGED,
+  LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = {0};
+
+enum {
+  PROP_TP_STREAMED_MEDIA = 1,
+  PROP_GST_BUS,
+  PROP_CONTACT,
+  PROP_INITIAL_AUDIO,
+  PROP_INITIAL_VIDEO,
+  PROP_SEND_AUDIO_CODEC,
+  PROP_SEND_VIDEO_CODEC,
+  PROP_RECV_AUDIO_CODECS,
+  PROP_RECV_VIDEO_CODECS,
+  PROP_AUDIO_REMOTE_CANDIDATE,
+  PROP_VIDEO_REMOTE_CANDIDATE,
+  PROP_AUDIO_LOCAL_CANDIDATE,
+  PROP_VIDEO_LOCAL_CANDIDATE,
+};
+
+/* private structure */
+
+typedef struct {
+  gboolean dispose_has_run;
+  EmpathyTpStreamedMedia *call;
+  EmpathyContact *contact;
+  TfChannel *tfchannel;
+  gboolean initial_audio;
+  gboolean initial_video;
+
+  FsCodec *send_audio_codec;
+  FsCodec *send_video_codec;
+  GList *recv_audio_codecs;
+  GList *recv_video_codecs;
+  FsCandidate *audio_remote_candidate;
+  FsCandidate *video_remote_candidate;
+  FsCandidate *audio_local_candidate;
+  FsCandidate *video_local_candidate;
+} EmpathyStreamedMediaHandlerPriv;
+
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyStreamedMediaHandler)
+
+static void
+empathy_streamed_media_handler_dispose (GObject *object)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (object);
+
+  if (priv->dispose_has_run)
+    return;
+
+  priv->dispose_has_run = TRUE;
+
+  if (priv->contact != NULL)
+    g_object_unref (priv->contact);
+
+  priv->contact = NULL;
+
+  if (priv->tfchannel != NULL)
+    g_object_unref (priv->tfchannel);
+
+  priv->tfchannel = NULL;
+
+  if (priv->call != NULL)
+    {
+      empathy_tp_streamed_media_close (priv->call);
+      g_object_unref (priv->call);
+    }
+
+  priv->call = NULL;
+
+  /* release any references held by the object here */
+  if (G_OBJECT_CLASS (empathy_streamed_media_handler_parent_class)->dispose)
+    G_OBJECT_CLASS (empathy_streamed_media_handler_parent_class)->dispose (object);
+}
+
+static void
+empathy_streamed_media_handler_finalize (GObject *object)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (object);
+
+  fs_codec_destroy (priv->send_audio_codec);
+  fs_codec_destroy (priv->send_video_codec);
+  fs_codec_list_destroy (priv->recv_audio_codecs);
+  fs_codec_list_destroy (priv->recv_video_codecs);
+  fs_candidate_destroy (priv->audio_remote_candidate);
+  fs_candidate_destroy (priv->video_remote_candidate);
+  fs_candidate_destroy (priv->audio_local_candidate);
+  fs_candidate_destroy (priv->video_local_candidate);
+
+  if (G_OBJECT_CLASS (empathy_streamed_media_handler_parent_class)->finalize)
+    G_OBJECT_CLASS (empathy_streamed_media_handler_parent_class)->finalize (object);
+}
+
+static void
+empathy_streamed_media_handler_init (EmpathyStreamedMediaHandler *obj)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (obj,
+    EMPATHY_TYPE_STREAMED_MEDIA_HANDLER, EmpathyStreamedMediaHandlerPriv);
+
+  obj->priv = priv;
+}
+
+static void
+empathy_streamed_media_handler_constructed (GObject *object)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (object);
+
+  if (priv->contact == NULL)
+    {
+      g_object_get (priv->call, "contact", &(priv->contact), NULL);
+    }
+}
+
+static void
+empathy_streamed_media_handler_set_property (GObject *object,
+  guint property_id, const GValue *value, GParamSpec *pspec)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (object);
+
+  switch (property_id)
+    {
+      case PROP_CONTACT:
+        priv->contact = g_value_dup_object (value);
+        break;
+      case PROP_TP_STREAMED_MEDIA:
+        priv->call = g_value_dup_object (value);
+        break;
+      case PROP_INITIAL_AUDIO:
+        priv->initial_audio = g_value_get_boolean (value);
+        break;
+      case PROP_INITIAL_VIDEO:
+        priv->initial_video = g_value_get_boolean (value);
+        break;
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+static void
+empathy_streamed_media_handler_get_property (GObject *object,
+  guint property_id, GValue *value, GParamSpec *pspec)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (object);
+
+  switch (property_id)
+    {
+      case PROP_CONTACT:
+        g_value_set_object (value, priv->contact);
+        break;
+      case PROP_TP_STREAMED_MEDIA:
+        g_value_set_object (value, priv->call);
+        break;
+      case PROP_INITIAL_AUDIO:
+        g_value_set_boolean (value, priv->initial_audio);
+        break;
+      case PROP_INITIAL_VIDEO:
+        g_value_set_boolean (value, priv->initial_video);
+        break;
+      case PROP_SEND_AUDIO_CODEC:
+        g_value_set_boxed (value, priv->send_audio_codec);
+        break;
+      case PROP_SEND_VIDEO_CODEC:
+        g_value_set_boxed (value, priv->send_video_codec);
+        break;
+      case PROP_RECV_AUDIO_CODECS:
+        g_value_set_boxed (value, priv->recv_audio_codecs);
+        break;
+      case PROP_RECV_VIDEO_CODECS:
+        g_value_set_boxed (value, priv->recv_video_codecs);
+        break;
+      case PROP_AUDIO_REMOTE_CANDIDATE:
+        g_value_set_boxed (value, priv->audio_remote_candidate);
+        break;
+      case PROP_VIDEO_REMOTE_CANDIDATE:
+        g_value_set_boxed (value, priv->video_remote_candidate);
+        break;
+      case PROP_AUDIO_LOCAL_CANDIDATE:
+        g_value_set_boxed (value, priv->audio_local_candidate);
+        break;
+      case PROP_VIDEO_LOCAL_CANDIDATE:
+        g_value_set_boxed (value, priv->video_local_candidate);
+        break;
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+
+static void
+empathy_streamed_media_handler_class_init (EmpathyStreamedMediaHandlerClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GParamSpec *param_spec;
+
+  g_type_class_add_private (klass, sizeof (EmpathyStreamedMediaHandlerPriv));
+
+  object_class->constructed = empathy_streamed_media_handler_constructed;
+  object_class->set_property = empathy_streamed_media_handler_set_property;
+  object_class->get_property = empathy_streamed_media_handler_get_property;
+  object_class->dispose = empathy_streamed_media_handler_dispose;
+  object_class->finalize = empathy_streamed_media_handler_finalize;
+
+  param_spec = g_param_spec_object ("contact",
+    "contact", "The remote contact",
+    EMPATHY_TYPE_CONTACT,
+    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_CONTACT, param_spec);
+
+  param_spec = g_param_spec_object ("tp-call",
+    "tp-call", "The calls channel wrapper",
+    EMPATHY_TYPE_TP_STREAMED_MEDIA,
+    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_TP_STREAMED_MEDIA, param_spec);
+
+  param_spec = g_param_spec_boolean ("initial-audio",
+    "initial-audio", "Whether the call should start with audio",
+    TRUE,
+    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_INITIAL_AUDIO,
+      param_spec);
+
+  param_spec = g_param_spec_boolean ("initial-video",
+    "initial-video", "Whether the call should start with video",
+    FALSE,
+    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_INITIAL_VIDEO,
+    param_spec);
+
+  param_spec = g_param_spec_boxed ("send-audio-codec",
+    "send audio codec", "Codec used to encode the outgoing video stream",
+    FS_TYPE_CODEC,
+    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_SEND_AUDIO_CODEC,
+    param_spec);
+
+  param_spec = g_param_spec_boxed ("send-video-codec",
+    "send video codec", "Codec used to encode the outgoing video stream",
+    FS_TYPE_CODEC,
+    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_SEND_VIDEO_CODEC,
+    param_spec);
+
+  param_spec = g_param_spec_boxed ("recv-audio-codecs",
+    "recvs audio codec", "Codecs used to decode the incoming audio stream",
+    FS_TYPE_CODEC_LIST,
+    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_RECV_AUDIO_CODECS,
+    param_spec);
+
+  param_spec = g_param_spec_boxed ("recv-video-codecs",
+    "recvs video codec", "Codecs used to decode the incoming video stream",
+    FS_TYPE_CODEC_LIST,
+    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_RECV_VIDEO_CODECS,
+    param_spec);
+
+  param_spec = g_param_spec_boxed ("audio-remote-candidate",
+    "audio remote candidate",
+    "Remote candidate used for the audio stream",
+    FS_TYPE_CANDIDATE,
+    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class,
+      PROP_AUDIO_REMOTE_CANDIDATE, param_spec);
+
+  param_spec = g_param_spec_boxed ("video-remote-candidate",
+    "video remote candidate",
+    "Remote candidate used for the video stream",
+    FS_TYPE_CANDIDATE,
+    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class,
+      PROP_VIDEO_REMOTE_CANDIDATE, param_spec);
+
+  param_spec = g_param_spec_boxed ("audio-local-candidate",
+    "audio local candidate",
+    "Local candidate used for the audio stream",
+    FS_TYPE_CANDIDATE,
+    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class,
+      PROP_AUDIO_REMOTE_CANDIDATE, param_spec);
+
+  param_spec = g_param_spec_boxed ("video-local-candidate",
+    "video local candidate",
+    "Local candidate used for the video stream",
+    FS_TYPE_CANDIDATE,
+    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class,
+      PROP_VIDEO_REMOTE_CANDIDATE, param_spec);
+
+  signals[CONFERENCE_ADDED] =
+    g_signal_new ("conference-added", G_TYPE_FROM_CLASS (klass),
+      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+      g_cclosure_marshal_VOID__OBJECT,
+      G_TYPE_NONE,
+      1, FS_TYPE_CONFERENCE);
+
+  signals[SRC_PAD_ADDED] =
+    g_signal_new ("src-pad-added", G_TYPE_FROM_CLASS (klass),
+      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+      _src_marshal_BOOLEAN__OBJECT_UINT,
+      G_TYPE_BOOLEAN,
+      2, GST_TYPE_PAD, G_TYPE_UINT);
+
+  signals[SINK_PAD_ADDED] =
+    g_signal_new ("sink-pad-added", G_TYPE_FROM_CLASS (klass),
+      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+      _src_marshal_BOOLEAN__OBJECT_UINT,
+      G_TYPE_BOOLEAN,
+      2, GST_TYPE_PAD, G_TYPE_UINT);
+
+  signals[REQUEST_RESOURCE] =
+    g_signal_new ("request-resource", G_TYPE_FROM_CLASS (klass),
+      G_SIGNAL_RUN_LAST, 0,
+      g_signal_accumulator_true_handled, NULL,
+      _src_marshal_BOOLEAN__UINT_UINT,
+      G_TYPE_BOOLEAN, 2, G_TYPE_UINT, G_TYPE_UINT);
+
+  signals[CLOSED] =
+    g_signal_new ("closed", G_TYPE_FROM_CLASS (klass),
+      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+      g_cclosure_marshal_VOID__VOID,
+      G_TYPE_NONE,
+      0);
+
+  signals[STREAM_CLOSED] =
+    g_signal_new ("stream-closed", G_TYPE_FROM_CLASS (klass),
+      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+      g_cclosure_marshal_VOID__OBJECT,
+      G_TYPE_NONE, 1, TF_TYPE_STREAM);
+
+  signals[CANDIDATES_CHANGED] =
+    g_signal_new ("candidates-changed", G_TYPE_FROM_CLASS (klass),
+      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+      g_cclosure_marshal_VOID__UINT,
+      G_TYPE_NONE, 1, G_TYPE_UINT);
+}
+
+/**
+ * empathy_streamed_media_handler_new_for_contact:
+ * @contact: an #EmpathyContact
+ *
+ * Creates a new #EmpathyStreamedMediaHandler with contact @contact.
+ *
+ * Return value: a new #EmpathyStreamedMediaHandler
+ */
+EmpathyStreamedMediaHandler *
+empathy_streamed_media_handler_new_for_contact (EmpathyContact *contact)
+{
+  return EMPATHY_STREAMED_MEDIA_HANDLER (g_object_new (EMPATHY_TYPE_STREAMED_MEDIA_HANDLER,
+    "contact", contact, NULL));
+}
+
+EmpathyStreamedMediaHandler *
+empathy_streamed_media_handler_new_for_channel (EmpathyTpStreamedMedia *call)
+{
+  return EMPATHY_STREAMED_MEDIA_HANDLER (g_object_new (EMPATHY_TYPE_STREAMED_MEDIA_HANDLER,
+    "tp-call", call,
+    "initial-video", empathy_tp_streamed_media_is_receiving_video (call),
+    NULL));
+}
+
+static void
+update_sending_codec (EmpathyStreamedMediaHandler *self,
+    FsCodec *codec,
+    FsSession *session)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+  FsMediaType type;
+
+  if (codec == NULL || session == NULL)
+    return;
+
+  g_object_get (session, "media-type", &type, NULL);
+
+  if (type == FS_MEDIA_TYPE_AUDIO)
+    {
+      priv->send_audio_codec = fs_codec_copy (codec);
+      g_object_notify (G_OBJECT (self), "send-audio-codec");
+    }
+  else if (type == FS_MEDIA_TYPE_VIDEO)
+    {
+      priv->send_video_codec = fs_codec_copy (codec);
+      g_object_notify (G_OBJECT (self), "send-video-codec");
+    }
+}
+
+static void
+update_receiving_codec (EmpathyStreamedMediaHandler *self,
+    GList *codecs,
+    FsStream *stream)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+  FsSession *session;
+  FsMediaType type;
+
+  if (codecs == NULL || stream == NULL)
+    return;
+
+  g_object_get (stream, "session", &session, NULL);
+  if (session == NULL)
+    return;
+
+  g_object_get (session, "media-type", &type, NULL);
+
+  if (type == FS_MEDIA_TYPE_AUDIO)
+    {
+      priv->recv_audio_codecs = fs_codec_list_copy (codecs);
+      g_object_notify (G_OBJECT (self), "recv-audio-codecs");
+    }
+  else if (type == FS_MEDIA_TYPE_VIDEO)
+    {
+      priv->recv_video_codecs = fs_codec_list_copy (codecs);
+      g_object_notify (G_OBJECT (self), "recv-video-codecs");
+    }
+
+  g_object_unref (session);
+}
+
+static void
+update_candidates (EmpathyStreamedMediaHandler *self,
+    FsCandidate *remote_candidate,
+    FsCandidate *local_candidate,
+    FsStream *stream)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+  FsSession *session;
+  FsMediaType type;
+
+  if (stream == NULL)
+    return;
+
+  g_object_get (stream, "session", &session, NULL);
+  if (session == NULL)
+    return;
+
+  g_object_get (session, "media-type", &type, NULL);
+
+  if (type == FS_MEDIA_TYPE_AUDIO)
+    {
+      if (remote_candidate != NULL)
+        {
+          fs_candidate_destroy (priv->audio_remote_candidate);
+          priv->audio_remote_candidate = fs_candidate_copy (remote_candidate);
+          g_object_notify (G_OBJECT (self), "audio-remote-candidate");
+        }
+
+      if (local_candidate != NULL)
+        {
+          fs_candidate_destroy (priv->audio_local_candidate);
+          priv->audio_local_candidate = fs_candidate_copy (local_candidate);
+          g_object_notify (G_OBJECT (self), "audio-local-candidate");
+        }
+
+      g_signal_emit (G_OBJECT (self), signals[CANDIDATES_CHANGED], 0,
+          FS_MEDIA_TYPE_AUDIO);
+    }
+  else if (type == FS_MEDIA_TYPE_VIDEO)
+    {
+      if (remote_candidate != NULL)
+        {
+          fs_candidate_destroy (priv->video_remote_candidate);
+          priv->video_remote_candidate = fs_candidate_copy (remote_candidate);
+          g_object_notify (G_OBJECT (self), "video-remote-candidate");
+        }
+
+      if (local_candidate != NULL)
+        {
+          fs_candidate_destroy (priv->video_local_candidate);
+          priv->video_local_candidate = fs_candidate_copy (local_candidate);
+          g_object_notify (G_OBJECT (self), "video-local-candidate");
+        }
+
+      g_signal_emit (G_OBJECT (self), signals[CANDIDATES_CHANGED], 0,
+          FS_MEDIA_TYPE_VIDEO);
+    }
+
+  g_object_unref (session);
+}
+
+void
+empathy_streamed_media_handler_bus_message (EmpathyStreamedMediaHandler *handler,
+  GstBus *bus, GstMessage *message)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (handler);
+  const GstStructure *s = gst_message_get_structure (message);
+
+  if (priv->tfchannel == NULL)
+    return;
+
+  if (s != NULL &&
+      gst_structure_has_name (s, "farsight-send-codec-changed"))
+    {
+      const GValue *val;
+      FsCodec *codec;
+      FsSession *session;
+
+      val = gst_structure_get_value (s, "codec");
+      codec = g_value_get_boxed (val);
+
+      val = gst_structure_get_value (s, "session");
+      session = g_value_get_object (val);
+
+      update_sending_codec (handler, codec, session);
+    }
+  else if (s != NULL &&
+      gst_structure_has_name (s, "farsight-recv-codecs-changed"))
+    {
+      const GValue *val;
+      GList *codecs;
+      FsStream *stream;
+
+      val = gst_structure_get_value (s, "codecs");
+      codecs = g_value_get_boxed (val);
+
+      val = gst_structure_get_value (s, "stream");
+      stream = g_value_get_object (val);
+
+      update_receiving_codec (handler, codecs, stream);
+    }
+  else if (s != NULL &&
+      gst_structure_has_name (s, "farsight-new-active-candidate-pair"))
+    {
+      const GValue *val;
+      FsCandidate *remote_candidate, *local_candidate;
+      FsStream *stream;
+
+      val = gst_structure_get_value (s, "remote-candidate");
+      remote_candidate = g_value_get_boxed (val);
+
+      val = gst_structure_get_value (s, "local-candidate");
+      local_candidate = g_value_get_boxed (val);
+
+      val = gst_structure_get_value (s, "stream");
+      stream = g_value_get_object (val);
+
+      update_candidates (handler, remote_candidate, local_candidate, stream);
+    }
+
+  tf_channel_bus_message (priv->tfchannel, message);
+}
+
+static void
+empathy_streamed_media_handler_tf_channel_session_created_cb (TfChannel *tfchannel,
+  FsConference *conference, FsParticipant *participant,
+  EmpathyStreamedMediaHandler *self)
+{
+  g_signal_emit (G_OBJECT (self), signals[CONFERENCE_ADDED], 0,
+    GST_ELEMENT (conference));
+}
+
+static gboolean
+src_pad_added_error_idle (gpointer data)
+{
+  TfStream *stream = data;
+
+  tf_stream_error (stream, TP_MEDIA_STREAM_ERROR_MEDIA_ERROR,
+      "Could not link sink");
+  g_object_unref (stream);
+
+  return FALSE;
+}
+
+static void
+empathy_streamed_media_handler_tf_stream_src_pad_added_cb (TfStream *stream,
+  GstPad *pad, FsCodec *codec, EmpathyStreamedMediaHandler  *handler)
+{
+  guint media_type;
+  gboolean retval;
+
+  g_object_get (stream, "media-type", &media_type, NULL);
+
+  g_signal_emit (G_OBJECT (handler), signals[SRC_PAD_ADDED], 0,
+      pad, media_type, &retval);
+
+  if (!retval)
+    g_idle_add (src_pad_added_error_idle, g_object_ref (stream));
+}
+
+
+static gboolean
+empathy_streamed_media_handler_tf_stream_request_resource_cb (TfStream *stream,
+  guint direction, EmpathyTpStreamedMedia *call)
+{
+  gboolean ret;
+  guint media_type;
+
+  g_object_get (G_OBJECT (stream), "media-type", &media_type, NULL);
+
+  g_signal_emit (G_OBJECT (call),
+    signals[REQUEST_RESOURCE], 0, media_type, direction, &ret);
+
+  return ret;
+}
+
+static void
+empathy_streamed_media_handler_tf_stream_closed_cb (TfStream *stream,
+  EmpathyStreamedMediaHandler *handler)
+{
+  g_signal_emit (handler, signals[STREAM_CLOSED], 0, stream);
+}
+
+static void
+empathy_streamed_media_handler_tf_channel_stream_created_cb (TfChannel *tfchannel,
+  TfStream *stream, EmpathyStreamedMediaHandler *handler)
+{
+  guint media_type;
+  GstPad *spad;
+  gboolean retval;
+  FsStream *fs_stream;
+  GList *codecs;
+  FsSession *session;
+  FsCodec *codec;
+
+  g_signal_connect (stream, "src-pad-added",
+      G_CALLBACK (empathy_streamed_media_handler_tf_stream_src_pad_added_cb), handler);
+  g_signal_connect (stream, "request-resource",
+      G_CALLBACK (empathy_streamed_media_handler_tf_stream_request_resource_cb),
+        handler);
+  g_signal_connect (stream, "closed",
+      G_CALLBACK (empathy_streamed_media_handler_tf_stream_closed_cb), handler);
+
+  g_object_get (stream, "media-type", &media_type,
+    "sink-pad", &spad, NULL);
+
+  g_signal_emit (G_OBJECT (handler), signals[SINK_PAD_ADDED], 0,
+      spad, media_type, &retval);
+
+ if (!retval)
+      tf_stream_error (stream, TP_MEDIA_STREAM_ERROR_MEDIA_ERROR,
+          "Could not link source");
+
+ /* Get sending codec */
+ g_object_get (stream, "farsight-session", &session, NULL);
+ g_object_get (session, "current-send-codec", &codec, NULL);
+
+ update_sending_codec (handler, codec, session);
+
+ tp_clear_object (&session);
+ tp_clear_object (&codec);
+
+ /* Get receiving codec */
+ g_object_get (stream, "farsight-stream", &fs_stream, NULL);
+ g_object_get (fs_stream, "current-recv-codecs", &codecs, NULL);
+
+ update_receiving_codec (handler, codecs, fs_stream);
+
+ fs_codec_list_destroy (codecs);
+ tp_clear_object (&fs_stream);
+
+ gst_object_unref (spad);
+}
+
+static void
+empathy_streamed_media_handler_tf_channel_closed_cb (TfChannel *tfchannel,
+  EmpathyStreamedMediaHandler *handler)
+{
+  g_signal_emit (G_OBJECT (handler), signals[CLOSED], 0);
+}
+
+static GList *
+empathy_streamed_media_handler_tf_channel_codec_config_cb (TfChannel *channel,
+  guint stream_id, FsMediaType media_type, guint direction, gpointer user_data)
+{
+  gchar *filename = empathy_file_lookup ("codec-preferences", "data");
+  GList *codecs;
+  GError *error = NULL;
+
+  codecs = fs_codec_list_from_keyfile (filename, &error);
+  g_free (filename);
+
+  if (!codecs)
+    {
+      g_warning ("No codec-preferences file: %s",
+          error ? error->message : "No error message");
+    }
+  g_clear_error (&error);
+
+  return codecs;
+}
+
+static void
+empathy_streamed_media_handler_start_tpfs (EmpathyStreamedMediaHandler *self)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+  TpChannel *channel;
+
+  g_object_get (priv->call, "channel", &channel, NULL);
+
+  g_assert (channel != NULL);
+
+  priv->tfchannel = tf_channel_new (channel);
+
+  /* Set up the telepathy farsight channel */
+  g_signal_connect (priv->tfchannel, "session-created",
+      G_CALLBACK (empathy_streamed_media_handler_tf_channel_session_created_cb), self);
+  g_signal_connect (priv->tfchannel, "stream-created",
+      G_CALLBACK (empathy_streamed_media_handler_tf_channel_stream_created_cb), self);
+  g_signal_connect (priv->tfchannel, "closed",
+      G_CALLBACK (empathy_streamed_media_handler_tf_channel_closed_cb), self);
+  g_signal_connect (priv->tfchannel, "stream-get-codec-config",
+      G_CALLBACK (empathy_streamed_media_handler_tf_channel_codec_config_cb), self);
+
+  g_object_unref (channel);
+}
+
+static void
+empathy_streamed_media_handler_request_cb (GObject *source,
+    GAsyncResult *result,
+    gpointer user_data)
+{
+  EmpathyStreamedMediaHandler *self = EMPATHY_STREAMED_MEDIA_HANDLER (user_data);
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+  TpChannel *channel;
+  GError *error = NULL;
+  TpAccountChannelRequest *req = TP_ACCOUNT_CHANNEL_REQUEST (source);
+  TpAccount *account;
+
+  channel = tp_account_channel_request_create_and_handle_channel_finish (req,
+      result, NULL, &error);
+  if (channel == NULL)
+    {
+      DEBUG ("Failed to create the channel: %s", error->message);
+      g_error_free (error);
+      return;
+    }
+
+  account = tp_account_channel_request_get_account (req);
+
+  priv->call = empathy_tp_streamed_media_new (account, channel);
+
+  g_object_notify (G_OBJECT (self), "tp-call");
+
+  empathy_streamed_media_handler_start_tpfs (self);
+
+  g_object_unref (channel);
+}
+
+void
+empathy_streamed_media_handler_start_call (EmpathyStreamedMediaHandler *handler,
+    gint64 timestamp)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (handler);
+  TpAccountChannelRequest *req;
+  TpAccount *account;
+  GHashTable *request;
+
+  if (priv->call != NULL)
+    {
+      empathy_streamed_media_handler_start_tpfs (handler);
+      empathy_tp_streamed_media_accept_incoming_call (priv->call);
+      return;
+    }
+
+  /* No TpStreamedMedia object (we are redialing). Request a new media channel that
+   * will be used to create a new EmpathyTpStreamedMedia. */
+  g_assert (priv->contact != NULL);
+
+  account = empathy_contact_get_account (priv->contact);
+  request = empathy_call_create_streamed_media_request (priv->contact,
+      priv->initial_audio, priv->initial_video);
+
+  req = tp_account_channel_request_new (account, request, timestamp);
+
+  tp_account_channel_request_create_and_handle_channel_async (req, NULL,
+      empathy_streamed_media_handler_request_cb, handler);
+
+  g_object_unref (req);
+  g_hash_table_unref (request);
+}
+
+/**
+ * empathy_streamed_media_handler_stop_call:
+ * @handler: an #EmpathyStreamedMediaHandler
+ *
+ * Closes the #EmpathyStreamedMediaHandler's call and frees its resources.
+ */
+void
+empathy_streamed_media_handler_stop_call (EmpathyStreamedMediaHandler *handler)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (handler);
+
+  if (priv->call != NULL)
+    {
+      empathy_tp_streamed_media_leave (priv->call);
+      g_object_unref (priv->call);
+    }
+
+  priv->call = NULL;
+}
+
+/**
+ * empathy_streamed_media_handler_has_initial_video:
+ * @handler: an #EmpathyStreamedMediaHandler
+ *
+ * Return %TRUE if the call managed by this #EmpathyStreamedMediaHandler was
+ * created with video enabled
+ *
+ * Return value: %TRUE if the call was created as a video conversation.
+ */
+gboolean
+empathy_streamed_media_handler_has_initial_video (EmpathyStreamedMediaHandler *handler)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (handler);
+
+  return priv->initial_video;
+}
+
+FsCodec *
+empathy_streamed_media_handler_get_send_audio_codec (EmpathyStreamedMediaHandler *self)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+
+  return priv->send_audio_codec;
+}
+
+FsCodec *
+empathy_streamed_media_handler_get_send_video_codec (EmpathyStreamedMediaHandler *self)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+
+  return priv->send_video_codec;
+}
+
+GList *
+empathy_streamed_media_handler_get_recv_audio_codecs (EmpathyStreamedMediaHandler *self)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+
+  return priv->recv_audio_codecs;
+}
+
+GList *
+empathy_streamed_media_handler_get_recv_video_codecs (EmpathyStreamedMediaHandler *self)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+
+  return priv->recv_video_codecs;
+}
+
+FsCandidate *
+empathy_streamed_media_handler_get_audio_remote_candidate (
+    EmpathyStreamedMediaHandler *self)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+
+  return priv->audio_remote_candidate;
+}
+
+FsCandidate *
+empathy_streamed_media_handler_get_audio_local_candidate (
+    EmpathyStreamedMediaHandler *self)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+
+  return priv->audio_local_candidate;
+}
+
+FsCandidate *
+empathy_streamed_media_handler_get_video_remote_candidate (
+    EmpathyStreamedMediaHandler *self)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+
+  return priv->video_remote_candidate;
+}
+
+FsCandidate *
+empathy_streamed_media_handler_get_video_local_candidate (
+    EmpathyStreamedMediaHandler *self)
+{
+  EmpathyStreamedMediaHandlerPriv *priv = GET_PRIV (self);
+
+  return priv->video_local_candidate;
+}
diff --git a/src/empathy-streamed-media-handler.h b/src/empathy-streamed-media-handler.h
new file mode 100644
index 0000000..ab655b8
--- /dev/null
+++ b/src/empathy-streamed-media-handler.h
@@ -0,0 +1,106 @@
+/*
+ * empathy-streamed-media-handler.h - Header for EmpathyStreamedMediaHandler
+ * Copyright (C) 2008-2009 Collabora Ltd.
+ * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __EMPATHY_STREAMED_MEDIA_HANDLER_H__
+#define __EMPATHY_STREAMED_MEDIA_HANDLER_H__
+
+#include <glib-object.h>
+
+#include <gst/gst.h>
+#include <gst/farsight/fs-conference-iface.h>
+
+#include <libempathy/empathy-tp-streamed-media.h>
+#include <libempathy/empathy-contact.h>
+
+G_BEGIN_DECLS
+
+typedef struct _EmpathyStreamedMediaHandler EmpathyStreamedMediaHandler;
+typedef struct _EmpathyStreamedMediaHandlerClass EmpathyStreamedMediaHandlerClass;
+
+struct _EmpathyStreamedMediaHandlerClass {
+    GObjectClass parent_class;
+};
+
+struct _EmpathyStreamedMediaHandler {
+    GObject parent;
+    gpointer priv;
+};
+
+GType empathy_streamed_media_handler_get_type (void);
+
+/* TYPE MACROS */
+#define EMPATHY_TYPE_STREAMED_MEDIA_HANDLER \
+  (empathy_streamed_media_handler_get_type ())
+#define EMPATHY_STREAMED_MEDIA_HANDLER(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), EMPATHY_TYPE_STREAMED_MEDIA_HANDLER, \
+    EmpathyStreamedMediaHandler))
+#define EMPATHY_STREAMED_MEDIA_HANDLER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass), EMPATHY_TYPE_STREAMED_MEDIA_HANDLER, \
+  EmpathyStreamedMediaHandlerClass))
+#define EMPATHY_IS_STREAMED_MEDIA_HANDLER(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), EMPATHY_TYPE_STREAMED_MEDIA_HANDLER))
+#define EMPATHY_IS_STREAMED_MEDIA_HANDLER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), EMPATHY_TYPE_STREAMED_MEDIA_HANDLER))
+#define EMPATHY_STREAMED_MEDIA_HANDLER_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_STREAMED_MEDIA_HANDLER, \
+  EmpathyStreamedMediaHandlerClass))
+
+EmpathyStreamedMediaHandler * empathy_streamed_media_handler_new_for_contact (
+  EmpathyContact *contact);
+
+EmpathyStreamedMediaHandler * empathy_streamed_media_handler_new_for_channel (
+  EmpathyTpStreamedMedia *call);
+
+void empathy_streamed_media_handler_start_call (EmpathyStreamedMediaHandler *handler,
+    gint64 timestamp);
+void empathy_streamed_media_handler_stop_call (EmpathyStreamedMediaHandler *handler);
+
+gboolean empathy_streamed_media_handler_has_initial_video (EmpathyStreamedMediaHandler *handler);
+
+void empathy_streamed_media_handler_bus_message (EmpathyStreamedMediaHandler *handler,
+  GstBus *bus, GstMessage *message);
+
+FsCodec * empathy_streamed_media_handler_get_send_audio_codec (
+    EmpathyStreamedMediaHandler *self);
+
+FsCodec * empathy_streamed_media_handler_get_send_video_codec (
+    EmpathyStreamedMediaHandler *self);
+
+GList * empathy_streamed_media_handler_get_recv_audio_codecs (
+    EmpathyStreamedMediaHandler *self);
+
+GList * empathy_streamed_media_handler_get_recv_video_codecs (
+    EmpathyStreamedMediaHandler *self);
+
+FsCandidate * empathy_streamed_media_handler_get_audio_remote_candidate (
+    EmpathyStreamedMediaHandler *self);
+
+FsCandidate * empathy_streamed_media_handler_get_audio_local_candidate (
+    EmpathyStreamedMediaHandler *self);
+
+FsCandidate * empathy_streamed_media_handler_get_video_remote_candidate (
+    EmpathyStreamedMediaHandler *self);
+
+FsCandidate * empathy_streamed_media_handler_get_video_local_candidate (
+    EmpathyStreamedMediaHandler *self);
+
+G_END_DECLS
+
+#endif /* #ifndef __EMPATHY_STREAMED_MEDIA_HANDLER_H__*/
diff --git a/src/empathy-streamed-media-window.c b/src/empathy-streamed-media-window.c
index c324d45..2408f97 100644
--- a/src/empathy-streamed-media-window.c
+++ b/src/empathy-streamed-media-window.c
@@ -36,7 +36,6 @@
 #include <gst/farsight/fs-element-added-notifier.h>
 
 #include <libempathy/empathy-tp-contact-factory.h>
-#include <libempathy/empathy-call-factory.h>
 #include <libempathy/empathy-utils.h>
 #include <libempathy-gtk/empathy-avatar-image.h>
 #include <libempathy-gtk/empathy-video-widget.h>
diff --git a/src/empathy-streamed-media-window.h b/src/empathy-streamed-media-window.h
index 3de80eb..aae56d8 100644
--- a/src/empathy-streamed-media-window.h
+++ b/src/empathy-streamed-media-window.h
@@ -23,7 +23,8 @@
 
 #include <glib-object.h>
 #include <gtk/gtk.h>
-#include <libempathy/empathy-streamed-media-handler.h>
+
+#include "empathy-streamed-media-handler.h"
 
 G_BEGIN_DECLS
 
