diff options
author | Joshua Colp <jcolp@digium.com> | 2017-10-25 22:31:33 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2017-10-30 17:10:03 -0500 |
commit | 4c535f5c30f7271f89d236f98fdfba101d73ff34 (patch) | |
tree | 6d867aa49526eadf221b08bb4d1542b4c22a1f4e /res/res_pjsip_sdp_rtp.c | |
parent | be5b7b2076a577c2a994e752b152c5242fb29ce7 (diff) |
core / pjsip: Add support for grouping streams together.
In WebRTC streams (or media tracks in their world) can be grouped
together using the mslabel. This informs the browser that each
should be synchronized with each other.
This change extends the stream API so this information can
be stored with streams. The PJSIP support has been extended
to use the mslabel to determine grouped streams and store
this association on the streams. Finally when creating the
SDP the group information is used to cause each media stream
to use the same mslabel.
ASTERISK-27379
Change-Id: Id6299aa031efe46254edbdc7973c534d54d641ad
Diffstat (limited to 'res/res_pjsip_sdp_rtp.c')
-rw-r--r-- | res/res_pjsip_sdp_rtp.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index 604fd421e..a87758267 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -1052,20 +1052,11 @@ static void add_msid_to_stream(struct ast_sip_session *session, } if (ast_strlen_zero(session_media->mslabel)) { - if (ast_sip_session_is_pending_stream_default(session, stream)) { - int index; - - /* If this is a default stream we group them together under the same stream, but as different tracks */ - for (index = 0; index < AST_VECTOR_SIZE(&session->pending_media_state->sessions); ++index) { - struct ast_sip_session_media *other_session_media = AST_VECTOR_GET(&session->pending_media_state->sessions, index); - - if (session_media == other_session_media) { - continue; - } + /* If this stream is grouped with another then use its media stream label if possible */ + if (ast_stream_get_group(stream) != -1) { + struct ast_sip_session_media *group_session_media = AST_VECTOR_GET(&session->pending_media_state->sessions, ast_stream_get_group(stream)); - ast_copy_string(session_media->mslabel, other_session_media->mslabel, sizeof(session_media->mslabel)); - break; - } + ast_copy_string(session_media->mslabel, group_session_media->mslabel, sizeof(session_media->mslabel)); } if (ast_strlen_zero(session_media->mslabel)) { |