Name change from stream label to stream id for spec compliance.
Bug: webrtc:7932
Change-Id: I66f33597342394083256f050cac2a00a68042302
Reviewed-on: https://webrtc-review.googlesource.com/59280
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22276}
diff --git a/api/mediastreaminterface.cc b/api/mediastreaminterface.cc
index 6f08a0c..3d4eb66 100644
--- a/api/mediastreaminterface.cc
+++ b/api/mediastreaminterface.cc
@@ -58,4 +58,15 @@
return nullptr;
}
+// TODO(shampson): Remove this once downstreams are using id().
+std::string MediaStreamInterface::label() const {
+ return id();
+}
+
+// TODO(shampson): Remove this default implementation once downstreams have
+// implemented.
+std::string MediaStreamInterface::id() const {
+ return std::string();
+}
+
} // namespace webrtc
diff --git a/api/mediastreaminterface.h b/api/mediastreaminterface.h
index b7ba332..e2412de 100644
--- a/api/mediastreaminterface.h
+++ b/api/mediastreaminterface.h
@@ -313,8 +313,10 @@
class MediaStreamInterface : public rtc::RefCountInterface,
public NotifierInterface {
public:
- // TODO(steveanton): This could be renamed to id() to match the spec.
- virtual std::string label() const = 0;
+ // TODO(shampson): Remove once downstreams are updated to use id().
+ virtual std::string label() const;
+ // TODO(shampson): Make pure virtual once downstreams have implemented.
+ virtual std::string id() const;
virtual AudioTrackVector GetAudioTracks() = 0;
virtual VideoTrackVector GetVideoTracks() = 0;
diff --git a/api/mediastreamproxy.h b/api/mediastreamproxy.h
index e32d52b..848b75b 100644
--- a/api/mediastreamproxy.h
+++ b/api/mediastreamproxy.h
@@ -23,6 +23,7 @@
BEGIN_SIGNALING_PROXY_MAP(MediaStream)
PROXY_SIGNALING_THREAD_DESTRUCTOR()
PROXY_CONSTMETHOD0(std::string, label)
+ PROXY_CONSTMETHOD0(std::string, id)
PROXY_METHOD0(AudioTrackVector, GetAudioTracks)
PROXY_METHOD0(VideoTrackVector, GetVideoTracks)
PROXY_METHOD1(rtc::scoped_refptr<AudioTrackInterface>,
diff --git a/api/peerconnectioninterface.h b/api/peerconnectioninterface.h
index 7f7b910..1dfe2bd 100644
--- a/api/peerconnectioninterface.h
+++ b/api/peerconnectioninterface.h
@@ -633,7 +633,7 @@
// Add a new MediaStreamTrack to be sent on this PeerConnection, and return
// the newly created RtpSender. The RtpSender will be associated with the
- // streams specified in the |stream_labels| list.
+ // streams specified in the |stream_ids| list.
//
// Errors:
// - INVALID_PARAMETER: |track| is null, has a kind other than audio or video,
@@ -643,13 +643,13 @@
// implementations have been updated.
virtual RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrack(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels) {
+ const std::vector<std::string>& stream_ids) {
return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
}
- // |streams| indicates which stream labels the track should be associated
+ // |streams| indicates which stream ids the track should be associated
// with.
// TODO(steveanton): Remove this overload once callers have moved to the
- // signature with stream labels.
+ // signature with stream ids.
virtual rtc::scoped_refptr<RtpSenderInterface> AddTrack(
MediaStreamTrackInterface* track,
std::vector<MediaStreamInterface*> streams) {
@@ -1189,8 +1189,8 @@
std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
PeerConnectionObserver* observer) = 0;
- virtual rtc::scoped_refptr<MediaStreamInterface>
- CreateLocalMediaStream(const std::string& label) = 0;
+ virtual rtc::scoped_refptr<MediaStreamInterface> CreateLocalMediaStream(
+ const std::string& stream_id) = 0;
// Creates an AudioSourceInterface.
// |options| decides audio processing settings.
diff --git a/api/rtptransceiverinterface.h b/api/rtptransceiverinterface.h
index 4106793..c8b42aa 100644
--- a/api/rtptransceiverinterface.h
+++ b/api/rtptransceiverinterface.h
@@ -40,6 +40,8 @@
RtpTransceiverDirection direction = RtpTransceiverDirection::kSendRecv;
// The added RtpTransceiver will be added to these streams.
+ // TODO(shampson): Change name to stream_id & update native wrapper's naming
+ // as well.
// TODO(bugs.webrtc.org/7600): Not implemented.
std::vector<std::string> stream_labels;
diff --git a/media/base/streamparams.cc b/media/base/streamparams.cc
index 0713909..421111a 100644
--- a/media/base/streamparams.cc
+++ b/media/base/streamparams.cc
@@ -199,23 +199,22 @@
return false;
}
-std::vector<std::string> StreamParams::stream_labels() const {
+std::vector<std::string> StreamParams::stream_ids() const {
if (sync_label.empty()) {
return {};
}
return {sync_label};
}
-void StreamParams::set_stream_labels(
- const std::vector<std::string>& stream_labels) {
- // TODO(steveanton): Support an arbitrary number of stream labels.
- RTC_DCHECK_LE(stream_labels.size(), 1) << "set_stream_labels currently only "
- "supports exactly 0 or 1 stream "
- "label.";
- sync_label = (stream_labels.empty() ? "" : stream_labels[0]);
+void StreamParams::set_stream_ids(const std::vector<std::string>& stream_ids) {
+ // TODO(bugs.webrtc.org/7932): Support an arbitrary number of stream ids.
+ RTC_DCHECK_LE(stream_ids.size(), 1) << "set_stream_ids currently only "
+ "supports exactly 0 or 1 stream "
+ "id.";
+ sync_label = (stream_ids.empty() ? "" : stream_ids[0]);
}
-std::string StreamParams::first_stream_label() const {
+std::string StreamParams::first_stream_id() const {
return sync_label;
}
diff --git a/media/base/streamparams.h b/media/base/streamparams.h
index 818fd94..016c27a 100644
--- a/media/base/streamparams.h
+++ b/media/base/streamparams.h
@@ -142,13 +142,13 @@
void GetFidSsrcs(const std::vector<uint32_t>& primary_ssrcs,
std::vector<uint32_t>* fid_ssrcs) const;
- // Stream labels serialized to SDP.
- std::vector<std::string> stream_labels() const;
- void set_stream_labels(const std::vector<std::string>& stream_labels);
+ // Stream ids serialized to SDP.
+ std::vector<std::string> stream_ids() const;
+ void set_stream_ids(const std::vector<std::string>& stream_ids);
- // Returns the first stream label or "" if none exist. This method exists only
+ // Returns the first stream id 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 first_stream_id() const;
std::string ToString() const;
@@ -165,7 +165,7 @@
// Friendly name describing stream
std::string display;
std::string cname; // RTCP CNAME
- // TODO(steveanton): Move callers to |stream_labels()| and make private.
+ // TODO(shampson): Move callers to |stream_ids()| and make private.
std::string sync_label; // Friendly name of cname.
private:
diff --git a/media/engine/webrtcvideoengine.cc b/media/engine/webrtcvideoengine.cc
index eb8cff0..de044d5 100644
--- a/media/engine/webrtcvideoengine.cc
+++ b/media/engine/webrtcvideoengine.cc
@@ -1224,8 +1224,8 @@
// TODO(nisse): Rename config variable to avoid negation.
config.disable_prerenderer_smoothing =
!video_config_.enable_prerenderer_smoothing;
- if (!sp.stream_labels().empty()) {
- config.sync_group = sp.stream_labels()[0];
+ if (!sp.stream_ids().empty()) {
+ config.sync_group = sp.stream_ids()[0];
}
receive_streams_[ssrc] = new WebRtcVideoReceiveStream(
diff --git a/media/engine/webrtcvideoengine_unittest.cc b/media/engine/webrtcvideoengine_unittest.cc
index 46ade39..e994d8d 100644
--- a/media/engine/webrtcvideoengine_unittest.cc
+++ b/media/engine/webrtcvideoengine_unittest.cc
@@ -1485,7 +1485,7 @@
const std::string kSyncLabel = "AvSyncLabel";
cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kVideoSsrc);
- sp.set_stream_labels({kSyncLabel});
+ sp.set_stream_ids({kSyncLabel});
EXPECT_TRUE(channel_->AddRecvStream(sp));
EXPECT_EQ(1, fake_call_->GetVideoReceiveStreams().size());
diff --git a/media/engine/webrtcvoiceengine.cc b/media/engine/webrtcvoiceengine.cc
index 9e0dda6..7d889f3 100644
--- a/media/engine/webrtcvoiceengine.cc
+++ b/media/engine/webrtcvoiceengine.cc
@@ -1113,7 +1113,7 @@
uint32_t local_ssrc,
bool use_transport_cc,
bool use_nack,
- const std::vector<std::string>& stream_labels,
+ const std::vector<std::string>& stream_ids,
const std::vector<webrtc::RtpExtension>& extensions,
webrtc::Call* call,
webrtc::Transport* rtcp_send_transport,
@@ -1131,8 +1131,8 @@
config_.rtcp_send_transport = rtcp_send_transport;
config_.jitter_buffer_max_packets = jitter_buffer_max_packets;
config_.jitter_buffer_fast_accelerate = jitter_buffer_fast_accelerate;
- if (!stream_labels.empty()) {
- config_.sync_group = stream_labels[0];
+ if (!stream_ids.empty()) {
+ config_.sync_group = stream_ids[0];
}
config_.decoder_factory = decoder_factory;
config_.decoder_map = decoder_map;
@@ -1173,11 +1173,11 @@
}
void MaybeRecreateAudioReceiveStream(
- const std::vector<std::string>& stream_labels) {
+ const std::vector<std::string>& stream_ids) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
std::string sync_group;
- if (!stream_labels.empty()) {
- sync_group = stream_labels[0];
+ if (!stream_ids.empty()) {
+ sync_group = stream_ids[0];
}
if (config_.sync_group != sync_group) {
RTC_LOG(LS_INFO) << "Recreating AudioReceiveStream for SSRC="
@@ -1846,9 +1846,9 @@
}
// If this stream was previously received unsignaled, we promote it, possibly
- // recreating the AudioReceiveStream, if stream labels have changed.
+ // recreating the AudioReceiveStream, if stream ids have changed.
if (MaybeDeregisterUnsignaledRecvStream(ssrc)) {
- recv_streams_[ssrc]->MaybeRecreateAudioReceiveStream(sp.stream_labels());
+ recv_streams_[ssrc]->MaybeRecreateAudioReceiveStream(sp.stream_ids());
return true;
}
@@ -1861,7 +1861,7 @@
recv_streams_.insert(std::make_pair(
ssrc, new WebRtcAudioReceiveStream(
ssrc, receiver_reports_ssrc_, recv_transport_cc_enabled_,
- recv_nack_enabled_, sp.stream_labels(), recv_rtp_extensions_,
+ recv_nack_enabled_, sp.stream_ids(), recv_rtp_extensions_,
call_, this, engine()->decoder_factory_, decoder_map_,
engine()->audio_jitter_buffer_max_packets_,
engine()->audio_jitter_buffer_fast_accelerate_)));
diff --git a/media/engine/webrtcvoiceengine_unittest.cc b/media/engine/webrtcvoiceengine_unittest.cc
index 02c9178..c8b0a21 100644
--- a/media/engine/webrtcvoiceengine_unittest.cc
+++ b/media/engine/webrtcvoiceengine_unittest.cc
@@ -2656,7 +2656,7 @@
int audio_receive_stream_id = streams.front()->id();
cricket::StreamParams stream_params;
stream_params.ssrcs.push_back(1);
- stream_params.set_stream_labels({"sync_label"});
+ stream_params.set_stream_ids({"stream_id"});
EXPECT_TRUE(channel_->AddRecvStream(stream_params));
EXPECT_EQ(1, streams.size());
EXPECT_NE(audio_receive_stream_id, streams.front()->id());
@@ -3035,13 +3035,13 @@
EXPECT_DOUBLE_EQ(4, GetRecvStream(kSsrcX).gain());
}
-TEST_F(WebRtcVoiceEngineTestFake, SetsSyncGroupFromSyncLabel) {
+TEST_F(WebRtcVoiceEngineTestFake, SetsSyncGroupFromStreamId) {
const uint32_t kAudioSsrc = 123;
- const std::string kSyncLabel = "AvSyncLabel";
+ const std::string kStreamId = "AvSyncLabel";
EXPECT_TRUE(SetupSendStream());
cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kAudioSsrc);
- sp.set_stream_labels({kSyncLabel});
+ sp.set_stream_ids({kStreamId});
// Creating two channels to make sure that sync label is set properly for both
// the default voice channel and following ones.
EXPECT_TRUE(channel_->AddRecvStream(sp));
@@ -3049,12 +3049,12 @@
EXPECT_TRUE(channel_->AddRecvStream(sp));
ASSERT_EQ(2, call_.GetAudioReceiveStreams().size());
- EXPECT_EQ(kSyncLabel,
+ EXPECT_EQ(kStreamId,
call_.GetAudioReceiveStream(kAudioSsrc)->GetConfig().sync_group)
- << "SyncGroup should be set based on sync_label";
- EXPECT_EQ(kSyncLabel,
+ << "SyncGroup should be set based on stream id";
+ EXPECT_EQ(kStreamId,
call_.GetAudioReceiveStream(kAudioSsrc + 1)->GetConfig().sync_group)
- << "SyncGroup should be set based on sync_label";
+ << "SyncGroup should be set based on stream id";
}
// TODO(solenberg): Remove, once recv streams are configured through Call.
diff --git a/pc/mediasession.cc b/pc/mediasession.cc
index b224cc8..5bea2a3 100644
--- a/pc/mediasession.cc
+++ b/pc/mediasession.cc
@@ -475,7 +475,7 @@
stream_param.cname = rtcp_cname;
// TODO(steveanton): Support any number of stream ids.
RTC_CHECK(sender.stream_ids.size() == 1U);
- stream_param.set_stream_labels(sender.stream_ids);
+ stream_param.set_stream_ids(sender.stream_ids);
content_description->AddStream(stream_param);
// Store the new StreamParams in current_streams.
@@ -487,7 +487,7 @@
// MediaStream to another.
// TODO(steveanton): Support any number of stream ids.
RTC_CHECK(sender.stream_ids.size() == 1U);
- param->set_stream_labels(sender.stream_ids);
+ param->set_stream_ids(sender.stream_ids);
content_description->AddStream(*param);
}
}
diff --git a/pc/mediasession_unittest.cc b/pc/mediasession_unittest.cc
index c21403a..8a0564a 100644
--- a/pc/mediasession_unittest.cc
+++ b/pc/mediasession_unittest.cc
@@ -375,7 +375,7 @@
simulcast_params.ssrcs = MAKE_VECTOR(kSimulcastParamsSsrc);
simulcast_params.ssrc_groups = ssrc_groups;
simulcast_params.cname = "Video_SIM_FEC";
- simulcast_params.set_stream_labels({kMediaStream1});
+ simulcast_params.set_stream_ids({kMediaStream1});
StreamParamsVec video_streams;
video_streams.push_back(simulcast_params);
diff --git a/pc/mediastream.cc b/pc/mediastream.cc
index eb78a8b..db410d4 100644
--- a/pc/mediastream.cc
+++ b/pc/mediastream.cc
@@ -28,14 +28,14 @@
}
rtc::scoped_refptr<MediaStream> MediaStream::Create(
- const std::string& label) {
+ const std::string& id) {
rtc::RefCountedObject<MediaStream>* stream =
- new rtc::RefCountedObject<MediaStream>(label);
+ new rtc::RefCountedObject<MediaStream>(id);
return stream;
}
-MediaStream::MediaStream(const std::string& label)
- : label_(label) {
+MediaStream::MediaStream(const std::string& id)
+ : id_(id) {
}
bool MediaStream::AddTrack(AudioTrackInterface* track) {
diff --git a/pc/mediastream.h b/pc/mediastream.h
index 081b8c9..708b13d 100644
--- a/pc/mediastream.h
+++ b/pc/mediastream.h
@@ -25,7 +25,8 @@
public:
static rtc::scoped_refptr<MediaStream> Create(const std::string& label);
- std::string label() const override { return label_; }
+ std::string label() const override { return id_; }
+ std::string id() const override { return id_; }
bool AddTrack(AudioTrackInterface* track) override;
bool AddTrack(VideoTrackInterface* track) override;
@@ -48,7 +49,7 @@
template <typename TrackVector>
bool RemoveTrack(TrackVector* Tracks, MediaStreamTrackInterface* track);
- std::string label_;
+ std::string id_;
AudioTrackVector audio_tracks_;
VideoTrackVector video_tracks_;
};
diff --git a/pc/mediastream_unittest.cc b/pc/mediastream_unittest.cc
index cfd1b50..d2e0c95 100644
--- a/pc/mediastream_unittest.cc
+++ b/pc/mediastream_unittest.cc
@@ -19,7 +19,7 @@
#include "test/gmock.h"
#include "test/gtest.h"
-static const char kStreamLabel1[] = "local_stream_1";
+static const char kStreamId1[] = "local_stream_1";
static const char kVideoTrackId[] = "dummy_video_cam_1";
static const char kAudioTrackId[] = "dummy_microphone_1";
@@ -53,7 +53,7 @@
class MediaStreamTest: public testing::Test {
protected:
virtual void SetUp() {
- stream_ = MediaStream::Create(kStreamLabel1);
+ stream_ = MediaStream::Create(kStreamId1);
ASSERT_TRUE(stream_.get() != NULL);
video_track_ = VideoTrack::Create(
diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc
index 245e89d..44adeab 100644
--- a/pc/peerconnection.cc
+++ b/pc/peerconnection.cc
@@ -93,7 +93,7 @@
namespace {
-static const char kDefaultStreamLabel[] = "default";
+static const char kDefaultStreamId[] = "default";
static const char kDefaultAudioSenderId[] = "defaulta0";
static const char kDefaultVideoSenderId[] = "defaultv0";
@@ -1068,15 +1068,15 @@
MediaStreamTrackInterface* track,
std::vector<MediaStreamInterface*> streams) {
TRACE_EVENT0("webrtc", "PeerConnection::AddTrack");
- std::vector<std::string> stream_labels;
+ std::vector<std::string> stream_ids;
for (auto* stream : streams) {
if (!stream) {
RTC_LOG(LS_ERROR) << "Stream list has null element.";
return nullptr;
}
- stream_labels.push_back(stream->label());
+ stream_ids.push_back(stream->label());
}
- auto sender_or_error = AddTrack(track, stream_labels);
+ auto sender_or_error = AddTrack(track, stream_ids);
if (!sender_or_error.ok()) {
return nullptr;
}
@@ -1085,7 +1085,7 @@
RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> PeerConnection::AddTrack(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels) {
+ const std::vector<std::string>& stream_ids) {
TRACE_EVENT0("webrtc", "PeerConnection::AddTrack");
if (!track) {
LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER, "Track is null.");
@@ -1096,7 +1096,7 @@
"Track has invalid kind: " + track->kind());
}
// TODO(bugs.webrtc.org/7932): Support adding a track to multiple streams.
- if (stream_labels.size() > 1u) {
+ if (stream_ids.size() > 1u) {
LOG_AND_RETURN_ERROR(
RTCErrorType::UNSUPPORTED_OPERATION,
"AddTrack with more than one stream is not currently supported.");
@@ -1113,15 +1113,15 @@
// TODO(bugs.webrtc.org/7933): MediaSession expects the sender to have exactly
// one stream. AddTrackInternal will return an error if there is more than one
// stream, but if the caller specifies none then we need to generate a random
- // stream label.
- std::vector<std::string> adjusted_stream_labels = stream_labels;
- if (stream_labels.empty()) {
- adjusted_stream_labels.push_back(rtc::CreateRandomUuid());
+ // stream id.
+ std::vector<std::string> adjusted_stream_ids = stream_ids;
+ if (stream_ids.empty()) {
+ adjusted_stream_ids.push_back(rtc::CreateRandomUuid());
}
- RTC_DCHECK_EQ(1, adjusted_stream_labels.size());
+ RTC_DCHECK_EQ(1, adjusted_stream_ids.size());
auto sender_or_error =
- (IsUnifiedPlan() ? AddTrackUnifiedPlan(track, adjusted_stream_labels)
- : AddTrackPlanB(track, adjusted_stream_labels));
+ (IsUnifiedPlan() ? AddTrackUnifiedPlan(track, adjusted_stream_ids)
+ : AddTrackPlanB(track, adjusted_stream_ids));
if (sender_or_error.ok()) {
observer_->OnRenegotiationNeeded();
stats_->AddTrack(track);
@@ -1132,12 +1132,12 @@
RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>
PeerConnection::AddTrackPlanB(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels) {
+ const std::vector<std::string>& stream_ids) {
cricket::MediaType media_type =
(track->kind() == MediaStreamTrackInterface::kAudioKind
? cricket::MEDIA_TYPE_AUDIO
: cricket::MEDIA_TYPE_VIDEO);
- auto new_sender = CreateSender(media_type, track, stream_labels);
+ auto new_sender = CreateSender(media_type, track, stream_ids);
if (track->kind() == MediaStreamTrackInterface::kAudioKind) {
new_sender->internal()->SetVoiceMediaChannel(voice_media_channel());
GetAudioTransceiver()->internal()->AddSender(new_sender);
@@ -1164,7 +1164,7 @@
RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>
PeerConnection::AddTrackUnifiedPlan(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels) {
+ const std::vector<std::string>& stream_ids) {
auto transceiver = FindFirstTransceiverForAddedTrack(track);
if (transceiver) {
if (transceiver->direction() == RtpTransceiverDirection::kRecvOnly) {
@@ -1175,13 +1175,13 @@
RtpTransceiverDirection::kSendOnly);
}
transceiver->sender()->SetTrack(track);
- transceiver->internal()->sender_internal()->set_stream_ids(stream_labels);
+ transceiver->internal()->sender_internal()->set_stream_ids(stream_ids);
} else {
cricket::MediaType media_type =
(track->kind() == MediaStreamTrackInterface::kAudioKind
? cricket::MEDIA_TYPE_AUDIO
: cricket::MEDIA_TYPE_VIDEO);
- auto sender = CreateSender(media_type, track, stream_labels);
+ auto sender = CreateSender(media_type, track, stream_ids);
auto receiver = CreateReceiver(media_type, rtc::CreateRandomUuid());
transceiver = CreateAndAddTransceiver(sender, receiver);
transceiver->internal()->set_created_by_addtrack(true);
@@ -1329,11 +1329,11 @@
"More than one stream is not yet supported.");
}
- std::vector<std::string> stream_labels = {!init.stream_labels.empty()
- ? init.stream_labels[0]
- : rtc::CreateRandomUuid()};
+ std::vector<std::string> stream_ids = {!init.stream_labels.empty()
+ ? init.stream_labels[0]
+ : rtc::CreateRandomUuid()};
- auto sender = CreateSender(media_type, track, stream_labels);
+ auto sender = CreateSender(media_type, track, stream_ids);
auto receiver = CreateReceiver(media_type, rtc::CreateRandomUuid());
auto transceiver = CreateAndAddTransceiver(sender, receiver);
transceiver->internal()->set_direction(init.direction);
@@ -1349,7 +1349,7 @@
PeerConnection::CreateSender(
cricket::MediaType media_type,
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels) {
+ const std::vector<std::string>& stream_ids) {
rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender;
if (media_type == cricket::MEDIA_TYPE_AUDIO) {
RTC_DCHECK(!track ||
@@ -1358,7 +1358,7 @@
signaling_thread(),
new AudioRtpSender(worker_thread(),
static_cast<AudioTrackInterface*>(track.get()),
- stream_labels, stats_.get()));
+ stream_ids, stats_.get()));
} else {
RTC_DCHECK_EQ(media_type, cricket::MEDIA_TYPE_VIDEO);
RTC_DCHECK(!track ||
@@ -1367,9 +1367,9 @@
signaling_thread(),
new VideoRtpSender(worker_thread(),
static_cast<VideoTrackInterface*>(track.get()),
- stream_labels));
+ stream_ids));
}
- sender->internal()->set_stream_ids(stream_labels);
+ sender->internal()->set_stream_ids(stream_ids);
return sender;
}
@@ -1440,23 +1440,23 @@
return nullptr;
}
- std::vector<std::string> stream_labels;
+ std::vector<std::string> stream_ids;
if (!stream_id.empty()) {
- stream_labels.push_back(stream_id);
+ stream_ids.push_back(stream_id);
}
// TODO(steveanton): Move construction of the RtpSenders to RtpTransceiver.
rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> new_sender;
if (kind == MediaStreamTrackInterface::kAudioKind) {
- auto* audio_sender = new AudioRtpSender(worker_thread(), nullptr,
- stream_labels, stats_.get());
+ auto* audio_sender =
+ new AudioRtpSender(worker_thread(), nullptr, stream_ids, stats_.get());
audio_sender->SetVoiceMediaChannel(voice_media_channel());
new_sender = RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
signaling_thread(), audio_sender);
GetAudioTransceiver()->internal()->AddSender(new_sender);
} else if (kind == MediaStreamTrackInterface::kVideoKind) {
auto* video_sender =
- new VideoRtpSender(worker_thread(), nullptr, stream_labels);
+ new VideoRtpSender(worker_thread(), nullptr, stream_ids);
video_sender->SetVideoMediaChannel(video_media_channel());
new_sender = RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
signaling_thread(), video_sender);
@@ -1963,7 +1963,7 @@
const auto& streams = content->media_description()->streams();
if (!content->rejected && !streams.empty()) {
transceiver->internal()->sender_internal()->set_stream_ids(
- streams[0].stream_labels());
+ streams[0].stream_ids());
transceiver->internal()->sender_internal()->SetSsrc(
streams[0].first_ssrc());
}
@@ -2231,8 +2231,8 @@
std::string sync_label = rtc::CreateRandomUuid();
if (!media_desc->streams().empty()) {
const cricket::StreamParams& stream_params = media_desc->streams()[0];
- if (!stream_params.stream_labels().empty()) {
- sync_label = stream_params.stream_labels()[0];
+ if (!stream_params.stream_ids().empty()) {
+ sync_label = stream_params.stream_ids()[0];
}
}
if (RtpTransceiverDirectionHasRecv(local_direction) &&
@@ -3857,7 +3857,7 @@
cricket::GetStreamBySsrc(streams, info.first_ssrc);
bool sender_exists = params && params->id == info.sender_id;
// If this is a default track, and we still need it, don't remove it.
- if ((info.stream_label == kDefaultStreamLabel && default_sender_needed) ||
+ if ((info.stream_id == kDefaultStreamId && default_sender_needed) ||
sender_exists) {
++sender_it;
} else {
@@ -3868,28 +3868,28 @@
// Find new and active senders.
for (const cricket::StreamParams& params : streams) {
- // The sync_label is the MediaStream label and the |stream.id| is the
- // sender id.
- // TODO(bugs.webrtc.org/7932): Add support for multiple stream labels.
- const std::string& stream_label =
- (!params.stream_labels().empty() ? params.stream_labels()[0] : "");
+ // |params.id| is the sender id and the stream id uses the first of
+ // |params.stream_ids|.
+ // TODO(bugs.webrtc.org/7932): Add support for multiple stream ids.
+ const std::string& stream_id =
+ (!params.stream_ids().empty() ? params.stream_ids()[0] : "");
const std::string& sender_id = params.id;
uint32_t ssrc = params.first_ssrc();
rtc::scoped_refptr<MediaStreamInterface> stream =
- remote_streams_->find(stream_label);
+ remote_streams_->find(stream_id);
if (!stream) {
// This is a new MediaStream. Create a new remote MediaStream.
stream = MediaStreamProxy::Create(rtc::Thread::Current(),
- MediaStream::Create(stream_label));
+ MediaStream::Create(stream_id));
remote_streams_->AddStream(stream);
new_streams->AddStream(stream);
}
const RtpSenderInfo* sender_info =
- FindSenderInfo(*current_senders, stream_label, sender_id);
+ FindSenderInfo(*current_senders, stream_id, sender_id);
if (!sender_info) {
- current_senders->push_back(RtpSenderInfo(stream_label, sender_id, ssrc));
+ current_senders->push_back(RtpSenderInfo(stream_id, sender_id, ssrc));
OnRemoteSenderAdded(current_senders->back(), media_type);
}
}
@@ -3897,22 +3897,22 @@
// Add default sender if necessary.
if (default_sender_needed) {
rtc::scoped_refptr<MediaStreamInterface> default_stream =
- remote_streams_->find(kDefaultStreamLabel);
+ remote_streams_->find(kDefaultStreamId);
if (!default_stream) {
// Create the new default MediaStream.
default_stream = MediaStreamProxy::Create(
- rtc::Thread::Current(), MediaStream::Create(kDefaultStreamLabel));
+ rtc::Thread::Current(), MediaStream::Create(kDefaultStreamId));
remote_streams_->AddStream(default_stream);
new_streams->AddStream(default_stream);
}
std::string default_sender_id = (media_type == cricket::MEDIA_TYPE_AUDIO)
? kDefaultAudioSenderId
: kDefaultVideoSenderId;
- const RtpSenderInfo* default_sender_info = FindSenderInfo(
- *current_senders, kDefaultStreamLabel, default_sender_id);
+ const RtpSenderInfo* default_sender_info =
+ FindSenderInfo(*current_senders, kDefaultStreamId, default_sender_id);
if (!default_sender_info) {
current_senders->push_back(
- RtpSenderInfo(kDefaultStreamLabel, default_sender_id, 0));
+ RtpSenderInfo(kDefaultStreamId, default_sender_id, 0));
OnRemoteSenderAdded(current_senders->back(), media_type);
}
}
@@ -3920,8 +3920,7 @@
void PeerConnection::OnRemoteSenderAdded(const RtpSenderInfo& sender_info,
cricket::MediaType media_type) {
- MediaStreamInterface* stream =
- remote_streams_->find(sender_info.stream_label);
+ MediaStreamInterface* stream = remote_streams_->find(sender_info.stream_id);
if (media_type == cricket::MEDIA_TYPE_AUDIO) {
CreateAudioReceiver(stream, sender_info);
@@ -3934,8 +3933,7 @@
void PeerConnection::OnRemoteSenderRemoved(const RtpSenderInfo& sender_info,
cricket::MediaType media_type) {
- MediaStreamInterface* stream =
- remote_streams_->find(sender_info.stream_label);
+ MediaStreamInterface* stream = remote_streams_->find(sender_info.stream_id);
rtc::scoped_refptr<RtpReceiverInterface> receiver;
if (media_type == cricket::MEDIA_TYPE_AUDIO) {
@@ -3986,7 +3984,7 @@
cricket::MediaType media_type) {
std::vector<RtpSenderInfo>* current_senders = GetLocalSenderInfos(media_type);
- // Find removed tracks. I.e., tracks where the track id, stream label or ssrc
+ // Find removed tracks. I.e., tracks where the track id, stream id or ssrc
// don't match the new StreamParam.
for (auto sender_it = current_senders->begin();
sender_it != current_senders->end();
@@ -3995,7 +3993,7 @@
const cricket::StreamParams* params =
cricket::GetStreamBySsrc(streams, info.first_ssrc);
if (!params || params->id != info.sender_id ||
- params->first_stream_label() != info.stream_label) {
+ params->first_stream_id() != info.stream_id) {
OnLocalSenderRemoved(info, media_type);
sender_it = current_senders->erase(sender_it);
} else {
@@ -4007,13 +4005,13 @@
for (const cricket::StreamParams& params : streams) {
// The sync_label is the MediaStream label and the |stream.id| is the
// sender id.
- const std::string& stream_label = params.first_stream_label();
+ const std::string& stream_id = params.first_stream_id();
const std::string& sender_id = params.id;
uint32_t ssrc = params.first_ssrc();
const RtpSenderInfo* sender_info =
- FindSenderInfo(*current_senders, stream_label, sender_id);
+ FindSenderInfo(*current_senders, stream_id, sender_id);
if (!sender_info) {
- current_senders->push_back(RtpSenderInfo(stream_label, sender_id, ssrc));
+ current_senders->push_back(RtpSenderInfo(stream_id, sender_id, ssrc));
OnLocalSenderAdded(current_senders->back(), media_type);
}
}
@@ -4035,7 +4033,7 @@
return;
}
- sender->internal()->set_stream_id(sender_info.stream_label);
+ sender->internal()->set_stream_id(sender_info.stream_id);
sender->internal()->SetSsrc(sender_info.first_ssrc);
}
@@ -4071,7 +4069,7 @@
// MediaStreams and Tracks.
// For MediaStreams, the sync_label is the MediaStream label and the
// track label is the same as |streamid|.
- const std::string& channel_label = params.first_stream_label();
+ const std::string& channel_label = params.first_stream_id();
auto data_channel_it = rtp_data_channels_.find(channel_label);
if (data_channel_it == rtp_data_channels_.end()) {
RTC_LOG(LS_ERROR) << "channel label not found";
@@ -4093,9 +4091,9 @@
for (const cricket::StreamParams& params : streams) {
// The data channel label is either the mslabel or the SSRC if the mslabel
// does not exist. Ex a=ssrc:444330170 mslabel:test1.
- std::string label = params.first_stream_label().empty()
+ std::string label = params.first_stream_id().empty()
? rtc::ToString(params.first_ssrc())
- : params.first_stream_label();
+ : params.first_stream_id();
auto data_channel_it = rtp_data_channels_.find(label);
if (data_channel_it == rtp_data_channels_.end()) {
// This is a new data channel.
@@ -4370,10 +4368,10 @@
const PeerConnection::RtpSenderInfo* PeerConnection::FindSenderInfo(
const std::vector<PeerConnection::RtpSenderInfo>& infos,
- const std::string& stream_label,
+ const std::string& stream_id,
const std::string sender_id) const {
for (const RtpSenderInfo& sender_info : infos) {
- if (sender_info.stream_label == stream_label &&
+ if (sender_info.stream_id == stream_id &&
sender_info.sender_id == sender_id) {
return &sender_info;
}
diff --git a/pc/peerconnection.h b/pc/peerconnection.h
index fb9a62f..90b087a 100644
--- a/pc/peerconnection.h
+++ b/pc/peerconnection.h
@@ -70,7 +70,7 @@
RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrack(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels) override;
+ const std::vector<std::string>& stream_ids) override;
rtc::scoped_refptr<RtpSenderInterface> AddTrack(
MediaStreamTrackInterface* track,
std::vector<MediaStreamInterface*> streams) override;
@@ -257,16 +257,16 @@
struct RtpSenderInfo {
RtpSenderInfo() : first_ssrc(0) {}
- RtpSenderInfo(const std::string& stream_label,
+ RtpSenderInfo(const std::string& stream_id,
const std::string sender_id,
uint32_t ssrc)
- : stream_label(stream_label), sender_id(sender_id), first_ssrc(ssrc) {}
+ : stream_id(stream_id), sender_id(sender_id), first_ssrc(ssrc) {}
bool operator==(const RtpSenderInfo& other) {
- return this->stream_label == other.stream_label &&
+ return this->stream_id == other.stream_id &&
this->sender_id == other.sender_id &&
this->first_ssrc == other.first_ssrc;
}
- std::string stream_label;
+ std::string stream_id;
std::string sender_id;
// An RtpSender can have many SSRCs. The first one is used as a sort of ID
// for communicating with the lower layers.
@@ -315,11 +315,11 @@
// AddTrack implementation when Unified Plan is specified.
RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrackUnifiedPlan(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels);
+ const std::vector<std::string>& stream_ids);
// AddTrack implementation when Plan B is specified.
RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrackPlanB(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels);
+ const std::vector<std::string>& stream_ids);
// Returns the first RtpTransceiver suitable for a newly added track, if such
// transceiver is available.
@@ -344,7 +344,7 @@
rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>
CreateSender(cricket::MediaType media_type,
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels);
+ const std::vector<std::string>& stream_ids);
rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
CreateReceiver(cricket::MediaType media_type, const std::string& receiver_id);
@@ -627,7 +627,7 @@
std::vector<RtpSenderInfo>* GetLocalSenderInfos(
cricket::MediaType media_type);
const RtpSenderInfo* FindSenderInfo(const std::vector<RtpSenderInfo>& infos,
- const std::string& stream_label,
+ const std::string& stream_id,
const std::string sender_id) const;
// Returns the specified SCTP DataChannel in sctp_data_channels_,
diff --git a/pc/peerconnection_integrationtest.cc b/pc/peerconnection_integrationtest.cc
index 30dbdc8..32ebd5e 100644
--- a/pc/peerconnection_integrationtest.cc
+++ b/pc/peerconnection_integrationtest.cc
@@ -313,8 +313,8 @@
rtc::scoped_refptr<RtpSenderInterface> AddTrack(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels = {}) {
- auto result = pc()->AddTrack(track, stream_labels);
+ const std::vector<std::string>& stream_ids = {}) {
+ auto result = pc()->AddTrack(track, stream_ids);
EXPECT_EQ(RTCErrorType::NONE, result.error().type());
return result.MoveValue();
}
diff --git a/pc/peerconnection_jsep_unittest.cc b/pc/peerconnection_jsep_unittest.cc
index f77579b..e19931f 100644
--- a/pc/peerconnection_jsep_unittest.cc
+++ b/pc/peerconnection_jsep_unittest.cc
@@ -1174,11 +1174,11 @@
TEST_F(PeerConnectionJsepTest,
SetRemoteOfferWithOneTrackOneStreamFiresOnAddTrack) {
const std::string kTrackLabel = "audio_track";
- const std::string kStreamLabel = "audio_stream";
+ const std::string kStreamId = "audio_stream";
auto caller = CreatePeerConnection();
auto callee = CreatePeerConnection();
- ASSERT_TRUE(caller->AddAudioTrack(kTrackLabel, {kStreamLabel}));
+ ASSERT_TRUE(caller->AddAudioTrack(kTrackLabel, {kStreamId}));
ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal()));
@@ -1187,7 +1187,7 @@
const auto& event = track_events[0];
ASSERT_EQ(1u, event.streams.size());
auto stream = event.streams[0];
- EXPECT_EQ(kStreamLabel, stream->label());
+ EXPECT_EQ(kStreamId, stream->label());
EXPECT_THAT(track_events[0].snapshotted_stream_tracks.at(stream),
ElementsAre(event.receiver->track()));
EXPECT_EQ(event.receiver->streams(), track_events[0].streams);
@@ -1202,12 +1202,12 @@
SetRemoteOfferWithTwoTracksSameStreamFiresOnAddTrack) {
const std::string kTrack1Label = "audio_track1";
const std::string kTrack2Label = "audio_track2";
- const std::string kSharedStreamLabel = "stream";
+ const std::string kSharedStreamId = "stream";
auto caller = CreatePeerConnection();
auto callee = CreatePeerConnection();
- ASSERT_TRUE(caller->AddAudioTrack(kTrack1Label, {kSharedStreamLabel}));
- ASSERT_TRUE(caller->AddAudioTrack(kTrack2Label, {kSharedStreamLabel}));
+ ASSERT_TRUE(caller->AddAudioTrack(kTrack1Label, {kSharedStreamId}));
+ ASSERT_TRUE(caller->AddAudioTrack(kTrack2Label, {kSharedStreamId}));
ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal()));
diff --git a/pc/peerconnection_rtp_unittest.cc b/pc/peerconnection_rtp_unittest.cc
index 351905d..4d67b4b 100644
--- a/pc/peerconnection_rtp_unittest.cc
+++ b/pc/peerconnection_rtp_unittest.cc
@@ -187,11 +187,11 @@
auto caller = CreatePeerConnection();
auto callee = CreatePeerConnection();
- const char kSharedStreamLabel[] = "shared_audio_stream";
+ const char kSharedStreamId[] = "shared_audio_stream";
auto sender1 = caller->AddTrack(caller->CreateAudioTrack("audio_track1"),
- {kSharedStreamLabel});
+ {kSharedStreamId});
auto sender2 = caller->AddTrack(caller->CreateAudioTrack("audio_track2"),
- {kSharedStreamLabel});
+ {kSharedStreamId});
ASSERT_TRUE(
callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal(),
static_cast<webrtc::RTCError*>(nullptr)));
@@ -408,11 +408,11 @@
auto caller = CreatePeerConnection();
auto callee = CreatePeerConnection();
- const char kSharedStreamLabel[] = "shared_audio_stream";
+ const char kSharedStreamId[] = "shared_audio_stream";
auto sender1 = caller->AddTrack(caller->CreateAudioTrack("audio_track1"),
- {kSharedStreamLabel});
+ {kSharedStreamId});
auto sender2 = caller->AddTrack(caller->CreateAudioTrack("audio_track2"),
- {kSharedStreamLabel});
+ {kSharedStreamId});
ASSERT_TRUE(
callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal(),
static_cast<webrtc::RTCError*>(nullptr)));
diff --git a/pc/peerconnectionfactory.cc b/pc/peerconnectionfactory.cc
index a6b889b..70e8d19 100644
--- a/pc/peerconnectionfactory.cc
+++ b/pc/peerconnectionfactory.cc
@@ -302,10 +302,10 @@
}
rtc::scoped_refptr<MediaStreamInterface>
-PeerConnectionFactory::CreateLocalMediaStream(const std::string& label) {
+PeerConnectionFactory::CreateLocalMediaStream(const std::string& stream_id) {
RTC_DCHECK(signaling_thread_->IsCurrent());
return MediaStreamProxy::Create(signaling_thread_,
- MediaStream::Create(label));
+ MediaStream::Create(stream_id));
}
rtc::scoped_refptr<VideoTrackInterface> PeerConnectionFactory::CreateVideoTrack(
diff --git a/pc/peerconnectionfactory.h b/pc/peerconnectionfactory.h
index 60facec..f0045f7 100644
--- a/pc/peerconnectionfactory.h
+++ b/pc/peerconnectionfactory.h
@@ -1,3 +1,4 @@
+
/*
* Copyright 2011 The WebRTC project authors. All Rights Reserved.
*
@@ -57,8 +58,8 @@
bool Initialize();
- rtc::scoped_refptr<MediaStreamInterface>
- CreateLocalMediaStream(const std::string& label) override;
+ rtc::scoped_refptr<MediaStreamInterface> CreateLocalMediaStream(
+ const std::string& stream_id) override;
rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource(
const cricket::AudioOptions& options) override;
diff --git a/pc/peerconnectioninterface_unittest.cc b/pc/peerconnectioninterface_unittest.cc
index eb396f5..198e1e5 100644
--- a/pc/peerconnectioninterface_unittest.cc
+++ b/pc/peerconnectioninterface_unittest.cc
@@ -52,9 +52,9 @@
#include "pc/test/androidtestinitializer.h"
#endif
-static const char kStreamLabel1[] = "local_stream_1";
-static const char kStreamLabel2[] = "local_stream_2";
-static const char kStreamLabel3[] = "local_stream_3";
+static const char kStreamId1[] = "local_stream_1";
+static const char kStreamId2[] = "local_stream_2";
+static const char kStreamId3[] = "local_stream_3";
static const int kDefaultStunPort = 3478;
static const char kStunAddressOnly[] = "stun:address";
static const char kStunInvalidPort[] = "stun:address:-1";
@@ -492,10 +492,10 @@
// Check if |streams| contains the specified track.
bool ContainsTrack(const std::vector<cricket::StreamParams>& streams,
- const std::string& stream_label,
+ const std::string& stream_id,
const std::string& track_id) {
for (const cricket::StreamParams& params : streams) {
- if (params.first_stream_label() == stream_label && params.id == track_id) {
+ if (params.first_stream_id() == stream_id && params.id == track_id) {
return true;
}
}
@@ -832,9 +832,9 @@
}
void AddVideoTrack(const std::string& track_label,
- const std::vector<std::string>& stream_labels = {}) {
+ const std::vector<std::string>& stream_ids = {}) {
auto sender_or_error =
- pc_->AddTrack(CreateVideoTrack(track_label), stream_labels);
+ pc_->AddTrack(CreateVideoTrack(track_label), stream_ids);
ASSERT_EQ(RTCErrorType::NONE, sender_or_error.error().type());
EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout);
observer_.renegotiation_needed_ = false;
@@ -855,9 +855,9 @@
}
void AddAudioTrack(const std::string& track_label,
- const std::vector<std::string>& stream_labels = {}) {
+ const std::vector<std::string>& stream_ids = {}) {
auto sender_or_error =
- pc_->AddTrack(CreateAudioTrack(track_label), stream_labels);
+ pc_->AddTrack(CreateAudioTrack(track_label), stream_ids);
ASSERT_EQ(RTCErrorType::NONE, sender_or_error.error().type());
EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout);
observer_.renegotiation_needed_ = false;
@@ -872,12 +872,12 @@
observer_.renegotiation_needed_ = false;
}
- void AddAudioVideoStream(const std::string& stream_label,
+ void AddAudioVideoStream(const std::string& stream_id,
const std::string& audio_track_label,
const std::string& video_track_label) {
// Create a local stream.
rtc::scoped_refptr<MediaStreamInterface> stream(
- pc_factory_->CreateLocalMediaStream(stream_label));
+ pc_factory_->CreateLocalMediaStream(stream_id));
stream->AddTrack(CreateAudioTrack(audio_track_label));
stream->AddTrack(CreateVideoTrack(video_track_label));
ASSERT_TRUE(pc_->AddStream(stream));
@@ -974,12 +974,12 @@
CreatePeerConnectionWithoutDtls();
// Create a local stream with audio&video tracks.
if (sdp_semantics_ == SdpSemantics::kPlanB) {
- AddAudioVideoStream(kStreamLabel1, "audio_track", "video_track");
+ AddAudioVideoStream(kStreamId1, "audio_track", "video_track");
} else {
// Unified Plan does not support AddStream, so just add an audio and video
// track.
- AddAudioTrack(kAudioTracks[0], {kStreamLabel1});
- AddVideoTrack(kVideoTracks[0], {kStreamLabel1});
+ AddAudioTrack(kAudioTracks[0], {kStreamId1});
+ AddVideoTrack(kVideoTracks[0], {kStreamId1});
}
CreateOfferReceiveAnswer();
}
@@ -1096,16 +1096,15 @@
EXPECT_EQ(PeerConnectionInterface::kStable, observer_.state_);
}
- // Waits until a remote stream with the given label is signaled. This helper
+ // Waits until a remote stream with the given id is signaled. This helper
// function will verify both OnAddTrack and OnAddStream (Plan B only) are
- // called with the given stream label and expected number of tracks.
- void WaitAndVerifyOnAddStream(const std::string& stream_label,
+ // called with the given stream id and expected number of tracks.
+ void WaitAndVerifyOnAddStream(const std::string& stream_id,
int expected_num_tracks) {
// Verify that both OnAddStream and OnAddTrack are called.
- EXPECT_EQ_WAIT(stream_label, observer_.GetLastAddedStreamLabel(), kTimeout);
+ EXPECT_EQ_WAIT(stream_id, observer_.GetLastAddedStreamId(), kTimeout);
EXPECT_EQ_WAIT(expected_num_tracks,
- observer_.CountAddTrackEventsForStream(stream_label),
- kTimeout);
+ observer_.CountAddTrackEventsForStream(stream_id), kTimeout);
}
// Creates an offer and applies it as a local session description.
@@ -1133,10 +1132,10 @@
reference_collection_ = StreamCollection::Create();
std::string sdp_ms1 = std::string(kSdpStringInit);
- std::string mediastream_label = kStreams[0];
+ std::string mediastream_id = kStreams[0];
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream(
- webrtc::MediaStream::Create(mediastream_label));
+ webrtc::MediaStream::Create(mediastream_id));
reference_collection_->AddStream(stream);
if (number_of_audio_tracks > 0) {
@@ -1189,7 +1188,7 @@
std::unique_ptr<SessionDescriptionInterface> CreateOfferWithOneAudioStream() {
CreatePeerConnectionWithoutDtls();
- AddAudioStream(kStreamLabel1);
+ AddAudioStream(kStreamId1);
std::unique_ptr<SessionDescriptionInterface> offer;
EXPECT_TRUE(DoCreateOffer(&offer, nullptr));
return offer;
@@ -1479,15 +1478,15 @@
TEST_F(PeerConnectionInterfaceTestPlanB, AddStreams) {
CreatePeerConnectionWithoutDtls();
- AddVideoStream(kStreamLabel1);
- AddAudioStream(kStreamLabel2);
+ AddVideoStream(kStreamId1);
+ AddAudioStream(kStreamId2);
ASSERT_EQ(2u, pc_->local_streams()->count());
// Test we can add multiple local streams to one peerconnection.
rtc::scoped_refptr<MediaStreamInterface> stream(
- pc_factory_->CreateLocalMediaStream(kStreamLabel3));
+ pc_factory_->CreateLocalMediaStream(kStreamId3));
rtc::scoped_refptr<AudioTrackInterface> audio_track(
- pc_factory_->CreateAudioTrack(kStreamLabel3,
+ pc_factory_->CreateAudioTrack(kStreamId3,
static_cast<AudioSourceInterface*>(NULL)));
stream->AddTrack(audio_track.get());
EXPECT_TRUE(pc_->AddStream(stream));
@@ -1510,42 +1509,36 @@
// Don't run under Unified Plan since the stream API is not available.
TEST_F(PeerConnectionInterfaceTestPlanB, AddedStreamsPresentInOffer) {
CreatePeerConnectionWithoutDtls();
- AddAudioVideoStream(kStreamLabel1, "audio_track", "video_track");
+ AddAudioVideoStream(kStreamId1, "audio_track", "video_track");
std::unique_ptr<SessionDescriptionInterface> offer;
ASSERT_TRUE(DoCreateOffer(&offer, nullptr));
const cricket::AudioContentDescription* audio_desc =
cricket::GetFirstAudioContentDescription(offer->description());
- EXPECT_TRUE(
- ContainsTrack(audio_desc->streams(), kStreamLabel1, "audio_track"));
+ EXPECT_TRUE(ContainsTrack(audio_desc->streams(), kStreamId1, "audio_track"));
const cricket::VideoContentDescription* video_desc =
cricket::GetFirstVideoContentDescription(offer->description());
- EXPECT_TRUE(
- ContainsTrack(video_desc->streams(), kStreamLabel1, "video_track"));
+ EXPECT_TRUE(ContainsTrack(video_desc->streams(), kStreamId1, "video_track"));
// Add another stream and ensure the offer includes both the old and new
// streams.
- AddAudioVideoStream(kStreamLabel2, "audio_track2", "video_track2");
+ AddAudioVideoStream(kStreamId2, "audio_track2", "video_track2");
ASSERT_TRUE(DoCreateOffer(&offer, nullptr));
audio_desc = cricket::GetFirstAudioContentDescription(offer->description());
- EXPECT_TRUE(
- ContainsTrack(audio_desc->streams(), kStreamLabel1, "audio_track"));
- EXPECT_TRUE(
- ContainsTrack(audio_desc->streams(), kStreamLabel2, "audio_track2"));
+ EXPECT_TRUE(ContainsTrack(audio_desc->streams(), kStreamId1, "audio_track"));
+ EXPECT_TRUE(ContainsTrack(audio_desc->streams(), kStreamId2, "audio_track2"));
video_desc = cricket::GetFirstVideoContentDescription(offer->description());
- EXPECT_TRUE(
- ContainsTrack(video_desc->streams(), kStreamLabel1, "video_track"));
- EXPECT_TRUE(
- ContainsTrack(video_desc->streams(), kStreamLabel2, "video_track2"));
+ EXPECT_TRUE(ContainsTrack(video_desc->streams(), kStreamId1, "video_track"));
+ EXPECT_TRUE(ContainsTrack(video_desc->streams(), kStreamId2, "video_track2"));
}
// Don't run under Unified Plan since the stream API is not available.
TEST_F(PeerConnectionInterfaceTestPlanB, RemoveStream) {
CreatePeerConnectionWithoutDtls();
- AddVideoStream(kStreamLabel1);
+ AddVideoStream(kStreamId1);
ASSERT_EQ(1u, pc_->local_streams()->count());
pc_->RemoveStream(pc_->local_streams()->at(0));
EXPECT_EQ(0u, pc_->local_streams()->count());
@@ -1566,14 +1559,14 @@
"video_track", pc_factory_->CreateVideoSource(
std::unique_ptr<cricket::VideoCapturer>(
new cricket::FakeVideoCapturer()))));
- auto audio_sender = pc_->AddTrack(audio_track, {kStreamLabel1}).MoveValue();
- auto video_sender = pc_->AddTrack(video_track, {kStreamLabel1}).MoveValue();
+ auto audio_sender = pc_->AddTrack(audio_track, {kStreamId1}).MoveValue();
+ auto video_sender = pc_->AddTrack(video_track, {kStreamId1}).MoveValue();
EXPECT_EQ(1UL, audio_sender->stream_ids().size());
- EXPECT_EQ(kStreamLabel1, audio_sender->stream_ids()[0]);
+ EXPECT_EQ(kStreamId1, audio_sender->stream_ids()[0]);
EXPECT_EQ("audio_track", audio_sender->id());
EXPECT_EQ(audio_track, audio_sender->track());
EXPECT_EQ(1UL, video_sender->stream_ids().size());
- EXPECT_EQ(kStreamLabel1, video_sender->stream_ids()[0]);
+ EXPECT_EQ(kStreamId1, video_sender->stream_ids()[0]);
EXPECT_EQ("video_track", video_sender->id());
EXPECT_EQ(video_track, video_sender->track());
@@ -1584,12 +1577,12 @@
const cricket::ContentInfo* audio_content =
cricket::GetFirstAudioContent(offer->description());
EXPECT_TRUE(ContainsTrack(audio_content->media_description()->streams(),
- kStreamLabel1, "audio_track"));
+ kStreamId1, "audio_track"));
const cricket::ContentInfo* video_content =
cricket::GetFirstVideoContent(offer->description());
EXPECT_TRUE(ContainsTrack(video_content->media_description()->streams(),
- kStreamLabel1, "video_track"));
+ kStreamId1, "video_track"));
EXPECT_TRUE(DoSetLocalDescription(std::move(offer)));
@@ -1602,11 +1595,11 @@
audio_content = cricket::GetFirstAudioContent(offer->description());
EXPECT_FALSE(ContainsTrack(audio_content->media_description()->streams(),
- kStreamLabel1, "audio_track"));
+ kStreamId1, "audio_track"));
video_content = cricket::GetFirstVideoContent(offer->description());
EXPECT_FALSE(ContainsTrack(video_content->media_description()->streams(),
- kStreamLabel1, "video_track"));
+ kStreamId1, "video_track"));
EXPECT_TRUE(DoSetLocalDescription(std::move(offer)));
@@ -1683,7 +1676,7 @@
// Don't run under Unified Plan since the stream API is not available.
TEST_F(PeerConnectionInterfaceTestPlanB, AttachmentIdIsSetOnAddStream) {
CreatePeerConnectionWithoutDtls();
- AddVideoStream(kStreamLabel1);
+ AddVideoStream(kStreamId1);
auto senders = pc_->GetSenders();
ASSERT_EQ(1u, senders.size());
auto* sender_proxy =
@@ -1694,39 +1687,39 @@
TEST_P(PeerConnectionInterfaceTest, CreateOfferReceiveAnswer) {
InitiateCall();
- WaitAndVerifyOnAddStream(kStreamLabel1, 2);
+ WaitAndVerifyOnAddStream(kStreamId1, 2);
VerifyRemoteRtpHeaderExtensions();
}
TEST_P(PeerConnectionInterfaceTest, CreateOfferReceivePrAnswerAndAnswer) {
CreatePeerConnectionWithoutDtls();
- AddVideoTrack(kVideoTracks[0], {kStreamLabel1});
+ AddVideoTrack(kVideoTracks[0], {kStreamId1});
CreateOfferAsLocalDescription();
std::string offer;
EXPECT_TRUE(pc_->local_description()->ToString(&offer));
CreatePrAnswerAndAnswerAsRemoteDescription(offer);
- WaitAndVerifyOnAddStream(kStreamLabel1, 1);
+ WaitAndVerifyOnAddStream(kStreamId1, 1);
}
TEST_P(PeerConnectionInterfaceTest, ReceiveOfferCreateAnswer) {
CreatePeerConnectionWithoutDtls();
- AddVideoTrack(kVideoTracks[0], {kStreamLabel1});
+ AddVideoTrack(kVideoTracks[0], {kStreamId1});
CreateOfferAsRemoteDescription();
CreateAnswerAsLocalDescription();
- WaitAndVerifyOnAddStream(kStreamLabel1, 1);
+ WaitAndVerifyOnAddStream(kStreamId1, 1);
}
TEST_P(PeerConnectionInterfaceTest, ReceiveOfferCreatePrAnswerAndAnswer) {
CreatePeerConnectionWithoutDtls();
- AddVideoTrack(kVideoTracks[0], {kStreamLabel1});
+ AddVideoTrack(kVideoTracks[0], {kStreamId1});
CreateOfferAsRemoteDescription();
CreatePrAnswerAsLocalDescription();
CreateAnswerAsLocalDescription();
- WaitAndVerifyOnAddStream(kStreamLabel1, 1);
+ WaitAndVerifyOnAddStream(kStreamId1, 1);
}
// Don't run under Unified Plan since the stream API is not available.
@@ -1736,7 +1729,7 @@
pc_->RemoveStream(pc_->local_streams()->at(0));
CreateOfferReceiveAnswer();
EXPECT_EQ(0u, pc_->remote_streams()->count());
- AddVideoStream(kStreamLabel1);
+ AddVideoStream(kStreamId1);
CreateOfferReceiveAnswer();
}
@@ -1744,7 +1737,7 @@
// renegotiation that removes the audio stream.
TEST_F(PeerConnectionInterfaceTestPlanB, RenegotiateAudioOnly) {
CreatePeerConnectionWithoutDtls();
- AddAudioStream(kStreamLabel1);
+ AddAudioStream(kStreamId1);
CreateOfferAsRemoteDescription();
CreateAnswerAsLocalDescription();
@@ -1787,8 +1780,8 @@
offer.reset();
// Create a local stream with audio&video tracks having same label.
- AddAudioTrack("track_label", {kStreamLabel1});
- AddVideoTrack("track_label", {kStreamLabel1});
+ AddAudioTrack("track_label", {kStreamId1});
+ AddVideoTrack("track_label", {kStreamId1});
// Test CreateOffer
EXPECT_FALSE(DoCreateOffer(&offer, nullptr));
@@ -1803,8 +1796,8 @@
TEST_P(PeerConnectionInterfaceTest, SsrcInOfferAnswer) {
CreatePeerConnectionWithoutDtls();
// Create a local stream with audio&video tracks having different labels.
- AddAudioTrack(kAudioTracks[0], {kStreamLabel1});
- AddVideoTrack(kVideoTracks[0], {kStreamLabel1});
+ AddAudioTrack(kAudioTracks[0], {kStreamId1});
+ AddVideoTrack(kVideoTracks[0], {kStreamId1});
// Test CreateOffer
std::unique_ptr<SessionDescriptionInterface> offer;
@@ -1837,7 +1830,7 @@
TEST_F(PeerConnectionInterfaceTestPlanB, AddTrackAfterAddStream) {
CreatePeerConnectionWithoutDtls();
// Create audio stream and add to PeerConnection.
- AddAudioStream(kStreamLabel1);
+ AddAudioStream(kStreamId1);
MediaStreamInterface* stream = pc_->local_streams()->at(0);
// Add video track to the audio-only stream.
@@ -1863,7 +1856,7 @@
TEST_F(PeerConnectionInterfaceTestPlanB, RemoveTrackAfterAddStream) {
CreatePeerConnectionWithoutDtls();
// Create audio/video stream and add to PeerConnection.
- AddAudioVideoStream(kStreamLabel1, "audio_label", "video_label");
+ AddAudioVideoStream(kStreamId1, "audio_label", "video_label");
MediaStreamInterface* stream = pc_->local_streams()->at(0);
// Remove the video track.
@@ -1894,7 +1887,7 @@
// Don't run under Unified Plan since the stream API is not available.
TEST_F(PeerConnectionInterfaceTestPlanB, CreateSenderWithStream) {
CreatePeerConnectionWithoutDtls();
- pc_->CreateSender("video", kStreamLabel1);
+ pc_->CreateSender("video", kStreamId1);
std::unique_ptr<SessionDescriptionInterface> offer;
ASSERT_TRUE(DoCreateOffer(&offer, nullptr));
@@ -1903,7 +1896,7 @@
cricket::GetFirstVideoContentDescription(offer->description());
ASSERT_TRUE(video_desc != nullptr);
ASSERT_EQ(1u, video_desc->streams().size());
- EXPECT_EQ(kStreamLabel1, video_desc->streams()[0].first_stream_label());
+ EXPECT_EQ(kStreamId1, video_desc->streams()[0].first_stream_id());
}
// Test that we can specify a certain track that we want statistics about.
@@ -1948,8 +1941,8 @@
// Clearing stats cache is needed now, but should be temporary.
// https://bugs.chromium.org/p/webrtc/issues/detail?id=8693
pc_->ClearStatsCache();
- AddAudioTrack(kAudioTracks[0], {kStreamLabel1});
- AddVideoTrack(kVideoTracks[0], {kStreamLabel1});
+ AddAudioTrack(kAudioTracks[0], {kStreamId1});
+ AddVideoTrack(kVideoTracks[0], {kStreamId1});
EXPECT_TRUE(DoGetRTCStats());
pc_->ClearStatsCache();
CreateOfferReceiveAnswer();
@@ -2704,7 +2697,7 @@
// Don't run under Unified Plan since the stream API is not available.
TEST_F(PeerConnectionInterfaceTestPlanB, CloseAndTestMethods) {
CreatePeerConnectionWithoutDtls();
- AddAudioVideoStream(kStreamLabel1, "audio_label", "video_label");
+ AddAudioVideoStream(kStreamId1, "audio_label", "video_label");
CreateOfferAsRemoteDescription();
CreateAnswerAsLocalDescription();
@@ -3258,8 +3251,8 @@
FakeConstraints default_constraints;
CreatePeerConnection(config, &default_constraints);
config = pc_->GetConfiguration();
- AddAudioTrack(kAudioTracks[0], {kStreamLabel1});
- AddVideoTrack(kVideoTracks[0], {kStreamLabel1});
+ AddAudioTrack(kAudioTracks[0], {kStreamId1});
+ AddVideoTrack(kVideoTracks[0], {kStreamId1});
// Do initial offer/answer so there's something to restart.
CreateOfferAsLocalDescription();
@@ -3330,8 +3323,8 @@
FakeConstraints default_constraints;
CreatePeerConnection(config, &default_constraints);
config = pc_->GetConfiguration();
- AddAudioTrack(kAudioTracks[0], {kStreamLabel1});
- AddVideoTrack(kVideoTracks[0], {kStreamLabel1});
+ AddAudioTrack(kAudioTracks[0], {kStreamId1});
+ AddVideoTrack(kVideoTracks[0], {kStreamId1});
// Do initial offer/answer so there's something to restart.
CreateOfferAsLocalDescription();
@@ -3873,7 +3866,7 @@
MediaStreamAddTrackRemoveTrackRenegotiate) {
CreatePeerConnectionWithoutDtls();
rtc::scoped_refptr<MediaStreamInterface> stream(
- pc_factory_->CreateLocalMediaStream(kStreamLabel1));
+ pc_factory_->CreateLocalMediaStream(kStreamId1));
pc_->AddStream(stream);
rtc::scoped_refptr<AudioTrackInterface> audio_track(
pc_factory_->CreateAudioTrack("audio_track", nullptr));
diff --git a/pc/peerconnectionwrapper.cc b/pc/peerconnectionwrapper.cc
index c09258d..5d26539 100644
--- a/pc/peerconnectionwrapper.cc
+++ b/pc/peerconnectionwrapper.cc
@@ -276,23 +276,23 @@
rtc::scoped_refptr<RtpSenderInterface> PeerConnectionWrapper::AddTrack(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels) {
+ const std::vector<std::string>& stream_ids) {
RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> result =
- pc()->AddTrack(track, stream_labels);
+ pc()->AddTrack(track, stream_ids);
EXPECT_EQ(RTCErrorType::NONE, result.error().type());
return result.MoveValue();
}
rtc::scoped_refptr<RtpSenderInterface> PeerConnectionWrapper::AddAudioTrack(
const std::string& track_label,
- const std::vector<std::string>& stream_labels) {
- return AddTrack(CreateAudioTrack(track_label), stream_labels);
+ const std::vector<std::string>& stream_ids) {
+ return AddTrack(CreateAudioTrack(track_label), stream_ids);
}
rtc::scoped_refptr<RtpSenderInterface> PeerConnectionWrapper::AddVideoTrack(
const std::string& track_label,
- const std::vector<std::string>& stream_labels) {
- return AddTrack(CreateVideoTrack(track_label), stream_labels);
+ const std::vector<std::string>& stream_ids) {
+ return AddTrack(CreateVideoTrack(track_label), stream_ids);
}
rtc::scoped_refptr<DataChannelInterface>
diff --git a/pc/peerconnectionwrapper.h b/pc/peerconnectionwrapper.h
index b775e85..330809f 100644
--- a/pc/peerconnectionwrapper.h
+++ b/pc/peerconnectionwrapper.h
@@ -138,19 +138,19 @@
// AddTrack fails.
rtc::scoped_refptr<RtpSenderInterface> AddTrack(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels = {});
+ const std::vector<std::string>& stream_ids = {});
// Calls the underlying PeerConnection's AddTrack method with an audio media
// stream track not bound to any source.
rtc::scoped_refptr<RtpSenderInterface> AddAudioTrack(
const std::string& track_label,
- const std::vector<std::string>& stream_labels = {});
+ const std::vector<std::string>& stream_ids = {});
// Calls the underlying PeerConnection's AddTrack method with a video media
// stream track fed by a fake video capturer.
rtc::scoped_refptr<RtpSenderInterface> AddVideoTrack(
const std::string& track_label,
- const std::vector<std::string>& stream_labels = {});
+ const std::vector<std::string>& stream_ids = {});
// Calls the underlying PeerConnection's CreateDataChannel method with default
// initialization parameters.
diff --git a/pc/rtcstatscollector_unittest.cc b/pc/rtcstatscollector_unittest.cc
index 3456f25..224dc29 100644
--- a/pc/rtcstatscollector_unittest.cc
+++ b/pc/rtcstatscollector_unittest.cc
@@ -321,7 +321,7 @@
bool add_stream) {
rtc::scoped_refptr<MediaStream> local_stream;
if (add_stream) {
- local_stream = MediaStream::Create("LocalStreamLabel");
+ local_stream = MediaStream::Create("LocalStreamId");
pc_->mutable_local_streams()->AddStream(local_stream);
}
@@ -349,7 +349,7 @@
const std::string& track_id,
uint32_t ssrc) {
rtc::scoped_refptr<MediaStream> remote_stream =
- MediaStream::Create("RemoteStreamLabel");
+ MediaStream::Create("RemoteStreamId");
pc_->mutable_remote_streams()->AddStream(remote_stream);
rtc::scoped_refptr<MediaStreamTrackInterface> track;
@@ -1195,7 +1195,7 @@
TEST_F(RTCStatsCollectorTest,
CollectLocalRTCMediaStreamStatsAndRTCMediaStreamTrackStats_Audio) {
rtc::scoped_refptr<MediaStream> local_stream =
- MediaStream::Create("LocalStreamLabel");
+ MediaStream::Create("LocalStreamId");
pc_->mutable_local_streams()->AddStream(local_stream);
// Local audio track
@@ -1255,7 +1255,7 @@
TEST_F(RTCStatsCollectorTest,
CollectRemoteRTCMediaStreamStatsAndRTCMediaStreamTrackStats_Audio) {
rtc::scoped_refptr<MediaStream> remote_stream =
- MediaStream::Create("RemoteStreamLabel");
+ MediaStream::Create("RemoteStreamId");
pc_->mutable_remote_streams()->AddStream(remote_stream);
// Remote audio track
@@ -1317,7 +1317,7 @@
TEST_F(RTCStatsCollectorTest,
CollectLocalRTCMediaStreamStatsAndRTCMediaStreamTrackStats_Video) {
rtc::scoped_refptr<MediaStream> local_stream =
- MediaStream::Create("LocalStreamLabel");
+ MediaStream::Create("LocalStreamId");
pc_->mutable_local_streams()->AddStream(local_stream);
// Local video track
@@ -1376,7 +1376,7 @@
TEST_F(RTCStatsCollectorTest,
CollectRemoteRTCMediaStreamStatsAndRTCMediaStreamTrackStats_Video) {
rtc::scoped_refptr<MediaStream> remote_stream =
- MediaStream::Create("RemoteStreamLabel");
+ MediaStream::Create("RemoteStreamId");
pc_->mutable_remote_streams()->AddStream(remote_stream);
// Remote video track with values
diff --git a/pc/rtpsender.cc b/pc/rtpsender.cc
index fb940e3..df2fd35 100644
--- a/pc/rtpsender.cc
+++ b/pc/rtpsender.cc
@@ -65,11 +65,11 @@
AudioRtpSender::AudioRtpSender(rtc::Thread* worker_thread,
rtc::scoped_refptr<AudioTrackInterface> track,
- const std::vector<std::string>& stream_labels,
+ const std::vector<std::string>& stream_ids,
StatsCollector* stats)
: worker_thread_(worker_thread),
id_(track ? track->id() : rtc::CreateRandomUuid()),
- stream_ids_(stream_labels),
+ stream_ids_(stream_ids),
stats_(stats),
track_(track),
dtmf_sender_proxy_(DtmfSenderProxy::Create(
@@ -81,7 +81,7 @@
RTC_DCHECK(worker_thread);
// TODO(bugs.webrtc.org/7932): Remove once zero or multiple streams are
// supported.
- RTC_DCHECK_EQ(stream_labels.size(), 1u);
+ RTC_DCHECK_EQ(stream_ids.size(), 1u);
if (track_) {
track_->RegisterObserver(this);
track_->AddSink(sink_adapter_.get());
@@ -306,20 +306,20 @@
VideoRtpSender::VideoRtpSender(rtc::Thread* worker_thread,
rtc::scoped_refptr<VideoTrackInterface> track,
- const std::vector<std::string>& stream_labels)
+ const std::vector<std::string>& stream_ids)
: worker_thread_(worker_thread),
id_(track ? track->id() : rtc::CreateRandomUuid()),
- stream_ids_(stream_labels),
+ stream_ids_(stream_ids),
track_(track),
cached_track_enabled_(track ? track->enabled() : false),
- cached_track_content_hint_(
- track ? track->content_hint()
- : VideoTrackInterface::ContentHint::kNone),
+ cached_track_content_hint_(track
+ ? track->content_hint()
+ : VideoTrackInterface::ContentHint::kNone),
attachment_id_(track ? GenerateUniqueId() : 0) {
RTC_DCHECK(worker_thread);
// TODO(bugs.webrtc.org/7932): Remove once zero or multiple streams are
// supported.
- RTC_DCHECK_EQ(stream_labels.size(), 1u);
+ RTC_DCHECK_EQ(stream_ids.size(), 1u);
if (track_) {
track_->RegisterObserver(this);
}
diff --git a/pc/rtpsender.h b/pc/rtpsender.h
index 000df94..05e1131 100644
--- a/pc/rtpsender.h
+++ b/pc/rtpsender.h
@@ -98,14 +98,14 @@
// at the appropriate times.
// Construct an AudioRtpSender with a null track, a single, randomly generated
- // stream label, and a randomly generated ID.
+ // stream id, and a randomly generated ID.
AudioRtpSender(rtc::Thread* worker_thread, StatsCollector* stats);
- // Construct an AudioRtpSender with the given track and stream labels. The
+ // Construct an AudioRtpSender with the given track and stream ids. The
// sender ID will be set to the track's ID.
AudioRtpSender(rtc::Thread* worker_thread,
rtc::scoped_refptr<AudioTrackInterface> track,
- const std::vector<std::string>& stream_labels,
+ const std::vector<std::string>& stream_ids,
StatsCollector* stats);
virtual ~AudioRtpSender();
@@ -198,14 +198,14 @@
public rtc::RefCountedObject<RtpSenderInternal> {
public:
// Construct a VideoRtpSender with a null track, a single, randomly generated
- // stream label, and a randomly generated ID.
+ // stream id, and a randomly generated ID.
explicit VideoRtpSender(rtc::Thread* worker_thread);
- // Construct a VideoRtpSender with the given track and stream labels. The
+ // Construct a VideoRtpSender with the given track and stream ids. The
// sender ID will be set to the track's ID.
VideoRtpSender(rtc::Thread* worker_thread,
rtc::scoped_refptr<VideoTrackInterface> track,
- const std::vector<std::string>& stream_labels);
+ const std::vector<std::string>& stream_ids);
virtual ~VideoRtpSender();
diff --git a/pc/rtpsenderreceiver_unittest.cc b/pc/rtpsenderreceiver_unittest.cc
index a09791c..f856248 100644
--- a/pc/rtpsenderreceiver_unittest.cc
+++ b/pc/rtpsenderreceiver_unittest.cc
@@ -39,7 +39,7 @@
namespace {
-static const char kStreamLabel1[] = "local_stream_1";
+static const char kStreamId1[] = "local_stream_1";
static const char kVideoTrackId[] = "video_1";
static const char kAudioTrackId[] = "audio_1";
static const uint32_t kVideoSsrc = 98;
@@ -65,7 +65,7 @@
worker_thread_,
network_thread_),
fake_call_(),
- local_stream_(MediaStream::Create(kStreamLabel1)) {
+ local_stream_(MediaStream::Create(kStreamId1)) {
// Create channels to be used by the RtpSenders and RtpReceivers.
channel_manager_.Init();
bool srtp_required = true;
diff --git a/pc/statscollector_unittest.cc b/pc/statscollector_unittest.cc
index 081c0b3..ffb0a5a 100644
--- a/pc/statscollector_unittest.cc
+++ b/pc/statscollector_unittest.cc
@@ -725,7 +725,7 @@
rtc::Thread::Current());
if (GetParam()) {
if (!stream_)
- stream_ = MediaStream::Create("streamlabel");
+ stream_ = MediaStream::Create("streamid");
stream_->AddTrack(track_);
stats->AddStream(stream_);
} else {
@@ -740,7 +740,7 @@
track_ = VideoTrack::Create(kRemoteTrackId, FakeVideoTrackSource::Create(),
rtc::Thread::Current());
if (GetParam()) {
- stream_ = MediaStream::Create("streamlabel");
+ stream_ = MediaStream::Create("streamid");
stream_->AddTrack(track_);
stats->AddStream(stream_);
} else {
@@ -758,7 +758,7 @@
audio_track_ = new rtc::RefCountedObject<FakeAudioTrack>(kLocalTrackId);
if (GetParam()) {
if (!stream_)
- stream_ = MediaStream::Create("streamlabel");
+ stream_ = MediaStream::Create("streamid");
stream_->AddTrack(audio_track_);
stats->AddStream(stream_);
} else {
@@ -773,7 +773,7 @@
audio_track_ = new rtc::RefCountedObject<FakeAudioTrack>(kRemoteTrackId);
if (GetParam()) {
if (stream_ == NULL)
- stream_ = MediaStream::Create("streamlabel");
+ stream_ = MediaStream::Create("streamid");
stream_->AddTrack(audio_track_);
stats->AddStream(stream_);
} else {
@@ -1427,7 +1427,7 @@
auto stats = CreateStatsCollector(pc);
// Create a local stream with a local audio track and adds it to the stats.
- stream_ = MediaStream::Create("streamlabel");
+ stream_ = MediaStream::Create("streamid");
rtc::scoped_refptr<FakeAudioTrackWithInitValue> local_track(
new rtc::RefCountedObject<FakeAudioTrackWithInitValue>(kLocalTrackId));
stream_->AddTrack(local_track);
@@ -1439,7 +1439,7 @@
// Create a remote stream with a remote audio track and adds it to the stats.
rtc::scoped_refptr<MediaStream> remote_stream(
- MediaStream::Create("remotestreamlabel"));
+ MediaStream::Create("remotestreamid"));
rtc::scoped_refptr<FakeAudioTrackWithInitValue> remote_track(
new rtc::RefCountedObject<FakeAudioTrackWithInitValue>(kRemoteTrackId));
remote_stream->AddTrack(remote_track);
@@ -1609,7 +1609,7 @@
// Create a remote stream with a remote audio track and adds it to the stats.
rtc::scoped_refptr<MediaStream> remote_stream(
- MediaStream::Create("remotestreamlabel"));
+ MediaStream::Create("remotestreamid"));
rtc::scoped_refptr<FakeAudioTrack> remote_track(
new rtc::RefCountedObject<FakeAudioTrack>(kRemoteTrackId));
pc->AddRemoteTrack(kSsrcOfTrack, kRemoteTrackId);
diff --git a/pc/test/fakepeerconnectionbase.h b/pc/test/fakepeerconnectionbase.h
index 5ca1ba7..2a46bf5 100644
--- a/pc/test/fakepeerconnectionbase.h
+++ b/pc/test/fakepeerconnectionbase.h
@@ -43,7 +43,7 @@
RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrack(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
- const std::vector<std::string>& stream_labels) override {
+ const std::vector<std::string>& stream_ids) override {
return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
}
diff --git a/pc/test/mockpeerconnectionobservers.h b/pc/test/mockpeerconnectionobservers.h
index 10979fd..162bd89 100644
--- a/pc/test/mockpeerconnectionobservers.h
+++ b/pc/test/mockpeerconnectionobservers.h
@@ -150,33 +150,33 @@
return receivers;
}
- int CountAddTrackEventsForStream(const std::string& stream_label) {
+ int CountAddTrackEventsForStream(const std::string& stream_id) {
int found_tracks = 0;
for (const AddTrackEvent& event : add_track_events_) {
- bool has_stream_label = false;
+ bool has_stream_id = false;
for (auto stream : event.streams) {
- if (stream->label() == stream_label) {
- has_stream_label = true;
+ if (stream->id() == stream_id) {
+ has_stream_id = true;
break;
}
}
- if (has_stream_label) {
+ if (has_stream_id) {
++found_tracks;
}
}
return found_tracks;
}
- // Returns the label of the last added stream.
+ // Returns the id of the last added stream.
// Empty string if no stream have been added.
- std::string GetLastAddedStreamLabel() {
+ std::string GetLastAddedStreamId() {
if (last_added_stream_.get())
- return last_added_stream_->label();
+ return last_added_stream_->id();
return "";
}
- std::string GetLastRemovedStreamLabel() {
+ std::string GetLastRemovedStreamId() {
if (last_removed_stream_.get())
- return last_removed_stream_->label();
+ return last_removed_stream_->id();
return "";
}
diff --git a/pc/test/peerconnectiontestwrapper.cc b/pc/test/peerconnectiontestwrapper.cc
index e2f6067..dfcbb85 100644
--- a/pc/test/peerconnectiontestwrapper.cc
+++ b/pc/test/peerconnectiontestwrapper.cc
@@ -34,7 +34,7 @@
using webrtc::VideoTrackInterface;
namespace {
-const char kStreamLabelBase[] = "stream_label";
+const char kStreamIdBase[] = "stream_id";
const char kVideoTrackLabelBase[] = "video_track";
const char kAudioTrackLabelBase[] = "audio_track";
constexpr int kMaxWait = 10000;
@@ -263,10 +263,10 @@
PeerConnectionTestWrapper::GetUserMedia(
bool audio, const webrtc::FakeConstraints& audio_constraints,
bool video, const webrtc::FakeConstraints& video_constraints) {
- std::string label =
- kStreamLabelBase + rtc::ToString(num_get_user_media_calls_++);
+ std::string stream_id =
+ kStreamIdBase + rtc::ToString(num_get_user_media_calls_++);
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
- peer_connection_factory_->CreateLocalMediaStream(label);
+ peer_connection_factory_->CreateLocalMediaStream(stream_id);
if (audio) {
FakeConstraints constraints = audio_constraints;
@@ -291,7 +291,7 @@
std::unique_ptr<cricket::VideoCapturer>(
new webrtc::FakePeriodicVideoCapturer()),
&constraints);
- std::string videotrack_label = label + kVideoTrackLabelBase;
+ std::string videotrack_label = stream_id + kVideoTrackLabelBase;
rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
peer_connection_factory_->CreateVideoTrack(videotrack_label, source));
diff --git a/pc/webrtcsdp.cc b/pc/webrtcsdp.cc
index 2a626f8..80ac8d5 100644
--- a/pc/webrtcsdp.cc
+++ b/pc/webrtcsdp.cc
@@ -634,17 +634,17 @@
}
track->add_ssrc(ssrc_info->ssrc_id);
track->cname = ssrc_info->cname;
- track->set_stream_labels({stream_id});
+ track->set_stream_ids({stream_id});
track->id = track_id;
}
}
-void GetMediaStreamLabels(const ContentInfo* content,
- std::set<std::string>* labels) {
+void GetMediaStreamIds(const ContentInfo* content,
+ std::set<std::string>* labels) {
for (const StreamParams& stream_params :
content->media_description()->streams()) {
- for (const std::string& stream_label : stream_params.stream_labels()) {
- labels->insert(stream_label);
+ for (const std::string& stream_id : stream_params.stream_ids()) {
+ labels->insert(stream_id);
}
}
}
@@ -809,17 +809,17 @@
InitAttrLine(kAttributeMsidSemantics, &os);
os << kSdpDelimiterColon << " " << kMediaStreamSemantic;
- std::set<std::string> media_stream_labels;
+ std::set<std::string> media_stream_ids;
const ContentInfo* audio_content = GetFirstAudioContent(desc);
if (audio_content)
- GetMediaStreamLabels(audio_content, &media_stream_labels);
+ GetMediaStreamIds(audio_content, &media_stream_ids);
const ContentInfo* video_content = GetFirstVideoContent(desc);
if (video_content)
- GetMediaStreamLabels(video_content, &media_stream_labels);
+ GetMediaStreamIds(video_content, &media_stream_ids);
- for (std::set<std::string>::const_iterator it =
- media_stream_labels.begin(); it != media_stream_labels.end(); ++it) {
+ for (std::set<std::string>::const_iterator it = media_stream_ids.begin();
+ it != media_stream_ids.end(); ++it) {
os << " " << *it;
}
AddLine(os.str(), &message);
@@ -1480,7 +1480,7 @@
const StreamParams& track = streams[0];
// TODO(bugs.webrtc.org/7932): Support serializing more than one stream
// label.
- const std::string& stream_id = track.first_stream_label();
+ const std::string& stream_id = track.first_stream_id();
InitAttrLine(kAttributeMsid, &os);
os << kSdpDelimiterColon << stream_id << kSdpDelimiterSpace << track.id;
AddLine(os.str(), message);
@@ -1536,7 +1536,7 @@
// necessary since the MediaContentDescription always contains a
// StreamParams with an ssrc even if no track or media stream have been
// created.
- if (track->stream_labels().empty())
+ if (track->stream_ids().empty())
continue;
// Build the ssrc-group lines.
@@ -1570,7 +1570,7 @@
// which corresponds to the "id" attribute of StreamParams.
// TODO(bugs.webrtc.org/7932): Support serializing more than one stream
// label.
- const std::string& stream_id = track->first_stream_label();
+ const std::string& stream_id = track->first_stream_id();
InitAttrLine(kAttributeSsrc, &os);
os << kSdpDelimiterColon << ssrc << kSdpDelimiterSpace
<< kSsrcAttributeMsid << kSdpDelimiterColon << stream_id
@@ -1583,7 +1583,7 @@
// a=ssrc:<ssrc-id> mslabel:<value>
// The label isn't yet defined.
// a=ssrc:<ssrc-id> label:<value>
- AddSsrcLine(ssrc, kSsrcAttributeMslabel, track->first_stream_label(),
+ AddSsrcLine(ssrc, kSsrcAttributeMslabel, track->first_stream_id(),
message);
AddSsrcLine(ssrc, kSSrcAttributeLabel, track->id, message);
}
diff --git a/pc/webrtcsdp_unittest.cc b/pc/webrtcsdp_unittest.cc
index c0e07e0..918dc30 100644
--- a/pc/webrtcsdp_unittest.cc
+++ b/pc/webrtcsdp_unittest.cc
@@ -740,7 +740,7 @@
static const char kVideoContentName3[] = "video_content_name_3";
// MediaStream 1
-static const char kStreamLabel1[] = "local_stream_1";
+static const char kStreamId1[] = "local_stream_1";
static const char kStream1Cname[] = "stream_1_cname";
static const char kAudioTrackId1[] = "audio_track_id_1";
static const uint32_t kAudioTrack1Ssrc = 1;
@@ -749,7 +749,7 @@
static const uint32_t kVideoTrack1Ssrc2 = 3;
// MediaStream 2
-static const char kStreamLabel2[] = "local_stream_2";
+static const char kStreamId2[] = "local_stream_2";
static const char kStream2Cname[] = "stream_2_cname";
static const char kAudioTrackId2[] = "audio_track_id_2";
static const uint32_t kAudioTrack2Ssrc = 4;
@@ -874,7 +874,7 @@
StreamParams audio_stream;
audio_stream.id = kAudioTrackId1;
audio_stream.cname = kStream1Cname;
- audio_stream.set_stream_labels({kStreamLabel1});
+ audio_stream.set_stream_ids({kStreamId1});
audio_stream.ssrcs.push_back(kAudioTrack1Ssrc);
audio_desc_->AddStream(audio_stream);
rtc::SocketAddress audio_addr("74.125.127.126", 2345);
@@ -886,7 +886,7 @@
StreamParams video_stream;
video_stream.id = kVideoTrackId1;
video_stream.cname = kStream1Cname;
- video_stream.set_stream_labels({kStreamLabel1});
+ video_stream.set_stream_ids({kStreamId1});
video_stream.ssrcs.push_back(kVideoTrack1Ssrc1);
video_stream.ssrcs.push_back(kVideoTrack1Ssrc2);
cricket::SsrcGroup ssrc_group(kFecSsrcGroupSemantics, video_stream.ssrcs);
@@ -1055,21 +1055,21 @@
StreamParams audio_track_2;
audio_track_2.id = kAudioTrackId2;
audio_track_2.cname = kStream2Cname;
- audio_track_2.set_stream_labels({kStreamLabel2});
+ audio_track_2.set_stream_ids({kStreamId2});
audio_track_2.ssrcs.push_back(kAudioTrack2Ssrc);
audio_desc_->AddStream(audio_track_2);
StreamParams video_track_2;
video_track_2.id = kVideoTrackId2;
video_track_2.cname = kStream2Cname;
- video_track_2.set_stream_labels({kStreamLabel2});
+ video_track_2.set_stream_ids({kStreamId2});
video_track_2.ssrcs.push_back(kVideoTrack2Ssrc);
video_desc_->AddStream(video_track_2);
StreamParams video_track_3;
video_track_3.id = kVideoTrackId3;
video_track_3.cname = kStream2Cname;
- video_track_3.set_stream_labels({kStreamLabel2});
+ video_track_3.set_stream_ids({kStreamId2});
video_track_3.ssrcs.push_back(kVideoTrack3Ssrc);
video_desc_->AddStream(video_track_3);
@@ -1090,7 +1090,7 @@
StreamParams audio_track_2;
audio_track_2.id = kAudioTrackId2;
audio_track_2.cname = kStream2Cname;
- audio_track_2.set_stream_labels({kStreamLabel2});
+ audio_track_2.set_stream_ids({kStreamId2});
audio_track_2.ssrcs.push_back(kAudioTrack2Ssrc);
audio_desc_2->AddStream(audio_track_2);
desc_.AddContent(kAudioContentName2, MediaProtocolType::kRtp, audio_desc_2);
@@ -1101,7 +1101,7 @@
StreamParams video_track_2;
video_track_2.id = kVideoTrackId2;
video_track_2.cname = kStream2Cname;
- video_track_2.set_stream_labels({kStreamLabel2});
+ video_track_2.set_stream_ids({kStreamId2});
video_track_2.ssrcs.push_back(kVideoTrack2Ssrc);
video_desc_2->AddStream(video_track_2);
desc_.AddContent(kVideoContentName2, MediaProtocolType::kRtp, video_desc_2);
@@ -1113,7 +1113,7 @@
StreamParams video_track_3;
video_track_3.id = kVideoTrackId3;
video_track_3.cname = kStream2Cname;
- video_track_3.set_stream_labels({kStreamLabel2});
+ video_track_3.set_stream_ids({kStreamId2});
video_track_3.ssrcs.push_back(kVideoTrack3Ssrc);
video_desc_3->AddStream(video_track_3);
desc_.AddContent(kVideoContentName3, MediaProtocolType::kRtp, video_desc_3);
@@ -1518,7 +1518,7 @@
StreamParams data_stream;
data_stream.id = kDataChannelMsid;
data_stream.cname = kDataChannelCname;
- data_stream.set_stream_labels({kDataChannelLabel});
+ data_stream.set_stream_ids({kDataChannelLabel});
data_stream.ssrcs.push_back(kDataChannelSsrc);
data_desc_->AddStream(data_stream);
data_desc_->AddCrypto(CryptoParams(