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

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

Issue 2774623006: Let PacketRouter separate send and receive modules. (Closed)
Patch Set: Send feedback messages on a send module, if possible. Created 3 years, 8 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 #include "webrtc/video/video_send_stream.h" 10 #include "webrtc/video/video_send_stream.h"
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 817
818 send_side_cc_->EnablePeriodicAlrProbing( 818 send_side_cc_->EnablePeriodicAlrProbing(
819 config_->periodic_alr_bandwidth_probing); 819 config_->periodic_alr_bandwidth_probing);
820 820
821 // RTP/RTCP initialization. 821 // RTP/RTCP initialization.
822 822
823 // We add the highest spatial layer first to ensure it'll be prioritized 823 // We add the highest spatial layer first to ensure it'll be prioritized
824 // when sending padding, with the hope that the packet rate will be smaller, 824 // when sending padding, with the hope that the packet rate will be smaller,
825 // and that it's more important to protect than the lower layers. 825 // and that it's more important to protect than the lower layers.
826 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) 826 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
827 packet_router_->AddRtpModule(rtp_rtcp); 827 packet_router_->AddSendRtpModule(rtp_rtcp);
828 828
829 for (size_t i = 0; i < config_->rtp.extensions.size(); ++i) { 829 for (size_t i = 0; i < config_->rtp.extensions.size(); ++i) {
830 const std::string& extension = config_->rtp.extensions[i].uri; 830 const std::string& extension = config_->rtp.extensions[i].uri;
831 int id = config_->rtp.extensions[i].id; 831 int id = config_->rtp.extensions[i].id;
832 // One-byte-extension local identifiers are in the range 1-14 inclusive. 832 // One-byte-extension local identifiers are in the range 1-14 inclusive.
833 RTC_DCHECK_GE(id, 1); 833 RTC_DCHECK_GE(id, 1);
834 RTC_DCHECK_LE(id, 14); 834 RTC_DCHECK_LE(id, 14);
835 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); 835 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension));
836 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 836 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
837 RTC_CHECK_EQ(0, rtp_rtcp->RegisterSendRtpHeaderExtension( 837 RTC_CHECK_EQ(0, rtp_rtcp->RegisterSendRtpHeaderExtension(
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 VideoSendStreamImpl::~VideoSendStreamImpl() { 896 VideoSendStreamImpl::~VideoSendStreamImpl() {
897 RTC_DCHECK_RUN_ON(worker_queue_); 897 RTC_DCHECK_RUN_ON(worker_queue_);
898 RTC_DCHECK(!payload_router_.IsActive()) 898 RTC_DCHECK(!payload_router_.IsActive())
899 << "VideoSendStreamImpl::Stop not called"; 899 << "VideoSendStreamImpl::Stop not called";
900 LOG(LS_INFO) << "~VideoSendStreamInternal: " << config_->ToString(); 900 LOG(LS_INFO) << "~VideoSendStreamInternal: " << config_->ToString();
901 901
902 rtp_rtcp_modules_[0]->SetREMBStatus(false); 902 rtp_rtcp_modules_[0]->SetREMBStatus(false);
903 remb_->RemoveRembSender(rtp_rtcp_modules_[0]); 903 remb_->RemoveRembSender(rtp_rtcp_modules_[0]);
904 904
905 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 905 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
906 packet_router_->RemoveRtpModule(rtp_rtcp); 906 packet_router_->RemoveSendRtpModule(rtp_rtcp);
907 delete rtp_rtcp; 907 delete rtp_rtcp;
908 } 908 }
909 } 909 }
910 910
911 bool VideoSendStreamImpl::DeliverRtcp(const uint8_t* packet, size_t length) { 911 bool VideoSendStreamImpl::DeliverRtcp(const uint8_t* packet, size_t length) {
912 // Runs on a network thread. 912 // Runs on a network thread.
913 RTC_DCHECK(!worker_queue_->IsCurrent()); 913 RTC_DCHECK(!worker_queue_->IsCurrent());
914 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) 914 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
915 rtp_rtcp->IncomingRtcpPacket(packet, length); 915 rtp_rtcp->IncomingRtcpPacket(packet, length);
916 return true; 916 return true;
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 std::min(config_->rtp.max_packet_size, 1340 std::min(config_->rtp.max_packet_size,
1341 kPathMTU - transport_overhead_bytes_per_packet_); 1341 kPathMTU - transport_overhead_bytes_per_packet_);
1342 1342
1343 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 1343 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
1344 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); 1344 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size);
1345 } 1345 }
1346 } 1346 }
1347 1347
1348 } // namespace internal 1348 } // namespace internal
1349 } // namespace webrtc 1349 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698