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

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 and reordering of params 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 sendCodec->codecType == kVideoCodecVP8
111 : sendCodec->codecSpecific.VP8.numberOfTemporalLayers; 111 ? sendCodec->codecSpecific.VP8.numberOfTemporalLayers
112 : (sendCodec->codecType == kVideoCodecVP9
113 ? sendCodec->codecSpecific.VP9.numberOfTemporalLayers
114 : 1);
stefan-webrtc 2015/10/01 08:45:59 Please write this in a more readable way.
ivica 2015/10/01 09:29:20 Done. Used ifs instead.
112 // If we have screensharing and we have layers, we disable frame dropper. 115 // If we have screensharing and we have layers, we disable frame dropper.
113 bool disable_frame_dropper = 116 bool disable_frame_dropper =
114 numLayers > 1 && sendCodec->mode == kScreensharing; 117 (numLayers > 1 && sendCodec->mode == kScreensharing) ||
118 sendCodec->forceDisableWrapperFrameDropper;
115 if (disable_frame_dropper) { 119 if (disable_frame_dropper) {
116 _mediaOpt.EnableFrameDropper(false); 120 _mediaOpt.EnableFrameDropper(false);
117 } else if (frame_dropper_enabled_) { 121 } else if (frame_dropper_enabled_) {
118 _mediaOpt.EnableFrameDropper(true); 122 _mediaOpt.EnableFrameDropper(true);
119 } 123 }
120 _nextFrameTypes.clear(); 124 _nextFrameTypes.clear();
121 _nextFrameTypes.resize(VCM_MAX(sendCodec->numberOfSimulcastStreams, 1), 125 _nextFrameTypes.resize(VCM_MAX(sendCodec->numberOfSimulcastStreams, 1),
122 kVideoFrameDelta); 126 kVideoFrameDelta);
123 127
124 _mediaOpt.SetEncodingData(sendCodec->codecType, 128 _mediaOpt.SetEncodingData(sendCodec->codecType,
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 int window_bps = std::max(threshold_bps / 10, 10000); 392 int window_bps = std::max(threshold_bps / 10, 10000);
389 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); 393 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps);
390 } 394 }
391 395
392 bool VideoSender::VideoSuspended() const { 396 bool VideoSender::VideoSuspended() const {
393 rtc::CritScope lock(&send_crit_); 397 rtc::CritScope lock(&send_crit_);
394 return _mediaOpt.IsVideoSuspended(); 398 return _mediaOpt.IsVideoSuspended();
395 } 399 }
396 } // namespace vcm 400 } // namespace vcm
397 } // namespace webrtc 401 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698