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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // Allow VideoSender to be created on one thread but used on another, post | 46 // Allow VideoSender to be created on one thread but used on another, post |
47 // construction. This is currently how this class is being used by at least | 47 // construction. This is currently how this class is being used by at least |
48 // one external project (diffractor). | 48 // one external project (diffractor). |
49 _mediaOpt.EnableQM(qm_settings_callback_ != nullptr); | 49 _mediaOpt.EnableQM(qm_settings_callback_ != nullptr); |
50 _mediaOpt.Reset(); | 50 _mediaOpt.Reset(); |
51 main_thread_.DetachFromThread(); | 51 main_thread_.DetachFromThread(); |
52 } | 52 } |
53 | 53 |
54 VideoSender::~VideoSender() {} | 54 VideoSender::~VideoSender() {} |
55 | 55 |
56 int32_t VideoSender::Process() { | 56 void VideoSender::Process() { |
57 int32_t returnValue = VCM_OK; | |
58 | |
59 if (_sendStatsTimer.TimeUntilProcess() == 0) { | 57 if (_sendStatsTimer.TimeUntilProcess() == 0) { |
60 _sendStatsTimer.Processed(); | 58 _sendStatsTimer.Processed(); |
61 CriticalSectionScoped cs(process_crit_sect_.get()); | 59 CriticalSectionScoped cs(process_crit_sect_.get()); |
62 if (_sendStatsCallback != nullptr) { | 60 if (_sendStatsCallback != nullptr) { |
63 uint32_t bitRate = _mediaOpt.SentBitRate(); | 61 uint32_t bitRate = _mediaOpt.SentBitRate(); |
64 uint32_t frameRate = _mediaOpt.SentFrameRate(); | 62 uint32_t frameRate = _mediaOpt.SentFrameRate(); |
65 _sendStatsCallback->SendStatistics(bitRate, frameRate); | 63 _sendStatsCallback->SendStatistics(bitRate, frameRate); |
66 } | 64 } |
67 } | 65 } |
68 | 66 |
69 { | 67 { |
70 rtc::CritScope cs(¶ms_crit_); | 68 rtc::CritScope cs(¶ms_crit_); |
71 // Force an encoder parameters update, so that incoming frame rate is | 69 // Force an encoder parameters update, so that incoming frame rate is |
72 // updated even if bandwidth hasn't changed. | 70 // updated even if bandwidth hasn't changed. |
73 encoder_params_.input_frame_rate = _mediaOpt.InputFrameRate(); | 71 encoder_params_.input_frame_rate = _mediaOpt.InputFrameRate(); |
74 } | 72 } |
75 | |
76 return returnValue; | |
77 } | 73 } |
78 | 74 |
79 int64_t VideoSender::TimeUntilNextProcess() { | 75 int64_t VideoSender::TimeUntilNextProcess() { |
80 return _sendStatsTimer.TimeUntilProcess(); | 76 return _sendStatsTimer.TimeUntilProcess(); |
81 } | 77 } |
82 | 78 |
83 // Register the send codec to be used. | 79 // Register the send codec to be used. |
84 int32_t VideoSender::RegisterSendCodec(const VideoCodec* sendCodec, | 80 int32_t VideoSender::RegisterSendCodec(const VideoCodec* sendCodec, |
85 uint32_t numberOfCores, | 81 uint32_t numberOfCores, |
86 uint32_t maxPayloadSize) { | 82 uint32_t maxPayloadSize) { |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 // 10 kbps. | 369 // 10 kbps. |
374 int window_bps = std::max(threshold_bps / 10, 10000); | 370 int window_bps = std::max(threshold_bps / 10, 10000); |
375 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); | 371 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); |
376 } | 372 } |
377 | 373 |
378 bool VideoSender::VideoSuspended() const { | 374 bool VideoSender::VideoSuspended() const { |
379 return _mediaOpt.IsVideoSuspended(); | 375 return _mediaOpt.IsVideoSuspended(); |
380 } | 376 } |
381 } // namespace vcm | 377 } // namespace vcm |
382 } // namespace webrtc | 378 } // namespace webrtc |
OLD | NEW |