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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // Get codec config parameters | 177 // Get codec config parameters |
178 int32_t VideoSender::CodecConfigParameters(uint8_t* buffer, | 178 int32_t VideoSender::CodecConfigParameters(uint8_t* buffer, |
179 int32_t size) const { | 179 int32_t size) const { |
180 rtc::CritScope lock(&send_crit_); | 180 rtc::CritScope lock(&send_crit_); |
181 if (_encoder != nullptr) { | 181 if (_encoder != nullptr) { |
182 return _encoder->CodecConfigParameters(buffer, size); | 182 return _encoder->CodecConfigParameters(buffer, size); |
183 } | 183 } |
184 return VCM_UNINITIALIZED; | 184 return VCM_UNINITIALIZED; |
185 } | 185 } |
186 | 186 |
187 // TODO(andresp): Make const once media_opt is thread-safe and this has a | |
188 // pointer to it. | |
189 int32_t VideoSender::SentFrameCount(VCMFrameCount* frameCount) { | |
190 *frameCount = _mediaOpt.SentFrameCount(); | |
191 return VCM_OK; | |
192 } | |
193 | |
194 // Get encode bitrate | 187 // Get encode bitrate |
195 int VideoSender::Bitrate(unsigned int* bitrate) const { | 188 int VideoSender::Bitrate(unsigned int* bitrate) const { |
196 RTC_DCHECK(main_thread_.CalledOnValidThread()); | 189 RTC_DCHECK(main_thread_.CalledOnValidThread()); |
197 // Since we're running on the thread that's the only thread known to modify | 190 // Since we're running on the thread that's the only thread known to modify |
198 // the value of _encoder, we don't need to grab the lock here. | 191 // the value of _encoder, we don't need to grab the lock here. |
199 | 192 |
200 // return the bit rate which the encoder is set to | 193 // return the bit rate which the encoder is set to |
201 if (!_encoder) { | 194 if (!_encoder) { |
202 return VCM_UNINITIALIZED; | 195 return VCM_UNINITIALIZED; |
203 } | 196 } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 int window_bps = std::max(threshold_bps / 10, 10000); | 381 int window_bps = std::max(threshold_bps / 10, 10000); |
389 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); | 382 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); |
390 } | 383 } |
391 | 384 |
392 bool VideoSender::VideoSuspended() const { | 385 bool VideoSender::VideoSuspended() const { |
393 rtc::CritScope lock(&send_crit_); | 386 rtc::CritScope lock(&send_crit_); |
394 return _mediaOpt.IsVideoSuspended(); | 387 return _mediaOpt.IsVideoSuspended(); |
395 } | 388 } |
396 } // namespace vcm | 389 } // namespace vcm |
397 } // namespace webrtc | 390 } // namespace webrtc |
OLD | NEW |