2 * Copyright (C) 2007 Elliot Fairweather
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 * Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
22 #include <dbus/dbus-glib.h>
24 #include <telepathy-glib/proxy-subclass.h>
25 #include <telepathy-glib/dbus.h>
27 #include <extensions/extensions.h>
28 #include <libempathy/empathy-contact-factory.h>
29 #include <libempathy/empathy-debug.h>
30 #include <libempathy/empathy-tp-group.h>
31 #include <libempathy/empathy-utils.h>
33 #include "empathy-tp-call.h"
35 #define DEBUG_DOMAIN "TpCall"
37 #define GET_PRIV(object) (G_TYPE_INSTANCE_GET_PRIVATE \
38 ((object), EMPATHY_TYPE_TP_CALL, EmpathyTpCallPriv))
40 #define STREAM_ENGINE_BUS_NAME "org.freedesktop.Telepathy.StreamEngine"
41 #define STREAM_ENGINE_OBJECT_PATH "/org/freedesktop/Telepathy/StreamEngine"
43 typedef struct _EmpathyTpCallPriv EmpathyTpCallPriv;
45 struct _EmpathyTpCallPriv
48 TpProxy *stream_engine;
49 TpDBusDaemon *dbus_daemon;
50 EmpathyTpGroup *group;
51 EmpathyContact *contact;
54 gboolean stream_engine_running;
56 EmpathyTpCallStream *audio;
57 EmpathyTpCallStream *video;
71 G_DEFINE_TYPE (EmpathyTpCall, empathy_tp_call, G_TYPE_OBJECT)
74 tp_call_add_stream (EmpathyTpCall *call,
79 guint stream_direction)
81 EmpathyTpCallPriv *priv = GET_PRIV (call);
85 case TP_MEDIA_STREAM_TYPE_AUDIO:
86 empathy_debug (DEBUG_DOMAIN,
87 "Audio stream - id: %d, state: %d, direction: %d",
88 stream_id, stream_state, stream_direction);
89 priv->audio->exists = TRUE;
90 priv->audio->id = stream_id;
91 priv->audio->state = stream_state;
92 priv->audio->direction = stream_direction;
93 g_object_notify (G_OBJECT (call), "audio-stream");
95 case TP_MEDIA_STREAM_TYPE_VIDEO:
96 empathy_debug (DEBUG_DOMAIN,
97 "Video stream - id: %d, state: %d, direction: %d",
98 stream_id, stream_state, stream_direction);
99 priv->video->exists = TRUE;
100 priv->video->id = stream_id;
101 priv->video->state = stream_state;
102 priv->video->direction = stream_direction;
103 g_object_notify (G_OBJECT (call), "video-stream");
106 empathy_debug (DEBUG_DOMAIN, "Unknown stream type: %d",
112 tp_call_stream_added_cb (TpChannel *channel,
114 guint contact_handle,
119 empathy_debug (DEBUG_DOMAIN,
120 "Stream added - stream id: %d, contact handle: %d, stream type: %d",
121 stream_id, contact_handle, stream_type);
123 tp_call_add_stream (EMPATHY_TP_CALL (call), stream_id, contact_handle,
124 stream_type, TP_MEDIA_STREAM_STATE_DISCONNECTED,
125 TP_MEDIA_STREAM_DIRECTION_NONE);
129 tp_call_stream_removed_cb (TpChannel *channel,
134 EmpathyTpCallPriv *priv = GET_PRIV (call);
136 empathy_debug (DEBUG_DOMAIN, "Stream removed - stream id: %d", stream_id);
138 if (stream_id == priv->audio->id)
140 priv->audio->exists = FALSE;
141 g_object_notify (call, "audio-stream");
143 else if (stream_id == priv->video->id)
145 priv->video->exists = FALSE;
146 g_object_notify (call, "video-stream");
151 tp_call_stream_state_changed_cb (TpChannel *proxy,
157 EmpathyTpCallPriv *priv = GET_PRIV (call);
159 empathy_debug (DEBUG_DOMAIN,
160 "Stream state changed - stream id: %d, state state: %d",
161 stream_id, stream_state);
163 if (stream_id == priv->audio->id)
165 priv->audio->state = stream_state;
166 g_object_notify (call, "audio-stream");
168 else if (stream_id == priv->video->id)
170 priv->video->state = stream_state;
171 g_object_notify (call, "video-stream");
176 tp_call_stream_direction_changed_cb (TpChannel *channel,
178 guint stream_direction,
183 EmpathyTpCallPriv *priv = GET_PRIV (call);
185 empathy_debug (DEBUG_DOMAIN,
186 "Stream direction changed - stream: %d, direction: %d",
187 stream_id, stream_direction);
189 if (stream_id == priv->audio->id)
191 priv->audio->direction = stream_direction;
192 g_object_notify (call, "audio-stream");
194 else if (stream_id == priv->video->id)
196 priv->video->direction = stream_direction;
197 g_object_notify (call, "video-stream");
202 tp_call_request_streams_cb (TpChannel *channel,
203 const GPtrArray *streams,
212 empathy_debug (DEBUG_DOMAIN, "Error requesting streams: %s", error->message);
216 for (i = 0; i < streams->len; i++)
220 guint contact_handle;
223 guint stream_direction;
225 values = g_ptr_array_index (streams, i);
226 stream_id = g_value_get_uint (g_value_array_get_nth (values, 0));
227 contact_handle = g_value_get_uint (g_value_array_get_nth (values, 1));
228 stream_type = g_value_get_uint (g_value_array_get_nth (values, 2));
229 stream_state = g_value_get_uint (g_value_array_get_nth (values, 3));
230 stream_direction = g_value_get_uint (g_value_array_get_nth (values, 4));
232 tp_call_add_stream (EMPATHY_TP_CALL (call), stream_id, contact_handle,
233 stream_type, stream_state, stream_direction);
238 tp_call_request_streams_for_capabilities (EmpathyTpCall *call,
239 EmpathyCapabilities capabilities)
241 EmpathyTpCallPriv *priv = GET_PRIV (call);
242 GArray *stream_types;
246 empathy_debug (DEBUG_DOMAIN, "Requesting new stream for capabilities %d",
249 stream_types = g_array_new (FALSE, FALSE, sizeof (guint));
250 handle = empathy_contact_get_handle (priv->contact);
252 if (capabilities & EMPATHY_CAPABILITIES_AUDIO)
254 stream_type = TP_MEDIA_STREAM_TYPE_AUDIO;
255 g_array_append_val (stream_types, stream_type);
257 if (capabilities & EMPATHY_CAPABILITIES_VIDEO)
259 stream_type = TP_MEDIA_STREAM_TYPE_VIDEO;
260 g_array_append_val (stream_types, stream_type);
263 tp_cli_channel_type_streamed_media_call_request_streams (priv->channel, -1,
264 handle, stream_types, tp_call_request_streams_cb, NULL, NULL,
267 g_array_free (stream_types, TRUE);
271 tp_call_request_streams (EmpathyTpCall *call)
273 EmpathyTpCallPriv *priv = GET_PRIV (call);
274 EmpathyCapabilities capabilities;
275 TpConnection *connection;
277 empathy_debug (DEBUG_DOMAIN,
278 "Requesting appropriate audio/video streams from contact");
280 /* FIXME: SIP don't have capabilities interface but we know it supports
281 * only audio and not video. */
282 g_object_get (priv->channel, "connection", &connection, NULL);
283 if (!tp_proxy_has_interface_by_id (connection,
284 TP_IFACE_QUARK_CONNECTION_INTERFACE_CAPABILITIES))
285 capabilities = EMPATHY_CAPABILITIES_AUDIO;
287 capabilities = empathy_contact_get_capabilities (priv->contact);
289 tp_call_request_streams_for_capabilities (call, capabilities);
290 g_object_unref (connection);
294 tp_call_group_ready_cb (EmpathyTpCall *call)
296 EmpathyTpCallPriv *priv = GET_PRIV (call);
297 EmpathyPendingInfo *invitation;
299 invitation = empathy_tp_group_get_invitation (priv->group, &priv->contact);
300 priv->is_incoming = (invitation != NULL);
301 priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
303 if (!priv->is_incoming)
304 tp_call_request_streams (call);
306 g_object_notify (G_OBJECT (call), "is-incoming");
307 g_object_notify (G_OBJECT (call), "contact");
308 g_object_notify (G_OBJECT (call), "status");
312 tp_call_member_added_cb (EmpathyTpGroup *group,
313 EmpathyContact *contact,
314 EmpathyContact *actor,
316 const gchar *message,
319 EmpathyTpCallPriv *priv = GET_PRIV (call);
321 if (priv->status == EMPATHY_TP_CALL_STATUS_PENDING &&
322 ((priv->is_incoming && contact != priv->contact) ||
323 (!priv->is_incoming && contact == priv->contact)))
325 priv->status = EMPATHY_TP_CALL_STATUS_ACCEPTED;
326 g_object_notify (G_OBJECT (call), "status");
331 tp_call_channel_invalidated_cb (TpChannel *channel,
337 EmpathyTpCallPriv *priv = GET_PRIV (call);
339 empathy_debug (DEBUG_DOMAIN, "Channel invalidated: %s", message);
340 priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
341 g_object_notify (G_OBJECT (call), "status");
345 tp_call_async_cb (TpProxy *proxy,
352 empathy_debug (DEBUG_DOMAIN, "Error %s: %s",
353 user_data, error->message);
358 tp_call_close_channel (EmpathyTpCall *call)
360 EmpathyTpCallPriv *priv = GET_PRIV (call);
362 if (priv->status == EMPATHY_TP_CALL_STATUS_CLOSED)
365 empathy_debug (DEBUG_DOMAIN, "Closing channel");
367 tp_cli_channel_call_close (priv->channel, -1,
368 (tp_cli_channel_callback_for_close) tp_call_async_cb,
369 "closing channel", NULL, G_OBJECT (call));
371 priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
372 g_object_notify (G_OBJECT (call), "status");
376 tp_call_stream_engine_invalidated_cb (TpProxy *stream_engine,
382 empathy_debug (DEBUG_DOMAIN, "Stream engine proxy invalidated: %s",
384 tp_call_close_channel (call);
388 tp_call_stream_engine_watch_name_owner_cb (TpDBusDaemon *daemon,
390 const gchar *new_owner,
393 EmpathyTpCallPriv *priv = GET_PRIV (call);
395 /* G_STR_EMPTY(new_owner) means either stream-engine has not started yet or
396 * has crashed. We want to close the channel if stream-engine has crashed.
398 empathy_debug (DEBUG_DOMAIN,
399 "Watch SE: name='%s' SE running='%s' new_owner='%s'",
400 name, priv->stream_engine_running ? "yes" : "no",
401 new_owner ? new_owner : "none");
402 if (priv->stream_engine_running && G_STR_EMPTY (new_owner))
404 empathy_debug (DEBUG_DOMAIN, "Stream engine falled off the bus");
405 tp_call_close_channel (call);
409 priv->stream_engine_running = !G_STR_EMPTY (new_owner);
413 tp_call_stream_engine_handle_channel (EmpathyTpCall *call)
415 EmpathyTpCallPriv *priv = GET_PRIV (call);
422 empathy_debug (DEBUG_DOMAIN, "Revving up the stream engine");
424 priv->stream_engine = g_object_new (TP_TYPE_PROXY,
425 "bus-name", STREAM_ENGINE_BUS_NAME,
426 "dbus-connection", tp_get_bus (),
427 "object-path", STREAM_ENGINE_OBJECT_PATH,
429 tp_proxy_add_interface_by_id (priv->stream_engine,
430 EMP_IFACE_QUARK_STREAM_ENGINE);
431 tp_proxy_add_interface_by_id (priv->stream_engine,
432 EMP_IFACE_QUARK_CHANNEL_HANDLER);
434 g_signal_connect (priv->stream_engine, "invalidated",
435 G_CALLBACK (tp_call_stream_engine_invalidated_cb),
438 /* FIXME: dbus daemon should be unique */
439 priv->dbus_daemon = tp_dbus_daemon_new (tp_get_bus ());
440 tp_dbus_daemon_watch_name_owner (priv->dbus_daemon, STREAM_ENGINE_BUS_NAME,
441 tp_call_stream_engine_watch_name_owner_cb,
444 g_object_get (priv->channel,
445 "connection", &connection,
446 "channel-type", &channel_type,
447 "object-path", &object_path,
448 "handle_type", &handle_type,
452 emp_cli_channel_handler_call_handle_channel (priv->stream_engine, -1,
453 connection->bus_name,
454 connection->object_path,
455 channel_type, object_path, handle_type, handle,
456 tp_call_async_cb, "calling handle channel", NULL,
459 g_object_unref (connection);
460 g_free (channel_type);
461 g_free (object_path);
465 tp_call_constructor (GType type,
466 guint n_construct_params,
467 GObjectConstructParam *construct_params)
471 EmpathyTpCallPriv *priv;
473 object = G_OBJECT_CLASS (empathy_tp_call_parent_class)->constructor (type,
474 n_construct_params, construct_params);
476 call = EMPATHY_TP_CALL (object);
477 priv = GET_PRIV (call);
479 /* Setup streamed media channel */
480 g_signal_connect (priv->channel, "invalidated",
481 G_CALLBACK (tp_call_channel_invalidated_cb), call);
482 tp_cli_channel_type_streamed_media_connect_to_stream_added (priv->channel,
483 tp_call_stream_added_cb, NULL, NULL, G_OBJECT (call), NULL);
484 tp_cli_channel_type_streamed_media_connect_to_stream_removed (priv->channel,
485 tp_call_stream_removed_cb, NULL, NULL, G_OBJECT (call), NULL);
486 tp_cli_channel_type_streamed_media_connect_to_stream_state_changed (priv->channel,
487 tp_call_stream_state_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
488 tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed (priv->channel,
489 tp_call_stream_direction_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
490 tp_cli_channel_type_streamed_media_call_list_streams (priv->channel, -1,
491 tp_call_request_streams_cb, NULL, NULL, G_OBJECT (call));
493 /* Setup group interface */
494 priv->group = empathy_tp_group_new (priv->channel);
496 g_signal_connect (G_OBJECT (priv->group), "member-added",
497 G_CALLBACK (tp_call_member_added_cb), call);
499 if (empathy_tp_group_is_ready (priv->group))
500 tp_call_group_ready_cb (call);
502 g_signal_connect_swapped (priv->group, "ready",
503 G_CALLBACK (tp_call_group_ready_cb), call);
505 /* Start stream engine */
506 tp_call_stream_engine_handle_channel (call);
512 tp_call_finalize (GObject *object)
514 EmpathyTpCallPriv *priv = GET_PRIV (object);
516 empathy_debug (DEBUG_DOMAIN, "Finalizing: %p", object);
518 g_slice_free (EmpathyTpCallStream, priv->audio);
519 g_slice_free (EmpathyTpCallStream, priv->video);
520 g_object_unref (priv->group);
522 if (priv->channel != NULL)
524 g_signal_handlers_disconnect_by_func (priv->channel,
525 tp_call_channel_invalidated_cb, object);
526 g_object_unref (priv->channel);
529 if (priv->stream_engine != NULL)
531 g_signal_handlers_disconnect_by_func (priv->stream_engine,
532 tp_call_stream_engine_invalidated_cb, object);
533 g_object_unref (priv->stream_engine);
536 if (priv->contact != NULL)
537 g_object_unref (priv->contact);
539 if (priv->dbus_daemon != NULL)
541 tp_dbus_daemon_cancel_name_owner_watch (priv->dbus_daemon,
542 STREAM_ENGINE_BUS_NAME,
543 tp_call_stream_engine_watch_name_owner_cb,
545 g_object_unref (priv->dbus_daemon);
548 (G_OBJECT_CLASS (empathy_tp_call_parent_class)->finalize) (object);
552 tp_call_set_property (GObject *object,
557 EmpathyTpCallPriv *priv = GET_PRIV (object);
562 priv->channel = g_value_dup_object (value);
565 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
571 tp_call_get_property (GObject *object,
576 EmpathyTpCallPriv *priv = GET_PRIV (object);
581 g_value_set_object (value, priv->channel);
584 g_value_set_object (value, priv->contact);
586 case PROP_IS_INCOMING:
587 g_value_set_boolean (value, priv->is_incoming);
590 g_value_set_uint (value, priv->status);
592 case PROP_AUDIO_STREAM:
593 g_value_set_pointer (value, priv->audio);
595 case PROP_VIDEO_STREAM:
596 g_value_set_pointer (value, priv->video);
599 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
605 empathy_tp_call_class_init (EmpathyTpCallClass *klass)
607 GObjectClass *object_class = G_OBJECT_CLASS (klass);
611 object_class->constructor = tp_call_constructor;
612 object_class->finalize = tp_call_finalize;
613 object_class->set_property = tp_call_set_property;
614 object_class->get_property = tp_call_get_property;
616 g_type_class_add_private (klass, sizeof (EmpathyTpCallPriv));
618 g_object_class_install_property (object_class, PROP_CHANNEL,
619 g_param_spec_object ("channel", "channel", "channel",
621 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
622 G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
623 g_object_class_install_property (object_class, PROP_CONTACT,
624 g_param_spec_object ("contact", "Call contact", "Call contact",
625 EMPATHY_TYPE_CONTACT,
626 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
627 g_object_class_install_property (object_class, PROP_IS_INCOMING,
628 g_param_spec_boolean ("is-incoming", "Is media stream incoming",
629 "Is media stream incoming", FALSE, G_PARAM_READABLE |
630 G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
631 g_object_class_install_property (object_class, PROP_STATUS,
632 g_param_spec_uint ("status", "Call status",
633 "Call status", 0, 255, 0, G_PARAM_READABLE | G_PARAM_STATIC_NICK |
634 G_PARAM_STATIC_BLURB));
635 g_object_class_install_property (object_class, PROP_AUDIO_STREAM,
636 g_param_spec_pointer ("audio-stream", "Audio stream data",
638 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
639 g_object_class_install_property (object_class, PROP_VIDEO_STREAM,
640 g_param_spec_pointer ("video-stream", "Video stream data",
642 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
646 empathy_tp_call_init (EmpathyTpCall *call)
648 EmpathyTpCallPriv *priv = GET_PRIV (call);
650 priv->status = EMPATHY_TP_CALL_STATUS_READYING;
651 priv->contact = NULL;
652 priv->stream_engine_running = FALSE;
653 priv->audio = g_slice_new0 (EmpathyTpCallStream);
654 priv->video = g_slice_new0 (EmpathyTpCallStream);
655 priv->audio->exists = FALSE;
656 priv->video->exists = FALSE;
660 empathy_tp_call_new (TpChannel *channel)
662 g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
664 return g_object_new (EMPATHY_TYPE_TP_CALL,
670 empathy_tp_call_accept_incoming_call (EmpathyTpCall *call)
672 EmpathyTpCallPriv *priv = GET_PRIV (call);
673 EmpathyContact *self_contact;
675 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
676 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_PENDING);
678 empathy_debug (DEBUG_DOMAIN, "Accepting incoming call");
680 self_contact = empathy_tp_group_get_self_contact (priv->group);
681 empathy_tp_group_add_member (priv->group, self_contact, NULL);
682 g_object_unref (self_contact);
686 empathy_tp_call_request_video_stream_direction (EmpathyTpCall *call,
689 EmpathyTpCallPriv *priv = GET_PRIV (call);
692 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
693 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_ACCEPTED);
695 empathy_debug (DEBUG_DOMAIN,
696 "Requesting video stream direction - is_sending: %d", is_sending);
698 if (!priv->video->exists)
700 tp_call_request_streams_for_capabilities (call, EMPATHY_CAPABILITIES_VIDEO);
705 new_direction = priv->video->direction | TP_MEDIA_STREAM_DIRECTION_SEND;
707 new_direction = priv->video->direction & ~TP_MEDIA_STREAM_DIRECTION_SEND;
709 tp_cli_channel_type_streamed_media_call_request_stream_direction (priv->channel,
710 -1, priv->video->id, new_direction,
711 (tp_cli_channel_type_streamed_media_callback_for_request_stream_direction)
712 tp_call_async_cb, NULL, NULL, G_OBJECT (call));
716 empathy_tp_call_add_preview_video (EmpathyTpCall *call,
717 guint preview_video_socket_id)
719 EmpathyTpCallPriv *priv = GET_PRIV (call);
721 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
722 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
724 empathy_debug (DEBUG_DOMAIN, "Adding preview video");
726 emp_cli_stream_engine_call_add_preview_window (priv->stream_engine, -1,
727 preview_video_socket_id,
729 "adding preview window", NULL,
734 empathy_tp_call_remove_preview_video (EmpathyTpCall *call,
735 guint preview_video_socket_id)
737 EmpathyTpCallPriv *priv = GET_PRIV (call);
739 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
740 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
742 empathy_debug (DEBUG_DOMAIN, "Removing preview video");
744 emp_cli_stream_engine_call_remove_preview_window (priv->stream_engine, -1,
745 preview_video_socket_id,
747 "removing preview window", NULL,
752 empathy_tp_call_add_output_video (EmpathyTpCall *call,
753 guint output_video_socket_id)
755 EmpathyTpCallPriv *priv = GET_PRIV (call);
757 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
758 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
760 empathy_debug (DEBUG_DOMAIN, "Adding output video - socket: %d",
761 output_video_socket_id);
763 emp_cli_stream_engine_call_set_output_window (priv->stream_engine, -1,
764 dbus_g_proxy_get_path (DBUS_G_PROXY (priv->channel)),
765 priv->video->id, output_video_socket_id,
767 "setting output window", NULL,
772 empathy_tp_call_set_output_volume (EmpathyTpCall *call,
775 EmpathyTpCallPriv *priv = GET_PRIV (call);
777 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
778 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
780 empathy_debug (DEBUG_DOMAIN, "Setting output volume: %d", volume);
782 emp_cli_stream_engine_call_set_output_volume (priv->stream_engine, -1,
783 dbus_g_proxy_get_path (DBUS_G_PROXY (priv->channel)),
784 priv->audio->id, volume,
786 "setting output volume", NULL,
791 empathy_tp_call_mute_output (EmpathyTpCall *call,
794 EmpathyTpCallPriv *priv = GET_PRIV (call);
796 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
797 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
799 empathy_debug (DEBUG_DOMAIN, "Setting output mute: %d", is_muted);
801 emp_cli_stream_engine_call_mute_output (priv->stream_engine, -1,
802 dbus_g_proxy_get_path (DBUS_G_PROXY (priv->channel)),
803 priv->audio->id, is_muted,
805 "muting output", NULL,
810 empathy_tp_call_mute_input (EmpathyTpCall *call,
813 EmpathyTpCallPriv *priv = GET_PRIV (call);
815 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
816 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
818 empathy_debug (DEBUG_DOMAIN, "Setting input mute: %d", is_muted);
820 emp_cli_stream_engine_call_mute_input (priv->stream_engine, -1,
821 dbus_g_proxy_get_path (DBUS_G_PROXY (priv->channel)),
822 priv->audio->id, is_muted,
824 "muting input", NULL,