| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 // SetSendCodec succeeded, _encoder should be set. | 98 // SetSendCodec succeeded, _encoder should be set. |
| 99 RTC_DCHECK(_encoder); | 99 RTC_DCHECK(_encoder); |
| 100 | 100 |
| 101 int numLayers; | 101 int numLayers; |
| 102 if (sendCodec->codecType == kVideoCodecVP8) { | 102 if (sendCodec->codecType == kVideoCodecVP8) { |
| 103 numLayers = sendCodec->VP8().numberOfTemporalLayers; | 103 numLayers = sendCodec->VP8().numberOfTemporalLayers; |
| 104 } else if (sendCodec->codecType == kVideoCodecVP9) { | 104 } else if (sendCodec->codecType == kVideoCodecVP9) { |
| 105 numLayers = sendCodec->VP9().numberOfTemporalLayers; | 105 numLayers = sendCodec->VP9().numberOfTemporalLayers; |
| 106 } else if (sendCodec->codecType == kVideoCodecGeneric && | |
| 107 sendCodec->numberOfSimulcastStreams > 0) { | |
| 108 // This is mainly for unit testing, disabling frame dropping. | |
| 109 // TODO(sprang): Add a better way to disable frame dropping. | |
| 110 numLayers = sendCodec->simulcastStream[0].numberOfTemporalLayers; | |
| 111 } else { | 106 } else { |
| 112 numLayers = 1; | 107 numLayers = 1; |
| 113 } | 108 } |
| 114 | 109 |
| 115 // If we have screensharing and we have layers, we disable frame dropper. | 110 // If we have screensharing and we have layers, we disable frame dropper. |
| 116 bool disable_frame_dropper = | 111 bool disable_frame_dropper = |
| 117 numLayers > 1 && sendCodec->mode == kScreensharing; | 112 numLayers > 1 && sendCodec->mode == kScreensharing; |
| 118 if (disable_frame_dropper) { | 113 if (disable_frame_dropper) { |
| 119 _mediaOpt.EnableFrameDropper(false); | 114 _mediaOpt.EnableFrameDropper(false); |
| 120 } else if (frame_dropper_enabled_) { | 115 } else if (frame_dropper_enabled_) { |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 } | 393 } |
| 399 | 394 |
| 400 int32_t VideoSender::EnableFrameDropper(bool enable) { | 395 int32_t VideoSender::EnableFrameDropper(bool enable) { |
| 401 rtc::CritScope lock(&encoder_crit_); | 396 rtc::CritScope lock(&encoder_crit_); |
| 402 frame_dropper_enabled_ = enable; | 397 frame_dropper_enabled_ = enable; |
| 403 _mediaOpt.EnableFrameDropper(enable); | 398 _mediaOpt.EnableFrameDropper(enable); |
| 404 return VCM_OK; | 399 return VCM_OK; |
| 405 } | 400 } |
| 406 } // namespace vcm | 401 } // namespace vcm |
| 407 } // namespace webrtc | 402 } // namespace webrtc |
| OLD | NEW |