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_member_added_cb (EmpathyTpGroup *group,
286 EmpathyContact *contact,
287 EmpathyContact *actor,
289 const gchar *message,
292 EmpathyTpCallPriv *priv = GET_PRIV (call);
294 if (priv->status == EMPATHY_TP_CALL_STATUS_PENDING &&
295 ((priv->is_incoming && contact != priv->contact) ||
296 (!priv->is_incoming && contact == priv->contact)))
298 priv->status = EMPATHY_TP_CALL_STATUS_ACCEPTED;
299 g_object_notify (G_OBJECT (call), "status");
304 tp_call_local_pending_cb (EmpathyTpGroup *group,
305 EmpathyContact *contact,
306 EmpathyContact *actor,
308 const gchar *message,
311 EmpathyTpCallPriv *priv = GET_PRIV (call);
313 if (!priv->contact && !empathy_contact_is_user (contact))
315 priv->contact = g_object_ref (contact);
316 priv->is_incoming = TRUE;
317 priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
318 g_object_notify (G_OBJECT (call), "is-incoming");
319 g_object_notify (G_OBJECT (call), "contact");
320 g_object_notify (G_OBJECT (call), "status");
325 tp_call_remote_pending_cb (EmpathyTpGroup *group,
326 EmpathyContact *contact,
327 EmpathyContact *actor,
329 const gchar *message,
332 EmpathyTpCallPriv *priv = GET_PRIV (call);
334 if (!priv->contact && !empathy_contact_is_user (contact))
336 priv->contact = g_object_ref (contact);
337 priv->is_incoming = FALSE;
338 priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
339 tp_call_request_streams (call);
340 g_object_notify (G_OBJECT (call), "is-incoming");
341 g_object_notify (G_OBJECT (call), "contact");
342 g_object_notify (G_OBJECT (call), "status");
347 tp_call_channel_invalidated_cb (TpChannel *channel,
353 EmpathyTpCallPriv *priv = GET_PRIV (call);
355 empathy_debug (DEBUG_DOMAIN, "Channel invalidated: %s", message);
356 priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
357 g_object_notify (G_OBJECT (call), "status");
361 tp_call_async_cb (TpProxy *proxy,
368 empathy_debug (DEBUG_DOMAIN, "Error %s: %s",
369 user_data, error->message);
374 tp_call_close_channel (EmpathyTpCall *call)
376 EmpathyTpCallPriv *priv = GET_PRIV (call);
378 if (priv->status == EMPATHY_TP_CALL_STATUS_CLOSED)
381 empathy_debug (DEBUG_DOMAIN, "Closing channel");
383 tp_cli_channel_call_close (priv->channel, -1,
384 NULL, NULL, NULL, NULL);
386 priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
387 g_object_notify (G_OBJECT (call), "status");
391 tp_call_stream_engine_invalidated_cb (TpProxy *stream_engine,
397 empathy_debug (DEBUG_DOMAIN, "Stream engine proxy invalidated: %s",
399 tp_call_close_channel (call);
403 tp_call_stream_engine_watch_name_owner_cb (TpDBusDaemon *daemon,
405 const gchar *new_owner,
408 EmpathyTpCallPriv *priv = GET_PRIV (call);
410 /* G_STR_EMPTY(new_owner) means either stream-engine has not started yet or
411 * has crashed. We want to close the channel if stream-engine has crashed.
413 empathy_debug (DEBUG_DOMAIN,
414 "Watch SE: name='%s' SE running='%s' new_owner='%s'",
415 name, priv->stream_engine_running ? "yes" : "no",
416 new_owner ? new_owner : "none");
417 if (priv->stream_engine_running && G_STR_EMPTY (new_owner))
419 empathy_debug (DEBUG_DOMAIN, "Stream engine falled off the bus");
420 tp_call_close_channel (call);
424 priv->stream_engine_running = !G_STR_EMPTY (new_owner);
428 tp_call_stream_engine_handle_channel (EmpathyTpCall *call)
430 EmpathyTpCallPriv *priv = GET_PRIV (call);
437 empathy_debug (DEBUG_DOMAIN, "Revving up the stream engine");
439 priv->stream_engine = g_object_new (TP_TYPE_PROXY,
440 "bus-name", STREAM_ENGINE_BUS_NAME,
441 "dbus-connection", tp_get_bus (),
442 "object-path", STREAM_ENGINE_OBJECT_PATH,
444 tp_proxy_add_interface_by_id (priv->stream_engine,
445 EMP_IFACE_QUARK_STREAM_ENGINE);
446 tp_proxy_add_interface_by_id (priv->stream_engine,
447 EMP_IFACE_QUARK_CHANNEL_HANDLER);
449 g_signal_connect (priv->stream_engine, "invalidated",
450 G_CALLBACK (tp_call_stream_engine_invalidated_cb),
453 /* FIXME: dbus daemon should be unique */
454 priv->dbus_daemon = tp_dbus_daemon_new (tp_get_bus ());
455 tp_dbus_daemon_watch_name_owner (priv->dbus_daemon, STREAM_ENGINE_BUS_NAME,
456 tp_call_stream_engine_watch_name_owner_cb,
459 g_object_get (priv->channel,
460 "connection", &connection,
461 "channel-type", &channel_type,
462 "object-path", &object_path,
463 "handle_type", &handle_type,
467 emp_cli_channel_handler_call_handle_channel (priv->stream_engine, -1,
468 connection->bus_name,
469 connection->object_path,
470 channel_type, object_path, handle_type, handle,
471 tp_call_async_cb, "calling handle channel", NULL,
474 g_object_unref (connection);
475 g_free (channel_type);
476 g_free (object_path);
480 tp_call_constructor (GType type,
481 guint n_construct_params,
482 GObjectConstructParam *construct_params)
486 EmpathyTpCallPriv *priv;
488 object = G_OBJECT_CLASS (empathy_tp_call_parent_class)->constructor (type,
489 n_construct_params, construct_params);
491 call = EMPATHY_TP_CALL (object);
492 priv = GET_PRIV (call);
494 /* Setup streamed media channel */
495 g_signal_connect (priv->channel, "invalidated",
496 G_CALLBACK (tp_call_channel_invalidated_cb), call);
497 tp_cli_channel_type_streamed_media_connect_to_stream_added (priv->channel,
498 tp_call_stream_added_cb, NULL, NULL, G_OBJECT (call), NULL);
499 tp_cli_channel_type_streamed_media_connect_to_stream_removed (priv->channel,
500 tp_call_stream_removed_cb, NULL, NULL, G_OBJECT (call), NULL);
501 tp_cli_channel_type_streamed_media_connect_to_stream_state_changed (priv->channel,
502 tp_call_stream_state_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
503 tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed (priv->channel,
504 tp_call_stream_direction_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
505 tp_cli_channel_type_streamed_media_call_list_streams (priv->channel, -1,
506 tp_call_request_streams_cb, NULL, NULL, G_OBJECT (call));
508 /* Setup group interface */
509 priv->group = empathy_tp_group_new (priv->channel);
511 g_signal_connect (priv->group, "member-added",
512 G_CALLBACK (tp_call_member_added_cb), call);
513 g_signal_connect (priv->group, "local-pending",
514 G_CALLBACK (tp_call_local_pending_cb), call);
515 g_signal_connect (priv->group, "remote-pending",
516 G_CALLBACK (tp_call_remote_pending_cb), call);
518 /* Start stream engine */
519 tp_call_stream_engine_handle_channel (call);
525 tp_call_finalize (GObject *object)
527 EmpathyTpCallPriv *priv = GET_PRIV (object);
529 empathy_debug (DEBUG_DOMAIN, "Finalizing: %p", object);
531 g_slice_free (EmpathyTpCallStream, priv->audio);
532 g_slice_free (EmpathyTpCallStream, priv->video);
533 g_object_unref (priv->group);
535 if (priv->channel != NULL)
537 g_signal_handlers_disconnect_by_func (priv->channel,
538 tp_call_channel_invalidated_cb, object);
539 tp_call_close_channel (EMPATHY_TP_CALL (object));
540 g_object_unref (priv->channel);
543 if (priv->stream_engine != NULL)
545 g_signal_handlers_disconnect_by_func (priv->stream_engine,
546 tp_call_stream_engine_invalidated_cb, object);
547 g_object_unref (priv->stream_engine);
550 if (priv->contact != NULL)
551 g_object_unref (priv->contact);
553 if (priv->dbus_daemon != NULL)
555 tp_dbus_daemon_cancel_name_owner_watch (priv->dbus_daemon,
556 STREAM_ENGINE_BUS_NAME,
557 tp_call_stream_engine_watch_name_owner_cb,
559 g_object_unref (priv->dbus_daemon);
562 (G_OBJECT_CLASS (empathy_tp_call_parent_class)->finalize) (object);
566 tp_call_set_property (GObject *object,
571 EmpathyTpCallPriv *priv = GET_PRIV (object);
576 priv->channel = g_value_dup_object (value);
579 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
585 tp_call_get_property (GObject *object,
590 EmpathyTpCallPriv *priv = GET_PRIV (object);
595 g_value_set_object (value, priv->channel);
598 g_value_set_object (value, priv->contact);
600 case PROP_IS_INCOMING:
601 g_value_set_boolean (value, priv->is_incoming);
604 g_value_set_uint (value, priv->status);
606 case PROP_AUDIO_STREAM:
607 g_value_set_pointer (value, priv->audio);
609 case PROP_VIDEO_STREAM:
610 g_value_set_pointer (value, priv->video);
613 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
619 empathy_tp_call_class_init (EmpathyTpCallClass *klass)
621 GObjectClass *object_class = G_OBJECT_CLASS (klass);
625 object_class->constructor = tp_call_constructor;
626 object_class->finalize = tp_call_finalize;
627 object_class->set_property = tp_call_set_property;
628 object_class->get_property = tp_call_get_property;
630 g_type_class_add_private (klass, sizeof (EmpathyTpCallPriv));
632 g_object_class_install_property (object_class, PROP_CHANNEL,
633 g_param_spec_object ("channel", "channel", "channel",
635 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
636 G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
637 g_object_class_install_property (object_class, PROP_CONTACT,
638 g_param_spec_object ("contact", "Call contact", "Call contact",
639 EMPATHY_TYPE_CONTACT,
640 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
641 g_object_class_install_property (object_class, PROP_IS_INCOMING,
642 g_param_spec_boolean ("is-incoming", "Is media stream incoming",
643 "Is media stream incoming", FALSE, G_PARAM_READABLE |
644 G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
645 g_object_class_install_property (object_class, PROP_STATUS,
646 g_param_spec_uint ("status", "Call status",
647 "Call status", 0, 255, 0, G_PARAM_READABLE | G_PARAM_STATIC_NICK |
648 G_PARAM_STATIC_BLURB));
649 g_object_class_install_property (object_class, PROP_AUDIO_STREAM,
650 g_param_spec_pointer ("audio-stream", "Audio stream data",
652 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
653 g_object_class_install_property (object_class, PROP_VIDEO_STREAM,
654 g_param_spec_pointer ("video-stream", "Video stream data",
656 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
660 empathy_tp_call_init (EmpathyTpCall *call)
662 EmpathyTpCallPriv *priv = GET_PRIV (call);
664 priv->status = EMPATHY_TP_CALL_STATUS_READYING;
665 priv->contact = NULL;
666 priv->stream_engine_running = FALSE;
667 priv->audio = g_slice_new0 (EmpathyTpCallStream);
668 priv->video = g_slice_new0 (EmpathyTpCallStream);
669 priv->audio->exists = FALSE;
670 priv->video->exists = FALSE;
674 empathy_tp_call_new (TpChannel *channel)
676 g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
678 return g_object_new (EMPATHY_TYPE_TP_CALL,
684 empathy_tp_call_accept_incoming_call (EmpathyTpCall *call)
686 EmpathyTpCallPriv *priv = GET_PRIV (call);
687 EmpathyContact *self_contact;
689 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
690 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_PENDING);
692 empathy_debug (DEBUG_DOMAIN, "Accepting incoming call");
694 self_contact = empathy_tp_group_get_self_contact (priv->group);
695 empathy_tp_group_add_member (priv->group, self_contact, NULL);
696 g_object_unref (self_contact);
700 empathy_tp_call_request_video_stream_direction (EmpathyTpCall *call,
703 EmpathyTpCallPriv *priv = GET_PRIV (call);
706 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
707 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_ACCEPTED);
709 empathy_debug (DEBUG_DOMAIN,
710 "Requesting video stream direction - is_sending: %d", is_sending);
712 if (!priv->video->exists)
715 tp_call_request_streams_for_capabilities (call,
716 EMPATHY_CAPABILITIES_VIDEO);
721 new_direction = priv->video->direction | TP_MEDIA_STREAM_DIRECTION_SEND;
723 new_direction = priv->video->direction & ~TP_MEDIA_STREAM_DIRECTION_SEND;
725 tp_cli_channel_type_streamed_media_call_request_stream_direction (priv->channel,
726 -1, priv->video->id, new_direction,
727 (tp_cli_channel_type_streamed_media_callback_for_request_stream_direction)
728 tp_call_async_cb, NULL, NULL, G_OBJECT (call));
732 empathy_tp_call_add_preview_video (EmpathyTpCall *call,
733 guint preview_video_socket_id)
735 EmpathyTpCallPriv *priv = GET_PRIV (call);
737 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
739 empathy_debug (DEBUG_DOMAIN, "Adding preview video");
741 emp_cli_stream_engine_call_add_preview_window (priv->stream_engine, -1,
742 preview_video_socket_id,
744 "adding preview window", NULL,
749 empathy_tp_call_remove_preview_video (EmpathyTpCall *call,
750 guint preview_video_socket_id)
752 EmpathyTpCallPriv *priv = GET_PRIV (call);
754 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
756 empathy_debug (DEBUG_DOMAIN, "Removing preview video");
758 emp_cli_stream_engine_call_remove_preview_window (priv->stream_engine, -1,
759 preview_video_socket_id,
761 "removing preview window", NULL,
766 empathy_tp_call_add_output_video (EmpathyTpCall *call,
767 guint output_video_socket_id)
769 EmpathyTpCallPriv *priv = GET_PRIV (call);
771 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
772 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
774 empathy_debug (DEBUG_DOMAIN, "Adding output video - socket: %d",
775 output_video_socket_id);
777 emp_cli_stream_engine_call_set_output_window (priv->stream_engine, -1,
778 TP_PROXY (priv->channel)->object_path,
779 priv->video->id, output_video_socket_id,
781 "setting output window", NULL,
786 empathy_tp_call_set_output_volume (EmpathyTpCall *call,
789 EmpathyTpCallPriv *priv = GET_PRIV (call);
791 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
792 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
794 empathy_debug (DEBUG_DOMAIN, "Setting output volume: %d", volume);
796 emp_cli_stream_engine_call_set_output_volume (priv->stream_engine, -1,
797 TP_PROXY (priv->channel)->object_path,
798 priv->audio->id, volume,
800 "setting output volume", NULL,
805 empathy_tp_call_mute_output (EmpathyTpCall *call,
808 EmpathyTpCallPriv *priv = GET_PRIV (call);
810 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
811 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
813 empathy_debug (DEBUG_DOMAIN, "Setting output mute: %d", is_muted);
815 emp_cli_stream_engine_call_mute_output (priv->stream_engine, -1,
816 TP_PROXY (priv->channel)->object_path,
817 priv->audio->id, is_muted,
819 "muting output", NULL,
824 empathy_tp_call_mute_input (EmpathyTpCall *call,
827 EmpathyTpCallPriv *priv = GET_PRIV (call);
829 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
830 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
832 empathy_debug (DEBUG_DOMAIN, "Setting input mute: %d", is_muted);
834 emp_cli_stream_engine_call_mute_input (priv->stream_engine, -1,
835 TP_PROXY (priv->channel)->object_path,
836 priv->audio->id, is_muted,
838 "muting input", NULL,