mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-16 23:30:48 +01:00
Remove public sync_label from StreamParams
This change replaces the use of sync_label from StreamParams with the new stream_labels() and set_stream_labels() getter and setter. Bug: webrtc:7932 Change-Id: Ibd6d38f7d4efed37ac07963e6fbe377c93a28fd6 Reviewed-on: https://webrtc-review.googlesource.com/58540 Commit-Queue: Steve Anton <steveanton@webrtc.org> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22257}
This commit is contained in:
parent
a796a7ee85
commit
5a26a3a2cd
12 changed files with 81 additions and 63 deletions
|
@ -215,6 +215,10 @@ void StreamParams::set_stream_labels(
|
||||||
sync_label = (stream_labels.empty() ? "" : stream_labels[0]);
|
sync_label = (stream_labels.empty() ? "" : stream_labels[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string StreamParams::first_stream_label() const {
|
||||||
|
return sync_label;
|
||||||
|
}
|
||||||
|
|
||||||
bool IsOneSsrcStream(const StreamParams& sp) {
|
bool IsOneSsrcStream(const StreamParams& sp) {
|
||||||
if (sp.ssrcs.size() == 1 && sp.ssrc_groups.empty()) {
|
if (sp.ssrcs.size() == 1 && sp.ssrc_groups.empty()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -69,14 +69,10 @@ struct StreamParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const StreamParams& other) const {
|
bool operator==(const StreamParams& other) const {
|
||||||
return (groupid == other.groupid &&
|
return (groupid == other.groupid && id == other.id &&
|
||||||
id == other.id &&
|
ssrcs == other.ssrcs && ssrc_groups == other.ssrc_groups &&
|
||||||
ssrcs == other.ssrcs &&
|
type == other.type && display == other.display &&
|
||||||
ssrc_groups == other.ssrc_groups &&
|
cname == other.cname && sync_label == other.sync_label);
|
||||||
type == other.type &&
|
|
||||||
display == other.display &&
|
|
||||||
cname == other.cname &&
|
|
||||||
sync_label == other.sync_label);
|
|
||||||
}
|
}
|
||||||
bool operator!=(const StreamParams &other) const {
|
bool operator!=(const StreamParams &other) const {
|
||||||
return !(*this == other);
|
return !(*this == other);
|
||||||
|
@ -150,6 +146,10 @@ struct StreamParams {
|
||||||
std::vector<std::string> stream_labels() const;
|
std::vector<std::string> stream_labels() const;
|
||||||
void set_stream_labels(const std::vector<std::string>& stream_labels);
|
void set_stream_labels(const std::vector<std::string>& stream_labels);
|
||||||
|
|
||||||
|
// Returns the first stream label or "" if none exist. This method exists only
|
||||||
|
// as temporary backwards compatibility with the old sync_label.
|
||||||
|
std::string first_stream_label() const;
|
||||||
|
|
||||||
std::string ToString() const;
|
std::string ToString() const;
|
||||||
|
|
||||||
// Resource of the MUC jid of the participant of with this stream.
|
// Resource of the MUC jid of the participant of with this stream.
|
||||||
|
|
|
@ -1224,7 +1224,9 @@ bool WebRtcVideoChannel::AddRecvStream(const StreamParams& sp,
|
||||||
// TODO(nisse): Rename config variable to avoid negation.
|
// TODO(nisse): Rename config variable to avoid negation.
|
||||||
config.disable_prerenderer_smoothing =
|
config.disable_prerenderer_smoothing =
|
||||||
!video_config_.enable_prerenderer_smoothing;
|
!video_config_.enable_prerenderer_smoothing;
|
||||||
config.sync_group = sp.sync_label;
|
if (!sp.stream_labels().empty()) {
|
||||||
|
config.sync_group = sp.stream_labels()[0];
|
||||||
|
}
|
||||||
|
|
||||||
receive_streams_[ssrc] = new WebRtcVideoReceiveStream(
|
receive_streams_[ssrc] = new WebRtcVideoReceiveStream(
|
||||||
call_, sp, std::move(config), decoder_factory_, default_stream,
|
call_, sp, std::move(config), decoder_factory_, default_stream,
|
||||||
|
|
|
@ -1485,7 +1485,7 @@ TEST_F(WebRtcVideoChannelTest, SetsSyncGroupFromSyncLabel) {
|
||||||
const std::string kSyncLabel = "AvSyncLabel";
|
const std::string kSyncLabel = "AvSyncLabel";
|
||||||
|
|
||||||
cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kVideoSsrc);
|
cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kVideoSsrc);
|
||||||
sp.sync_label = kSyncLabel;
|
sp.set_stream_labels({kSyncLabel});
|
||||||
EXPECT_TRUE(channel_->AddRecvStream(sp));
|
EXPECT_TRUE(channel_->AddRecvStream(sp));
|
||||||
|
|
||||||
EXPECT_EQ(1, fake_call_->GetVideoReceiveStreams().size());
|
EXPECT_EQ(1, fake_call_->GetVideoReceiveStreams().size());
|
||||||
|
|
|
@ -1113,7 +1113,7 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
|
||||||
uint32_t local_ssrc,
|
uint32_t local_ssrc,
|
||||||
bool use_transport_cc,
|
bool use_transport_cc,
|
||||||
bool use_nack,
|
bool use_nack,
|
||||||
const std::string& sync_group,
|
const std::vector<std::string>& stream_labels,
|
||||||
const std::vector<webrtc::RtpExtension>& extensions,
|
const std::vector<webrtc::RtpExtension>& extensions,
|
||||||
webrtc::Call* call,
|
webrtc::Call* call,
|
||||||
webrtc::Transport* rtcp_send_transport,
|
webrtc::Transport* rtcp_send_transport,
|
||||||
|
@ -1131,7 +1131,9 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
|
||||||
config_.rtcp_send_transport = rtcp_send_transport;
|
config_.rtcp_send_transport = rtcp_send_transport;
|
||||||
config_.jitter_buffer_max_packets = jitter_buffer_max_packets;
|
config_.jitter_buffer_max_packets = jitter_buffer_max_packets;
|
||||||
config_.jitter_buffer_fast_accelerate = jitter_buffer_fast_accelerate;
|
config_.jitter_buffer_fast_accelerate = jitter_buffer_fast_accelerate;
|
||||||
config_.sync_group = sync_group;
|
if (!stream_labels.empty()) {
|
||||||
|
config_.sync_group = stream_labels[0];
|
||||||
|
}
|
||||||
config_.decoder_factory = decoder_factory;
|
config_.decoder_factory = decoder_factory;
|
||||||
config_.decoder_map = decoder_map;
|
config_.decoder_map = decoder_map;
|
||||||
RecreateAudioReceiveStream();
|
RecreateAudioReceiveStream();
|
||||||
|
@ -1170,8 +1172,13 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
|
||||||
ReconfigureAudioReceiveStream();
|
ReconfigureAudioReceiveStream();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaybeRecreateAudioReceiveStream(const std::string& sync_group) {
|
void MaybeRecreateAudioReceiveStream(
|
||||||
|
const std::vector<std::string>& stream_labels) {
|
||||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||||
|
std::string sync_group;
|
||||||
|
if (!stream_labels.empty()) {
|
||||||
|
sync_group = stream_labels[0];
|
||||||
|
}
|
||||||
if (config_.sync_group != sync_group) {
|
if (config_.sync_group != sync_group) {
|
||||||
RTC_LOG(LS_INFO) << "Recreating AudioReceiveStream for SSRC="
|
RTC_LOG(LS_INFO) << "Recreating AudioReceiveStream for SSRC="
|
||||||
<< config_.rtp.remote_ssrc
|
<< config_.rtp.remote_ssrc
|
||||||
|
@ -1839,9 +1846,9 @@ bool WebRtcVoiceMediaChannel::AddRecvStream(const StreamParams& sp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this stream was previously received unsignaled, we promote it, possibly
|
// If this stream was previously received unsignaled, we promote it, possibly
|
||||||
// recreating the AudioReceiveStream, if sync_label has changed.
|
// recreating the AudioReceiveStream, if stream labels have changed.
|
||||||
if (MaybeDeregisterUnsignaledRecvStream(ssrc)) {
|
if (MaybeDeregisterUnsignaledRecvStream(ssrc)) {
|
||||||
recv_streams_[ssrc]->MaybeRecreateAudioReceiveStream(sp.sync_label);
|
recv_streams_[ssrc]->MaybeRecreateAudioReceiveStream(sp.stream_labels());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1852,20 +1859,12 @@ bool WebRtcVoiceMediaChannel::AddRecvStream(const StreamParams& sp) {
|
||||||
|
|
||||||
// Create a new channel for receiving audio data.
|
// Create a new channel for receiving audio data.
|
||||||
recv_streams_.insert(std::make_pair(
|
recv_streams_.insert(std::make_pair(
|
||||||
ssrc,
|
ssrc, new WebRtcAudioReceiveStream(
|
||||||
new WebRtcAudioReceiveStream(
|
ssrc, receiver_reports_ssrc_, recv_transport_cc_enabled_,
|
||||||
ssrc,
|
recv_nack_enabled_, sp.stream_labels(), recv_rtp_extensions_,
|
||||||
receiver_reports_ssrc_,
|
call_, this, engine()->decoder_factory_, decoder_map_,
|
||||||
recv_transport_cc_enabled_,
|
engine()->audio_jitter_buffer_max_packets_,
|
||||||
recv_nack_enabled_,
|
engine()->audio_jitter_buffer_fast_accelerate_)));
|
||||||
sp.sync_label,
|
|
||||||
recv_rtp_extensions_,
|
|
||||||
call_,
|
|
||||||
this,
|
|
||||||
engine()->decoder_factory_,
|
|
||||||
decoder_map_,
|
|
||||||
engine()->audio_jitter_buffer_max_packets_,
|
|
||||||
engine()->audio_jitter_buffer_fast_accelerate_)));
|
|
||||||
recv_streams_[ssrc]->SetPlayout(playout_);
|
recv_streams_[ssrc]->SetPlayout(playout_);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -2656,7 +2656,7 @@ TEST_F(WebRtcVoiceEngineTestFake, AddRecvStreamAfterUnsignaled_Recreate) {
|
||||||
int audio_receive_stream_id = streams.front()->id();
|
int audio_receive_stream_id = streams.front()->id();
|
||||||
cricket::StreamParams stream_params;
|
cricket::StreamParams stream_params;
|
||||||
stream_params.ssrcs.push_back(1);
|
stream_params.ssrcs.push_back(1);
|
||||||
stream_params.sync_label = "sync_label";
|
stream_params.set_stream_labels({"sync_label"});
|
||||||
EXPECT_TRUE(channel_->AddRecvStream(stream_params));
|
EXPECT_TRUE(channel_->AddRecvStream(stream_params));
|
||||||
EXPECT_EQ(1, streams.size());
|
EXPECT_EQ(1, streams.size());
|
||||||
EXPECT_NE(audio_receive_stream_id, streams.front()->id());
|
EXPECT_NE(audio_receive_stream_id, streams.front()->id());
|
||||||
|
@ -3041,7 +3041,7 @@ TEST_F(WebRtcVoiceEngineTestFake, SetsSyncGroupFromSyncLabel) {
|
||||||
|
|
||||||
EXPECT_TRUE(SetupSendStream());
|
EXPECT_TRUE(SetupSendStream());
|
||||||
cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kAudioSsrc);
|
cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kAudioSsrc);
|
||||||
sp.sync_label = kSyncLabel;
|
sp.set_stream_labels({kSyncLabel});
|
||||||
// Creating two channels to make sure that sync label is set properly for both
|
// Creating two channels to make sure that sync label is set properly for both
|
||||||
// the default voice channel and following ones.
|
// the default voice channel and following ones.
|
||||||
EXPECT_TRUE(channel_->AddRecvStream(sp));
|
EXPECT_TRUE(channel_->AddRecvStream(sp));
|
||||||
|
|
|
@ -475,7 +475,7 @@ static bool AddStreamParams(
|
||||||
stream_param.cname = rtcp_cname;
|
stream_param.cname = rtcp_cname;
|
||||||
// TODO(steveanton): Support any number of stream ids.
|
// TODO(steveanton): Support any number of stream ids.
|
||||||
RTC_CHECK(sender.stream_ids.size() == 1U);
|
RTC_CHECK(sender.stream_ids.size() == 1U);
|
||||||
stream_param.sync_label = sender.stream_ids[0];
|
stream_param.set_stream_labels(sender.stream_ids);
|
||||||
content_description->AddStream(stream_param);
|
content_description->AddStream(stream_param);
|
||||||
|
|
||||||
// Store the new StreamParams in current_streams.
|
// Store the new StreamParams in current_streams.
|
||||||
|
@ -487,7 +487,7 @@ static bool AddStreamParams(
|
||||||
// MediaStream to another.
|
// MediaStream to another.
|
||||||
// TODO(steveanton): Support any number of stream ids.
|
// TODO(steveanton): Support any number of stream ids.
|
||||||
RTC_CHECK(sender.stream_ids.size() == 1U);
|
RTC_CHECK(sender.stream_ids.size() == 1U);
|
||||||
param->sync_label = sender.stream_ids[0];
|
param->set_stream_labels(sender.stream_ids);
|
||||||
content_description->AddStream(*param);
|
content_description->AddStream(*param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,7 +375,7 @@ class MediaSessionDescriptionFactoryTest : public testing::Test {
|
||||||
simulcast_params.ssrcs = MAKE_VECTOR(kSimulcastParamsSsrc);
|
simulcast_params.ssrcs = MAKE_VECTOR(kSimulcastParamsSsrc);
|
||||||
simulcast_params.ssrc_groups = ssrc_groups;
|
simulcast_params.ssrc_groups = ssrc_groups;
|
||||||
simulcast_params.cname = "Video_SIM_FEC";
|
simulcast_params.cname = "Video_SIM_FEC";
|
||||||
simulcast_params.sync_label = kMediaStream1;
|
simulcast_params.set_stream_labels({kMediaStream1});
|
||||||
|
|
||||||
StreamParamsVec video_streams;
|
StreamParamsVec video_streams;
|
||||||
video_streams.push_back(simulcast_params);
|
video_streams.push_back(simulcast_params);
|
||||||
|
|
|
@ -1954,7 +1954,7 @@ RTCError PeerConnection::ApplyLocalDescription(
|
||||||
const auto& streams = content->media_description()->streams();
|
const auto& streams = content->media_description()->streams();
|
||||||
if (!content->rejected && !streams.empty()) {
|
if (!content->rejected && !streams.empty()) {
|
||||||
transceiver->internal()->sender_internal()->set_stream_ids(
|
transceiver->internal()->sender_internal()->set_stream_ids(
|
||||||
{streams[0].sync_label});
|
streams[0].stream_labels());
|
||||||
transceiver->internal()->sender_internal()->SetSsrc(
|
transceiver->internal()->sender_internal()->SetSsrc(
|
||||||
streams[0].first_ssrc());
|
streams[0].first_ssrc());
|
||||||
}
|
}
|
||||||
|
@ -2221,7 +2221,10 @@ RTCError PeerConnection::ApplyRemoteDescription(
|
||||||
// Create a sync label in the case of an unsignalled msid.
|
// Create a sync label in the case of an unsignalled msid.
|
||||||
std::string sync_label = rtc::CreateRandomUuid();
|
std::string sync_label = rtc::CreateRandomUuid();
|
||||||
if (!media_desc->streams().empty()) {
|
if (!media_desc->streams().empty()) {
|
||||||
sync_label = media_desc->streams()[0].sync_label;
|
const cricket::StreamParams& stream_params = media_desc->streams()[0];
|
||||||
|
if (!stream_params.stream_labels().empty()) {
|
||||||
|
sync_label = stream_params.stream_labels()[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (RtpTransceiverDirectionHasRecv(local_direction) &&
|
if (RtpTransceiverDirectionHasRecv(local_direction) &&
|
||||||
(!transceiver->current_direction() ||
|
(!transceiver->current_direction() ||
|
||||||
|
@ -3858,7 +3861,9 @@ void PeerConnection::UpdateRemoteSendersList(
|
||||||
for (const cricket::StreamParams& params : streams) {
|
for (const cricket::StreamParams& params : streams) {
|
||||||
// The sync_label is the MediaStream label and the |stream.id| is the
|
// The sync_label is the MediaStream label and the |stream.id| is the
|
||||||
// sender id.
|
// sender id.
|
||||||
const std::string& stream_label = params.sync_label;
|
// TODO(bugs.webrtc.org/7932): Add support for multiple stream labels.
|
||||||
|
const std::string& stream_label =
|
||||||
|
(!params.stream_labels().empty() ? params.stream_labels()[0] : "");
|
||||||
const std::string& sender_id = params.id;
|
const std::string& sender_id = params.id;
|
||||||
uint32_t ssrc = params.first_ssrc();
|
uint32_t ssrc = params.first_ssrc();
|
||||||
|
|
||||||
|
@ -3981,7 +3986,7 @@ void PeerConnection::UpdateLocalSenders(
|
||||||
const cricket::StreamParams* params =
|
const cricket::StreamParams* params =
|
||||||
cricket::GetStreamBySsrc(streams, info.first_ssrc);
|
cricket::GetStreamBySsrc(streams, info.first_ssrc);
|
||||||
if (!params || params->id != info.sender_id ||
|
if (!params || params->id != info.sender_id ||
|
||||||
params->sync_label != info.stream_label) {
|
params->first_stream_label() != info.stream_label) {
|
||||||
OnLocalSenderRemoved(info, media_type);
|
OnLocalSenderRemoved(info, media_type);
|
||||||
sender_it = current_senders->erase(sender_it);
|
sender_it = current_senders->erase(sender_it);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3993,7 +3998,7 @@ void PeerConnection::UpdateLocalSenders(
|
||||||
for (const cricket::StreamParams& params : streams) {
|
for (const cricket::StreamParams& params : streams) {
|
||||||
// The sync_label is the MediaStream label and the |stream.id| is the
|
// The sync_label is the MediaStream label and the |stream.id| is the
|
||||||
// sender id.
|
// sender id.
|
||||||
const std::string& stream_label = params.sync_label;
|
const std::string& stream_label = params.first_stream_label();
|
||||||
const std::string& sender_id = params.id;
|
const std::string& sender_id = params.id;
|
||||||
uint32_t ssrc = params.first_ssrc();
|
uint32_t ssrc = params.first_ssrc();
|
||||||
const RtpSenderInfo* sender_info =
|
const RtpSenderInfo* sender_info =
|
||||||
|
@ -4057,7 +4062,7 @@ void PeerConnection::UpdateLocalRtpDataChannels(
|
||||||
// MediaStreams and Tracks.
|
// MediaStreams and Tracks.
|
||||||
// For MediaStreams, the sync_label is the MediaStream label and the
|
// For MediaStreams, the sync_label is the MediaStream label and the
|
||||||
// track label is the same as |streamid|.
|
// track label is the same as |streamid|.
|
||||||
const std::string& channel_label = params.sync_label;
|
const std::string& channel_label = params.first_stream_label();
|
||||||
auto data_channel_it = rtp_data_channels_.find(channel_label);
|
auto data_channel_it = rtp_data_channels_.find(channel_label);
|
||||||
if (data_channel_it == rtp_data_channels_.end()) {
|
if (data_channel_it == rtp_data_channels_.end()) {
|
||||||
RTC_LOG(LS_ERROR) << "channel label not found";
|
RTC_LOG(LS_ERROR) << "channel label not found";
|
||||||
|
@ -4079,9 +4084,9 @@ void PeerConnection::UpdateRemoteRtpDataChannels(
|
||||||
for (const cricket::StreamParams& params : streams) {
|
for (const cricket::StreamParams& params : streams) {
|
||||||
// The data channel label is either the mslabel or the SSRC if the mslabel
|
// The data channel label is either the mslabel or the SSRC if the mslabel
|
||||||
// does not exist. Ex a=ssrc:444330170 mslabel:test1.
|
// does not exist. Ex a=ssrc:444330170 mslabel:test1.
|
||||||
std::string label = params.sync_label.empty()
|
std::string label = params.first_stream_label().empty()
|
||||||
? rtc::ToString(params.first_ssrc())
|
? rtc::ToString(params.first_ssrc())
|
||||||
: params.sync_label;
|
: params.first_stream_label();
|
||||||
auto data_channel_it = rtp_data_channels_.find(label);
|
auto data_channel_it = rtp_data_channels_.find(label);
|
||||||
if (data_channel_it == rtp_data_channels_.end()) {
|
if (data_channel_it == rtp_data_channels_.end()) {
|
||||||
// This is a new data channel.
|
// This is a new data channel.
|
||||||
|
|
|
@ -495,7 +495,7 @@ bool ContainsTrack(const std::vector<cricket::StreamParams>& streams,
|
||||||
const std::string& stream_label,
|
const std::string& stream_label,
|
||||||
const std::string& track_id) {
|
const std::string& track_id) {
|
||||||
for (const cricket::StreamParams& params : streams) {
|
for (const cricket::StreamParams& params : streams) {
|
||||||
if (params.sync_label == stream_label && params.id == track_id) {
|
if (params.first_stream_label() == stream_label && params.id == track_id) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1903,7 +1903,7 @@ TEST_F(PeerConnectionInterfaceTestPlanB, CreateSenderWithStream) {
|
||||||
cricket::GetFirstVideoContentDescription(offer->description());
|
cricket::GetFirstVideoContentDescription(offer->description());
|
||||||
ASSERT_TRUE(video_desc != nullptr);
|
ASSERT_TRUE(video_desc != nullptr);
|
||||||
ASSERT_EQ(1u, video_desc->streams().size());
|
ASSERT_EQ(1u, video_desc->streams().size());
|
||||||
EXPECT_EQ(kStreamLabel1, video_desc->streams()[0].sync_label);
|
EXPECT_EQ(kStreamLabel1, video_desc->streams()[0].first_stream_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test that we can specify a certain track that we want statistics about.
|
// Test that we can specify a certain track that we want statistics about.
|
||||||
|
|
|
@ -634,7 +634,7 @@ void CreateTracksFromSsrcInfos(const SsrcInfoVec& ssrc_infos,
|
||||||
}
|
}
|
||||||
track->add_ssrc(ssrc_info->ssrc_id);
|
track->add_ssrc(ssrc_info->ssrc_id);
|
||||||
track->cname = ssrc_info->cname;
|
track->cname = ssrc_info->cname;
|
||||||
track->sync_label = stream_id;
|
track->set_stream_labels({stream_id});
|
||||||
track->id = track_id;
|
track->id = track_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -643,7 +643,9 @@ void GetMediaStreamLabels(const ContentInfo* content,
|
||||||
std::set<std::string>* labels) {
|
std::set<std::string>* labels) {
|
||||||
for (const StreamParams& stream_params :
|
for (const StreamParams& stream_params :
|
||||||
content->media_description()->streams()) {
|
content->media_description()->streams()) {
|
||||||
labels->insert(stream_params.sync_label);
|
for (const std::string& stream_label : stream_params.stream_labels()) {
|
||||||
|
labels->insert(stream_label);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1476,7 +1478,9 @@ void BuildRtpContentAttributes(const MediaContentDescription* media_desc,
|
||||||
const StreamParamsVec& streams = media_desc->streams();
|
const StreamParamsVec& streams = media_desc->streams();
|
||||||
if (streams.size() == 1u) {
|
if (streams.size() == 1u) {
|
||||||
const StreamParams& track = streams[0];
|
const StreamParams& track = streams[0];
|
||||||
const std::string& stream_id = track.sync_label;
|
// TODO(bugs.webrtc.org/7932): Support serializing more than one stream
|
||||||
|
// label.
|
||||||
|
const std::string& stream_id = track.first_stream_label();
|
||||||
InitAttrLine(kAttributeMsid, &os);
|
InitAttrLine(kAttributeMsid, &os);
|
||||||
os << kSdpDelimiterColon << stream_id << kSdpDelimiterSpace << track.id;
|
os << kSdpDelimiterColon << stream_id << kSdpDelimiterSpace << track.id;
|
||||||
AddLine(os.str(), message);
|
AddLine(os.str(), message);
|
||||||
|
@ -1528,11 +1532,12 @@ void BuildRtpContentAttributes(const MediaContentDescription* media_desc,
|
||||||
|
|
||||||
for (StreamParamsVec::const_iterator track = media_desc->streams().begin();
|
for (StreamParamsVec::const_iterator track = media_desc->streams().begin();
|
||||||
track != media_desc->streams().end(); ++track) {
|
track != media_desc->streams().end(); ++track) {
|
||||||
// Require that the track belongs to a media stream,
|
// Require that the track belongs to a media stream. This extra check is
|
||||||
// ie the sync_label is set. This extra check is necessary since the
|
// necessary since the MediaContentDescription always contains a
|
||||||
// MediaContentDescription always contains a streamparam with an ssrc even
|
// StreamParams with an ssrc even if no track or media stream have been
|
||||||
// if no track or media stream have been created.
|
// created.
|
||||||
if (track->sync_label.empty()) continue;
|
if (track->stream_labels().empty())
|
||||||
|
continue;
|
||||||
|
|
||||||
// Build the ssrc-group lines.
|
// Build the ssrc-group lines.
|
||||||
for (size_t i = 0; i < track->ssrc_groups.size(); ++i) {
|
for (size_t i = 0; i < track->ssrc_groups.size(); ++i) {
|
||||||
|
@ -1563,7 +1568,9 @@ void BuildRtpContentAttributes(const MediaContentDescription* media_desc,
|
||||||
// a=ssrc:<ssrc-id> msid:identifier [appdata]
|
// a=ssrc:<ssrc-id> msid:identifier [appdata]
|
||||||
// The appdata consists of the "id" attribute of a MediaStreamTrack,
|
// The appdata consists of the "id" attribute of a MediaStreamTrack,
|
||||||
// which corresponds to the "id" attribute of StreamParams.
|
// which corresponds to the "id" attribute of StreamParams.
|
||||||
const std::string& stream_id = track->sync_label;
|
// TODO(bugs.webrtc.org/7932): Support serializing more than one stream
|
||||||
|
// label.
|
||||||
|
const std::string& stream_id = track->first_stream_label();
|
||||||
InitAttrLine(kAttributeSsrc, &os);
|
InitAttrLine(kAttributeSsrc, &os);
|
||||||
os << kSdpDelimiterColon << ssrc << kSdpDelimiterSpace
|
os << kSdpDelimiterColon << ssrc << kSdpDelimiterSpace
|
||||||
<< kSsrcAttributeMsid << kSdpDelimiterColon << stream_id
|
<< kSsrcAttributeMsid << kSdpDelimiterColon << stream_id
|
||||||
|
@ -1576,7 +1583,8 @@ void BuildRtpContentAttributes(const MediaContentDescription* media_desc,
|
||||||
// a=ssrc:<ssrc-id> mslabel:<value>
|
// a=ssrc:<ssrc-id> mslabel:<value>
|
||||||
// The label isn't yet defined.
|
// The label isn't yet defined.
|
||||||
// a=ssrc:<ssrc-id> label:<value>
|
// a=ssrc:<ssrc-id> label:<value>
|
||||||
AddSsrcLine(ssrc, kSsrcAttributeMslabel, track->sync_label, message);
|
AddSsrcLine(ssrc, kSsrcAttributeMslabel, track->first_stream_label(),
|
||||||
|
message);
|
||||||
AddSsrcLine(ssrc, kSSrcAttributeLabel, track->id, message);
|
AddSsrcLine(ssrc, kSSrcAttributeLabel, track->id, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -874,7 +874,7 @@ class WebRtcSdpTest : public testing::Test {
|
||||||
StreamParams audio_stream;
|
StreamParams audio_stream;
|
||||||
audio_stream.id = kAudioTrackId1;
|
audio_stream.id = kAudioTrackId1;
|
||||||
audio_stream.cname = kStream1Cname;
|
audio_stream.cname = kStream1Cname;
|
||||||
audio_stream.sync_label = kStreamLabel1;
|
audio_stream.set_stream_labels({kStreamLabel1});
|
||||||
audio_stream.ssrcs.push_back(kAudioTrack1Ssrc);
|
audio_stream.ssrcs.push_back(kAudioTrack1Ssrc);
|
||||||
audio_desc_->AddStream(audio_stream);
|
audio_desc_->AddStream(audio_stream);
|
||||||
rtc::SocketAddress audio_addr("74.125.127.126", 2345);
|
rtc::SocketAddress audio_addr("74.125.127.126", 2345);
|
||||||
|
@ -886,7 +886,7 @@ class WebRtcSdpTest : public testing::Test {
|
||||||
StreamParams video_stream;
|
StreamParams video_stream;
|
||||||
video_stream.id = kVideoTrackId1;
|
video_stream.id = kVideoTrackId1;
|
||||||
video_stream.cname = kStream1Cname;
|
video_stream.cname = kStream1Cname;
|
||||||
video_stream.sync_label = kStreamLabel1;
|
video_stream.set_stream_labels({kStreamLabel1});
|
||||||
video_stream.ssrcs.push_back(kVideoTrack1Ssrc1);
|
video_stream.ssrcs.push_back(kVideoTrack1Ssrc1);
|
||||||
video_stream.ssrcs.push_back(kVideoTrack1Ssrc2);
|
video_stream.ssrcs.push_back(kVideoTrack1Ssrc2);
|
||||||
cricket::SsrcGroup ssrc_group(kFecSsrcGroupSemantics, video_stream.ssrcs);
|
cricket::SsrcGroup ssrc_group(kFecSsrcGroupSemantics, video_stream.ssrcs);
|
||||||
|
@ -1055,21 +1055,21 @@ class WebRtcSdpTest : public testing::Test {
|
||||||
StreamParams audio_track_2;
|
StreamParams audio_track_2;
|
||||||
audio_track_2.id = kAudioTrackId2;
|
audio_track_2.id = kAudioTrackId2;
|
||||||
audio_track_2.cname = kStream2Cname;
|
audio_track_2.cname = kStream2Cname;
|
||||||
audio_track_2.sync_label = kStreamLabel2;
|
audio_track_2.set_stream_labels({kStreamLabel2});
|
||||||
audio_track_2.ssrcs.push_back(kAudioTrack2Ssrc);
|
audio_track_2.ssrcs.push_back(kAudioTrack2Ssrc);
|
||||||
audio_desc_->AddStream(audio_track_2);
|
audio_desc_->AddStream(audio_track_2);
|
||||||
|
|
||||||
StreamParams video_track_2;
|
StreamParams video_track_2;
|
||||||
video_track_2.id = kVideoTrackId2;
|
video_track_2.id = kVideoTrackId2;
|
||||||
video_track_2.cname = kStream2Cname;
|
video_track_2.cname = kStream2Cname;
|
||||||
video_track_2.sync_label = kStreamLabel2;
|
video_track_2.set_stream_labels({kStreamLabel2});
|
||||||
video_track_2.ssrcs.push_back(kVideoTrack2Ssrc);
|
video_track_2.ssrcs.push_back(kVideoTrack2Ssrc);
|
||||||
video_desc_->AddStream(video_track_2);
|
video_desc_->AddStream(video_track_2);
|
||||||
|
|
||||||
StreamParams video_track_3;
|
StreamParams video_track_3;
|
||||||
video_track_3.id = kVideoTrackId3;
|
video_track_3.id = kVideoTrackId3;
|
||||||
video_track_3.cname = kStream2Cname;
|
video_track_3.cname = kStream2Cname;
|
||||||
video_track_3.sync_label = kStreamLabel2;
|
video_track_3.set_stream_labels({kStreamLabel2});
|
||||||
video_track_3.ssrcs.push_back(kVideoTrack3Ssrc);
|
video_track_3.ssrcs.push_back(kVideoTrack3Ssrc);
|
||||||
video_desc_->AddStream(video_track_3);
|
video_desc_->AddStream(video_track_3);
|
||||||
|
|
||||||
|
@ -1090,7 +1090,7 @@ class WebRtcSdpTest : public testing::Test {
|
||||||
StreamParams audio_track_2;
|
StreamParams audio_track_2;
|
||||||
audio_track_2.id = kAudioTrackId2;
|
audio_track_2.id = kAudioTrackId2;
|
||||||
audio_track_2.cname = kStream2Cname;
|
audio_track_2.cname = kStream2Cname;
|
||||||
audio_track_2.sync_label = kStreamLabel2;
|
audio_track_2.set_stream_labels({kStreamLabel2});
|
||||||
audio_track_2.ssrcs.push_back(kAudioTrack2Ssrc);
|
audio_track_2.ssrcs.push_back(kAudioTrack2Ssrc);
|
||||||
audio_desc_2->AddStream(audio_track_2);
|
audio_desc_2->AddStream(audio_track_2);
|
||||||
desc_.AddContent(kAudioContentName2, MediaProtocolType::kRtp, audio_desc_2);
|
desc_.AddContent(kAudioContentName2, MediaProtocolType::kRtp, audio_desc_2);
|
||||||
|
@ -1101,7 +1101,7 @@ class WebRtcSdpTest : public testing::Test {
|
||||||
StreamParams video_track_2;
|
StreamParams video_track_2;
|
||||||
video_track_2.id = kVideoTrackId2;
|
video_track_2.id = kVideoTrackId2;
|
||||||
video_track_2.cname = kStream2Cname;
|
video_track_2.cname = kStream2Cname;
|
||||||
video_track_2.sync_label = kStreamLabel2;
|
video_track_2.set_stream_labels({kStreamLabel2});
|
||||||
video_track_2.ssrcs.push_back(kVideoTrack2Ssrc);
|
video_track_2.ssrcs.push_back(kVideoTrack2Ssrc);
|
||||||
video_desc_2->AddStream(video_track_2);
|
video_desc_2->AddStream(video_track_2);
|
||||||
desc_.AddContent(kVideoContentName2, MediaProtocolType::kRtp, video_desc_2);
|
desc_.AddContent(kVideoContentName2, MediaProtocolType::kRtp, video_desc_2);
|
||||||
|
@ -1113,7 +1113,7 @@ class WebRtcSdpTest : public testing::Test {
|
||||||
StreamParams video_track_3;
|
StreamParams video_track_3;
|
||||||
video_track_3.id = kVideoTrackId3;
|
video_track_3.id = kVideoTrackId3;
|
||||||
video_track_3.cname = kStream2Cname;
|
video_track_3.cname = kStream2Cname;
|
||||||
video_track_3.sync_label = kStreamLabel2;
|
video_track_3.set_stream_labels({kStreamLabel2});
|
||||||
video_track_3.ssrcs.push_back(kVideoTrack3Ssrc);
|
video_track_3.ssrcs.push_back(kVideoTrack3Ssrc);
|
||||||
video_desc_3->AddStream(video_track_3);
|
video_desc_3->AddStream(video_track_3);
|
||||||
desc_.AddContent(kVideoContentName3, MediaProtocolType::kRtp, video_desc_3);
|
desc_.AddContent(kVideoContentName3, MediaProtocolType::kRtp, video_desc_3);
|
||||||
|
@ -1518,7 +1518,7 @@ class WebRtcSdpTest : public testing::Test {
|
||||||
StreamParams data_stream;
|
StreamParams data_stream;
|
||||||
data_stream.id = kDataChannelMsid;
|
data_stream.id = kDataChannelMsid;
|
||||||
data_stream.cname = kDataChannelCname;
|
data_stream.cname = kDataChannelCname;
|
||||||
data_stream.sync_label = kDataChannelLabel;
|
data_stream.set_stream_labels({kDataChannelLabel});
|
||||||
data_stream.ssrcs.push_back(kDataChannelSsrc);
|
data_stream.ssrcs.push_back(kDataChannelSsrc);
|
||||||
data_desc_->AddStream(data_stream);
|
data_desc_->AddStream(data_stream);
|
||||||
data_desc_->AddCrypto(CryptoParams(
|
data_desc_->AddCrypto(CryptoParams(
|
||||||
|
|
Loading…
Reference in a new issue