#include <clutter-gtk/clutter-gtk.h>
#include <clutter-gst/clutter-gst.h>
-#include <telepathy-glib/util.h>
#include <telepathy-farstream/telepathy-farstream.h>
-#include <telepathy-glib/util.h>
+#include <telepathy-glib/telepathy-glib.h>
#include <farstream/fs-element-added-notifier.h>
#include <farstream/fs-utils.h>
GtkWidget *audio_call_button;
GtkWidget *video_call_button;
GtkWidget *mic_button;
+ GtkWidget *microphone_icon;
GtkWidget *volume_button;
GtkWidget *camera_button;
GtkWidget *dialpad_button;
if (muted && self->priv->transitions)
clutter_state_set_state (self->priv->transitions, "fade-in");
+ if (muted)
+ {
+ gtk_image_set_from_icon_name (GTK_IMAGE (self->priv->microphone_icon),
+ EMPATHY_IMAGE_MIC_MUTED, GTK_ICON_SIZE_MENU);
+ }
+ else
+ {
+ gtk_image_set_from_icon_name (GTK_IMAGE (self->priv->microphone_icon),
+ EMPATHY_IMAGE_MIC, GTK_ICON_SIZE_MENU);
+ }
+
empathy_call_window_update_timer (self);
}
g_signal_connect (priv->audio_input, "notify::mute",
G_CALLBACK (audio_input_mute_notify_cb), self);
-
- g_object_bind_property (priv->mic_button, "active",
- priv->audio_input, "mute",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE);
-
}
static void
}
static void
-empathy_call_window_camera_toggled_cb (GtkToggleToolButton *toggle,
+empathy_call_window_camera_toggled_cb (GtkToggleButton *toggle,
EmpathyCallWindow *self)
{
- if (gtk_toggle_tool_button_get_active (toggle))
+ if (gtk_toggle_button_get_active (toggle))
enable_camera (self);
else
disable_camera (self);
tp_add_dispatch_operation_context_accept (context);
}
+static void
+mic_button_clicked (GtkWidget *button,
+ EmpathyCallWindow *self)
+{
+ /* Toggle the muted state. We rely on audio_input_mute_notify_cb to update
+ * the icon. */
+ empathy_audio_src_set_mute (EMPATHY_GST_AUDIO_SRC (self->priv->audio_input),
+ !self->priv->muted);
+}
+
static void
empathy_call_window_init (EmpathyCallWindow *self)
{
"audiocall", &priv->audio_call_button,
"videocall", &priv->video_call_button,
"microphone", &priv->mic_button,
+ "microphone_icon", &priv->microphone_icon,
"volume", &priv->volume_button,
"camera", &priv->camera_button,
"hangup", &priv->hangup_button,
g_signal_connect (priv->camera_monitor, "removed",
G_CALLBACK (empathy_call_window_camera_removed_cb), self);
+ g_signal_connect (priv->mic_button, "clicked",
+ G_CALLBACK (mic_button_clicked), self);
+
g_mutex_init (&priv->lock);
gtk_container_add (GTK_CONTAINER (self), top_vbox);
gtk_widget_set_sensitive (priv->mic_button, FALSE);
/* Be sure that the mic button is enabled */
- gtk_toggle_button_set_active (
- GTK_TOGGLE_BUTTON (priv->mic_button), TRUE);
+ empathy_audio_src_set_mute (
+ EMPATHY_GST_AUDIO_SRC (self->priv->audio_input), TRUE);
if (priv->camera_state == CAMERA_STATE_ON)
{
if (priv->call_state == HELD)
status = _("On hold");
- else if (!gtk_toggle_button_get_active (
- GTK_TOGGLE_BUTTON (priv->mic_button)))
+ else if (priv->muted)
status = _("Mute");
else
status = _("Duration");
case TP_MEDIA_STREAM_ERROR_INVALID_CM_BEHAVIOR:
tp_connection_parse_object_path (
- tp_channel_borrow_connection (TP_CHANNEL (call)),
+ tp_channel_get_connection (TP_CHANNEL (call)),
NULL, &cm);
url = g_strdup_printf ("http://bugs.freedesktop.org/enter_bug.cgi?"
"call-channel", &call,
NULL);
- conn = tp_channel_borrow_connection (call);
+ conn = tp_channel_get_connection (call);
g_object_unref (call);
uri = tp_connection_get_balance_uri (conn);
}
/* Called from the streaming thread */
+#ifdef HAVE_GST1
+static GstPadProbeReturn
+empathy_call_window_video_probe_cb (GstPad *pad,
+ GstPadProbeInfo *info,
+ gpointer user_data)
+{
+ EmpathyCallWindow *self = user_data;
+
+ if (G_UNLIKELY (!self->priv->got_video))
+ {
+ /* show the remote video */
+ g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
+ empathy_call_window_show_video_output_cb,
+ g_object_ref (self), g_object_unref);
+
+ self->priv->got_video = TRUE;
+ }
+
+ return GST_PAD_PROBE_OK;
+}
+#else
static gboolean
empathy_call_window_video_probe_cb (GstPad *pad,
GstMiniObject *mini_obj,
return TRUE;
}
+#endif
/* Called from the streaming thread */
static gboolean
g_idle_add (empathy_call_window_show_video_output_cb, self);
pad = empathy_call_window_get_video_sink_pad (self);
+#ifdef HAVE_GST1
+ gst_pad_add_probe (src,
+ GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST,
+ empathy_call_window_video_probe_cb, self, NULL);
+#else
gst_pad_add_data_probe (src,
G_CALLBACK (empathy_call_window_video_probe_cb), self);
+#endif
if (priv->got_video_src > 0)
g_source_remove (priv->got_video_src);
priv->got_video_src = g_timeout_add_seconds (1,
case FS_MEDIA_TYPE_VIDEO:
if (priv->video_tee != NULL)
{
+#ifdef HAVE_GST1
+ pad = gst_element_get_request_pad (priv->video_tee, "src_%u");
+#else
pad = gst_element_get_request_pad (priv->video_tee, "src%d");
+#endif
if (GST_PAD_LINK_FAILED (gst_pad_link (pad, sink)))
{
g_warning ("Could not link video source input pipeline");
GdkEventKey *event, EmpathyCallWindow *window)
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
+ gchar key;
if (priv->is_fullscreen && event->keyval == GDK_KEY_Escape)
{
return TRUE;
}
- return FALSE;
+ key = gdk_keyval_to_unicode (event->keyval);
+ switch (key)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '*':
+ case '#':
+ break;
+ default:
+ return TRUE;
+ break;
+ }
+
+ gtk_toggle_tool_button_set_active (
+ GTK_TOGGLE_TOOL_BUTTON (priv->dialpad_button), TRUE);
+
+ empathy_dialpad_widget_press_key (
+ EMPATHY_DIALPAD_WIDGET (priv->dtmf_panel), key);
+
+ return TRUE;
}
static gboolean