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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 _keyRequestTimer.Processed(); | 87 _keyRequestTimer.Processed(); |
88 bool request_key_frame = false; | 88 bool request_key_frame = false; |
89 { | 89 { |
90 rtc::CritScope cs(&process_crit_); | 90 rtc::CritScope cs(&process_crit_); |
91 request_key_frame = _scheduleKeyRequest && _frameTypeCallback != nullptr; | 91 request_key_frame = _scheduleKeyRequest && _frameTypeCallback != nullptr; |
92 } | 92 } |
93 if (request_key_frame) | 93 if (request_key_frame) |
94 RequestKeyFrame(); | 94 RequestKeyFrame(); |
95 } | 95 } |
96 | 96 |
97 if (_receiver.TimeUntilNextProcess() == 0) { | |
98 _receiver.Process(); | |
99 } | |
100 | |
101 // Packet retransmission requests | 97 // Packet retransmission requests |
102 // TODO(holmer): Add API for changing Process interval and make sure it's | 98 // TODO(holmer): Add API for changing Process interval and make sure it's |
103 // disabled when NACK is off. | 99 // disabled when NACK is off. |
104 if (_retransmissionTimer.TimeUntilProcess() == 0) { | 100 if (_retransmissionTimer.TimeUntilProcess() == 0) { |
105 _retransmissionTimer.Processed(); | 101 _retransmissionTimer.Processed(); |
106 bool callback_registered = false; | 102 bool callback_registered = false; |
107 uint16_t length; | 103 uint16_t length; |
108 { | 104 { |
109 rtc::CritScope cs(&process_crit_); | 105 rtc::CritScope cs(&process_crit_); |
110 length = max_nack_list_size_; | 106 length = max_nack_list_size_; |
(...skipping 20 matching lines...) Expand all Loading... |
131 int64_t VideoReceiver::TimeUntilNextProcess() { | 127 int64_t VideoReceiver::TimeUntilNextProcess() { |
132 int64_t timeUntilNextProcess = _receiveStatsTimer.TimeUntilProcess(); | 128 int64_t timeUntilNextProcess = _receiveStatsTimer.TimeUntilProcess(); |
133 if (_receiver.NackMode() != kNoNack) { | 129 if (_receiver.NackMode() != kNoNack) { |
134 // We need a Process call more often if we are relying on | 130 // We need a Process call more often if we are relying on |
135 // retransmissions | 131 // retransmissions |
136 timeUntilNextProcess = | 132 timeUntilNextProcess = |
137 VCM_MIN(timeUntilNextProcess, _retransmissionTimer.TimeUntilProcess()); | 133 VCM_MIN(timeUntilNextProcess, _retransmissionTimer.TimeUntilProcess()); |
138 } | 134 } |
139 timeUntilNextProcess = | 135 timeUntilNextProcess = |
140 VCM_MIN(timeUntilNextProcess, _keyRequestTimer.TimeUntilProcess()); | 136 VCM_MIN(timeUntilNextProcess, _keyRequestTimer.TimeUntilProcess()); |
141 timeUntilNextProcess = | |
142 VCM_MIN(timeUntilNextProcess, _receiver.TimeUntilNextProcess()); | |
143 | 137 |
144 return timeUntilNextProcess; | 138 return timeUntilNextProcess; |
145 } | 139 } |
146 | 140 |
147 int32_t VideoReceiver::SetReceiveChannelParameters(int64_t rtt) { | 141 int32_t VideoReceiver::SetReceiveChannelParameters(int64_t rtt) { |
148 rtc::CritScope cs(&receive_crit_); | 142 rtc::CritScope cs(&receive_crit_); |
149 _receiver.UpdateRtt(rtt); | 143 _receiver.UpdateRtt(rtt); |
150 return 0; | 144 return 0; |
151 } | 145 } |
152 | 146 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 _receiver.SetNackSettings(max_nack_list_size, max_packet_age_to_nack, | 496 _receiver.SetNackSettings(max_nack_list_size, max_packet_age_to_nack, |
503 max_incomplete_time_ms); | 497 max_incomplete_time_ms); |
504 } | 498 } |
505 | 499 |
506 int VideoReceiver::SetMinReceiverDelay(int desired_delay_ms) { | 500 int VideoReceiver::SetMinReceiverDelay(int desired_delay_ms) { |
507 return _receiver.SetMinReceiverDelay(desired_delay_ms); | 501 return _receiver.SetMinReceiverDelay(desired_delay_ms); |
508 } | 502 } |
509 | 503 |
510 } // namespace vcm | 504 } // namespace vcm |
511 } // namespace webrtc | 505 } // namespace webrtc |
OLD | NEW |