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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 numLayers, maxPayloadSize); | 142 numLayers, maxPayloadSize); |
143 return VCM_OK; | 143 return VCM_OK; |
144 } | 144 } |
145 | 145 |
146 // Register an external decoder object. | 146 // Register an external decoder object. |
147 // This can not be used together with external decoder callbacks. | 147 // This can not be used together with external decoder callbacks. |
148 void VideoSender::RegisterExternalEncoder(VideoEncoder* externalEncoder, | 148 void VideoSender::RegisterExternalEncoder(VideoEncoder* externalEncoder, |
149 uint8_t payloadType, | 149 uint8_t payloadType, |
150 bool internalSource /*= false*/) { | 150 bool internalSource /*= false*/) { |
151 RTC_DCHECK(main_thread_.CalledOnValidThread()); | 151 RTC_DCHECK(main_thread_.CalledOnValidThread()); |
152 | |
153 rtc::CritScope lock(&encoder_crit_); | 152 rtc::CritScope lock(&encoder_crit_); |
154 | 153 |
155 if (externalEncoder == nullptr) { | 154 if (externalEncoder == nullptr) { |
156 bool wasSendCodec = false; | 155 bool wasSendCodec = false; |
157 RTC_CHECK( | 156 RTC_CHECK( |
158 _codecDataBase.DeregisterExternalEncoder(payloadType, &wasSendCodec)); | 157 _codecDataBase.DeregisterExternalEncoder(payloadType, &wasSendCodec)); |
159 if (wasSendCodec) { | 158 if (wasSendCodec) { |
160 // Make sure the VCM doesn't use the de-registered codec | 159 // Make sure the VCM doesn't use the de-registered codec |
161 rtc::CritScope params_lock(¶ms_crit_); | 160 rtc::CritScope params_lock(¶ms_crit_); |
162 _encoder = nullptr; | 161 _encoder = nullptr; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 // 10 kbps. | 372 // 10 kbps. |
374 int window_bps = std::max(threshold_bps / 10, 10000); | 373 int window_bps = std::max(threshold_bps / 10, 10000); |
375 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); | 374 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); |
376 } | 375 } |
377 | 376 |
378 bool VideoSender::VideoSuspended() const { | 377 bool VideoSender::VideoSuspended() const { |
379 return _mediaOpt.IsVideoSuspended(); | 378 return _mediaOpt.IsVideoSuspended(); |
380 } | 379 } |
381 } // namespace vcm | 380 } // namespace vcm |
382 } // namespace webrtc | 381 } // namespace webrtc |
OLD | NEW |