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

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: 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
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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 } 351 }
352 if (target_delay_ms_ > 0) { 352 if (target_delay_ms_ > 0) {
353 // Buffered mode. 353 // Buffered mode.
354 // TODO(pwestin): Workaround until nack is configured as a time and not 354 // TODO(pwestin): Workaround until nack is configured as a time and not
355 // number of packets. 355 // number of packets.
356 return pacer_->QueueInMs() >= 356 return pacer_->QueueInMs() >=
357 std::max( 357 std::max(
358 static_cast<int>(target_delay_ms_ * kEncoderPausePacerMargin), 358 static_cast<int>(target_delay_ms_ * kEncoderPausePacerMargin),
359 kMinPacingDelayMs); 359 kMinPacingDelayMs);
360 } 360 }
361 if (pacer_->ExpectedQueueTimeMs() > PacedSender::kDefaultMaxQueueLengthMs) { 361 if (pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs) {
362 // Too much data in pacer queue, drop frame. 362 // Too much data in pacer queue, drop frame.
363 return true; 363 return true;
364 } 364 }
365 return !network_is_transmitting_; 365 return !network_is_transmitting_;
366 } 366 }
367 367
368 void ViEEncoder::TraceFrameDropStart() { 368 void ViEEncoder::TraceFrameDropStart() {
369 // Start trace event only on the first frame after encoder is paused. 369 // Start trace event only on the first frame after encoder is paused.
370 if (!encoder_paused_and_dropped_frame_) { 370 if (!encoder_paused_and_dropped_frame_) {
371 TRACE_EVENT_ASYNC_BEGIN0("webrtc", "EncoderPaused", this); 371 TRACE_EVENT_ASYNC_BEGIN0("webrtc", "EncoderPaused", this);
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 const uint32_t width, 714 const uint32_t width,
715 const uint32_t height) { 715 const uint32_t height) {
716 return vpm_->SetTargetResolution(width, height, frame_rate); 716 return vpm_->SetTargetResolution(width, height, frame_rate);
717 } 717 }
718 718
719 void QMVideoSettingsCallback::SetTargetFramerate(int frame_rate) { 719 void QMVideoSettingsCallback::SetTargetFramerate(int frame_rate) {
720 vpm_->SetTargetFramerate(frame_rate); 720 vpm_->SetTargetFramerate(frame_rate);
721 } 721 }
722 722
723 } // namespace webrtc 723 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698