aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy/Makefile.am4
-rw-r--r--libempathy/empathy-call-factory.c14
-rw-r--r--libempathy/empathy-call-handler.c30
-rw-r--r--libempathy/empathy-call-handler.h4
-rw-r--r--libempathy/empathy-tp-call.h101
-rw-r--r--libempathy/empathy-tp-streamed-media.c (renamed from libempathy/empathy-tp-call.c)266
-rw-r--r--libempathy/empathy-tp-streamed-media.h113
-rw-r--r--libempathy/empathy-utils.c1
-rw-r--r--src/empathy-call-window.c50
-rw-r--r--src/empathy-event-manager.c22
10 files changed, 308 insertions, 297 deletions
diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am
index 25153eab8..497d8d99b 100644
--- a/libempathy/Makefile.am
+++ b/libempathy/Makefile.am
@@ -57,12 +57,12 @@ libempathy_headers = \
empathy-time.h \
empathy-tls-certificate.h \
empathy-tls-verifier.h \
- empathy-tp-call.h \
empathy-tp-chat.h \
empathy-tp-contact-factory.h \
empathy-tp-contact-list.h \
empathy-tp-file.h \
empathy-tp-roomlist.h \
+ empathy-tp-streamed-media.h \
empathy-types.h \
empathy-utils.h
@@ -97,12 +97,12 @@ libempathy_la_SOURCES = \
empathy-time.c \
empathy-tls-certificate.c \
empathy-tls-verifier.c \
- empathy-tp-call.c \
empathy-tp-chat.c \
empathy-tp-contact-factory.c \
empathy-tp-contact-list.c \
empathy-tp-file.c \
empathy-tp-roomlist.c \
+ empathy-tp-streamed-media.c \
empathy-utils.c
# do not distribute generated files
diff --git a/libempathy/empathy-call-factory.c b/libempathy/empathy-call-factory.c
index 49bc60de9..6e523aada 100644
--- a/libempathy/empathy-call-factory.c
+++ b/libempathy/empathy-call-factory.c
@@ -261,7 +261,7 @@ empathy_call_factory_new_call_with_streams (EmpathyContact *contact,
static void
create_call_handler (EmpathyCallFactory *factory,
- EmpathyTpCall *call)
+ EmpathyTpStreamedMedia *call)
{
EmpathyCallHandler *handler;
@@ -276,11 +276,11 @@ create_call_handler (EmpathyCallFactory *factory,
}
static void
-call_status_changed_cb (EmpathyTpCall *call,
+call_status_changed_cb (EmpathyTpStreamedMedia *call,
GParamSpec *spec,
EmpathyCallFactory *self)
{
- if (empathy_tp_call_get_status (call) <= EMPATHY_TP_CALL_STATUS_READYING)
+ if (empathy_tp_streamed_media_get_status (call) <= EMPATHY_TP_STREAMED_MEDIA_STATUS_READYING)
return;
create_call_handler (self, call);
@@ -305,7 +305,7 @@ handle_channels_cb (TpSimpleHandler *handler,
for (l = channels; l != NULL; l = g_list_next (l))
{
TpChannel *channel = l->data;
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
if (tp_proxy_get_invalidated (channel) != NULL)
continue;
@@ -314,11 +314,11 @@ handle_channels_cb (TpSimpleHandler *handler,
TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA)
continue;
- call = empathy_tp_call_new (account, channel);
+ call = empathy_tp_streamed_media_new (account, channel);
- if (empathy_tp_call_get_status (call) <= EMPATHY_TP_CALL_STATUS_READYING)
+ if (empathy_tp_streamed_media_get_status (call) <= EMPATHY_TP_STREAMED_MEDIA_STATUS_READYING)
{
- /* We have to wait that the TpCall is ready as the
+ /* 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);
diff --git a/libempathy/empathy-call-handler.c b/libempathy/empathy-call-handler.c
index dc734b2e5..c3ce5fed4 100644
--- a/libempathy/empathy-call-handler.c
+++ b/libempathy/empathy-call-handler.c
@@ -54,7 +54,7 @@ enum {
static guint signals[LAST_SIGNAL] = {0};
enum {
- PROP_TP_CALL = 1,
+ PROP_TP_STREAMED_MEDIA = 1,
PROP_GST_BUS,
PROP_CONTACT,
PROP_INITIAL_AUDIO,
@@ -73,7 +73,7 @@ enum {
typedef struct {
gboolean dispose_has_run;
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
EmpathyContact *contact;
TfChannel *tfchannel;
gboolean initial_audio;
@@ -113,7 +113,7 @@ empathy_call_handler_dispose (GObject *object)
if (priv->call != NULL)
{
- empathy_tp_call_close (priv->call);
+ empathy_tp_streamed_media_close (priv->call);
g_object_unref (priv->call);
}
@@ -173,7 +173,7 @@ empathy_call_handler_set_property (GObject *object,
case PROP_CONTACT:
priv->contact = g_value_dup_object (value);
break;
- case PROP_TP_CALL:
+ case PROP_TP_STREAMED_MEDIA:
priv->call = g_value_dup_object (value);
break;
case PROP_INITIAL_AUDIO:
@@ -198,7 +198,7 @@ empathy_call_handler_get_property (GObject *object,
case PROP_CONTACT:
g_value_set_object (value, priv->contact);
break;
- case PROP_TP_CALL:
+ case PROP_TP_STREAMED_MEDIA:
g_value_set_object (value, priv->call);
break;
case PROP_INITIAL_AUDIO:
@@ -259,9 +259,9 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass)
param_spec = g_param_spec_object ("tp-call",
"tp-call", "The calls channel wrapper",
- EMPATHY_TYPE_TP_CALL,
+ 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_CALL, param_spec);
+ 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",
@@ -401,11 +401,11 @@ empathy_call_handler_new_for_contact (EmpathyContact *contact)
}
EmpathyCallHandler *
-empathy_call_handler_new_for_channel (EmpathyTpCall *call)
+empathy_call_handler_new_for_channel (EmpathyTpStreamedMedia *call)
{
return EMPATHY_CALL_HANDLER (g_object_new (EMPATHY_TYPE_CALL_HANDLER,
"tp-call", call,
- "initial-video", empathy_tp_call_is_receiving_video (call),
+ "initial-video", empathy_tp_streamed_media_is_receiving_video (call),
NULL));
}
@@ -629,7 +629,7 @@ empathy_call_handler_tf_stream_src_pad_added_cb (TfStream *stream,
static gboolean
empathy_call_handler_tf_stream_request_resource_cb (TfStream *stream,
- guint direction, EmpathyTpCall *call)
+ guint direction, EmpathyTpStreamedMedia *call)
{
gboolean ret;
guint media_type;
@@ -776,7 +776,7 @@ empathy_call_handler_request_cb (GObject *source,
account = tp_account_channel_request_get_account (req);
- priv->call = empathy_tp_call_new (account, channel);
+ priv->call = empathy_tp_streamed_media_new (account, channel);
g_object_notify (G_OBJECT (self), "tp-call");
@@ -797,12 +797,12 @@ empathy_call_handler_start_call (EmpathyCallHandler *handler,
if (priv->call != NULL)
{
empathy_call_handler_start_tpfs (handler);
- empathy_tp_call_accept_incoming_call (priv->call);
+ empathy_tp_streamed_media_accept_incoming_call (priv->call);
return;
}
- /* No TpCall object (we are redialing). Request a new media channel that
- * will be used to create a new EmpathyTpCall. */
+ /* 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);
@@ -831,7 +831,7 @@ empathy_call_handler_stop_call (EmpathyCallHandler *handler)
if (priv->call != NULL)
{
- empathy_tp_call_leave (priv->call);
+ empathy_tp_streamed_media_leave (priv->call);
g_object_unref (priv->call);
}
diff --git a/libempathy/empathy-call-handler.h b/libempathy/empathy-call-handler.h
index 9f6fd9e3b..1e0fd7165 100644
--- a/libempathy/empathy-call-handler.h
+++ b/libempathy/empathy-call-handler.h
@@ -26,7 +26,7 @@
#include <gst/gst.h>
#include <gst/farsight/fs-conference-iface.h>
-#include <libempathy/empathy-tp-call.h>
+#include <libempathy/empathy-tp-streamed-media.h>
#include <libempathy/empathy-contact.h>
G_BEGIN_DECLS
@@ -66,7 +66,7 @@ EmpathyCallHandler * empathy_call_handler_new_for_contact (
EmpathyContact *contact);
EmpathyCallHandler * empathy_call_handler_new_for_channel (
- EmpathyTpCall *call);
+ EmpathyTpStreamedMedia *call);
void empathy_call_handler_start_call (EmpathyCallHandler *handler,
gint64 timestamp);
diff --git a/libempathy/empathy-tp-call.h b/libempathy/empathy-tp-call.h
deleted file mode 100644
index c633da3ad..000000000
--- a/libempathy/empathy-tp-call.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2007 Elliot Fairweather
- * Copyright (C) 2007-2008 Collabora Ltd.
- *
- * 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
- *
- * Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
- * Xavier Claessens <xclaesse@gmail.com>
- */
-
-#ifndef __EMPATHY_TP_CALL_H__
-#define __EMPATHY_TP_CALL_H__
-
-#include <glib.h>
-#include <telepathy-glib/channel.h>
-
-#include "empathy-contact.h"
-
-G_BEGIN_DECLS
-
-#define EMPATHY_TYPE_TP_CALL (empathy_tp_call_get_type ())
-#define EMPATHY_TP_CALL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), \
- EMPATHY_TYPE_TP_CALL, EmpathyTpCall))
-#define EMPATHY_TP_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
- EMPATHY_TYPE_TP_CALL, EmpathyTpCallClass))
-#define EMPATHY_IS_TP_CALL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), \
- EMPATHY_TYPE_TP_CALL))
-#define EMPATHY_IS_TP_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
- EMPATHY_TYPE_TP_CALL))
-#define EMPATHY_TP_CALL_GET_CLASS(object) \
- (G_TYPE_INSTANCE_GET_CLASS ((object), \
- EMPATHY_TYPE_TP_CALL, EmpathyTpCallClass))
-
-typedef struct _EmpathyTpCall EmpathyTpCall;
-typedef struct _EmpathyTpCallClass EmpathyTpCallClass;
-
-struct _EmpathyTpCall {
- GObject parent;
- gpointer priv;
-};
-
-struct _EmpathyTpCallClass {
- GObjectClass parent_class;
-};
-
-typedef enum
-{
- EMPATHY_TP_CALL_STATUS_READYING,
- EMPATHY_TP_CALL_STATUS_PENDING,
- EMPATHY_TP_CALL_STATUS_ACCEPTED,
- EMPATHY_TP_CALL_STATUS_CLOSED
-} EmpathyTpCallStatus;
-
-typedef struct
-{
- gboolean exists;
- guint id;
- guint state;
- guint direction;
-} EmpathyTpCallStream;
-
-GType empathy_tp_call_get_type (void) G_GNUC_CONST;
-EmpathyTpCall *empathy_tp_call_new (TpAccount *account,
- TpChannel *channel);
-void empathy_tp_call_close (EmpathyTpCall *call);
-
-void empathy_tp_call_accept_incoming_call (EmpathyTpCall *call);
-void empathy_tp_call_request_video_stream_direction (EmpathyTpCall *call,
- gboolean is_sending);
-void empathy_tp_call_start_tone (EmpathyTpCall *call, TpDTMFEvent event);
-void empathy_tp_call_stop_tone (EmpathyTpCall *call);
-gboolean empathy_tp_call_has_dtmf (EmpathyTpCall *call);
-gboolean empathy_tp_call_is_receiving_video (EmpathyTpCall *call);
-gboolean empathy_tp_call_is_sending_video (EmpathyTpCall *call);
-
-const gchar * empathy_tp_call_get_connection_manager (EmpathyTpCall *self);
-
-gboolean empathy_tp_call_has_initial_video (EmpathyTpCall *self);
-
-void empathy_tp_call_leave (EmpathyTpCall *self);
-
-EmpathyTpCallStatus empathy_tp_call_get_status (EmpathyTpCall *self);
-
-TpAccount * empathy_tp_call_get_account (EmpathyTpCall *self);
-
-G_END_DECLS
-
-#endif /* __EMPATHY_TP_CALL_H__ */
diff --git a/libempathy/empathy-tp-call.c b/libempathy/empathy-tp-streamed-media.c
index 1a53de65d..b79e4b6b5 100644
--- a/libempathy/empathy-tp-call.c
+++ b/libempathy/empathy-tp-streamed-media.c
@@ -27,7 +27,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
-#include "empathy-tp-call.h"
+#include "empathy-tp-streamed-media.h"
#include "empathy-tp-contact-factory.h"
#include "empathy-utils.h"
#include "empathy-marshal.h"
@@ -35,7 +35,7 @@
#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
#include "empathy-debug.h"
-#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpCall)
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpStreamedMedia)
typedef struct
{
gboolean dispose_has_run;
@@ -45,9 +45,9 @@ typedef struct
gboolean is_incoming;
guint status;
- EmpathyTpCallStream *audio;
- EmpathyTpCallStream *video;
-} EmpathyTpCallPriv;
+ EmpathyTpStreamedMediaStream *audio;
+ EmpathyTpStreamedMediaStream *video;
+} EmpathyTpStreamedMediaPriv;
/* signal enum */
enum {
@@ -69,17 +69,17 @@ enum
PROP_VIDEO_STREAM
};
-G_DEFINE_TYPE (EmpathyTpCall, empathy_tp_call, G_TYPE_OBJECT)
+G_DEFINE_TYPE (EmpathyTpStreamedMedia, empathy_tp_streamed_media, G_TYPE_OBJECT)
static void
-tp_call_add_stream (EmpathyTpCall *call,
+tp_streamed_media_add_stream (EmpathyTpStreamedMedia *call,
guint stream_id,
guint contact_handle,
guint stream_type,
guint stream_state,
guint stream_direction)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
switch (stream_type)
{
@@ -107,7 +107,7 @@ tp_call_add_stream (EmpathyTpCall *call,
}
static void
-tp_call_stream_added_cb (TpChannel *channel,
+tp_streamed_media_stream_added_cb (TpChannel *channel,
guint stream_id,
guint contact_handle,
guint stream_type,
@@ -117,18 +117,18 @@ tp_call_stream_added_cb (TpChannel *channel,
DEBUG ("Stream added - stream id: %d, contact handle: %d, stream type: %d",
stream_id, contact_handle, stream_type);
- tp_call_add_stream (EMPATHY_TP_CALL (call), stream_id, contact_handle,
+ tp_streamed_media_add_stream (EMPATHY_TP_STREAMED_MEDIA (call), stream_id, contact_handle,
stream_type, TP_MEDIA_STREAM_STATE_DISCONNECTED,
TP_MEDIA_STREAM_DIRECTION_NONE);
}
static void
-tp_call_stream_removed_cb (TpChannel *channel,
+tp_streamed_media_stream_removed_cb (TpChannel *channel,
guint stream_id,
gpointer user_data,
GObject *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
DEBUG ("Stream removed - stream id: %d", stream_id);
@@ -145,13 +145,13 @@ tp_call_stream_removed_cb (TpChannel *channel,
}
static void
-tp_call_stream_state_changed_cb (TpChannel *proxy,
+tp_streamed_media_stream_state_changed_cb (TpChannel *proxy,
guint stream_id,
guint stream_state,
gpointer user_data,
GObject *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
DEBUG ("Stream state changed - stream id: %d, state state: %d",
stream_id, stream_state);
@@ -169,14 +169,14 @@ tp_call_stream_state_changed_cb (TpChannel *proxy,
}
static void
-tp_call_stream_direction_changed_cb (TpChannel *channel,
+tp_streamed_media_stream_direction_changed_cb (TpChannel *channel,
guint stream_id,
guint stream_direction,
guint pending_flags,
gpointer user_data,
GObject *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
DEBUG ("Stream direction changed - stream: %d, direction: %d",
stream_id, stream_direction);
@@ -194,7 +194,7 @@ tp_call_stream_direction_changed_cb (TpChannel *channel,
}
static void
-tp_call_request_streams_cb (TpChannel *channel,
+tp_streamed_media_request_streams_cb (TpChannel *channel,
const GPtrArray *streams,
const GError *error,
gpointer user_data,
@@ -224,16 +224,16 @@ tp_call_request_streams_cb (TpChannel *channel,
stream_state = g_value_get_uint (g_value_array_get_nth (values, 3));
stream_direction = g_value_get_uint (g_value_array_get_nth (values, 4));
- tp_call_add_stream (EMPATHY_TP_CALL (call), stream_id, contact_handle,
+ tp_streamed_media_add_stream (EMPATHY_TP_STREAMED_MEDIA (call), stream_id, contact_handle,
stream_type, stream_state, stream_direction);
}
}
static void
-tp_call_request_streams_for_capabilities (EmpathyTpCall *call,
+tp_streamed_media_request_streams_for_capabilities (EmpathyTpStreamedMedia *call,
EmpathyCapabilities capabilities)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
GArray *stream_types;
guint handle;
guint stream_type;
@@ -259,20 +259,20 @@ tp_call_request_streams_for_capabilities (EmpathyTpCall *call,
}
tp_cli_channel_type_streamed_media_call_request_streams (priv->channel, -1,
- handle, stream_types, tp_call_request_streams_cb, NULL, NULL,
+ handle, stream_types, tp_streamed_media_request_streams_cb, NULL, NULL,
G_OBJECT (call));
g_array_free (stream_types, TRUE);
}
static void
-tp_call_got_contact_cb (TpConnection *connection,
+tp_streamed_media_got_contact_cb (TpConnection *connection,
EmpathyContact *contact,
const GError *error,
gpointer user_data,
GObject *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
if (error)
{
@@ -282,9 +282,9 @@ tp_call_got_contact_cb (TpConnection *connection,
priv->contact = g_object_ref (contact);
- if (priv->status < EMPATHY_TP_CALL_STATUS_PENDING)
+ if (priv->status < EMPATHY_TP_STREAMED_MEDIA_STATUS_PENDING)
{
- priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
+ priv->status = EMPATHY_TP_STREAMED_MEDIA_STATUS_PENDING;
g_object_notify (G_OBJECT (call), "status");
}
@@ -292,9 +292,9 @@ tp_call_got_contact_cb (TpConnection *connection,
}
static void
-tp_call_update_status (EmpathyTpCall *call)
+tp_streamed_media_update_status (EmpathyTpStreamedMedia *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
TpHandle self_handle;
const TpIntSet *set;
TpIntSetIter iter;
@@ -306,11 +306,11 @@ tp_call_update_status (EmpathyTpCall *call)
tp_intset_iter_init (&iter, set);
while (tp_intset_iter_next (&iter))
{
- if (priv->status == EMPATHY_TP_CALL_STATUS_PENDING &&
+ if (priv->status == EMPATHY_TP_STREAMED_MEDIA_STATUS_PENDING &&
((priv->is_incoming && iter.element == self_handle) ||
(!priv->is_incoming && iter.element != self_handle)))
{
- priv->status = EMPATHY_TP_CALL_STATUS_ACCEPTED;
+ priv->status = EMPATHY_TP_STREAMED_MEDIA_STATUS_ACCEPTED;
g_object_notify (G_OBJECT (call), "status");
}
}
@@ -319,21 +319,21 @@ tp_call_update_status (EmpathyTpCall *call)
}
static void
-tp_call_channel_invalidated_cb (TpChannel *channel,
+tp_streamed_media_channel_invalidated_cb (TpChannel *channel,
GQuark domain,
gint code,
gchar *message,
- EmpathyTpCall *call)
+ EmpathyTpStreamedMedia *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
DEBUG ("Channel invalidated: %s", message);
- priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
+ priv->status = EMPATHY_TP_STREAMED_MEDIA_STATUS_CLOSED;
g_object_notify (G_OBJECT (call), "status");
}
static void
-tp_call_async_cb (TpProxy *proxy,
+tp_streamed_media_async_cb (TpProxy *proxy,
const GError *error,
gpointer user_data,
GObject *call)
@@ -343,15 +343,15 @@ tp_call_async_cb (TpProxy *proxy,
}
static void
-tp_call_stream_error_cb (TpChannel *channel,
+tp_streamed_media_stream_error_cb (TpChannel *channel,
guint stream_id,
guint error_code,
const gchar *msg,
gpointer user_data,
GObject *call)
{
- EmpathyTpCall *self = EMPATHY_TP_CALL (call);
- EmpathyTpCallPriv *priv = GET_PRIV (self);
+ EmpathyTpStreamedMedia *self = EMPATHY_TP_STREAMED_MEDIA (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (self);
DEBUG ("Stream error on stream %u: %s (code: %u)", stream_id, msg,
error_code);
@@ -371,35 +371,35 @@ tp_call_stream_error_cb (TpChannel *channel,
}
static GObject *
-tp_call_constructor (GType type,
+tp_streamed_media_constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
{
GObject *object;
- EmpathyTpCall *call;
- EmpathyTpCallPriv *priv;
+ EmpathyTpStreamedMedia *call;
+ EmpathyTpStreamedMediaPriv *priv;
- object = G_OBJECT_CLASS (empathy_tp_call_parent_class)->constructor (type,
+ object = G_OBJECT_CLASS (empathy_tp_streamed_media_parent_class)->constructor (type,
n_construct_params, construct_params);
- call = EMPATHY_TP_CALL (object);
+ call = EMPATHY_TP_STREAMED_MEDIA (object);
priv = GET_PRIV (call);
/* Setup streamed media channel */
g_signal_connect (priv->channel, "invalidated",
- G_CALLBACK (tp_call_channel_invalidated_cb), call);
+ G_CALLBACK (tp_streamed_media_channel_invalidated_cb), call);
tp_cli_channel_type_streamed_media_connect_to_stream_added (priv->channel,
- tp_call_stream_added_cb, NULL, NULL, G_OBJECT (call), NULL);
+ tp_streamed_media_stream_added_cb, NULL, NULL, G_OBJECT (call), NULL);
tp_cli_channel_type_streamed_media_connect_to_stream_removed (priv->channel,
- tp_call_stream_removed_cb, NULL, NULL, G_OBJECT (call), NULL);
+ tp_streamed_media_stream_removed_cb, NULL, NULL, G_OBJECT (call), NULL);
tp_cli_channel_type_streamed_media_connect_to_stream_state_changed (priv->channel,
- tp_call_stream_state_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
+ tp_streamed_media_stream_state_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed (priv->channel,
- tp_call_stream_direction_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
+ tp_streamed_media_stream_direction_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
tp_cli_channel_type_streamed_media_connect_to_stream_error (priv->channel,
- tp_call_stream_error_cb, NULL, NULL, G_OBJECT (call), NULL);
+ tp_streamed_media_stream_error_cb, NULL, NULL, G_OBJECT (call), NULL);
tp_cli_channel_type_streamed_media_call_list_streams (priv->channel, -1,
- tp_call_request_streams_cb, NULL, NULL, G_OBJECT (call));
+ tp_streamed_media_request_streams_cb, NULL, NULL, G_OBJECT (call));
/* Is the call incoming? */
priv->is_incoming = !tp_channel_get_requested (priv->channel);
@@ -407,20 +407,20 @@ tp_call_constructor (GType type,
/* Get the remote contact */
empathy_tp_contact_factory_get_from_handle (
tp_channel_borrow_connection (priv->channel),
- tp_channel_get_handle (priv->channel, NULL), tp_call_got_contact_cb,
+ tp_channel_get_handle (priv->channel, NULL), tp_streamed_media_got_contact_cb,
NULL, NULL, object);
/* Update status when members changes */
- tp_call_update_status (call);
+ tp_streamed_media_update_status (call);
tp_g_signal_connect_object (priv->channel, "group-members-changed",
- G_CALLBACK (tp_call_update_status), call, G_CONNECT_SWAPPED);
+ G_CALLBACK (tp_streamed_media_update_status), call, G_CONNECT_SWAPPED);
return object;
}
static void
-tp_call_dispose (GObject *object)
+tp_streamed_media_dispose (GObject *object)
{
- EmpathyTpCallPriv *priv = GET_PRIV (object);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (object);
DEBUG ("Disposing: %p, %d", object, priv->dispose_has_run);
@@ -432,7 +432,7 @@ tp_call_dispose (GObject *object)
if (priv->channel != NULL)
{
g_signal_handlers_disconnect_by_func (priv->channel,
- tp_call_channel_invalidated_cb, object);
+ tp_streamed_media_channel_invalidated_cb, object);
g_object_unref (priv->channel);
priv->channel = NULL;
@@ -443,30 +443,30 @@ tp_call_dispose (GObject *object)
tp_clear_object (&priv->account);
- if (G_OBJECT_CLASS (empathy_tp_call_parent_class)->dispose)
- G_OBJECT_CLASS (empathy_tp_call_parent_class)->dispose (object);
+ if (G_OBJECT_CLASS (empathy_tp_streamed_media_parent_class)->dispose)
+ G_OBJECT_CLASS (empathy_tp_streamed_media_parent_class)->dispose (object);
}
static void
-tp_call_finalize (GObject *object)
+tp_streamed_media_finalize (GObject *object)
{
- EmpathyTpCallPriv *priv = GET_PRIV (object);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (object);
DEBUG ("Finalizing: %p", object);
- g_slice_free (EmpathyTpCallStream, priv->audio);
- g_slice_free (EmpathyTpCallStream, priv->video);
+ g_slice_free (EmpathyTpStreamedMediaStream, priv->audio);
+ g_slice_free (EmpathyTpStreamedMediaStream, priv->video);
- (G_OBJECT_CLASS (empathy_tp_call_parent_class)->finalize) (object);
+ (G_OBJECT_CLASS (empathy_tp_streamed_media_parent_class)->finalize) (object);
}
static void
-tp_call_set_property (GObject *object,
+tp_streamed_media_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
- EmpathyTpCallPriv *priv = GET_PRIV (object);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (object);
switch (prop_id)
{
@@ -483,12 +483,12 @@ tp_call_set_property (GObject *object,
}
static void
-tp_call_get_property (GObject *object,
+tp_streamed_media_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
- EmpathyTpCallPriv *priv = GET_PRIV (object);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (object);
switch (prop_id)
{
@@ -517,17 +517,17 @@ tp_call_get_property (GObject *object,
}
static void
-empathy_tp_call_class_init (EmpathyTpCallClass *klass)
+empathy_tp_streamed_media_class_init (EmpathyTpStreamedMediaClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->constructor = tp_call_constructor;
- object_class->dispose = tp_call_dispose;
- object_class->finalize = tp_call_finalize;
- object_class->set_property = tp_call_set_property;
- object_class->get_property = tp_call_get_property;
+ object_class->constructor = tp_streamed_media_constructor;
+ object_class->dispose = tp_streamed_media_dispose;
+ object_class->finalize = tp_streamed_media_finalize;
+ object_class->set_property = tp_streamed_media_set_property;
+ object_class->get_property = tp_streamed_media_get_property;
- g_type_class_add_private (klass, sizeof (EmpathyTpCallPriv));
+ g_type_class_add_private (klass, sizeof (EmpathyTpStreamedMediaPriv));
g_object_class_install_property (object_class, PROP_ACCOUNT,
g_param_spec_object ("account", "TpAccount", "TpAccount",
@@ -581,42 +581,42 @@ empathy_tp_call_class_init (EmpathyTpCallClass *klass)
}
static void
-empathy_tp_call_init (EmpathyTpCall *call)
+empathy_tp_streamed_media_init (EmpathyTpStreamedMedia *call)
{
- EmpathyTpCallPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (call,
- EMPATHY_TYPE_TP_CALL, EmpathyTpCallPriv);
+ EmpathyTpStreamedMediaPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (call,
+ EMPATHY_TYPE_TP_STREAMED_MEDIA, EmpathyTpStreamedMediaPriv);
call->priv = priv;
- priv->status = EMPATHY_TP_CALL_STATUS_READYING;
+ priv->status = EMPATHY_TP_STREAMED_MEDIA_STATUS_READYING;
priv->contact = NULL;
- priv->audio = g_slice_new0 (EmpathyTpCallStream);
- priv->video = g_slice_new0 (EmpathyTpCallStream);
+ priv->audio = g_slice_new0 (EmpathyTpStreamedMediaStream);
+ priv->video = g_slice_new0 (EmpathyTpStreamedMediaStream);
priv->audio->exists = FALSE;
priv->video->exists = FALSE;
}
-EmpathyTpCall *
-empathy_tp_call_new (TpAccount *account,
+EmpathyTpStreamedMedia *
+empathy_tp_streamed_media_new (TpAccount *account,
TpChannel *channel)
{
g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL);
g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
- return g_object_new (EMPATHY_TYPE_TP_CALL,
+ return g_object_new (EMPATHY_TYPE_TP_STREAMED_MEDIA,
"account", account,
"channel", channel,
NULL);
}
void
-empathy_tp_call_accept_incoming_call (EmpathyTpCall *call)
+empathy_tp_streamed_media_accept_incoming_call (EmpathyTpStreamedMedia *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
TpHandle self_handle;
GArray handles = {(gchar *) &self_handle, 1};
- g_return_if_fail (EMPATHY_IS_TP_CALL (call));
- g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_PENDING);
+ g_return_if_fail (EMPATHY_IS_TP_STREAMED_MEDIA (call));
+ g_return_if_fail (priv->status == EMPATHY_TP_STREAMED_MEDIA_STATUS_PENDING);
if (!priv->is_incoming)
return;
@@ -629,13 +629,13 @@ empathy_tp_call_accept_incoming_call (EmpathyTpCall *call)
}
void
-empathy_tp_call_close (EmpathyTpCall *call)
+empathy_tp_streamed_media_close (EmpathyTpStreamedMedia *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
- g_return_if_fail (EMPATHY_IS_TP_CALL (call));
+ g_return_if_fail (EMPATHY_IS_TP_STREAMED_MEDIA (call));
- if (priv->status == EMPATHY_TP_CALL_STATUS_CLOSED)
+ if (priv->status == EMPATHY_TP_STREAMED_MEDIA_STATUS_CLOSED)
return;
DEBUG ("Closing channel");
@@ -643,26 +643,26 @@ empathy_tp_call_close (EmpathyTpCall *call)
tp_cli_channel_call_close (priv->channel, -1,
NULL, NULL, NULL, NULL);
- priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
+ priv->status = EMPATHY_TP_STREAMED_MEDIA_STATUS_CLOSED;
g_object_notify (G_OBJECT (call), "status");
}
void
-empathy_tp_call_request_video_stream_direction (EmpathyTpCall *call,
+empathy_tp_streamed_media_request_video_stream_direction (EmpathyTpStreamedMedia *call,
gboolean is_sending)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
guint new_direction;
- g_return_if_fail (EMPATHY_IS_TP_CALL (call));
- g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_ACCEPTED);
+ g_return_if_fail (EMPATHY_IS_TP_STREAMED_MEDIA (call));
+ g_return_if_fail (priv->status == EMPATHY_TP_STREAMED_MEDIA_STATUS_ACCEPTED);
DEBUG ("Requesting video stream direction - is_sending: %d", is_sending);
if (!priv->video->exists)
{
if (is_sending)
- tp_call_request_streams_for_capabilities (call,
+ tp_streamed_media_request_streams_for_capabilities (call,
EMPATHY_CAPABILITIES_VIDEO);
return;
}
@@ -675,56 +675,56 @@ empathy_tp_call_request_video_stream_direction (EmpathyTpCall *call,
tp_cli_channel_type_streamed_media_call_request_stream_direction (priv->channel,
-1, priv->video->id, new_direction,
(tp_cli_channel_type_streamed_media_callback_for_request_stream_direction)
- tp_call_async_cb, NULL, NULL, G_OBJECT (call));
+ tp_streamed_media_async_cb, NULL, NULL, G_OBJECT (call));
}
void
-empathy_tp_call_start_tone (EmpathyTpCall *call, TpDTMFEvent event)
+empathy_tp_streamed_media_start_tone (EmpathyTpStreamedMedia *call, TpDTMFEvent event)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
- g_return_if_fail (EMPATHY_IS_TP_CALL (call));
- g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_ACCEPTED);
+ g_return_if_fail (EMPATHY_IS_TP_STREAMED_MEDIA (call));
+ g_return_if_fail (priv->status == EMPATHY_TP_STREAMED_MEDIA_STATUS_ACCEPTED);
if (!priv->audio->exists)
return;
tp_cli_channel_interface_dtmf_call_start_tone (priv->channel, -1,
priv->audio->id, event,
- (tp_cli_channel_interface_dtmf_callback_for_start_tone) tp_call_async_cb,
+ (tp_cli_channel_interface_dtmf_callback_for_start_tone) tp_streamed_media_async_cb,
"starting tone", NULL, G_OBJECT (call));
}
void
-empathy_tp_call_stop_tone (EmpathyTpCall *call)
+empathy_tp_streamed_media_stop_tone (EmpathyTpStreamedMedia *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
- g_return_if_fail (EMPATHY_IS_TP_CALL (call));
- g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_ACCEPTED);
+ g_return_if_fail (EMPATHY_IS_TP_STREAMED_MEDIA (call));
+ g_return_if_fail (priv->status == EMPATHY_TP_STREAMED_MEDIA_STATUS_ACCEPTED);
if (!priv->audio->exists)
return;
tp_cli_channel_interface_dtmf_call_stop_tone (priv->channel, -1,
priv->audio->id,
- (tp_cli_channel_interface_dtmf_callback_for_stop_tone) tp_call_async_cb,
+ (tp_cli_channel_interface_dtmf_callback_for_stop_tone) tp_streamed_media_async_cb,
"stoping tone", NULL, G_OBJECT (call));
}
gboolean
-empathy_tp_call_has_dtmf (EmpathyTpCall *call)
+empathy_tp_streamed_media_has_dtmf (EmpathyTpStreamedMedia *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
- g_return_val_if_fail (EMPATHY_IS_TP_CALL (call), FALSE);
+ g_return_val_if_fail (EMPATHY_IS_TP_STREAMED_MEDIA (call), FALSE);
return tp_proxy_has_interface_by_id (priv->channel,
TP_IFACE_QUARK_CHANNEL_INTERFACE_DTMF);
}
/**
- * empathy_tp_call_is_receiving_video:
+ * empathy_tp_streamed_media_is_receiving_video:
* @call: the call
*
* Indicates if the call is receiving video or not.
@@ -732,11 +732,11 @@ empathy_tp_call_has_dtmf (EmpathyTpCall *call)
* Returns: %TRUE if the call is currently receiving video, %FALSE otherwise.
*/
gboolean
-empathy_tp_call_is_receiving_video (EmpathyTpCall *call)
+empathy_tp_streamed_media_is_receiving_video (EmpathyTpStreamedMedia *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
- g_return_val_if_fail (EMPATHY_IS_TP_CALL (call), FALSE);
+ g_return_val_if_fail (EMPATHY_IS_TP_STREAMED_MEDIA (call), FALSE);
if (!priv->video->exists)
return FALSE;
@@ -746,7 +746,7 @@ empathy_tp_call_is_receiving_video (EmpathyTpCall *call)
}
/**
- * empathy_tp_call_is_sending_video:
+ * empathy_tp_streamed_media_is_sending_video:
* @call: the call
*
* Indicates if the call is sending video or not.
@@ -754,11 +754,11 @@ empathy_tp_call_is_receiving_video (EmpathyTpCall *call)
* Returns: %TRUE if the call is currently sending video, %FALSE otherwise.
*/
gboolean
-empathy_tp_call_is_sending_video (EmpathyTpCall *call)
+empathy_tp_streamed_media_is_sending_video (EmpathyTpStreamedMedia *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
- g_return_val_if_fail (EMPATHY_IS_TP_CALL (call), FALSE);
+ g_return_val_if_fail (EMPATHY_IS_TP_STREAMED_MEDIA (call), FALSE);
if (!priv->video->exists)
return FALSE;
@@ -768,17 +768,17 @@ empathy_tp_call_is_sending_video (EmpathyTpCall *call)
}
const gchar *
-empathy_tp_call_get_connection_manager (EmpathyTpCall *self)
+empathy_tp_streamed_media_get_connection_manager (EmpathyTpStreamedMedia *self)
{
- EmpathyTpCallPriv *priv = GET_PRIV (self);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (self);
return tp_account_get_connection_manager (priv->account);
}
gboolean
-empathy_tp_call_has_initial_video (EmpathyTpCall *self)
+empathy_tp_streamed_media_has_initial_video (EmpathyTpStreamedMedia *self)
{
- EmpathyTpCallPriv *priv = GET_PRIV (self);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (self);
GHashTable *props;
gboolean initial_video;
gboolean valid;
@@ -803,26 +803,26 @@ leave_remove_members_cb (TpChannel *proxy,
gpointer user_data,
GObject *weak_object)
{
- EmpathyTpCall *self = user_data;
+ EmpathyTpStreamedMedia *self = user_data;
if (error == NULL)
return;
DEBUG ("RemoveMembers failed (%s); closing the channel", error->message);
- empathy_tp_call_close (self);
+ empathy_tp_streamed_media_close (self);
}
void
-empathy_tp_call_leave (EmpathyTpCall *self)
+empathy_tp_streamed_media_leave (EmpathyTpStreamedMedia *self)
{
- EmpathyTpCallPriv *priv = GET_PRIV (self);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (self);
TpHandle self_handle;
GArray array = { (gchar *) &self_handle, 1 };
if (!tp_proxy_has_interface_by_id (priv->channel,
TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP))
{
- empathy_tp_call_close (self);
+ empathy_tp_streamed_media_close (self);
return;
}
@@ -830,7 +830,7 @@ empathy_tp_call_leave (EmpathyTpCall *self)
if (self_handle == 0)
{
/* we are not member of the channel */
- empathy_tp_call_close (self);
+ empathy_tp_streamed_media_close (self);
return;
}
@@ -838,18 +838,18 @@ empathy_tp_call_leave (EmpathyTpCall *self)
"", leave_remove_members_cb, self, NULL, G_OBJECT (self));
}
-EmpathyTpCallStatus
-empathy_tp_call_get_status (EmpathyTpCall *self)
+EmpathyTpStreamedMediaStatus
+empathy_tp_streamed_media_get_status (EmpathyTpStreamedMedia *self)
{
- EmpathyTpCallPriv *priv = GET_PRIV (self);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (self);
return priv->status;
}
TpAccount *
-empathy_tp_call_get_account (EmpathyTpCall *self)
+empathy_tp_streamed_media_get_account (EmpathyTpStreamedMedia *self)
{
- EmpathyTpCallPriv *priv = GET_PRIV (self);
+ EmpathyTpStreamedMediaPriv *priv = GET_PRIV (self);
return priv->account;
}
diff --git a/libempathy/empathy-tp-streamed-media.h b/libempathy/empathy-tp-streamed-media.h
new file mode 100644
index 000000000..35612b292
--- /dev/null
+++ b/libempathy/empathy-tp-streamed-media.h
@@ -0,0 +1,113 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2007 Elliot Fairweather
+ * Copyright (C) 2007-2008 Collabora Ltd.
+ *
+ * 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
+ *
+ * Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
+ * Xavier Claessens <xclaesse@gmail.com>
+ */
+
+#ifndef __EMPATHY_TP_STREAMED_MEDIA_H__
+#define __EMPATHY_TP_STREAMED_MEDIA_H__
+
+#include <glib.h>
+#include <telepathy-glib/channel.h>
+
+#include "empathy-contact.h"
+
+G_BEGIN_DECLS
+
+#define EMPATHY_TYPE_TP_STREAMED_MEDIA (empathy_tp_streamed_media_get_type ())
+#define EMPATHY_TP_STREAMED_MEDIA(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), \
+ EMPATHY_TYPE_TP_STREAMED_MEDIA, EmpathyTpStreamedMedia))
+#define EMPATHY_TP_STREAMED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
+ EMPATHY_TYPE_TP_STREAMED_MEDIA, EmpathyTpStreamedMediaClass))
+#define EMPATHY_IS_TP_STREAMED_MEDIA(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), \
+ EMPATHY_TYPE_TP_STREAMED_MEDIA))
+#define EMPATHY_IS_TP_STREAMED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ EMPATHY_TYPE_TP_STREAMED_MEDIA))
+#define EMPATHY_TP_STREAMED_MEDIA_GET_CLASS(object) \
+ (G_TYPE_INSTANCE_GET_CLASS ((object), \
+ EMPATHY_TYPE_TP_STREAMED_MEDIA, EmpathyTpStreamedMediaClass))
+
+typedef struct _EmpathyTpStreamedMedia EmpathyTpStreamedMedia;
+typedef struct _EmpathyTpStreamedMediaClass EmpathyTpStreamedMediaClass;
+
+struct _EmpathyTpStreamedMedia {
+ GObject parent;
+ gpointer priv;
+};
+
+struct _EmpathyTpStreamedMediaClass {
+ GObjectClass parent_class;
+};
+
+typedef enum
+{
+ EMPATHY_TP_STREAMED_MEDIA_STATUS_READYING,
+ EMPATHY_TP_STREAMED_MEDIA_STATUS_PENDING,
+ EMPATHY_TP_STREAMED_MEDIA_STATUS_ACCEPTED,
+ EMPATHY_TP_STREAMED_MEDIA_STATUS_CLOSED
+} EmpathyTpStreamedMediaStatus;
+
+typedef struct
+{
+ gboolean exists;
+ guint id;
+ guint state;
+ guint direction;
+} EmpathyTpStreamedMediaStream;
+
+GType empathy_tp_streamed_media_get_type (void) G_GNUC_CONST;
+EmpathyTpStreamedMedia *empathy_tp_streamed_media_new (TpAccount *account,
+ TpChannel *channel);
+void empathy_tp_streamed_media_close (EmpathyTpStreamedMedia *streamed_media);
+
+void empathy_tp_streamed_media_accept_incoming_call (
+ EmpathyTpStreamedMedia *streamed_media);
+void empathy_tp_streamed_media_request_video_stream_direction (
+ EmpathyTpStreamedMedia *streamed_media,
+ gboolean is_sending);
+void empathy_tp_streamed_media_start_tone (
+ EmpathyTpStreamedMedia *streamed_media,
+ TpDTMFEvent event);
+void empathy_tp_streamed_media_stop_tone (
+ EmpathyTpStreamedMedia *streamed_media);
+gboolean empathy_tp_streamed_media_has_dtmf (
+ EmpathyTpStreamedMedia *streamed_media);
+gboolean empathy_tp_streamed_media_is_receiving_video (
+ EmpathyTpStreamedMedia *streamed_media);
+gboolean empathy_tp_streamed_media_is_sending_video (
+ EmpathyTpStreamedMedia *streamed_media);
+
+const gchar * empathy_tp_streamed_media_get_connection_manager (
+ EmpathyTpStreamedMedia *self);
+
+gboolean empathy_tp_streamed_media_has_initial_video (
+ EmpathyTpStreamedMedia *self);
+
+void empathy_tp_streamed_media_leave (EmpathyTpStreamedMedia *self);
+
+EmpathyTpStreamedMediaStatus empathy_tp_streamed_media_get_status (
+ EmpathyTpStreamedMedia *self);
+
+TpAccount * empathy_tp_streamed_media_get_account (
+ EmpathyTpStreamedMedia *self);
+
+G_END_DECLS
+
+#endif /* __EMPATHY_TP_STREAMED_MEDIA_H__ */
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 3730e43a8..d089c6fd5 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -50,7 +50,6 @@
#include "empathy-individual-manager.h"
#include "empathy-dispatcher.h"
#include "empathy-presence-manager.h"
-#include "empathy-tp-call.h"
#include "empathy-tp-contact-factory.h"
#include <extensions/extensions.h>
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index d50012315..2b9c48ce0 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -280,7 +280,7 @@ static void empathy_call_window_restart_call (EmpathyCallWindow *window);
static void empathy_call_window_status_message (EmpathyCallWindow *window,
gchar *message);
-static void empathy_call_window_update_avatars_visibility (EmpathyTpCall *call,
+static void empathy_call_window_update_avatars_visibility (EmpathyTpStreamedMedia *call,
EmpathyCallWindow *window);
static gboolean empathy_call_window_bus_message (GstBus *bus,
@@ -342,7 +342,7 @@ static void
dtmf_button_pressed_cb (GtkButton *button, EmpathyCallWindow *window)
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
GQuark button_quark;
TpDTMFEvent event;
@@ -352,7 +352,7 @@ dtmf_button_pressed_cb (GtkButton *button, EmpathyCallWindow *window)
event = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (button),
button_quark));
- empathy_tp_call_start_tone (call, event);
+ empathy_tp_streamed_media_start_tone (call, event);
g_object_unref (call);
}
@@ -361,11 +361,11 @@ static void
dtmf_button_released_cb (GtkButton *button, EmpathyCallWindow *window)
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
g_object_get (priv->handler, "tp-call", &call, NULL);
- empathy_tp_call_stop_tone (call);
+ empathy_tp_streamed_media_stop_tone (call);
g_object_unref (call);
}
@@ -1577,7 +1577,7 @@ empathy_call_window_constructed (GObject *object)
{
EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (object);
EmpathyCallWindowPriv *priv = GET_PRIV (self);
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
g_assert (priv->handler != NULL);
@@ -1676,7 +1676,7 @@ empathy_call_window_class_init (
}
static void
-empathy_call_window_video_stream_changed_cb (EmpathyTpCall *call,
+empathy_call_window_video_stream_changed_cb (EmpathyTpStreamedMedia *call,
GParamSpec *property, EmpathyCallWindow *self)
{
DEBUG ("video stream changed");
@@ -1686,7 +1686,7 @@ empathy_call_window_video_stream_changed_cb (EmpathyTpCall *call,
void
empathy_call_window_dispose (GObject *object)
{
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (object);
EmpathyCallWindowPriv *priv = GET_PRIV (self);
@@ -2267,7 +2267,7 @@ empathy_call_window_update_timer (gpointer user_data)
static void
display_error (EmpathyCallWindow *self,
- EmpathyTpCall *call,
+ EmpathyTpStreamedMedia *call,
const gchar *img,
const gchar *title,
const gchar *desc,
@@ -2342,7 +2342,7 @@ display_error (EmpathyCallWindow *self,
static gchar *
media_stream_error_to_txt (EmpathyCallWindow *self,
- EmpathyTpCall *call,
+ EmpathyTpStreamedMedia *call,
gboolean audio,
TpMediaStreamError error)
{
@@ -2384,7 +2384,7 @@ media_stream_error_to_txt (EmpathyCallWindow *self,
"are not installed on your computer"));
case TP_MEDIA_STREAM_ERROR_INVALID_CM_BEHAVIOR:
- cm = empathy_tp_call_get_connection_manager (call);
+ cm = empathy_tp_streamed_media_get_connection_manager (call);
url = g_strdup_printf ("http://bugs.freedesktop.org/enter_bug.cgi?"
"product=Telepathy&amp;component=%s", cm);
@@ -2411,7 +2411,7 @@ media_stream_error_to_txt (EmpathyCallWindow *self,
static void
empathy_call_window_stream_error (EmpathyCallWindow *self,
- EmpathyTpCall *call,
+ EmpathyTpStreamedMedia *call,
gboolean audio,
guint code,
const gchar *msg,
@@ -2435,7 +2435,7 @@ empathy_call_window_stream_error (EmpathyCallWindow *self,
}
static void
-empathy_call_window_audio_stream_error (EmpathyTpCall *call,
+empathy_call_window_audio_stream_error (EmpathyTpStreamedMedia *call,
guint code,
const gchar *msg,
EmpathyCallWindow *self)
@@ -2445,7 +2445,7 @@ empathy_call_window_audio_stream_error (EmpathyTpCall *call,
}
static void
-empathy_call_window_video_stream_error (EmpathyTpCall *call,
+empathy_call_window_video_stream_error (EmpathyTpStreamedMedia *call,
guint code,
const gchar *msg,
EmpathyCallWindow *self)
@@ -2459,7 +2459,7 @@ empathy_call_window_connected (gpointer user_data)
{
EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
EmpathyCallWindowPriv *priv = GET_PRIV (self);
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
gboolean can_send_video;
empathy_sound_manager_stop (priv->sound_mgr, EMPATHY_SOUND_PHONE_OUTGOING);
@@ -2473,14 +2473,14 @@ empathy_call_window_connected (gpointer user_data)
G_CALLBACK (empathy_call_window_video_stream_changed_cb),
self, 0);
- if (empathy_tp_call_has_dtmf (call))
+ if (empathy_tp_streamed_media_has_dtmf (call))
gtk_widget_set_sensitive (priv->dtmf_panel, TRUE);
if (priv->video_input == NULL)
empathy_call_window_set_send_video (self, CAMERA_STATE_OFF);
priv->sending_video = can_send_video ?
- empathy_tp_call_is_sending_video (call) : FALSE;
+ empathy_tp_streamed_media_is_sending_video (call) : FALSE;
gtk_toggle_tool_button_set_active (
GTK_TOGGLE_TOOL_BUTTON (priv->tool_button_camera_on),
@@ -2795,12 +2795,12 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
}
static void
-empathy_call_window_update_avatars_visibility (EmpathyTpCall *call,
+empathy_call_window_update_avatars_visibility (EmpathyTpStreamedMedia *call,
EmpathyCallWindow *window)
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
- if (empathy_tp_call_is_receiving_video (call))
+ if (empathy_tp_streamed_media_is_receiving_video (call))
{
gtk_widget_hide (priv->remote_user_avatar_widget);
gtk_widget_show (priv->video_output);
@@ -2813,12 +2813,12 @@ empathy_call_window_update_avatars_visibility (EmpathyTpCall *call,
}
static void
-call_handler_notify_tp_call_cb (EmpathyCallHandler *handler,
+call_handler_notify_tp_streamed_media_cb (EmpathyCallHandler *handler,
GParamSpec *spec,
EmpathyCallWindow *self)
{
EmpathyCallWindowPriv *priv = GET_PRIV (self);
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
g_object_get (priv->handler, "tp-call", &call, NULL);
if (call == NULL)
@@ -2836,7 +2836,7 @@ static void
empathy_call_window_realized_cb (GtkWidget *widget, EmpathyCallWindow *window)
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
g_signal_connect (priv->handler, "conference-added",
G_CALLBACK (empathy_call_window_conference_added_cb), window);
@@ -2868,7 +2868,7 @@ empathy_call_window_realized_cb (GtkWidget *widget, EmpathyCallWindow *window)
/* tp-call doesn't exist yet, we'll connect signals once it has been
* set */
g_signal_connect (priv->handler, "notify::tp-call",
- G_CALLBACK (call_handler_notify_tp_call_cb), window);
+ G_CALLBACK (call_handler_notify_tp_streamed_media_cb), window);
}
gst_element_set_state (priv->pipeline, GST_STATE_PAUSED);
@@ -3045,7 +3045,7 @@ empathy_call_window_set_send_video (EmpathyCallWindow *window,
CameraState state)
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
priv->sending_video = (state == CAMERA_STATE_ON);
@@ -3066,7 +3066,7 @@ empathy_call_window_set_send_video (EmpathyCallWindow *window,
g_object_get (priv->handler, "tp-call", &call, NULL);
DEBUG ("%s sending video", priv->sending_video ? "start": "stop");
- empathy_tp_call_request_video_stream_direction (call, priv->sending_video);
+ empathy_tp_streamed_media_request_video_stream_direction (call, priv->sending_video);
g_object_unref (call);
}
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index b20f1719f..ffe8e597f 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -33,7 +33,7 @@
#include <libempathy/empathy-tp-contact-factory.h>
#include <libempathy/empathy-contact-manager.h>
#include <libempathy/empathy-tp-chat.h>
-#include <libempathy/empathy-tp-call.h>
+#include <libempathy/empathy-tp-streamed-media.h>
#include <libempathy/empathy-tp-file.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-call-factory.h>
@@ -404,9 +404,9 @@ reject_channel_claim_cb (GObject *source,
goto out;
}
- if (EMPATHY_IS_TP_CALL (user_data))
+ if (EMPATHY_IS_TP_STREAMED_MEDIA (user_data))
{
- empathy_tp_call_close (user_data);
+ empathy_tp_streamed_media_close (user_data);
}
else if (EMPATHY_IS_TP_CHAT (user_data))
{
@@ -489,7 +489,7 @@ event_channel_process_voip_func (EventPriv *event)
GtkWidget *dialog;
GtkWidget *button;
GtkWidget *image;
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
gboolean video;
gchar *title;
@@ -499,9 +499,9 @@ event_channel_process_voip_func (EventPriv *event)
return;
}
- call = EMPATHY_TP_CALL (event->approval->handler_instance);
+ call = EMPATHY_TP_STREAMED_MEDIA (event->approval->handler_instance);
- video = empathy_tp_call_has_initial_video (call);
+ video = empathy_tp_streamed_media_has_initial_video (call);
dialog = gtk_message_dialog_new (NULL, 0,
GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
@@ -650,12 +650,12 @@ event_manager_media_channel_got_contact (EventManagerApproval *approval)
EmpathyEventManagerPriv *priv = GET_PRIV (approval->manager);
GtkWidget *window = empathy_main_window_dup ();
gchar *header;
- EmpathyTpCall *call;
+ EmpathyTpStreamedMedia *call;
gboolean video;
- call = EMPATHY_TP_CALL (approval->handler_instance);
+ call = EMPATHY_TP_STREAMED_MEDIA (approval->handler_instance);
- video = empathy_tp_call_has_initial_video (call);
+ video = empathy_tp_streamed_media_has_initial_video (call);
header = g_strdup_printf (
video ? _("Incoming video call from %s") :_("Incoming call from %s"),
@@ -678,7 +678,7 @@ event_manager_media_channel_got_contact (EventManagerApproval *approval)
}
static void
-event_manager_media_channel_contact_changed_cb (EmpathyTpCall *call,
+event_manager_media_channel_contact_changed_cb (EmpathyTpStreamedMedia *call,
GParamSpec *param, EventManagerApproval *approval)
{
EmpathyContact *contact;
@@ -975,7 +975,7 @@ approve_channels (TpSimpleApprover *approver,
else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA)
{
EmpathyContact *contact;
- EmpathyTpCall *call = empathy_tp_call_new (account, channel);
+ EmpathyTpStreamedMedia *call = empathy_tp_streamed_media_new (account, channel);
approval->handler_instance = G_OBJECT (call);