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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 _nextFrameTypes.resize(VCM_MAX(sendCodec->numberOfSimulcastStreams, 1), | 126 _nextFrameTypes.resize(VCM_MAX(sendCodec->numberOfSimulcastStreams, 1), |
127 kVideoFrameDelta); | 127 kVideoFrameDelta); |
128 | 128 |
129 _mediaOpt.SetEncodingData(sendCodec->codecType, sendCodec->maxBitrate * 1000, | 129 _mediaOpt.SetEncodingData(sendCodec->codecType, sendCodec->maxBitrate * 1000, |
130 sendCodec->startBitrate * 1000, sendCodec->width, | 130 sendCodec->startBitrate * 1000, sendCodec->width, |
131 sendCodec->height, sendCodec->maxFramerate, | 131 sendCodec->height, sendCodec->maxFramerate, |
132 numLayers, maxPayloadSize); | 132 numLayers, maxPayloadSize); |
133 return VCM_OK; | 133 return VCM_OK; |
134 } | 134 } |
135 | 135 |
136 const VideoCodec& VideoSender::GetSendCodec() const { | |
137 RTC_DCHECK(main_thread_.CalledOnValidThread()); | |
138 return current_codec_; | |
139 } | |
140 | |
141 int32_t VideoSender::SendCodecBlocking(VideoCodec* currentSendCodec) const { | |
142 rtc::CritScope lock(&send_crit_); | |
143 if (currentSendCodec == nullptr) { | |
144 return VCM_PARAMETER_ERROR; | |
145 } | |
146 return _codecDataBase.SendCodec(currentSendCodec) ? 0 : -1; | |
147 } | |
148 | |
149 VideoCodecType VideoSender::SendCodecBlocking() const { | |
150 rtc::CritScope lock(&send_crit_); | |
151 return _codecDataBase.SendCodec(); | |
152 } | |
153 | |
154 // Register an external decoder object. | 136 // Register an external decoder object. |
155 // This can not be used together with external decoder callbacks. | 137 // This can not be used together with external decoder callbacks. |
156 void VideoSender::RegisterExternalEncoder(VideoEncoder* externalEncoder, | 138 void VideoSender::RegisterExternalEncoder(VideoEncoder* externalEncoder, |
157 uint8_t payloadType, | 139 uint8_t payloadType, |
158 bool internalSource /*= false*/) { | 140 bool internalSource /*= false*/) { |
159 RTC_DCHECK(main_thread_.CalledOnValidThread()); | 141 RTC_DCHECK(main_thread_.CalledOnValidThread()); |
160 | 142 |
161 rtc::CritScope lock(&send_crit_); | 143 rtc::CritScope lock(&send_crit_); |
162 | 144 |
163 if (externalEncoder == nullptr) { | 145 if (externalEncoder == nullptr) { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // 10 kbps. | 343 // 10 kbps. |
362 int window_bps = std::max(threshold_bps / 10, 10000); | 344 int window_bps = std::max(threshold_bps / 10, 10000); |
363 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); | 345 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); |
364 } | 346 } |
365 | 347 |
366 bool VideoSender::VideoSuspended() const { | 348 bool VideoSender::VideoSuspended() const { |
367 return _mediaOpt.IsVideoSuspended(); | 349 return _mediaOpt.IsVideoSuspended(); |
368 } | 350 } |
369 } // namespace vcm | 351 } // namespace vcm |
370 } // namespace webrtc | 352 } // namespace webrtc |
OLD | NEW |