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

Side by Side Diff: webrtc/video/vie_channel.cc

Issue 1674663002: Initialize VideoSendStream members in constructor. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback + test update Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 } 631 }
632 632
633 void ViEChannel::SetRtpStateForSsrc(uint32_t ssrc, const RtpState& rtp_state) { 633 void ViEChannel::SetRtpStateForSsrc(uint32_t ssrc, const RtpState& rtp_state) {
634 RTC_DCHECK(!rtp_rtcp_modules_[0]->Sending()); 634 RTC_DCHECK(!rtp_rtcp_modules_[0]->Sending());
635 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 635 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
636 if (rtp_rtcp->SetRtpStateForSsrc(ssrc, rtp_state)) 636 if (rtp_rtcp->SetRtpStateForSsrc(ssrc, rtp_state))
637 return; 637 return;
638 } 638 }
639 } 639 }
640 640
641 RtpState ViEChannel::GetRtpStateForSsrc(uint32_t ssrc) { 641 RtpState ViEChannel::GetRtpStateForSsrc(uint32_t ssrc) const {
642 RTC_DCHECK(!rtp_rtcp_modules_[0]->Sending()); 642 RTC_DCHECK(!rtp_rtcp_modules_[0]->Sending());
643 RtpState rtp_state; 643 RtpState rtp_state;
644 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 644 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
645 if (rtp_rtcp->GetRtpStateForSsrc(ssrc, &rtp_state)) 645 if (rtp_rtcp->GetRtpStateForSsrc(ssrc, &rtp_state))
646 return rtp_state; 646 return rtp_state;
647 } 647 }
648 LOG(LS_ERROR) << "Couldn't get RTP state for ssrc: " << ssrc; 648 LOG(LS_ERROR) << "Couldn't get RTP state for ssrc: " << ssrc;
649 return rtp_state; 649 return rtp_state;
650 } 650 }
651 651
652 // TODO(pbos): Set CNAME on all modules. 652 // TODO(pbos): Set CNAME on all modules.
653 int32_t ViEChannel::SetRTCPCName(const char* rtcp_cname) { 653 int32_t ViEChannel::SetRTCPCName(const char* rtcp_cname) {
654 RTC_DCHECK(!rtp_rtcp_modules_[0]->Sending()); 654 RTC_DCHECK(!rtp_rtcp_modules_[0]->Sending());
655 return rtp_rtcp_modules_[0]->SetCNAME(rtcp_cname); 655 return rtp_rtcp_modules_[0]->SetCNAME(rtcp_cname);
656 } 656 }
657 657
658 int32_t ViEChannel::GetRemoteRTCPCName(char rtcp_cname[]) { 658 int32_t ViEChannel::GetRemoteRTCPCName(char rtcp_cname[]) {
659 uint32_t remoteSSRC = vie_receiver_.GetRemoteSsrc(); 659 uint32_t remoteSSRC = vie_receiver_.GetRemoteSsrc();
660 return rtp_rtcp_modules_[0]->RemoteCNAME(remoteSSRC, rtcp_cname); 660 return rtp_rtcp_modules_[0]->RemoteCNAME(remoteSSRC, rtcp_cname);
661 } 661 }
662 662
663 int32_t ViEChannel::GetSendRtcpStatistics(uint16_t* fraction_lost, 663 int32_t ViEChannel::GetSendRtcpStatistics(uint16_t* fraction_lost,
664 uint32_t* cumulative_lost, 664 uint32_t* cumulative_lost,
665 uint32_t* extended_max, 665 uint32_t* extended_max,
666 uint32_t* jitter_samples, 666 uint32_t* jitter_samples,
667 int64_t* rtt_ms) { 667 int64_t* rtt_ms) const {
668 // Aggregate the report blocks associated with streams sent on this channel. 668 // Aggregate the report blocks associated with streams sent on this channel.
669 std::vector<RTCPReportBlock> report_blocks; 669 std::vector<RTCPReportBlock> report_blocks;
670 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) 670 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
671 rtp_rtcp->RemoteRTCPStat(&report_blocks); 671 rtp_rtcp->RemoteRTCPStat(&report_blocks);
672 672
673 if (report_blocks.empty()) 673 if (report_blocks.empty())
674 return -1; 674 return -1;
675 675
676 uint32_t remote_ssrc = vie_receiver_.GetRemoteSsrc(); 676 uint32_t remote_ssrc = vie_receiver_.GetRemoteSsrc();
677 std::vector<RTCPReportBlock>::const_iterator it = report_blocks.begin(); 677 std::vector<RTCPReportBlock>::const_iterator it = report_blocks.begin();
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 rtc::CritScope lock(&crit_); 1110 rtc::CritScope lock(&crit_);
1111 receive_stats_callback_ = receive_statistics_proxy; 1111 receive_stats_callback_ = receive_statistics_proxy;
1112 } 1112 }
1113 1113
1114 void ViEChannel::SetIncomingVideoStream( 1114 void ViEChannel::SetIncomingVideoStream(
1115 IncomingVideoStream* incoming_video_stream) { 1115 IncomingVideoStream* incoming_video_stream) {
1116 rtc::CritScope lock(&crit_); 1116 rtc::CritScope lock(&crit_);
1117 incoming_video_stream_ = incoming_video_stream; 1117 incoming_video_stream_ = incoming_video_stream;
1118 } 1118 }
1119 } // namespace webrtc 1119 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698