#include <stdlib.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/interfaces.h>
#include <telepathy-farsight/channel.h>
#include <telepathy-farsight/stream.h>
-#include <gst/farsight/fs-element-added-notifier.h>
-
#include "empathy-call-handler.h"
#include "empathy-dispatcher.h"
#include "empathy-marshal.h"
SINK_PAD_ADDED,
REQUEST_RESOURCE,
CLOSED,
+ STREAM_CLOSED,
LAST_SIGNAL
};
TfChannel *tfchannel;
gboolean initial_audio;
gboolean initial_video;
- FsElementAddedNotifier *fsnotifier;
} EmpathyCallHandlerPriv;
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyCallHandler)
priv->call = NULL;
- if (priv->fsnotifier != NULL)
- {
- g_object_unref (priv->fsnotifier);
- }
- priv->fsnotifier = NULL;
-
/* release any references held by the object here */
if (G_OBJECT_CLASS (empathy_call_handler_parent_class)->dispose)
G_OBJECT_CLASS (empathy_call_handler_parent_class)->dispose (object);
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);
}
/**
FsConference *conference, FsParticipant *participant,
EmpathyCallHandler *self)
{
- EmpathyCallHandlerPriv *priv = GET_PRIV (self);
- GKeyFile *keyfile;
- gchar *filename;
- GError *error = NULL;
-
- priv->fsnotifier = fs_element_added_notifier_new ();
- fs_element_added_notifier_add (priv->fsnotifier, GST_BIN (conference));
-
- keyfile = g_key_file_new ();
- filename = empathy_file_lookup ("element-properties", "data");
- if (g_key_file_load_from_file (keyfile, filename, G_KEY_FILE_NONE, &error))
- {
- fs_element_added_notifier_set_properties_from_keyfile (priv->fsnotifier,
- keyfile);
- }
- else
- {
- g_warning ("Could not load element-properties file: %s", error->message);
- g_key_file_free (keyfile);
- g_clear_error (&error);
- }
- g_free (filename);
-
g_signal_emit (G_OBJECT (self), signals[CONFERENCE_ADDED], 0,
GST_ELEMENT (conference));
}
return ret;
}
+static void
+empathy_call_handler_tf_stream_closed_cb (TfStream *stream,
+ EmpathyCallHandler *handler)
+{
+ g_signal_emit (handler, signals[STREAM_CLOSED], 0, stream);
+}
+
static void
empathy_call_handler_tf_channel_stream_created_cb (TfChannel *tfchannel,
TfStream *stream, EmpathyCallHandler *handler)
g_signal_connect (stream, "request-resource",
G_CALLBACK (empathy_call_handler_tf_stream_request_resource_cb),
handler);
+ g_signal_connect (stream, "closed",
+ G_CALLBACK (empathy_call_handler_tf_stream_closed_cb), handler);
g_object_get (stream, "media-type", &media_type,
"sink-pad", &spad, NULL);
empathy_dispatch_operation_get_channel_wrapper (operation));
g_object_ref (priv->call);
+ g_object_notify (G_OBJECT (self), "tp-call");
empathy_call_handler_start_tpfs (self);