1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2007 Elliot Fairweather
4 * Copyright (C) 2007-2008 Collabora Ltd.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
21 * Xavier Claessens <xclaesse@gmail.com>
26 #include <telepathy-glib/proxy-subclass.h>
27 #include <telepathy-glib/dbus.h>
29 #include <extensions/extensions.h>
30 #include <libempathy/empathy-contact-factory.h>
31 #include <libempathy/empathy-debug.h>
32 #include <libempathy/empathy-tp-group.h>
33 #include <libempathy/empathy-utils.h>
35 #include "empathy-tp-call.h"
37 #define DEBUG_DOMAIN "TpCall"
39 #define GET_PRIV(object) (G_TYPE_INSTANCE_GET_PRIVATE \
40 ((object), EMPATHY_TYPE_TP_CALL, EmpathyTpCallPriv))
42 #define STREAM_ENGINE_BUS_NAME "org.freedesktop.Telepathy.StreamEngine"
43 #define STREAM_ENGINE_OBJECT_PATH "/org/freedesktop/Telepathy/StreamEngine"
45 typedef struct _EmpathyTpCallPriv EmpathyTpCallPriv;
47 struct _EmpathyTpCallPriv
50 TpProxy *stream_engine;
51 TpDBusDaemon *dbus_daemon;
52 EmpathyTpGroup *group;
53 EmpathyContact *contact;
56 gboolean stream_engine_running;
58 EmpathyTpCallStream *audio;
59 EmpathyTpCallStream *video;
73 G_DEFINE_TYPE (EmpathyTpCall, empathy_tp_call, G_TYPE_OBJECT)
76 tp_call_add_stream (EmpathyTpCall *call,
81 guint stream_direction)
83 EmpathyTpCallPriv *priv = GET_PRIV (call);
87 case TP_MEDIA_STREAM_TYPE_AUDIO:
88 empathy_debug (DEBUG_DOMAIN,
89 "Audio stream - id: %d, state: %d, direction: %d",
90 stream_id, stream_state, stream_direction);
91 priv->audio->exists = TRUE;
92 priv->audio->id = stream_id;
93 priv->audio->state = stream_state;
94 priv->audio->direction = stream_direction;
95 g_object_notify (G_OBJECT (call), "audio-stream");
97 case TP_MEDIA_STREAM_TYPE_VIDEO:
98 empathy_debug (DEBUG_DOMAIN,
99 "Video stream - id: %d, state: %d, direction: %d",
100 stream_id, stream_state, stream_direction);
101 priv->video->exists = TRUE;
102 priv->video->id = stream_id;
103 priv->video->state = stream_state;
104 priv->video->direction = stream_direction;
105 g_object_notify (G_OBJECT (call), "video-stream");
108 empathy_debug (DEBUG_DOMAIN, "Unknown stream type: %d",
114 tp_call_stream_added_cb (TpChannel *channel,
116 guint contact_handle,
121 empathy_debug (DEBUG_DOMAIN,
122 "Stream added - stream id: %d, contact handle: %d, stream type: %d",
123 stream_id, contact_handle, stream_type);
125 tp_call_add_stream (EMPATHY_TP_CALL (call), stream_id, contact_handle,
126 stream_type, TP_MEDIA_STREAM_STATE_DISCONNECTED,
127 TP_MEDIA_STREAM_DIRECTION_NONE);
131 tp_call_stream_removed_cb (TpChannel *channel,
136 EmpathyTpCallPriv *priv = GET_PRIV (call);
138 empathy_debug (DEBUG_DOMAIN, "Stream removed - stream id: %d", stream_id);
140 if (stream_id == priv->audio->id)
142 priv->audio->exists = FALSE;
143 g_object_notify (call, "audio-stream");
145 else if (stream_id == priv->video->id)
147 priv->video->exists = FALSE;
148 g_object_notify (call, "video-stream");
153 tp_call_stream_state_changed_cb (TpChannel *proxy,
159 EmpathyTpCallPriv *priv = GET_PRIV (call);
161 empathy_debug (DEBUG_DOMAIN,
162 "Stream state changed - stream id: %d, state state: %d",
163 stream_id, stream_state);
165 if (stream_id == priv->audio->id)
167 priv->audio->state = stream_state;
168 g_object_notify (call, "audio-stream");
170 else if (stream_id == priv->video->id)
172 priv->video->state = stream_state;
173 g_object_notify (call, "video-stream");
178 tp_call_stream_direction_changed_cb (TpChannel *channel,
180 guint stream_direction,
185 EmpathyTpCallPriv *priv = GET_PRIV (call);
187 empathy_debug (DEBUG_DOMAIN,
188 "Stream direction changed - stream: %d, direction: %d",
189 stream_id, stream_direction);
191 if (stream_id == priv->audio->id)
193 priv->audio->direction = stream_direction;
194 g_object_notify (call, "audio-stream");
196 else if (stream_id == priv->video->id)
198 priv->video->direction = stream_direction;
199 g_object_notify (call, "video-stream");
204 tp_call_request_streams_cb (TpChannel *channel,
205 const GPtrArray *streams,
214 empathy_debug (DEBUG_DOMAIN, "Error requesting streams: %s", error->message);
218 for (i = 0; i < streams->len; i++)
222 guint contact_handle;
225 guint stream_direction;
227 values = g_ptr_array_index (streams, i);
228 stream_id = g_value_get_uint (g_value_array_get_nth (values, 0));
229 contact_handle = g_value_get_uint (g_value_array_get_nth (values, 1));
230 stream_type = g_value_get_uint (g_value_array_get_nth (values, 2));
231 stream_state = g_value_get_uint (g_value_array_get_nth (values, 3));
232 stream_direction = g_value_get_uint (g_value_array_get_nth (values, 4));
234 tp_call_add_stream (EMPATHY_TP_CALL (call), stream_id, contact_handle,
235 stream_type, stream_state, stream_direction);
240 tp_call_request_streams_for_capabilities (EmpathyTpCall *call,
241 EmpathyCapabilities capabilities)
243 EmpathyTpCallPriv *priv = GET_PRIV (call);
244 GArray *stream_types;
248 if (capabilities == EMPATHY_CAPABILITIES_UNKNOWN)
249 capabilities = EMPATHY_CAPABILITIES_AUDIO | EMPATHY_CAPABILITIES_VIDEO;
251 empathy_debug (DEBUG_DOMAIN, "Requesting new stream for capabilities %d",
254 stream_types = g_array_new (FALSE, FALSE, sizeof (guint));
255 handle = empathy_contact_get_handle (priv->contact);
257 if (capabilities & EMPATHY_CAPABILITIES_AUDIO)
259 stream_type = TP_MEDIA_STREAM_TYPE_AUDIO;
260 g_array_append_val (stream_types, stream_type);
262 if (capabilities & EMPATHY_CAPABILITIES_VIDEO)
264 stream_type = TP_MEDIA_STREAM_TYPE_VIDEO;
265 g_array_append_val (stream_types, stream_type);
268 tp_cli_channel_type_streamed_media_call_request_streams (priv->channel, -1,
269 handle, stream_types, tp_call_request_streams_cb, NULL, NULL,
272 g_array_free (stream_types, TRUE);
276 tp_call_request_streams (EmpathyTpCall *call)
278 EmpathyTpCallPriv *priv = GET_PRIV (call);
280 tp_call_request_streams_for_capabilities (call,
281 empathy_contact_get_capabilities (priv->contact));
285 tp_call_group_ready_cb (EmpathyTpCall *call)
287 EmpathyTpCallPriv *priv = GET_PRIV (call);
288 EmpathyPendingInfo *invitation;
290 invitation = empathy_tp_group_get_invitation (priv->group, &priv->contact);
291 priv->is_incoming = (invitation != NULL);
292 priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
294 if (!priv->is_incoming)
295 tp_call_request_streams (call);
297 g_object_notify (G_OBJECT (call), "is-incoming");
298 g_object_notify (G_OBJECT (call), "contact");
299 g_object_notify (G_OBJECT (call), "status");
303 tp_call_member_added_cb (EmpathyTpGroup *group,
304 EmpathyContact *contact,
305 EmpathyContact *actor,
307 const gchar *message,
310 EmpathyTpCallPriv *priv = GET_PRIV (call);
312 if (priv->status == EMPATHY_TP_CALL_STATUS_PENDING &&
313 ((priv->is_incoming && contact != priv->contact) ||
314 (!priv->is_incoming && contact == priv->contact)))
316 priv->status = EMPATHY_TP_CALL_STATUS_ACCEPTED;
317 g_object_notify (G_OBJECT (call), "status");
322 tp_call_channel_invalidated_cb (TpChannel *channel,
328 EmpathyTpCallPriv *priv = GET_PRIV (call);
330 empathy_debug (DEBUG_DOMAIN, "Channel invalidated: %s", message);
331 priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
332 g_object_notify (G_OBJECT (call), "status");
336 tp_call_async_cb (TpProxy *proxy,
343 empathy_debug (DEBUG_DOMAIN, "Error %s: %s",
344 user_data, error->message);
349 tp_call_close_channel (EmpathyTpCall *call)
351 EmpathyTpCallPriv *priv = GET_PRIV (call);
353 if (priv->status == EMPATHY_TP_CALL_STATUS_CLOSED)
356 empathy_debug (DEBUG_DOMAIN, "Closing channel");
358 tp_cli_channel_call_close (priv->channel, -1,
359 (tp_cli_channel_callback_for_close) tp_call_async_cb,
360 "closing channel", NULL, G_OBJECT (call));
362 priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
363 g_object_notify (G_OBJECT (call), "status");
367 tp_call_stream_engine_invalidated_cb (TpProxy *stream_engine,
373 empathy_debug (DEBUG_DOMAIN, "Stream engine proxy invalidated: %s",
375 tp_call_close_channel (call);
379 tp_call_stream_engine_watch_name_owner_cb (TpDBusDaemon *daemon,
381 const gchar *new_owner,
384 EmpathyTpCallPriv *priv = GET_PRIV (call);
386 /* G_STR_EMPTY(new_owner) means either stream-engine has not started yet or
387 * has crashed. We want to close the channel if stream-engine has crashed.
389 empathy_debug (DEBUG_DOMAIN,
390 "Watch SE: name='%s' SE running='%s' new_owner='%s'",
391 name, priv->stream_engine_running ? "yes" : "no",
392 new_owner ? new_owner : "none");
393 if (priv->stream_engine_running && G_STR_EMPTY (new_owner))
395 empathy_debug (DEBUG_DOMAIN, "Stream engine falled off the bus");
396 tp_call_close_channel (call);
400 priv->stream_engine_running = !G_STR_EMPTY (new_owner);
404 tp_call_stream_engine_handle_channel (EmpathyTpCall *call)
406 EmpathyTpCallPriv *priv = GET_PRIV (call);
413 empathy_debug (DEBUG_DOMAIN, "Revving up the stream engine");
415 priv->stream_engine = g_object_new (TP_TYPE_PROXY,
416 "bus-name", STREAM_ENGINE_BUS_NAME,
417 "dbus-connection", tp_get_bus (),
418 "object-path", STREAM_ENGINE_OBJECT_PATH,
420 tp_proxy_add_interface_by_id (priv->stream_engine,
421 EMP_IFACE_QUARK_STREAM_ENGINE);
422 tp_proxy_add_interface_by_id (priv->stream_engine,
423 EMP_IFACE_QUARK_CHANNEL_HANDLER);
425 g_signal_connect (priv->stream_engine, "invalidated",
426 G_CALLBACK (tp_call_stream_engine_invalidated_cb),
429 /* FIXME: dbus daemon should be unique */
430 priv->dbus_daemon = tp_dbus_daemon_new (tp_get_bus ());
431 tp_dbus_daemon_watch_name_owner (priv->dbus_daemon, STREAM_ENGINE_BUS_NAME,
432 tp_call_stream_engine_watch_name_owner_cb,
435 g_object_get (priv->channel,
436 "connection", &connection,
437 "channel-type", &channel_type,
438 "object-path", &object_path,
439 "handle_type", &handle_type,
443 emp_cli_channel_handler_call_handle_channel (priv->stream_engine, -1,
444 connection->bus_name,
445 connection->object_path,
446 channel_type, object_path, handle_type, handle,
447 tp_call_async_cb, "calling handle channel", NULL,
450 g_object_unref (connection);
451 g_free (channel_type);
452 g_free (object_path);
456 tp_call_constructor (GType type,
457 guint n_construct_params,
458 GObjectConstructParam *construct_params)
462 EmpathyTpCallPriv *priv;
464 object = G_OBJECT_CLASS (empathy_tp_call_parent_class)->constructor (type,
465 n_construct_params, construct_params);
467 call = EMPATHY_TP_CALL (object);
468 priv = GET_PRIV (call);
470 /* Setup streamed media channel */
471 g_signal_connect (priv->channel, "invalidated",
472 G_CALLBACK (tp_call_channel_invalidated_cb), call);
473 tp_cli_channel_type_streamed_media_connect_to_stream_added (priv->channel,
474 tp_call_stream_added_cb, NULL, NULL, G_OBJECT (call), NULL);
475 tp_cli_channel_type_streamed_media_connect_to_stream_removed (priv->channel,
476 tp_call_stream_removed_cb, NULL, NULL, G_OBJECT (call), NULL);
477 tp_cli_channel_type_streamed_media_connect_to_stream_state_changed (priv->channel,
478 tp_call_stream_state_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
479 tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed (priv->channel,
480 tp_call_stream_direction_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
481 tp_cli_channel_type_streamed_media_call_list_streams (priv->channel, -1,
482 tp_call_request_streams_cb, NULL, NULL, G_OBJECT (call));
484 /* Setup group interface */
485 priv->group = empathy_tp_group_new (priv->channel);
487 g_signal_connect (G_OBJECT (priv->group), "member-added",
488 G_CALLBACK (tp_call_member_added_cb), call);
490 if (empathy_tp_group_is_ready (priv->group))
491 tp_call_group_ready_cb (call);
493 g_signal_connect_swapped (priv->group, "notify::ready",
494 G_CALLBACK (tp_call_group_ready_cb), call);
496 /* Start stream engine */
497 tp_call_stream_engine_handle_channel (call);
503 tp_call_finalize (GObject *object)
505 EmpathyTpCallPriv *priv = GET_PRIV (object);
507 empathy_debug (DEBUG_DOMAIN, "Finalizing: %p", object);
509 g_slice_free (EmpathyTpCallStream, priv->audio);
510 g_slice_free (EmpathyTpCallStream, priv->video);
511 g_object_unref (priv->group);
513 if (priv->channel != NULL)
515 g_signal_handlers_disconnect_by_func (priv->channel,
516 tp_call_channel_invalidated_cb, object);
517 g_object_unref (priv->channel);
520 if (priv->stream_engine != NULL)
522 g_signal_handlers_disconnect_by_func (priv->stream_engine,
523 tp_call_stream_engine_invalidated_cb, object);
524 g_object_unref (priv->stream_engine);
527 if (priv->contact != NULL)
528 g_object_unref (priv->contact);
530 if (priv->dbus_daemon != NULL)
532 tp_dbus_daemon_cancel_name_owner_watch (priv->dbus_daemon,
533 STREAM_ENGINE_BUS_NAME,
534 tp_call_stream_engine_watch_name_owner_cb,
536 g_object_unref (priv->dbus_daemon);
539 (G_OBJECT_CLASS (empathy_tp_call_parent_class)->finalize) (object);
543 tp_call_set_property (GObject *object,
548 EmpathyTpCallPriv *priv = GET_PRIV (object);
553 priv->channel = g_value_dup_object (value);
556 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
562 tp_call_get_property (GObject *object,
567 EmpathyTpCallPriv *priv = GET_PRIV (object);
572 g_value_set_object (value, priv->channel);
575 g_value_set_object (value, priv->contact);
577 case PROP_IS_INCOMING:
578 g_value_set_boolean (value, priv->is_incoming);
581 g_value_set_uint (value, priv->status);
583 case PROP_AUDIO_STREAM:
584 g_value_set_pointer (value, priv->audio);
586 case PROP_VIDEO_STREAM:
587 g_value_set_pointer (value, priv->video);
590 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
596 empathy_tp_call_class_init (EmpathyTpCallClass *klass)
598 GObjectClass *object_class = G_OBJECT_CLASS (klass);
602 object_class->constructor = tp_call_constructor;
603 object_class->finalize = tp_call_finalize;
604 object_class->set_property = tp_call_set_property;
605 object_class->get_property = tp_call_get_property;
607 g_type_class_add_private (klass, sizeof (EmpathyTpCallPriv));
609 g_object_class_install_property (object_class, PROP_CHANNEL,
610 g_param_spec_object ("channel", "channel", "channel",
612 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
613 G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
614 g_object_class_install_property (object_class, PROP_CONTACT,
615 g_param_spec_object ("contact", "Call contact", "Call contact",
616 EMPATHY_TYPE_CONTACT,
617 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
618 g_object_class_install_property (object_class, PROP_IS_INCOMING,
619 g_param_spec_boolean ("is-incoming", "Is media stream incoming",
620 "Is media stream incoming", FALSE, G_PARAM_READABLE |
621 G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
622 g_object_class_install_property (object_class, PROP_STATUS,
623 g_param_spec_uint ("status", "Call status",
624 "Call status", 0, 255, 0, G_PARAM_READABLE | G_PARAM_STATIC_NICK |
625 G_PARAM_STATIC_BLURB));
626 g_object_class_install_property (object_class, PROP_AUDIO_STREAM,
627 g_param_spec_pointer ("audio-stream", "Audio stream data",
629 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
630 g_object_class_install_property (object_class, PROP_VIDEO_STREAM,
631 g_param_spec_pointer ("video-stream", "Video stream data",
633 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
637 empathy_tp_call_init (EmpathyTpCall *call)
639 EmpathyTpCallPriv *priv = GET_PRIV (call);
641 priv->status = EMPATHY_TP_CALL_STATUS_READYING;
642 priv->contact = NULL;
643 priv->stream_engine_running = FALSE;
644 priv->audio = g_slice_new0 (EmpathyTpCallStream);
645 priv->video = g_slice_new0 (EmpathyTpCallStream);
646 priv->audio->exists = FALSE;
647 priv->video->exists = FALSE;
651 empathy_tp_call_new (TpChannel *channel)
653 g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
655 return g_object_new (EMPATHY_TYPE_TP_CALL,
661 empathy_tp_call_accept_incoming_call (EmpathyTpCall *call)
663 EmpathyTpCallPriv *priv = GET_PRIV (call);
664 EmpathyContact *self_contact;
666 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
667 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_PENDING);
669 empathy_debug (DEBUG_DOMAIN, "Accepting incoming call");
671 self_contact = empathy_tp_group_get_self_contact (priv->group);
672 empathy_tp_group_add_member (priv->group, self_contact, NULL);
673 g_object_unref (self_contact);
677 empathy_tp_call_request_video_stream_direction (EmpathyTpCall *call,
680 EmpathyTpCallPriv *priv = GET_PRIV (call);
683 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
684 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_ACCEPTED);
686 empathy_debug (DEBUG_DOMAIN,
687 "Requesting video stream direction - is_sending: %d", is_sending);
689 if (!priv->video->exists)
692 tp_call_request_streams_for_capabilities (call,
693 EMPATHY_CAPABILITIES_VIDEO);
698 new_direction = priv->video->direction | TP_MEDIA_STREAM_DIRECTION_SEND;
700 new_direction = priv->video->direction & ~TP_MEDIA_STREAM_DIRECTION_SEND;
702 tp_cli_channel_type_streamed_media_call_request_stream_direction (priv->channel,
703 -1, priv->video->id, new_direction,
704 (tp_cli_channel_type_streamed_media_callback_for_request_stream_direction)
705 tp_call_async_cb, NULL, NULL, G_OBJECT (call));
709 empathy_tp_call_add_preview_video (EmpathyTpCall *call,
710 guint preview_video_socket_id)
712 EmpathyTpCallPriv *priv = GET_PRIV (call);
714 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
715 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
717 empathy_debug (DEBUG_DOMAIN, "Adding preview video");
719 emp_cli_stream_engine_call_add_preview_window (priv->stream_engine, -1,
720 preview_video_socket_id,
722 "adding preview window", NULL,
727 empathy_tp_call_remove_preview_video (EmpathyTpCall *call,
728 guint preview_video_socket_id)
730 EmpathyTpCallPriv *priv = GET_PRIV (call);
732 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
733 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
735 empathy_debug (DEBUG_DOMAIN, "Removing preview video");
737 emp_cli_stream_engine_call_remove_preview_window (priv->stream_engine, -1,
738 preview_video_socket_id,
740 "removing preview window", NULL,
745 empathy_tp_call_add_output_video (EmpathyTpCall *call,
746 guint output_video_socket_id)
748 EmpathyTpCallPriv *priv = GET_PRIV (call);
750 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
751 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
753 empathy_debug (DEBUG_DOMAIN, "Adding output video - socket: %d",
754 output_video_socket_id);
756 emp_cli_stream_engine_call_set_output_window (priv->stream_engine, -1,
757 TP_PROXY (priv->channel)->object_path,
758 priv->video->id, output_video_socket_id,
760 "setting output window", NULL,
765 empathy_tp_call_set_output_volume (EmpathyTpCall *call,
768 EmpathyTpCallPriv *priv = GET_PRIV (call);
770 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
771 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
773 empathy_debug (DEBUG_DOMAIN, "Setting output volume: %d", volume);
775 emp_cli_stream_engine_call_set_output_volume (priv->stream_engine, -1,
776 TP_PROXY (priv->channel)->object_path,
777 priv->audio->id, volume,
779 "setting output volume", NULL,
784 empathy_tp_call_mute_output (EmpathyTpCall *call,
787 EmpathyTpCallPriv *priv = GET_PRIV (call);
789 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
790 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
792 empathy_debug (DEBUG_DOMAIN, "Setting output mute: %d", is_muted);
794 emp_cli_stream_engine_call_mute_output (priv->stream_engine, -1,
795 TP_PROXY (priv->channel)->object_path,
796 priv->audio->id, is_muted,
798 "muting output", NULL,
803 empathy_tp_call_mute_input (EmpathyTpCall *call,
806 EmpathyTpCallPriv *priv = GET_PRIV (call);
808 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
809 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
811 empathy_debug (DEBUG_DOMAIN, "Setting input mute: %d", is_muted);
813 emp_cli_stream_engine_call_mute_input (priv->stream_engine, -1,
814 TP_PROXY (priv->channel)->object_path,
815 priv->audio->id, is_muted,
817 "muting input", NULL,