bridging: Add better support for adding/removing streams.

This change adds support to bridge_softmix to allow the addition
and removal of additional video source streams. When such a change
occurs each participant is renegotiated as needed to reflect the
update. If another video source is added then each participant
gets another source. If a video source is removed then it is
removed from each participant. This functionality allows you to
have both your webcam and screenshare providing video if you
desire, or even more streams. Mapping has been changed to use
the topology index on the source channel as a unique identifier
for outgoing participant streams, this will never change and
provides an easy way to establish the mapping.

The bridge_simple and bridge_native_rtp modules have also been
updated to renegotiate when the stream topology of a party changes
allowing the same behavior to occur as added to bridge_softmix.
If a screen share is added then the opposite party is renegotiated.
If that screen share is removed then the opposite party is
renegotiated again.

Some additional fixes are also included in here. Stream state is
now conveyed in SDP so sendonly/recvonly/inactive streams can
be requested. Removed streams now also remove previous state
from themselves so consumers don't get confused.

ASTERISK-28733

Change-Id: I93f41fb41b85646bef71408111c17ccea30cb0c5
This commit is contained in:
Joshua C. Colp
2020-01-05 00:11:20 +00:00
committed by Joshua Colp
parent a6de4497e6
commit 5a5be92b79
8 changed files with 566 additions and 149 deletions

View File

@@ -215,6 +215,12 @@ typedef unsigned long long ast_group_t;
struct ast_stream_topology;
/*!
* \brief Set as the change source reason when a channel stream topology has
* been changed externally as a result of the remote side renegotiating.
*/
static const char ast_stream_topology_changed_external[] = "external";
/*! \todo Add an explanation of an Asterisk generator
*/
struct ast_generator {
@@ -5025,6 +5031,20 @@ int ast_channel_request_stream_topology_change(struct ast_channel *chan,
*/
int ast_channel_stream_topology_changed(struct ast_channel *chan, struct ast_stream_topology *topology);
/*!
* \brief Provide notice from a channel that the topology has changed on it as a result
* of the remote party renegotiating.
*
* \param chan The channel to provide notice from
*
* \retval 0 success
* \retval -1 failure
*
* \note This interface is provided for channels to provide notice that a topology change
* has occurred as a result of a remote party renegotiating the stream topology.
*/
int ast_channel_stream_topology_changed_externally(struct ast_channel *chan);
/*!
* \brief Retrieve the source that initiated the last stream topology change
*