*/
#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <telepathy-glib/account-channel-request.h>
-#include <telepathy-glib/util.h>
-#include <telepathy-glib/interfaces.h>
+#include "empathy-call-handler.h"
#include <telepathy-farstream/telepathy-farstream.h>
-#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-tp-contact-factory.h>
-
-#include <libempathy-gtk/empathy-call-utils.h>
-
-#include "empathy-call-handler.h"
+#include "empathy-call-utils.h"
+#include "empathy-utils.h"
#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
-#include <libempathy/empathy-debug.h>
+#include "empathy-debug.h"
G_DEFINE_TYPE(EmpathyCallHandler, empathy_call_handler, G_TYPE_OBJECT)
PROP_CALL_CHANNEL = 1,
PROP_GST_BUS,
PROP_CONTACT,
- PROP_INITIAL_AUDIO,
PROP_INITIAL_VIDEO,
PROP_SEND_AUDIO_CODEC,
PROP_SEND_VIDEO_CODEC,
EmpathyContact *contact;
TfChannel *tfchannel;
- gboolean initial_audio;
gboolean initial_video;
FsCodec *send_audio_codec;
{
EmpathyCallHandlerPriv *priv = handler->priv;
+ /* Clean up the TfChannel before bubbling the state-change signal
+ * further up. This ensures that the conference-removed signal is
+ * emitted before state-changed so that the client gets a chance
+ * to remove the conference from the pipeline before resetting the
+ * pipeline itself.
+ */
+ if (state == TP_CALL_STATE_ENDED)
+ {
+ tp_channel_close_async (TP_CHANNEL (call), NULL, NULL);
+ priv->accept_when_initialised = FALSE;
+ tp_clear_object (&priv->call);
+ tp_clear_object (&priv->tfchannel);
+ }
+
g_signal_emit (handler, signals[STATE_CHANGED], 0, state,
reason->dbus_reason);
tp_call_channel_accept_async (priv->call, on_call_accepted_cb, NULL);
priv->accept_when_initialised = FALSE;
}
-
- if (state == TP_CALL_STATE_ENDED)
- {
- tp_channel_close_async (TP_CHANNEL (call), NULL, NULL);
- priv->accept_when_initialised = FALSE;
- tp_clear_object (&priv->call);
- tp_clear_object (&priv->tfchannel);
- }
}
static void
tp_g_signal_connect_object (priv->call, "invalidated",
G_CALLBACK (on_call_invalidated_cb), object, 0);
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;
case PROP_CALL_CHANNEL:
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;
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_CALL_CHANNEL, 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,
account = empathy_contact_get_account (priv->contact);
request = empathy_call_create_call_request (
- empathy_contact_get_id (priv->contact),
- priv->initial_audio, priv->initial_video);
+ empathy_contact_get_id (priv->contact), priv->initial_video);
req = tp_account_channel_request_new (account, request, timestamp);