static gboolean src_pad_added_error_idle (gpointer data) { TfContent *content = data; tf_content_error_literal (content, "Could not link sink"); g_object_unref (content); return FALSE; }
void tf_content_error (TfContent *content, const gchar *message_format, ...) { gchar *message; va_list valist; g_return_if_fail (content != NULL); g_return_if_fail (message_format != NULL); va_start (valist, message_format); message = g_strdup_vprintf (message_format, valist); va_end (valist); tf_content_error_literal (content, message); g_free (message); }
static void on_tf_channel_content_removed_cb (TfChannel *tfchannel, TfContent *content, EmpathyCallHandler *handler) { gboolean retval; DEBUG ("removing content"); g_signal_emit (G_OBJECT (handler), signals[CONTENT_REMOVED], 0, content, &retval); if (!retval) { g_warning ("Could not remove content!"); tf_content_error_literal (content, "Could not link source"); } }
static void on_tf_channel_content_added_cb (TfChannel *tfchannel, TfContent *content, EmpathyCallHandler *handler) { FsMediaType mtype; FsSession *session; // FsStream *fs_stream; FsCodec *codec; // GList *codecs; gboolean retval; g_signal_connect (content, "src-pad-added", G_CALLBACK (on_tf_content_src_pad_added_cb), handler); #if 0 g_signal_connect (content, "start-sending", G_CALLBACK (on_tf_content_start_sending_cb), handler); g_signal_connect (content, "stop-sending", G_CALLBACK (on_tf_content_stop_sending_cb), handler); #endif g_signal_emit (G_OBJECT (handler), signals[CONTENT_ADDED], 0, content, &retval); if (!retval) tf_content_error_literal (content, "Could not link source"); /* Get sending codec */ g_object_get (content, "fs-session", &session, NULL); g_object_get (session, "current-send-codec", &codec, NULL); update_sending_codec (handler, codec, session); tp_clear_object (&session); tp_clear_object (&codec); /* Get receiving codec */ /* FIXME g_object_get (content, "fs-stream", &fs_stream, NULL); g_object_get (fs_stream, "current-recv-codecs", &codecs, NULL); update_receiving_codec (handler, codecs, fs_stream); fs_codec_list_destroy (codecs); 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_connect (content, "notify::framerate", G_CALLBACK (on_tf_content_framerate_changed), handler); g_signal_connect (content, "resolution-changed", G_CALLBACK (on_tf_content_resolution_changed), handler); g_object_get (content, "framerate", &framerate, "width", &width, "height", &height, NULL); if (framerate > 0) g_signal_emit (G_OBJECT (handler), signals[FRAMERATE_CHANGED], 0, framerate); if (width > 0 && height > 0) g_signal_emit (G_OBJECT (handler), signals[RESOLUTION_CHANGED], 0, width, height); } }