| Index: talk/media/webrtc/webrtcvideoengine2.cc
|
| diff --git a/talk/media/webrtc/webrtcvideoengine2.cc b/talk/media/webrtc/webrtcvideoengine2.cc
|
| index 7cd5c0622e7991c491dd270d00afcf854bb0a13d..1dfffd8790015aa5f198042681f147f1c7caea5b 100644
|
| --- a/talk/media/webrtc/webrtcvideoengine2.cc
|
| +++ b/talk/media/webrtc/webrtcvideoengine2.cc
|
| @@ -218,9 +218,9 @@ static bool ValidateStreamParams(const StreamParams& sp) {
|
| return false;
|
| }
|
|
|
| - std::vector<uint32> primary_ssrcs;
|
| + std::vector<uint32_t> primary_ssrcs;
|
| sp.GetPrimarySsrcs(&primary_ssrcs);
|
| - std::vector<uint32> rtx_ssrcs;
|
| + std::vector<uint32_t> rtx_ssrcs;
|
| sp.GetFidSsrcs(primary_ssrcs, &rtx_ssrcs);
|
| for (uint32_t rtx_ssrc : rtx_ssrcs) {
|
| bool rtx_ssrc_present = false;
|
| @@ -922,10 +922,9 @@ bool WebRtcVideoChannel2::SetRecvCodecs(const std::vector<VideoCodec>& codecs) {
|
| recv_codecs_ = supported_codecs;
|
|
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - for (std::map<uint32, WebRtcVideoReceiveStream*>::iterator it =
|
| + for (std::map<uint32_t, WebRtcVideoReceiveStream*>::iterator it =
|
| receive_streams_.begin();
|
| - it != receive_streams_.end();
|
| - ++it) {
|
| + it != receive_streams_.end(); ++it) {
|
| it->second->SetRecvCodecs(recv_codecs_);
|
| }
|
|
|
| @@ -1012,7 +1011,7 @@ bool WebRtcVideoChannel2::GetSendCodec(VideoCodec* codec) {
|
| return true;
|
| }
|
|
|
| -bool WebRtcVideoChannel2::SetSendStreamFormat(uint32 ssrc,
|
| +bool WebRtcVideoChannel2::SetSendStreamFormat(uint32_t ssrc,
|
| const VideoFormat& format) {
|
| LOG(LS_VERBOSE) << "SetSendStreamFormat:" << ssrc << " -> "
|
| << format.ToString();
|
| @@ -1044,7 +1043,8 @@ bool WebRtcVideoChannel2::SetSend(bool send) {
|
| return true;
|
| }
|
|
|
| -bool WebRtcVideoChannel2::SetVideoSend(uint32 ssrc, bool mute,
|
| +bool WebRtcVideoChannel2::SetVideoSend(uint32_t ssrc,
|
| + bool mute,
|
| const VideoOptions* options) {
|
| // TODO(solenberg): The state change should be fully rolled back if any one of
|
| // these calls fail.
|
| @@ -1091,7 +1091,7 @@ bool WebRtcVideoChannel2::AddSendStream(const StreamParams& sp) {
|
| if (!ValidateSendSsrcAvailability(sp))
|
| return false;
|
|
|
| - for (uint32 used_ssrc : sp.ssrcs)
|
| + for (uint32_t used_ssrc : sp.ssrcs)
|
| send_ssrcs_.insert(used_ssrc);
|
|
|
| webrtc::VideoSendStream::Config config(this);
|
| @@ -1107,7 +1107,7 @@ bool WebRtcVideoChannel2::AddSendStream(const StreamParams& sp) {
|
| send_codec_,
|
| send_rtp_extensions_);
|
|
|
| - uint32 ssrc = sp.first_ssrc();
|
| + uint32_t ssrc = sp.first_ssrc();
|
| RTC_DCHECK(ssrc != 0);
|
| send_streams_[ssrc] = stream;
|
|
|
| @@ -1128,7 +1128,7 @@ bool WebRtcVideoChannel2::AddSendStream(const StreamParams& sp) {
|
| return true;
|
| }
|
|
|
| -bool WebRtcVideoChannel2::RemoveSendStream(uint32 ssrc) {
|
| +bool WebRtcVideoChannel2::RemoveSendStream(uint32_t ssrc) {
|
| LOG(LS_INFO) << "RemoveSendStream: " << ssrc;
|
|
|
| if (ssrc == 0) {
|
| @@ -1144,13 +1144,13 @@ bool WebRtcVideoChannel2::RemoveSendStream(uint32 ssrc) {
|
| WebRtcVideoSendStream* removed_stream;
|
| {
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - std::map<uint32, WebRtcVideoSendStream*>::iterator it =
|
| + std::map<uint32_t, WebRtcVideoSendStream*>::iterator it =
|
| send_streams_.find(ssrc);
|
| if (it == send_streams_.end()) {
|
| return false;
|
| }
|
|
|
| - for (uint32 old_ssrc : it->second->GetSsrcs())
|
| + for (uint32_t old_ssrc : it->second->GetSsrcs())
|
| send_ssrcs_.erase(old_ssrc);
|
|
|
| removed_stream = it->second;
|
| @@ -1168,7 +1168,7 @@ bool WebRtcVideoChannel2::RemoveSendStream(uint32 ssrc) {
|
|
|
| void WebRtcVideoChannel2::DeleteReceiveStream(
|
| WebRtcVideoChannel2::WebRtcVideoReceiveStream* stream) {
|
| - for (uint32 old_ssrc : stream->GetSsrcs())
|
| + for (uint32_t old_ssrc : stream->GetSsrcs())
|
| receive_ssrcs_.erase(old_ssrc);
|
| delete stream;
|
| }
|
| @@ -1186,7 +1186,7 @@ bool WebRtcVideoChannel2::AddRecvStream(const StreamParams& sp,
|
| if (!ValidateStreamParams(sp))
|
| return false;
|
|
|
| - uint32 ssrc = sp.first_ssrc();
|
| + uint32_t ssrc = sp.first_ssrc();
|
| RTC_DCHECK(ssrc != 0); // TODO(pbos): Is this ever valid?
|
|
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| @@ -1205,7 +1205,7 @@ bool WebRtcVideoChannel2::AddRecvStream(const StreamParams& sp,
|
| if (!ValidateReceiveSsrcAvailability(sp))
|
| return false;
|
|
|
| - for (uint32 used_ssrc : sp.ssrcs)
|
| + for (uint32_t used_ssrc : sp.ssrcs)
|
| receive_ssrcs_.insert(used_ssrc);
|
|
|
| webrtc::VideoReceiveStream::Config config(this);
|
| @@ -1230,7 +1230,7 @@ bool WebRtcVideoChannel2::AddRecvStream(const StreamParams& sp,
|
| void WebRtcVideoChannel2::ConfigureReceiverRtp(
|
| webrtc::VideoReceiveStream::Config* config,
|
| const StreamParams& sp) const {
|
| - uint32 ssrc = sp.first_ssrc();
|
| + uint32_t ssrc = sp.first_ssrc();
|
|
|
| config->rtp.remote_ssrc = ssrc;
|
| config->rtp.local_ssrc = rtcp_receiver_report_ssrc_;
|
| @@ -1254,7 +1254,7 @@ void WebRtcVideoChannel2::ConfigureReceiverRtp(
|
| }
|
|
|
| for (size_t i = 0; i < recv_codecs_.size(); ++i) {
|
| - uint32 rtx_ssrc;
|
| + uint32_t rtx_ssrc;
|
| if (recv_codecs_[i].rtx_payload_type != -1 &&
|
| sp.GetFidSsrc(ssrc, &rtx_ssrc)) {
|
| webrtc::VideoReceiveStream::Config::Rtp::Rtx& rtx =
|
| @@ -1265,7 +1265,7 @@ void WebRtcVideoChannel2::ConfigureReceiverRtp(
|
| }
|
| }
|
|
|
| -bool WebRtcVideoChannel2::RemoveRecvStream(uint32 ssrc) {
|
| +bool WebRtcVideoChannel2::RemoveRecvStream(uint32_t ssrc) {
|
| LOG(LS_INFO) << "RemoveRecvStream: " << ssrc;
|
| if (ssrc == 0) {
|
| LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported.";
|
| @@ -1273,7 +1273,7 @@ bool WebRtcVideoChannel2::RemoveRecvStream(uint32 ssrc) {
|
| }
|
|
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - std::map<uint32, WebRtcVideoReceiveStream*>::iterator stream =
|
| + std::map<uint32_t, WebRtcVideoReceiveStream*>::iterator stream =
|
| receive_streams_.find(ssrc);
|
| if (stream == receive_streams_.end()) {
|
| LOG(LS_ERROR) << "Stream not found for ssrc: " << ssrc;
|
| @@ -1285,7 +1285,7 @@ bool WebRtcVideoChannel2::RemoveRecvStream(uint32 ssrc) {
|
| return true;
|
| }
|
|
|
| -bool WebRtcVideoChannel2::SetRenderer(uint32 ssrc, VideoRenderer* renderer) {
|
| +bool WebRtcVideoChannel2::SetRenderer(uint32_t ssrc, VideoRenderer* renderer) {
|
| LOG(LS_INFO) << "SetRenderer: ssrc:" << ssrc << " "
|
| << (renderer ? "(ptr)" : "NULL");
|
| if (ssrc == 0) {
|
| @@ -1294,7 +1294,7 @@ bool WebRtcVideoChannel2::SetRenderer(uint32 ssrc, VideoRenderer* renderer) {
|
| }
|
|
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - std::map<uint32, WebRtcVideoReceiveStream*>::iterator it =
|
| + std::map<uint32_t, WebRtcVideoReceiveStream*>::iterator it =
|
| receive_streams_.find(ssrc);
|
| if (it == receive_streams_.end()) {
|
| return false;
|
| @@ -1304,14 +1304,14 @@ bool WebRtcVideoChannel2::SetRenderer(uint32 ssrc, VideoRenderer* renderer) {
|
| return true;
|
| }
|
|
|
| -bool WebRtcVideoChannel2::GetRenderer(uint32 ssrc, VideoRenderer** renderer) {
|
| +bool WebRtcVideoChannel2::GetRenderer(uint32_t ssrc, VideoRenderer** renderer) {
|
| if (ssrc == 0) {
|
| *renderer = default_unsignalled_ssrc_handler_.GetDefaultRenderer();
|
| return *renderer != NULL;
|
| }
|
|
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - std::map<uint32, WebRtcVideoReceiveStream*>::iterator it =
|
| + std::map<uint32_t, WebRtcVideoReceiveStream*>::iterator it =
|
| receive_streams_.find(ssrc);
|
| if (it == receive_streams_.end()) {
|
| return false;
|
| @@ -1336,20 +1336,18 @@ bool WebRtcVideoChannel2::GetStats(VideoMediaInfo* info) {
|
|
|
| void WebRtcVideoChannel2::FillSenderStats(VideoMediaInfo* video_media_info) {
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - for (std::map<uint32, WebRtcVideoSendStream*>::iterator it =
|
| + for (std::map<uint32_t, WebRtcVideoSendStream*>::iterator it =
|
| send_streams_.begin();
|
| - it != send_streams_.end();
|
| - ++it) {
|
| + it != send_streams_.end(); ++it) {
|
| video_media_info->senders.push_back(it->second->GetVideoSenderInfo());
|
| }
|
| }
|
|
|
| void WebRtcVideoChannel2::FillReceiverStats(VideoMediaInfo* video_media_info) {
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - for (std::map<uint32, WebRtcVideoReceiveStream*>::iterator it =
|
| + for (std::map<uint32_t, WebRtcVideoReceiveStream*>::iterator it =
|
| receive_streams_.begin();
|
| - it != receive_streams_.end();
|
| - ++it) {
|
| + it != receive_streams_.end(); ++it) {
|
| video_media_info->receivers.push_back(it->second->GetVideoReceiverInfo());
|
| }
|
| }
|
| @@ -1364,16 +1362,15 @@ void WebRtcVideoChannel2::FillBandwidthEstimationStats(
|
|
|
| // Get send stream bitrate stats.
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - for (std::map<uint32, WebRtcVideoSendStream*>::iterator stream =
|
| + for (std::map<uint32_t, WebRtcVideoSendStream*>::iterator stream =
|
| send_streams_.begin();
|
| - stream != send_streams_.end();
|
| - ++stream) {
|
| + stream != send_streams_.end(); ++stream) {
|
| stream->second->FillBandwidthEstimationInfo(&bwe_info);
|
| }
|
| video_media_info->bw_estimations.push_back(bwe_info);
|
| }
|
|
|
| -bool WebRtcVideoChannel2::SetCapturer(uint32 ssrc, VideoCapturer* capturer) {
|
| +bool WebRtcVideoChannel2::SetCapturer(uint32_t ssrc, VideoCapturer* capturer) {
|
| LOG(LS_INFO) << "SetCapturer: " << ssrc << " -> "
|
| << (capturer != NULL ? "(capturer)" : "NULL");
|
| RTC_DCHECK(ssrc != 0);
|
| @@ -1431,7 +1428,7 @@ void WebRtcVideoChannel2::OnPacketReceived(
|
| break;
|
| }
|
|
|
| - uint32 ssrc = 0;
|
| + uint32_t ssrc = 0;
|
| if (!GetRtpSsrc(packet->data(), packet->size(), &ssrc)) {
|
| return;
|
| }
|
| @@ -1488,7 +1485,7 @@ void WebRtcVideoChannel2::OnReadyToSend(bool ready) {
|
| call_->SignalNetworkState(ready ? webrtc::kNetworkUp : webrtc::kNetworkDown);
|
| }
|
|
|
| -bool WebRtcVideoChannel2::MuteStream(uint32 ssrc, bool mute) {
|
| +bool WebRtcVideoChannel2::MuteStream(uint32_t ssrc, bool mute) {
|
| LOG(LS_VERBOSE) << "MuteStream: " << ssrc << " -> "
|
| << (mute ? "mute" : "unmute");
|
| RTC_DCHECK(ssrc != 0);
|
| @@ -1521,10 +1518,9 @@ bool WebRtcVideoChannel2::SetRecvRtpHeaderExtensions(
|
| recv_rtp_extensions_ = filtered_extensions;
|
|
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - for (std::map<uint32, WebRtcVideoReceiveStream*>::iterator it =
|
| + for (std::map<uint32_t, WebRtcVideoReceiveStream*>::iterator it =
|
| receive_streams_.begin();
|
| - it != receive_streams_.end();
|
| - ++it) {
|
| + it != receive_streams_.end(); ++it) {
|
| it->second->SetRtpExtensions(recv_rtp_extensions_);
|
| }
|
| return true;
|
| @@ -1552,10 +1548,9 @@ bool WebRtcVideoChannel2::SetSendRtpHeaderExtensions(
|
| send_rtp_extensions_, kRtpVideoRotationHeaderExtension);
|
|
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - for (std::map<uint32, WebRtcVideoSendStream*>::iterator it =
|
| + for (std::map<uint32_t, WebRtcVideoSendStream*>::iterator it =
|
| send_streams_.begin();
|
| - it != send_streams_.end();
|
| - ++it) {
|
| + it != send_streams_.end(); ++it) {
|
| it->second->SetRtpExtensions(send_rtp_extensions_);
|
| it->second->SetApplyRotation(!cvo_extension);
|
| }
|
| @@ -1613,10 +1608,9 @@ bool WebRtcVideoChannel2::SetOptions(const VideoOptions& options) {
|
| : rtc::DSCP_DEFAULT;
|
| MediaChannel::SetDscp(dscp);
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - for (std::map<uint32, WebRtcVideoSendStream*>::iterator it =
|
| + for (std::map<uint32_t, WebRtcVideoSendStream*>::iterator it =
|
| send_streams_.begin();
|
| - it != send_streams_.end();
|
| - ++it) {
|
| + it != send_streams_.end(); ++it) {
|
| it->second->SetOptions(options_);
|
| }
|
| return true;
|
| @@ -1678,20 +1672,18 @@ bool WebRtcVideoChannel2::SendRtcp(const uint8_t* data, size_t len) {
|
|
|
| void WebRtcVideoChannel2::StartAllSendStreams() {
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - for (std::map<uint32, WebRtcVideoSendStream*>::iterator it =
|
| + for (std::map<uint32_t, WebRtcVideoSendStream*>::iterator it =
|
| send_streams_.begin();
|
| - it != send_streams_.end();
|
| - ++it) {
|
| + it != send_streams_.end(); ++it) {
|
| it->second->Start();
|
| }
|
| }
|
|
|
| void WebRtcVideoChannel2::StopAllSendStreams() {
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| - for (std::map<uint32, WebRtcVideoSendStream*>::iterator it =
|
| + for (std::map<uint32_t, WebRtcVideoSendStream*>::iterator it =
|
| send_streams_.begin();
|
| - it != send_streams_.end();
|
| - ++it) {
|
| + it != send_streams_.end(); ++it) {
|
| it->second->Stop();
|
| }
|
| }
|
| @@ -1916,7 +1908,7 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::DisconnectCapturer() {
|
| return true;
|
| }
|
|
|
| -const std::vector<uint32>&
|
| +const std::vector<uint32_t>&
|
| WebRtcVideoChannel2::WebRtcVideoSendStream::GetSsrcs() const {
|
| return ssrcs_;
|
| }
|
| @@ -2379,7 +2371,7 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::~WebRtcVideoReceiveStream() {
|
| ClearDecoders(&allocated_decoders_);
|
| }
|
|
|
| -const std::vector<uint32>&
|
| +const std::vector<uint32_t>&
|
| WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetSsrcs() const {
|
| return ssrcs_;
|
| }
|
|
|