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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2567333004: Add video send SSRC to RtpParameters, and don't allow changing SSRC. (Closed)
Patch Set: Deleting errant semicolon. Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1553 parameters_(std::move(config), options, max_bitrate_bps, codec_settings), 1553 parameters_(std::move(config), options, max_bitrate_bps, codec_settings),
1554 rtp_parameters_(CreateRtpParametersWithOneEncoding()), 1554 rtp_parameters_(CreateRtpParametersWithOneEncoding()),
1555 allocated_encoder_(nullptr, cricket::VideoCodec(), false), 1555 allocated_encoder_(nullptr, cricket::VideoCodec(), false),
1556 sending_(false), 1556 sending_(false),
1557 last_frame_timestamp_us_(0) { 1557 last_frame_timestamp_us_(0) {
1558 parameters_.config.rtp.max_packet_size = kVideoMtu; 1558 parameters_.config.rtp.max_packet_size = kVideoMtu;
1559 parameters_.conference_mode = send_params.conference_mode; 1559 parameters_.conference_mode = send_params.conference_mode;
1560 1560
1561 sp.GetPrimarySsrcs(&parameters_.config.rtp.ssrcs); 1561 sp.GetPrimarySsrcs(&parameters_.config.rtp.ssrcs);
1562 1562
1563 // ValidateStreamParams should prevent this from happening.
1564 RTC_CHECK(!parameters_.config.rtp.ssrcs.empty());
pthatcher1 2016/12/14 19:01:38 This might happen down the road when we support MI
Taylor Brandstetter 2016/12/15 00:04:26 When that change occurs, we can update this RTC_CH
1565 rtp_parameters_.encodings[0].ssrc =
1566 rtc::Optional<uint32_t>(parameters_.config.rtp.ssrcs[0]);
1567
1563 // RTX. 1568 // RTX.
1564 sp.GetFidSsrcs(parameters_.config.rtp.ssrcs, 1569 sp.GetFidSsrcs(parameters_.config.rtp.ssrcs,
1565 &parameters_.config.rtp.rtx.ssrcs); 1570 &parameters_.config.rtp.rtx.ssrcs);
1566 1571
1567 // FlexFEC. 1572 // FlexFEC.
1568 // TODO(brandtr): This code needs to be generalized when we add support for 1573 // TODO(brandtr): This code needs to be generalized when we add support for
1569 // multistream protection. 1574 // multistream protection.
1570 if (IsFlexfecFieldTrialEnabled()) { 1575 if (IsFlexfecFieldTrialEnabled()) {
1571 uint32_t flexfec_ssrc; 1576 uint32_t flexfec_ssrc;
1572 bool flexfec_enabled = false; 1577 bool flexfec_enabled = false;
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 } 1860 }
1856 1861
1857 webrtc::RtpParameters 1862 webrtc::RtpParameters
1858 WebRtcVideoChannel2::WebRtcVideoSendStream::GetRtpParameters() const { 1863 WebRtcVideoChannel2::WebRtcVideoSendStream::GetRtpParameters() const {
1859 RTC_DCHECK_RUN_ON(&thread_checker_); 1864 RTC_DCHECK_RUN_ON(&thread_checker_);
1860 return rtp_parameters_; 1865 return rtp_parameters_;
1861 } 1866 }
1862 1867
1863 bool WebRtcVideoChannel2::WebRtcVideoSendStream::ValidateRtpParameters( 1868 bool WebRtcVideoChannel2::WebRtcVideoSendStream::ValidateRtpParameters(
1864 const webrtc::RtpParameters& rtp_parameters) { 1869 const webrtc::RtpParameters& rtp_parameters) {
1870 RTC_DCHECK_RUN_ON(&thread_checker_);
1865 if (rtp_parameters.encodings.size() != 1) { 1871 if (rtp_parameters.encodings.size() != 1) {
1866 LOG(LS_ERROR) 1872 LOG(LS_ERROR)
1867 << "Attempted to set RtpParameters without exactly one encoding"; 1873 << "Attempted to set RtpParameters without exactly one encoding";
1868 return false; 1874 return false;
1869 } 1875 }
1876 if (rtp_parameters.encodings[0].ssrc != rtp_parameters_.encodings[0].ssrc) {
1877 LOG(LS_ERROR) << "Attempted to set RtpParameters with modified SSRC";
pthatcher1 2016/12/14 19:01:38 You might as well use a for-loop here that will be
1878 return false;
1879 }
1870 return true; 1880 return true;
1871 } 1881 }
1872 1882
1873 void WebRtcVideoChannel2::WebRtcVideoSendStream::UpdateSendState() { 1883 void WebRtcVideoChannel2::WebRtcVideoSendStream::UpdateSendState() {
1874 RTC_DCHECK_RUN_ON(&thread_checker_); 1884 RTC_DCHECK_RUN_ON(&thread_checker_);
1875 // TODO(deadbeef): Need to handle more than one encoding in the future. 1885 // TODO(deadbeef): Need to handle more than one encoding in the future.
1876 RTC_DCHECK(rtp_parameters_.encodings.size() == 1u); 1886 RTC_DCHECK(rtp_parameters_.encodings.size() == 1u);
1877 if (sending_ && rtp_parameters_.encodings[0].active) { 1887 if (sending_ && rtp_parameters_.encodings[0].active) {
1878 RTC_DCHECK(stream_ != nullptr); 1888 RTC_DCHECK(stream_ != nullptr);
1879 stream_->Start(); 1889 stream_->Start();
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
2573 rtx_mapping[video_codecs[i].codec.id] != 2583 rtx_mapping[video_codecs[i].codec.id] !=
2574 ulpfec_config.red_payload_type) { 2584 ulpfec_config.red_payload_type) {
2575 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2585 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2576 } 2586 }
2577 } 2587 }
2578 2588
2579 return video_codecs; 2589 return video_codecs;
2580 } 2590 }
2581 2591
2582 } // namespace cricket 2592 } // namespace cricket
OLDNEW
« 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