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>
23 #include <telepathy-glib/proxy-subclass.h>
24 #include <telepathy-glib/dbus.h>
26 #include <extensions/extensions.h>
27 #include <libempathy/empathy-contact-factory.h>
28 #include <libempathy/empathy-debug.h>
29 #include <libempathy/empathy-tp-group.h>
30 #include <libempathy/empathy-utils.h>
32 #include "empathy-tp-call.h"
34 #define DEBUG_DOMAIN "TpCall"
36 #define GET_PRIV(object) (G_TYPE_INSTANCE_GET_PRIVATE \
37 ((object), EMPATHY_TYPE_TP_CALL, EmpathyTpCallPriv))
39 #define STREAM_ENGINE_BUS_NAME "org.freedesktop.Telepathy.StreamEngine"
40 #define STREAM_ENGINE_OBJECT_PATH "/org/freedesktop/Telepathy/StreamEngine"
42 typedef struct _EmpathyTpCallPriv EmpathyTpCallPriv;
44 struct _EmpathyTpCallPriv
47 TpProxy *stream_engine;
48 TpDBusDaemon *dbus_daemon;
49 EmpathyTpGroup *group;
50 EmpathyContact *contact;
53 gboolean stream_engine_running;
55 EmpathyTpCallStream *audio;
56 EmpathyTpCallStream *video;
70 G_DEFINE_TYPE (EmpathyTpCall, empathy_tp_call, G_TYPE_OBJECT)
73 tp_call_add_stream (EmpathyTpCall *call,
78 guint stream_direction)
80 EmpathyTpCallPriv *priv = GET_PRIV (call);
84 case TP_MEDIA_STREAM_TYPE_AUDIO:
85 empathy_debug (DEBUG_DOMAIN,
86 "Audio stream - id: %d, state: %d, direction: %d",
87 stream_id, stream_state, stream_direction);
88 priv->audio->exists = TRUE;
89 priv->audio->id = stream_id;
90 priv->audio->state = stream_state;
91 priv->audio->direction = stream_direction;
92 g_object_notify (G_OBJECT (call), "audio-stream");
94 case TP_MEDIA_STREAM_TYPE_VIDEO:
95 empathy_debug (DEBUG_DOMAIN,
96 "Video stream - id: %d, state: %d, direction: %d",
97 stream_id, stream_state, stream_direction);
98 priv->video->exists = TRUE;
99 priv->video->id = stream_id;
100 priv->video->state = stream_state;
101 priv->video->direction = stream_direction;
102 g_object_notify (G_OBJECT (call), "video-stream");
105 empathy_debug (DEBUG_DOMAIN, "Unknown stream type: %d",
111 tp_call_stream_added_cb (TpChannel *channel,
113 guint contact_handle,
118 empathy_debug (DEBUG_DOMAIN,
119 "Stream added - stream id: %d, contact handle: %d, stream type: %d",
120 stream_id, contact_handle, stream_type);
122 tp_call_add_stream (EMPATHY_TP_CALL (call), stream_id, contact_handle,
123 stream_type, TP_MEDIA_STREAM_STATE_DISCONNECTED,
124 TP_MEDIA_STREAM_DIRECTION_NONE);
128 tp_call_stream_removed_cb (TpChannel *channel,
133 EmpathyTpCallPriv *priv = GET_PRIV (call);
135 empathy_debug (DEBUG_DOMAIN, "Stream removed - stream id: %d", stream_id);
137 if (stream_id == priv->audio->id)
139 priv->audio->exists = FALSE;
140 g_object_notify (call, "audio-stream");
142 else if (stream_id == priv->video->id)
144 priv->video->exists = FALSE;
145 g_object_notify (call, "video-stream");
150 tp_call_stream_state_changed_cb (TpChannel *proxy,
156 EmpathyTpCallPriv *priv = GET_PRIV (call);
158 empathy_debug (DEBUG_DOMAIN,
159 "Stream state changed - stream id: %d, state state: %d",
160 stream_id, stream_state);
162 if (stream_id == priv->audio->id)
164 priv->audio->state = stream_state;
165 g_object_notify (call, "audio-stream");
167 else if (stream_id == priv->video->id)
169 priv->video->state = stream_state;
170 g_object_notify (call, "video-stream");
175 tp_call_stream_direction_changed_cb (TpChannel *channel,
177 guint stream_direction,
182 EmpathyTpCallPriv *priv = GET_PRIV (call);
184 empathy_debug (DEBUG_DOMAIN,
185 "Stream direction changed - stream: %d, direction: %d",
186 stream_id, stream_direction);
188 if (stream_id == priv->audio->id)
190 priv->audio->direction = stream_direction;
191 g_object_notify (call, "audio-stream");
193 else if (stream_id == priv->video->id)
195 priv->video->direction = stream_direction;
196 g_object_notify (call, "video-stream");
201 tp_call_request_streams_cb (TpChannel *channel,
202 const GPtrArray *streams,
211 empathy_debug (DEBUG_DOMAIN, "Error requesting streams: %s", error->message);
215 for (i = 0; i < streams->len; i++)
219 guint contact_handle;
222 guint stream_direction;
224 values = g_ptr_array_index (streams, i);
225 stream_id = g_value_get_uint (g_value_array_get_nth (values, 0));
226 contact_handle = g_value_get_uint (g_value_array_get_nth (values, 1));
227 stream_type = g_value_get_uint (g_value_array_get_nth (values, 2));
228 stream_state = g_value_get_uint (g_value_array_get_nth (values, 3));
229 stream_direction = g_value_get_uint (g_value_array_get_nth (values, 4));
231 tp_call_add_stream (EMPATHY_TP_CALL (call), stream_id, contact_handle,
232 stream_type, stream_state, stream_direction);
237 tp_call_request_streams_for_capabilities (EmpathyTpCall *call,
238 EmpathyCapabilities capabilities)
240 EmpathyTpCallPriv *priv = GET_PRIV (call);
241 GArray *stream_types;
245 empathy_debug (DEBUG_DOMAIN, "Requesting new stream for capabilities %d",
248 stream_types = g_array_new (FALSE, FALSE, sizeof (guint));
249 handle = empathy_contact_get_handle (priv->contact);
251 if (capabilities & EMPATHY_CAPABILITIES_AUDIO)
253 stream_type = TP_MEDIA_STREAM_TYPE_AUDIO;
254 g_array_append_val (stream_types, stream_type);
256 if (capabilities & EMPATHY_CAPABILITIES_VIDEO)
258 stream_type = TP_MEDIA_STREAM_TYPE_VIDEO;
259 g_array_append_val (stream_types, stream_type);
262 tp_cli_channel_type_streamed_media_call_request_streams (priv->channel, -1,
263 handle, stream_types, tp_call_request_streams_cb, NULL, NULL,
266 g_array_free (stream_types, TRUE);
270 tp_call_request_streams (EmpathyTpCall *call)
272 EmpathyTpCallPriv *priv = GET_PRIV (call);
273 EmpathyCapabilities capabilities;
274 TpConnection *connection;
276 empathy_debug (DEBUG_DOMAIN,
277 "Requesting appropriate audio/video streams from contact");
279 /* FIXME: SIP don't have capabilities interface but we know it supports
280 * only audio and not video. */
281 g_object_get (priv->channel, "connection", &connection, NULL);
282 if (!tp_proxy_has_interface_by_id (connection,
283 TP_IFACE_QUARK_CONNECTION_INTERFACE_CAPABILITIES))
284 capabilities = EMPATHY_CAPABILITIES_AUDIO;
286 capabilities = empathy_contact_get_capabilities (priv->contact);
288 tp_call_request_streams_for_capabilities (call, capabilities);
289 g_object_unref (connection);
293 tp_call_group_ready_cb (EmpathyTpCall *call)
295 EmpathyTpCallPriv *priv = GET_PRIV (call);
296 EmpathyPendingInfo *invitation;
298 invitation = empathy_tp_group_get_invitation (priv->group, &priv->contact);
299 priv->is_incoming = (invitation != NULL);
300 priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
302 if (!priv->is_incoming)
303 tp_call_request_streams (call);
305 g_object_notify (G_OBJECT (call), "is-incoming");
306 g_object_notify (G_OBJECT (call), "contact");
307 g_object_notify (G_OBJECT (call), "status");
311 tp_call_member_added_cb (EmpathyTpGroup *group,
312 EmpathyContact *contact,
313 EmpathyContact *actor,
315 const gchar *message,
318 EmpathyTpCallPriv *priv = GET_PRIV (call);
320 if (priv->status == EMPATHY_TP_CALL_STATUS_PENDING &&
321 ((priv->is_incoming && contact != priv->contact) ||
322 (!priv->is_incoming && contact == priv->contact)))
324 priv->status = EMPATHY_TP_CALL_STATUS_ACCEPTED;
325 g_object_notify (G_OBJECT (call), "status");
330 tp_call_channel_invalidated_cb (TpChannel *channel,
336 EmpathyTpCallPriv *priv = GET_PRIV (call);
338 empathy_debug (DEBUG_DOMAIN, "Channel invalidated: %s", message);
339 priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
340 g_object_notify (G_OBJECT (call), "status");
344 tp_call_async_cb (TpProxy *proxy,
351 empathy_debug (DEBUG_DOMAIN, "Error %s: %s",
352 user_data, error->message);
357 tp_call_close_channel (EmpathyTpCall *call)
359 EmpathyTpCallPriv *priv = GET_PRIV (call);
361 if (priv->status == EMPATHY_TP_CALL_STATUS_CLOSED)
364 empathy_debug (DEBUG_DOMAIN, "Closing channel");
366 tp_cli_channel_call_close (priv->channel, -1,
367 (tp_cli_channel_callback_for_close) tp_call_async_cb,
368 "closing channel", NULL, G_OBJECT (call));
370 priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
371 g_object_notify (G_OBJECT (call), "status");
375 tp_call_stream_engine_invalidated_cb (TpProxy *stream_engine,
381 empathy_debug (DEBUG_DOMAIN, "Stream engine proxy invalidated: %s",
383 tp_call_close_channel (call);
387 tp_call_stream_engine_watch_name_owner_cb (TpDBusDaemon *daemon,
389 const gchar *new_owner,
392 EmpathyTpCallPriv *priv = GET_PRIV (call);
394 /* G_STR_EMPTY(new_owner) means either stream-engine has not started yet or
395 * has crashed. We want to close the channel if stream-engine has crashed.
397 empathy_debug (DEBUG_DOMAIN,
398 "Watch SE: name='%s' SE running='%s' new_owner='%s'",
399 name, priv->stream_engine_running ? "yes" : "no",
400 new_owner ? new_owner : "none");
401 if (priv->stream_engine_running && G_STR_EMPTY (new_owner))
403 empathy_debug (DEBUG_DOMAIN, "Stream engine falled off the bus");
404 tp_call_close_channel (call);
408 priv->stream_engine_running = !G_STR_EMPTY (new_owner);
412 tp_call_stream_engine_handle_channel (EmpathyTpCall *call)
414 EmpathyTpCallPriv *priv = GET_PRIV (call);
421 empathy_debug (DEBUG_DOMAIN, "Revving up the stream engine");
423 priv->stream_engine = g_object_new (TP_TYPE_PROXY,
424 "bus-name", STREAM_ENGINE_BUS_NAME,
425 "dbus-connection", tp_get_bus (),
426 "object-path", STREAM_ENGINE_OBJECT_PATH,
428 tp_proxy_add_interface_by_id (priv->stream_engine,
429 EMP_IFACE_QUARK_STREAM_ENGINE);
430 tp_proxy_add_interface_by_id (priv->stream_engine,
431 EMP_IFACE_QUARK_CHANNEL_HANDLER);
433 g_signal_connect (priv->stream_engine, "invalidated",
434 G_CALLBACK (tp_call_stream_engine_invalidated_cb),
437 /* FIXME: dbus daemon should be unique */
438 priv->dbus_daemon = tp_dbus_daemon_new (tp_get_bus ());
439 tp_dbus_daemon_watch_name_owner (priv->dbus_daemon, STREAM_ENGINE_BUS_NAME,
440 tp_call_stream_engine_watch_name_owner_cb,
443 g_object_get (priv->channel,
444 "connection", &connection,
445 "channel-type", &channel_type,
446 "object-path", &object_path,
447 "handle_type", &handle_type,
451 emp_cli_channel_handler_call_handle_channel (priv->stream_engine, -1,
452 connection->bus_name,
453 connection->object_path,
454 channel_type, object_path, handle_type, handle,
455 tp_call_async_cb, "calling handle channel", NULL,
458 g_object_unref (connection);
459 g_free (channel_type);
460 g_free (object_path);
464 tp_call_constructor (GType type,
465 guint n_construct_params,
466 GObjectConstructParam *construct_params)
470 EmpathyTpCallPriv *priv;
472 object = G_OBJECT_CLASS (empathy_tp_call_parent_class)->constructor (type,
473 n_construct_params, construct_params);
475 call = EMPATHY_TP_CALL (object);
476 priv = GET_PRIV (call);
478 /* Setup streamed media channel */
479 g_signal_connect (priv->channel, "invalidated",
480 G_CALLBACK (tp_call_channel_invalidated_cb), call);
481 tp_cli_channel_type_streamed_media_connect_to_stream_added (priv->channel,
482 tp_call_stream_added_cb, NULL, NULL, G_OBJECT (call), NULL);
483 tp_cli_channel_type_streamed_media_connect_to_stream_removed (priv->channel,
484 tp_call_stream_removed_cb, NULL, NULL, G_OBJECT (call), NULL);
485 tp_cli_channel_type_streamed_media_connect_to_stream_state_changed (priv->channel,
486 tp_call_stream_state_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
487 tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed (priv->channel,
488 tp_call_stream_direction_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
489 tp_cli_channel_type_streamed_media_call_list_streams (priv->channel, -1,
490 tp_call_request_streams_cb, NULL, NULL, G_OBJECT (call));
492 /* Setup group interface */
493 priv->group = empathy_tp_group_new (priv->channel);
495 g_signal_connect (G_OBJECT (priv->group), "member-added",
496 G_CALLBACK (tp_call_member_added_cb), call);
498 if (empathy_tp_group_is_ready (priv->group))
499 tp_call_group_ready_cb (call);
501 g_signal_connect_swapped (priv->group, "ready",
502 G_CALLBACK (tp_call_group_ready_cb), call);
504 /* Start stream engine */
505 tp_call_stream_engine_handle_channel (call);
511 tp_call_finalize (GObject *object)
513 EmpathyTpCallPriv *priv = GET_PRIV (object);
515 empathy_debug (DEBUG_DOMAIN, "Finalizing: %p", object);
517 g_slice_free (EmpathyTpCallStream, priv->audio);
518 g_slice_free (EmpathyTpCallStream, priv->video);
519 g_object_unref (priv->group);
521 if (priv->channel != NULL)
523 g_signal_handlers_disconnect_by_func (priv->channel,
524 tp_call_channel_invalidated_cb, object);
525 g_object_unref (priv->channel);
528 if (priv->stream_engine != NULL)
530 g_signal_handlers_disconnect_by_func (priv->stream_engine,
531 tp_call_stream_engine_invalidated_cb, object);
532 g_object_unref (priv->stream_engine);
535 if (priv->contact != NULL)
536 g_object_unref (priv->contact);
538 if (priv->dbus_daemon != NULL)
540 tp_dbus_daemon_cancel_name_owner_watch (priv->dbus_daemon,
541 STREAM_ENGINE_BUS_NAME,
542 tp_call_stream_engine_watch_name_owner_cb,
544 g_object_unref (priv->dbus_daemon);
547 (G_OBJECT_CLASS (empathy_tp_call_parent_class)->finalize) (object);
551 tp_call_set_property (GObject *object,
556 EmpathyTpCallPriv *priv = GET_PRIV (object);
561 priv->channel = g_value_dup_object (value);
564 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
570 tp_call_get_property (GObject *object,
575 EmpathyTpCallPriv *priv = GET_PRIV (object);
580 g_value_set_object (value, priv->channel);
583 g_value_set_object (value, priv->contact);
585 case PROP_IS_INCOMING:
586 g_value_set_boolean (value, priv->is_incoming);
589 g_value_set_uint (value, priv->status);
591 case PROP_AUDIO_STREAM:
592 g_value_set_pointer (value, priv->audio);
594 case PROP_VIDEO_STREAM:
595 g_value_set_pointer (value, priv->video);
598 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
604 empathy_tp_call_class_init (EmpathyTpCallClass *klass)
606 GObjectClass *object_class = G_OBJECT_CLASS (klass);
610 object_class->constructor = tp_call_constructor;
611 object_class->finalize = tp_call_finalize;
612 object_class->set_property = tp_call_set_property;
613 object_class->get_property = tp_call_get_property;
615 g_type_class_add_private (klass, sizeof (EmpathyTpCallPriv));
617 g_object_class_install_property (object_class, PROP_CHANNEL,
618 g_param_spec_object ("channel", "channel", "channel",
620 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
621 G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
622 g_object_class_install_property (object_class, PROP_CONTACT,
623 g_param_spec_object ("contact", "Call contact", "Call contact",
624 EMPATHY_TYPE_CONTACT,
625 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
626 g_object_class_install_property (object_class, PROP_IS_INCOMING,
627 g_param_spec_boolean ("is-incoming", "Is media stream incoming",
628 "Is media stream incoming", FALSE, G_PARAM_READABLE |
629 G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
630 g_object_class_install_property (object_class, PROP_STATUS,
631 g_param_spec_uint ("status", "Call status",
632 "Call status", 0, 255, 0, G_PARAM_READABLE | G_PARAM_STATIC_NICK |
633 G_PARAM_STATIC_BLURB));
634 g_object_class_install_property (object_class, PROP_AUDIO_STREAM,
635 g_param_spec_pointer ("audio-stream", "Audio stream data",
637 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
638 g_object_class_install_property (object_class, PROP_VIDEO_STREAM,
639 g_param_spec_pointer ("video-stream", "Video stream data",
641 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
645 empathy_tp_call_init (EmpathyTpCall *call)
647 EmpathyTpCallPriv *priv = GET_PRIV (call);
649 priv->status = EMPATHY_TP_CALL_STATUS_READYING;
650 priv->contact = NULL;
651 priv->stream_engine_running = FALSE;
652 priv->audio = g_slice_new0 (EmpathyTpCallStream);
653 priv->video = g_slice_new0 (EmpathyTpCallStream);
654 priv->audio->exists = FALSE;
655 priv->video->exists = FALSE;
659 empathy_tp_call_new (TpChannel *channel)
661 g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
663 return g_object_new (EMPATHY_TYPE_TP_CALL,
669 empathy_tp_call_accept_incoming_call (EmpathyTpCall *call)
671 EmpathyTpCallPriv *priv = GET_PRIV (call);
672 EmpathyContact *self_contact;
674 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
675 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_PENDING);
677 empathy_debug (DEBUG_DOMAIN, "Accepting incoming call");
679 self_contact = empathy_tp_group_get_self_contact (priv->group);
680 empathy_tp_group_add_member (priv->group, self_contact, NULL);
681 g_object_unref (self_contact);
685 empathy_tp_call_request_video_stream_direction (EmpathyTpCall *call,
688 EmpathyTpCallPriv *priv = GET_PRIV (call);
691 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
692 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_ACCEPTED);
694 empathy_debug (DEBUG_DOMAIN,
695 "Requesting video stream direction - is_sending: %d", is_sending);
697 if (!priv->video->exists)
699 tp_call_request_streams_for_capabilities (call, EMPATHY_CAPABILITIES_VIDEO);
704 new_direction = priv->video->direction | TP_MEDIA_STREAM_DIRECTION_SEND;
706 new_direction = priv->video->direction & ~TP_MEDIA_STREAM_DIRECTION_SEND;
708 tp_cli_channel_type_streamed_media_call_request_stream_direction (priv->channel,
709 -1, priv->video->id, new_direction,
710 (tp_cli_channel_type_streamed_media_callback_for_request_stream_direction)
711 tp_call_async_cb, NULL, NULL, G_OBJECT (call));
715 empathy_tp_call_add_preview_video (EmpathyTpCall *call,
716 guint preview_video_socket_id)
718 EmpathyTpCallPriv *priv = GET_PRIV (call);
720 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
721 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
723 empathy_debug (DEBUG_DOMAIN, "Adding preview video");
725 emp_cli_stream_engine_call_add_preview_window (priv->stream_engine, -1,
726 preview_video_socket_id,
728 "adding preview window", NULL,
733 empathy_tp_call_remove_preview_video (EmpathyTpCall *call,
734 guint preview_video_socket_id)
736 EmpathyTpCallPriv *priv = GET_PRIV (call);
738 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
739 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
741 empathy_debug (DEBUG_DOMAIN, "Removing preview video");
743 emp_cli_stream_engine_call_remove_preview_window (priv->stream_engine, -1,
744 preview_video_socket_id,
746 "removing preview window", NULL,
751 empathy_tp_call_add_output_video (EmpathyTpCall *call,
752 guint output_video_socket_id)
754 EmpathyTpCallPriv *priv = GET_PRIV (call);
756 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
757 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
759 empathy_debug (DEBUG_DOMAIN, "Adding output video - socket: %d",
760 output_video_socket_id);
762 emp_cli_stream_engine_call_set_output_window (priv->stream_engine, -1,
763 TP_PROXY (priv->channel)->object_path,
764 priv->video->id, output_video_socket_id,
766 "setting output window", NULL,
771 empathy_tp_call_set_output_volume (EmpathyTpCall *call,
774 EmpathyTpCallPriv *priv = GET_PRIV (call);
776 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
777 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
779 empathy_debug (DEBUG_DOMAIN, "Setting output volume: %d", volume);
781 emp_cli_stream_engine_call_set_output_volume (priv->stream_engine, -1,
782 TP_PROXY (priv->channel)->object_path,
783 priv->audio->id, volume,
785 "setting output volume", NULL,
790 empathy_tp_call_mute_output (EmpathyTpCall *call,
793 EmpathyTpCallPriv *priv = GET_PRIV (call);
795 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
796 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
798 empathy_debug (DEBUG_DOMAIN, "Setting output mute: %d", is_muted);
800 emp_cli_stream_engine_call_mute_output (priv->stream_engine, -1,
801 TP_PROXY (priv->channel)->object_path,
802 priv->audio->id, is_muted,
804 "muting output", NULL,
809 empathy_tp_call_mute_input (EmpathyTpCall *call,
812 EmpathyTpCallPriv *priv = GET_PRIV (call);
814 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
815 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
817 empathy_debug (DEBUG_DOMAIN, "Setting input mute: %d", is_muted);
819 emp_cli_stream_engine_call_mute_input (priv->stream_engine, -1,
820 TP_PROXY (priv->channel)->object_path,
821 priv->audio->id, is_muted,
823 "muting input", NULL,