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

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

Issue 2437503004: Set actual transport overhead in rtp_rtcp (Closed)
Patch Set: Response to comments of honghaiz3 Created 4 years, 1 month 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 void SignalNetworkState(NetworkState state); 267 void SignalNetworkState(NetworkState state);
268 bool DeliverRtcp(const uint8_t* packet, size_t length); 268 bool DeliverRtcp(const uint8_t* packet, size_t length);
269 void Start(); 269 void Start();
270 void Stop(); 270 void Stop();
271 271
272 VideoSendStream::RtpStateMap GetRtpStates() const; 272 VideoSendStream::RtpStateMap GetRtpStates() const;
273 273
274 void EnableEncodedFrameRecording(const std::vector<rtc::PlatformFile>& files, 274 void EnableEncodedFrameRecording(const std::vector<rtc::PlatformFile>& files,
275 size_t byte_limit); 275 size_t byte_limit);
276 276
277 void SetTransportOverhead(int transport_overhead_per_packet_byte);
278
277 private: 279 private:
278 class CheckEncoderActivityTask; 280 class CheckEncoderActivityTask;
279 class EncoderReconfiguredTask; 281 class EncoderReconfiguredTask;
280 282
281 // Implements BitrateAllocatorObserver. 283 // Implements BitrateAllocatorObserver.
282 uint32_t OnBitrateUpdated(uint32_t bitrate_bps, 284 uint32_t OnBitrateUpdated(uint32_t bitrate_bps,
283 uint8_t fraction_loss, 285 uint8_t fraction_loss,
284 int64_t rtt) override; 286 int64_t rtt) override;
285 287
286 // Implements webrtc::VCMProtectionCallback. 288 // Implements webrtc::VCMProtectionCallback.
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 vie_encoder_->DeRegisterProcessThread(); 612 vie_encoder_->DeRegisterProcessThread();
611 VideoSendStream::RtpStateMap state_map; 613 VideoSendStream::RtpStateMap state_map;
612 send_stream_->DeRegisterProcessThread(); 614 send_stream_->DeRegisterProcessThread();
613 worker_queue_->PostTask( 615 worker_queue_->PostTask(
614 std::unique_ptr<rtc::QueuedTask>(new DestructAndGetRtpStateTask( 616 std::unique_ptr<rtc::QueuedTask>(new DestructAndGetRtpStateTask(
615 &state_map, std::move(send_stream_), &thread_sync_event_))); 617 &state_map, std::move(send_stream_), &thread_sync_event_)));
616 thread_sync_event_.Wait(rtc::Event::kForever); 618 thread_sync_event_.Wait(rtc::Event::kForever);
617 return state_map; 619 return state_map;
618 } 620 }
619 621
622 void VideoSendStream::SetTransportOverhead(
623 int transport_overhead_per_packet_byte) {
624 RTC_DCHECK_RUN_ON(&thread_checker_);
625 VideoSendStreamImpl* send_stream = send_stream_.get();
626 worker_queue_->PostTask([send_stream, transport_overhead_per_packet_byte] {
627 send_stream->SetTransportOverhead(transport_overhead_per_packet_byte);
628 });
629 }
630
620 bool VideoSendStream::DeliverRtcp(const uint8_t* packet, size_t length) { 631 bool VideoSendStream::DeliverRtcp(const uint8_t* packet, size_t length) {
621 // Called on a network thread. 632 // Called on a network thread.
622 return send_stream_->DeliverRtcp(packet, length); 633 return send_stream_->DeliverRtcp(packet, length);
623 } 634 }
624 635
625 void VideoSendStream::EnableEncodedFrameRecording( 636 void VideoSendStream::EnableEncodedFrameRecording(
626 const std::vector<rtc::PlatformFile>& files, 637 const std::vector<rtc::PlatformFile>& files,
627 size_t byte_limit) { 638 size_t byte_limit) {
628 send_stream_->EnableEncodedFrameRecording(files, byte_limit); 639 send_stream_->EnableEncodedFrameRecording(files, byte_limit);
629 } 640 }
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 rtp_rtcp->SetFecParameters(delta_params, key_params); 1116 rtp_rtcp->SetFecParameters(delta_params, key_params);
1106 rtp_rtcp->BitrateSent(&not_used, &module_video_rate, &module_fec_rate, 1117 rtp_rtcp->BitrateSent(&not_used, &module_video_rate, &module_fec_rate,
1107 &module_nack_rate); 1118 &module_nack_rate);
1108 *sent_video_rate_bps += module_video_rate; 1119 *sent_video_rate_bps += module_video_rate;
1109 *sent_nack_rate_bps += module_nack_rate; 1120 *sent_nack_rate_bps += module_nack_rate;
1110 *sent_fec_rate_bps += module_fec_rate; 1121 *sent_fec_rate_bps += module_fec_rate;
1111 } 1122 }
1112 return 0; 1123 return 0;
1113 } 1124 }
1114 1125
1126 void VideoSendStreamImpl::SetTransportOverhead(
1127 int transport_overhead_per_packet_byte) {
1128 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
stefan-webrtc 2016/11/02 13:21:43 You can remove {}
michaelt 2016/11/02 13:35:34 Acknowledged.
1129 rtp_rtcp->SetTransportOverhead(transport_overhead_per_packet_byte);
1130 }
1131 }
1132
1115 } // namespace internal 1133 } // namespace internal
1116 } // namespace webrtc 1134 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698