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

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: rebase master 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
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
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // Cache the current codec here so they can be fetched from this thread 99 // Cache the current codec here so they can be fetched from this thread
100 // without requiring the _sendCritSect lock. 100 // without requiring the _sendCritSect lock.
101 current_codec_ = *sendCodec; 101 current_codec_ = *sendCodec;
102 102
103 if (!ret) { 103 if (!ret) {
104 LOG(LS_ERROR) << "Failed to initialize set encoder with payload name '" 104 LOG(LS_ERROR) << "Failed to initialize set encoder with payload name '"
105 << sendCodec->plName << "'."; 105 << sendCodec->plName << "'.";
106 return VCM_CODEC_ERROR; 106 return VCM_CODEC_ERROR;
107 } 107 }
108 108
109 int numLayers = (sendCodec->codecType != kVideoCodecVP8) 109 int numLayers;
110 ? 1 110 if (sendCodec->codecType == kVideoCodecVP8) {
111 : sendCodec->codecSpecific.VP8.numberOfTemporalLayers; 111 numLayers = sendCodec->codecSpecific.VP8.numberOfTemporalLayers;
112 } else if (sendCodec->codecType == kVideoCodecVP9) {
113 numLayers = sendCodec->codecSpecific.VP9.numberOfTemporalLayers;
114 } else {
115 numLayers = 1;
116 }
117
112 // If we have screensharing and we have layers, we disable frame dropper. 118 // If we have screensharing and we have layers, we disable frame dropper.
113 bool disable_frame_dropper = 119 bool disable_frame_dropper =
114 numLayers > 1 && sendCodec->mode == kScreensharing; 120 (numLayers > 1 && sendCodec->mode == kScreensharing) ||
121 sendCodec->disableGenericBitrateFrameDropper;
115 if (disable_frame_dropper) { 122 if (disable_frame_dropper) {
116 _mediaOpt.EnableFrameDropper(false); 123 _mediaOpt.EnableFrameDropper(false);
117 } else if (frame_dropper_enabled_) { 124 } else if (frame_dropper_enabled_) {
118 _mediaOpt.EnableFrameDropper(true); 125 _mediaOpt.EnableFrameDropper(true);
119 } 126 }
120 _nextFrameTypes.clear(); 127 _nextFrameTypes.clear();
121 _nextFrameTypes.resize(VCM_MAX(sendCodec->numberOfSimulcastStreams, 1), 128 _nextFrameTypes.resize(VCM_MAX(sendCodec->numberOfSimulcastStreams, 1),
122 kVideoFrameDelta); 129 kVideoFrameDelta);
123 130
124 _mediaOpt.SetEncodingData(sendCodec->codecType, 131 _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); 388 int window_bps = std::max(threshold_bps / 10, 10000);
382 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); 389 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps);
383 } 390 }
384 391
385 bool VideoSender::VideoSuspended() const { 392 bool VideoSender::VideoSuspended() const {
386 rtc::CritScope lock(&send_crit_); 393 rtc::CritScope lock(&send_crit_);
387 return _mediaOpt.IsVideoSuspended(); 394 return _mediaOpt.IsVideoSuspended();
388 } 395 }
389 } // namespace vcm 396 } // namespace vcm
390 } // namespace webrtc 397 } // namespace webrtc
OLDNEW
« webrtc/config.h ('K') | « webrtc/config.cc ('k') | webrtc/video/screenshare_loopback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698