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

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

Issue 2437503004: Set actual transport overhead in rtp_rtcp (Closed)
Patch Set: Rename SignalTransportOverheadChanged to UpdateTransportOverhead. 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
« no previous file with comments | « webrtc/video/video_send_stream.h ('k') | webrtc/video/video_send_stream_tests.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) 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);
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(int transport_overhead_per_packet) {
623 RTC_DCHECK_RUN_ON(&thread_checker_);
624 VideoSendStreamImpl* send_stream = send_stream_.get();
625 worker_queue_->PostTask([send_stream, transport_overhead_per_packet] {
626 send_stream->SetTransportOverhead(transport_overhead_per_packet);
627 });
628 }
629
620 bool VideoSendStream::DeliverRtcp(const uint8_t* packet, size_t length) { 630 bool VideoSendStream::DeliverRtcp(const uint8_t* packet, size_t length) {
621 // Called on a network thread. 631 // Called on a network thread.
622 return send_stream_->DeliverRtcp(packet, length); 632 return send_stream_->DeliverRtcp(packet, length);
623 } 633 }
624 634
625 void VideoSendStream::EnableEncodedFrameRecording( 635 void VideoSendStream::EnableEncodedFrameRecording(
626 const std::vector<rtc::PlatformFile>& files, 636 const std::vector<rtc::PlatformFile>& files,
627 size_t byte_limit) { 637 size_t byte_limit) {
628 send_stream_->EnableEncodedFrameRecording(files, byte_limit); 638 send_stream_->EnableEncodedFrameRecording(files, byte_limit);
629 } 639 }
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 rtp_rtcp->SetFecParameters(*delta_params, *key_params); 1125 rtp_rtcp->SetFecParameters(*delta_params, *key_params);
1116 rtp_rtcp->BitrateSent(&not_used, &module_video_rate, &module_fec_rate, 1126 rtp_rtcp->BitrateSent(&not_used, &module_video_rate, &module_fec_rate,
1117 &module_nack_rate); 1127 &module_nack_rate);
1118 *sent_video_rate_bps += module_video_rate; 1128 *sent_video_rate_bps += module_video_rate;
1119 *sent_nack_rate_bps += module_nack_rate; 1129 *sent_nack_rate_bps += module_nack_rate;
1120 *sent_fec_rate_bps += module_fec_rate; 1130 *sent_fec_rate_bps += module_fec_rate;
1121 } 1131 }
1122 return 0; 1132 return 0;
1123 } 1133 }
1124 1134
1135 void VideoSendStreamImpl::SetTransportOverhead(
1136 int transport_overhead_per_packet) {
1137 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
1138 rtp_rtcp->SetTransportOverhead(transport_overhead_per_packet);
1139 }
1140
1125 } // namespace internal 1141 } // namespace internal
1126 } // namespace webrtc 1142 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_send_stream.h ('k') | webrtc/video/video_send_stream_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698