mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-15 00:41:02 +00:00
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
This commit is contained in:
@@ -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 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));
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
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)) {
|
||||
|
Reference in New Issue
Block a user