Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2567333004: Add video send SSRC to RtpParameters, and don't allow changing SSRC. (Closed)
Patch Set: Back out Obj-C and Java changes (were landed separately) Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoengine2.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc
index 9e36697a6155b2c68ad355d89b892639b12488a5..96c60f93d1e4f09b666c548154566bbcdfaa4f24 100644
--- a/webrtc/media/engine/webrtcvideoengine2.cc
+++ b/webrtc/media/engine/webrtcvideoengine2.cc
@@ -1560,6 +1560,11 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::WebRtcVideoSendStream(
sp.GetPrimarySsrcs(&parameters_.config.rtp.ssrcs);
+ // ValidateStreamParams should prevent this from happening.
+ RTC_CHECK(!parameters_.config.rtp.ssrcs.empty());
+ rtp_parameters_.encodings[0].ssrc =
+ rtc::Optional<uint32_t>(parameters_.config.rtp.ssrcs[0]);
+
// RTX.
sp.GetFidSsrcs(parameters_.config.rtp.ssrcs,
&parameters_.config.rtp.rtx.ssrcs);
@@ -1862,11 +1867,16 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::GetRtpParameters() const {
bool WebRtcVideoChannel2::WebRtcVideoSendStream::ValidateRtpParameters(
const webrtc::RtpParameters& rtp_parameters) {
+ RTC_DCHECK_RUN_ON(&thread_checker_);
if (rtp_parameters.encodings.size() != 1) {
LOG(LS_ERROR)
<< "Attempted to set RtpParameters without exactly one encoding";
return false;
}
+ if (rtp_parameters.encodings[0].ssrc != rtp_parameters_.encodings[0].ssrc) {
+ LOG(LS_ERROR) << "Attempted to set RtpParameters with modified SSRC";
+ return false;
+ }
return true;
}
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698