Ejemplo n.º 1
0
static void
mex_telepathy_channel_new_tf_channel (GObject      *source,
                                      GAsyncResult *result,
                                      gpointer      user_data)
{
  MexTelepathyChannel *self = MEX_TELEPATHY_CHANNEL (user_data);
  MexTelepathyChannelPrivate *priv = self->priv;

  MEX_DEBUG ("New TfChannel");

  priv->tf_channel = TF_CHANNEL (g_async_initable_new_finish (
                                   G_ASYNC_INITABLE (source), result, NULL));

  if (priv->tf_channel == NULL)
    {
      MEX_WARNING ("Failed to create channel");
      return;
    }

  MEX_DEBUG ("Adding timeout");
  priv->pipeline_timer = g_timeout_add_seconds (5,
                         mex_telepathy_channel_dump_pipeline,
                         self);

  g_signal_connect (priv->tf_channel, "fs-conference-added",
                    G_CALLBACK (mex_telepathy_channel_conference_added), self);

  g_signal_connect (priv->tf_channel, "content-added",
                    G_CALLBACK (mex_telepathy_channel_on_content_added), self);
}
Ejemplo n.º 2
0
static void
on_tf_channel_ready (GObject *source,
    GAsyncResult *result,
    gpointer user_data)
{
  EmpathyCallHandler *self = EMPATHY_CALL_HANDLER (user_data);
  EmpathyCallHandlerPriv *priv = GET_PRIV (self);
  GError *error = NULL;

  priv->tfchannel = TF_CHANNEL (g_async_initable_new_finish (
      G_ASYNC_INITABLE (source), result, NULL));

  if (priv->tfchannel == NULL)
    {
      g_warning ("Failed to create Farstream channel: %s", error->message);
      g_error_free (error);
      return;
    }

  /* Set up the telepathy farstream channel */
  g_signal_connect (priv->tfchannel, "closed",
      G_CALLBACK (on_tf_channel_closed_cb), self);
  g_signal_connect (priv->tfchannel, "fs-conference-added",
      G_CALLBACK (on_tf_channel_conference_added_cb), self);
  g_signal_connect (priv->tfchannel, "fs-conference-removed",
      G_CALLBACK (on_tf_channel_conference_removed_cb), self);
  g_signal_connect (priv->tfchannel, "content-added",
      G_CALLBACK (on_tf_channel_content_added_cb), self);
  g_signal_connect (priv->tfchannel, "content-removed",
      G_CALLBACK (on_tf_channel_content_removed_cb), self);
}