diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2012-02-24 21:29:38 -0500 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2012-02-24 21:29:38 -0500 |
commit | 27fe5141c7a7ebf3873fc1ffde568481a42ae860 (patch) | |
tree | ef944d660f933e871f6bf906b5075b8d3be180c3 | |
parent | f43819371c088e55c48bf5482825dcc68ced199e (diff) |
CallStream: Disable direction changes if mutable-contents=false
-rw-r--r-- | rakia/call-stream.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/rakia/call-stream.c b/rakia/call-stream.c index c3c719f..4f13849 100644 --- a/rakia/call-stream.c +++ b/rakia/call-stream.c @@ -473,10 +473,25 @@ rakia_call_stream_set_sending (TpBaseMediaCallStream *stream, RakiaCallStreamPrivate *priv = self->priv; RakiaDirection current_direction = rakia_sip_media_get_requested_direction (priv->media); + gboolean mutable_contents; if (!!(current_direction & RAKIA_DIRECTION_SEND) == sending) return TRUE; + /* Can't change the actual direction of a stream if we disable modifying + * the SDP, except if we're starting a call. + * In that case, we stop sending, but we don't inform the other side. + */ + g_object_get (priv->channel, + "mutable-contents", &mutable_contents, + NULL); + + if (!mutable_contents && + !(tp_base_channel_is_requested (TP_BASE_CHANNEL (priv->channel)) && + tp_base_call_channel_get_state ( + TP_BASE_CALL_CHANNEL (priv->channel)) == + TP_CALL_STATE_PENDING_INITIATOR)) + return TRUE; if (sending) rakia_sip_media_set_requested_direction (priv->media, |