OLD | NEW |
---|---|
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 Loading... | |
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) |
stefan-webrtc
2015/10/01 09:58:04
{} on all if/else/else ifs since when it's multipl
ivica
2015/10/01 11:17:51
Done.
| |
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 | |
112 // If we have screensharing and we have layers, we disable frame dropper. | 117 // If we have screensharing and we have layers, we disable frame dropper. |
113 bool disable_frame_dropper = | 118 bool disable_frame_dropper = |
114 numLayers > 1 && sendCodec->mode == kScreensharing; | 119 (numLayers > 1 && sendCodec->mode == kScreensharing) || |
120 sendCodec->disableGenericBitrateFrameDropper; | |
115 if (disable_frame_dropper) { | 121 if (disable_frame_dropper) { |
116 _mediaOpt.EnableFrameDropper(false); | 122 _mediaOpt.EnableFrameDropper(false); |
117 } else if (frame_dropper_enabled_) { | 123 } else if (frame_dropper_enabled_) { |
118 _mediaOpt.EnableFrameDropper(true); | 124 _mediaOpt.EnableFrameDropper(true); |
119 } | 125 } |
120 _nextFrameTypes.clear(); | 126 _nextFrameTypes.clear(); |
121 _nextFrameTypes.resize(VCM_MAX(sendCodec->numberOfSimulcastStreams, 1), | 127 _nextFrameTypes.resize(VCM_MAX(sendCodec->numberOfSimulcastStreams, 1), |
122 kVideoFrameDelta); | 128 kVideoFrameDelta); |
123 | 129 |
124 _mediaOpt.SetEncodingData(sendCodec->codecType, | 130 _mediaOpt.SetEncodingData(sendCodec->codecType, |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
388 int window_bps = std::max(threshold_bps / 10, 10000); | 394 int window_bps = std::max(threshold_bps / 10, 10000); |
389 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); | 395 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); |
390 } | 396 } |
391 | 397 |
392 bool VideoSender::VideoSuspended() const { | 398 bool VideoSender::VideoSuspended() const { |
393 rtc::CritScope lock(&send_crit_); | 399 rtc::CritScope lock(&send_crit_); |
394 return _mediaOpt.IsVideoSuspended(); | 400 return _mediaOpt.IsVideoSuspended(); |
395 } | 401 } |
396 } // namespace vcm | 402 } // namespace vcm |
397 } // namespace webrtc | 403 } // namespace webrtc |
OLD | NEW |