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

Side by Side Diff: webrtc/modules/video_coding/video_sender.cc

Issue 1600973002: Initialize VideoEncoder objects asynchronously. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rename new_codec_settings Created 4 years, 11 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
« no previous file with comments | « webrtc/call/call_perf_tests.cc ('k') | webrtc/video/payload_router.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(&params_crit_); 160 rtc::CritScope params_lock(&params_crit_);
162 _encoder = nullptr; 161 _encoder = nullptr;
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « webrtc/call/call_perf_tests.cc ('k') | webrtc/video/payload_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698