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

Side by Side Diff: webrtc/modules/video_coding/main/source/video_sender.cc

Issue 1351693005: Read the number of TLs for VP9 too + cleanup (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Use field trial Created 5 years, 2 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
« no previous file with comments | « no previous file | webrtc/video/video_loopback.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 10
11 #include "webrtc/common_types.h" 11 #include "webrtc/common_types.h"
12 12
13 #include <algorithm> // std::max 13 #include <algorithm> // std::max
14 14
15 #include "webrtc/base/checks.h" 15 #include "webrtc/base/checks.h"
16 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 16 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
17 #include "webrtc/modules/video_coding/codecs/interface/video_codec_interface.h" 17 #include "webrtc/modules/video_coding/codecs/interface/video_codec_interface.h"
18 #include "webrtc/modules/video_coding/main/source/encoded_frame.h" 18 #include "webrtc/modules/video_coding/main/source/encoded_frame.h"
19 #include "webrtc/modules/video_coding/main/source/video_coding_impl.h" 19 #include "webrtc/modules/video_coding/main/source/video_coding_impl.h"
20 #include "webrtc/modules/video_coding/utility/include/quality_scaler.h" 20 #include "webrtc/modules/video_coding/utility/include/quality_scaler.h"
21 #include "webrtc/system_wrappers/interface/clock.h" 21 #include "webrtc/system_wrappers/interface/clock.h"
22 #include "webrtc/system_wrappers/interface/field_trial.h"
22 #include "webrtc/system_wrappers/interface/logging.h" 23 #include "webrtc/system_wrappers/interface/logging.h"
23 24
24 namespace webrtc { 25 namespace webrtc {
25 namespace vcm { 26 namespace vcm {
26 27
27 VideoSender::VideoSender(Clock* clock, 28 VideoSender::VideoSender(Clock* clock,
28 EncodedImageCallback* post_encode_callback, 29 EncodedImageCallback* post_encode_callback,
29 VideoEncoderRateObserver* encoder_rate_observer, 30 VideoEncoderRateObserver* encoder_rate_observer,
30 VCMQMSettingsCallback* qm_settings_callback) 31 VCMQMSettingsCallback* qm_settings_callback)
31 : clock_(clock), 32 : clock_(clock),
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // Cache the current codec here so they can be fetched from this thread 100 // Cache the current codec here so they can be fetched from this thread
100 // without requiring the _sendCritSect lock. 101 // without requiring the _sendCritSect lock.
101 current_codec_ = *sendCodec; 102 current_codec_ = *sendCodec;
102 103
103 if (!ret) { 104 if (!ret) {
104 LOG(LS_ERROR) << "Failed to initialize set encoder with payload name '" 105 LOG(LS_ERROR) << "Failed to initialize set encoder with payload name '"
105 << sendCodec->plName << "'."; 106 << sendCodec->plName << "'.";
106 return VCM_CODEC_ERROR; 107 return VCM_CODEC_ERROR;
107 } 108 }
108 109
109 int numLayers = (sendCodec->codecType != kVideoCodecVP8) 110 int numLayers;
110 ? 1 111 if (sendCodec->codecType == kVideoCodecVP8) {
111 : sendCodec->codecSpecific.VP8.numberOfTemporalLayers; 112 numLayers = sendCodec->codecSpecific.VP8.numberOfTemporalLayers;
113 } else if (sendCodec->codecType == kVideoCodecVP9) {
114 numLayers = sendCodec->codecSpecific.VP9.numberOfTemporalLayers;
115 } else {
116 numLayers = 1;
117 }
118
112 // If we have screensharing and we have layers, we disable frame dropper. 119 // If we have screensharing and we have layers, we disable frame dropper.
113 bool disable_frame_dropper = 120 bool disable_frame_dropper =
114 numLayers > 1 && sendCodec->mode == kScreensharing; 121 (numLayers > 1 && sendCodec->mode == kScreensharing) ||
122 (field_trial::FindFullName("WebRTC-DisableGenericBitrateFrameDropper")
pbos-webrtc 2015/10/07 11:27:55 Can we call this WebRTC-Test- or so? I'd like to d
ivica 2015/10/07 11:32:52 Now when it's so simple, I'm not sure if it's nece
123 == "Enabled");
115 if (disable_frame_dropper) { 124 if (disable_frame_dropper) {
116 _mediaOpt.EnableFrameDropper(false); 125 _mediaOpt.EnableFrameDropper(false);
117 } else if (frame_dropper_enabled_) { 126 } else if (frame_dropper_enabled_) {
118 _mediaOpt.EnableFrameDropper(true); 127 _mediaOpt.EnableFrameDropper(true);
119 } 128 }
120 _nextFrameTypes.clear(); 129 _nextFrameTypes.clear();
121 _nextFrameTypes.resize(VCM_MAX(sendCodec->numberOfSimulcastStreams, 1), 130 _nextFrameTypes.resize(VCM_MAX(sendCodec->numberOfSimulcastStreams, 1),
122 kVideoFrameDelta); 131 kVideoFrameDelta);
123 132
124 _mediaOpt.SetEncodingData(sendCodec->codecType, 133 _mediaOpt.SetEncodingData(sendCodec->codecType,
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 int window_bps = std::max(threshold_bps / 10, 10000); 390 int window_bps = std::max(threshold_bps / 10, 10000);
382 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); 391 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps);
383 } 392 }
384 393
385 bool VideoSender::VideoSuspended() const { 394 bool VideoSender::VideoSuspended() const {
386 rtc::CritScope lock(&send_crit_); 395 rtc::CritScope lock(&send_crit_);
387 return _mediaOpt.IsVideoSuspended(); 396 return _mediaOpt.IsVideoSuspended();
388 } 397 }
389 } // namespace vcm 398 } // namespace vcm
390 } // namespace webrtc 399 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/video/video_loopback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698