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

Side by Side Diff: webrtc/video_engine/vie_encoder.cc

Issue 1412293003: Allow pacer to boost bitrate in order to meet time constraints. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Cast Created 5 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/modules/pacing/paced_sender_unittest.cc ('k') | no next file » | 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) 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 } 320 }
321 if (target_delay_ms_ > 0) { 321 if (target_delay_ms_ > 0) {
322 // Buffered mode. 322 // Buffered mode.
323 // TODO(pwestin): Workaround until nack is configured as a time and not 323 // TODO(pwestin): Workaround until nack is configured as a time and not
324 // number of packets. 324 // number of packets.
325 return pacer_->QueueInMs() >= 325 return pacer_->QueueInMs() >=
326 std::max( 326 std::max(
327 static_cast<int>(target_delay_ms_ * kEncoderPausePacerMargin), 327 static_cast<int>(target_delay_ms_ * kEncoderPausePacerMargin),
328 kMinPacingDelayMs); 328 kMinPacingDelayMs);
329 } 329 }
330 if (pacer_->ExpectedQueueTimeMs() > PacedSender::kDefaultMaxQueueLengthMs) { 330 if (pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs) {
331 // Too much data in pacer queue, drop frame. 331 // Too much data in pacer queue, drop frame.
332 return true; 332 return true;
333 } 333 }
334 return !network_is_transmitting_; 334 return !network_is_transmitting_;
335 } 335 }
336 336
337 void ViEEncoder::TraceFrameDropStart() { 337 void ViEEncoder::TraceFrameDropStart() {
338 // Start trace event only on the first frame after encoder is paused. 338 // Start trace event only on the first frame after encoder is paused.
339 if (!encoder_paused_and_dropped_frame_) { 339 if (!encoder_paused_and_dropped_frame_) {
340 TRACE_EVENT_ASYNC_BEGIN0("webrtc", "EncoderPaused", this); 340 TRACE_EVENT_ASYNC_BEGIN0("webrtc", "EncoderPaused", this);
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 const uint32_t width, 647 const uint32_t width,
648 const uint32_t height) { 648 const uint32_t height) {
649 return vpm_->SetTargetResolution(width, height, frame_rate); 649 return vpm_->SetTargetResolution(width, height, frame_rate);
650 } 650 }
651 651
652 void QMVideoSettingsCallback::SetTargetFramerate(int frame_rate) { 652 void QMVideoSettingsCallback::SetTargetFramerate(int frame_rate) {
653 vpm_->SetTargetFramerate(frame_rate); 653 vpm_->SetTargetFramerate(frame_rate);
654 } 654 }
655 655
656 } // namespace webrtc 656 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/pacing/paced_sender_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698