CONFERENCE_ADDED,
CONFERENCE_REMOVED,
SRC_PAD_ADDED,
- SINK_PAD_ADDED,
- SINK_PAD_REMOVED,
+ CONTENT_ADDED,
+ CONTENT_REMOVED,
CLOSED,
CANDIDATES_CHANGED,
STATE_CHANGED,
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),
+ signals[CONTENT_ADDED] =
+ g_signal_new ("content-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
g_cclosure_marshal_generic,
G_TYPE_BOOLEAN,
- 2, GST_TYPE_PAD, G_TYPE_UINT);
+ 1, TF_TYPE_CONTENT);
- signals[SINK_PAD_REMOVED] =
- g_signal_new ("sink-pad-removed", G_TYPE_FROM_CLASS (klass),
+ signals[CONTENT_REMOVED] =
+ g_signal_new ("content-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
g_cclosure_marshal_generic,
G_TYPE_BOOLEAN,
- 2, GST_TYPE_PAD, G_TYPE_UINT);
+ 1, TF_TYPE_CONTENT);
signals[CLOSED] =
g_signal_new ("closed", G_TYPE_FROM_CLASS (klass),
EmpathyCallHandler *handler)
{
FsMediaType mtype;
- GstPad *spad;
FsSession *session;
// FsStream *fs_stream;
FsCodec *codec;
G_CALLBACK (on_tf_content_stop_sending_cb), handler);
#endif
- g_object_get (content, "media-type", &mtype,
- "sink-pad", &spad, NULL);
-
- g_signal_emit (G_OBJECT (handler), signals[SINK_PAD_ADDED], 0,
- spad, mtype, &retval);
+ g_signal_emit (G_OBJECT (handler), signals[CONTENT_ADDED], 0,
+ content, &retval);
if (!retval)
tf_content_error (content, 0 /* FIXME */,
tp_clear_object (&fs_stream);
*/
+ g_object_get (content, "media-type", &mtype, NULL);
+
if (mtype == FS_MEDIA_TYPE_VIDEO)
{
guint framerate, width, height;
g_signal_emit (G_OBJECT (handler), signals[RESOLUTION_CHANGED], 0,
width, height);
}
-
- gst_object_unref (spad);
}
static void
TfContent *content,
EmpathyCallHandler *handler)
{
- FsMediaType mtype;
- GstPad *spad;
gboolean retval;
DEBUG ("removing content");
- g_object_get (content, "media-type", &mtype,
- "sink-pad", &spad, NULL);
-
- g_signal_emit (G_OBJECT (handler), signals[SINK_PAD_REMOVED], 0,
- spad, mtype, &retval);
+ g_signal_emit (G_OBJECT (handler), signals[CONTENT_REMOVED], 0,
+ content, &retval);
if (!retval)
{
}
static gboolean
-empathy_call_window_sink_removed_cb (EmpathyCallHandler *handler,
- GstPad *sink,
- FsMediaType media_type,
+empathy_call_window_content_removed_cb (EmpathyCallHandler *handler,
+ TfContent *content,
EmpathyCallWindow *self)
{
EmpathyCallWindowPriv *priv = GET_PRIV (self);
+ FsMediaType media_type;
DEBUG ("removing content");
+ g_object_get (content, "media-type", &media_type, NULL);
+
/*
* This assumes that there is only one video stream per channel...
*/
gst_bin_remove (GST_BIN (priv->pipeline), output);
gst_bin_remove (GST_BIN (priv->pipeline), priv->funnel);
priv->funnel = NULL;
- return TRUE;
}
}
else if (media_type == FS_MEDIA_TYPE_AUDIO)
gst_bin_remove (GST_BIN (priv->pipeline), priv->audio_output);
priv->audio_output = NULL;
- return TRUE;
}
}
+ else
+ {
+ g_assert_not_reached ();
+ }
- return FALSE;
+ return TRUE;
}
static void
}
static gboolean
-empathy_call_window_sink_added_cb (EmpathyCallHandler *handler,
- GstPad *sink, FsMediaType media_type, gpointer user_data)
+empathy_call_window_content_added_cb (EmpathyCallHandler *handler,
+ TfContent *content, gpointer user_data)
{
EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
EmpathyCallWindowPriv *priv = GET_PRIV (self);
- GstPad *pad;
+ GstPad *sink, *pad;
+ FsMediaType media_type;
gboolean retval = FALSE;
+ g_object_get (content, "media-type", &media_type, "sink-pad", &sink, NULL);
+ g_assert (sink != NULL);
+
switch (media_type)
{
case FS_MEDIA_TYPE_AUDIO:
g_assert_not_reached ();
}
+ gst_object_unref (sink);
return retval;
}
G_CALLBACK (empathy_call_window_channel_closed_cb), self);
g_signal_connect (priv->handler, "src-pad-added",
G_CALLBACK (empathy_call_window_src_added_cb), self);
- g_signal_connect (priv->handler, "sink-pad-added",
- G_CALLBACK (empathy_call_window_sink_added_cb), self);
- g_signal_connect (priv->handler, "sink-pad-removed",
- G_CALLBACK (empathy_call_window_sink_removed_cb), self);
+ g_signal_connect (priv->handler, "content-added",
+ G_CALLBACK (empathy_call_window_content_added_cb), self);
+ g_signal_connect (priv->handler, "content-removed",
+ G_CALLBACK (empathy_call_window_content_removed_cb), self);
/* We connect to ::call-channel unconditionally since we'll
* get new channels if we hangup and redial or if we reuse the