| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 #include "webrtc/modules/video_coding/jitter_buffer.h" | 10 #include "webrtc/modules/video_coding/jitter_buffer.h" |
| (...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 missing_sequence_numbers_.erase( | 1187 missing_sequence_numbers_.erase( |
| 1188 missing_sequence_numbers_.begin(), | 1188 missing_sequence_numbers_.begin(), |
| 1189 missing_sequence_numbers_.upper_bound(last_decoded_sequence_number)); | 1189 missing_sequence_numbers_.upper_bound(last_decoded_sequence_number)); |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 int64_t VCMJitterBuffer::LastDecodedTimestamp() const { | 1192 int64_t VCMJitterBuffer::LastDecodedTimestamp() const { |
| 1193 CriticalSectionScoped cs(crit_sect_); | 1193 CriticalSectionScoped cs(crit_sect_); |
| 1194 return last_decoded_state_.time_stamp(); | 1194 return last_decoded_state_.time_stamp(); |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 void VCMJitterBuffer::RenderBufferSize(uint32_t* timestamp_start, | |
| 1198 uint32_t* timestamp_end) { | |
| 1199 CriticalSectionScoped cs(crit_sect_); | |
| 1200 CleanUpOldOrEmptyFrames(); | |
| 1201 *timestamp_start = 0; | |
| 1202 *timestamp_end = 0; | |
| 1203 if (decodable_frames_.empty()) { | |
| 1204 return; | |
| 1205 } | |
| 1206 *timestamp_start = decodable_frames_.Front()->TimeStamp(); | |
| 1207 *timestamp_end = decodable_frames_.Back()->TimeStamp(); | |
| 1208 } | |
| 1209 | |
| 1210 void VCMJitterBuffer::RegisterStatsCallback( | 1197 void VCMJitterBuffer::RegisterStatsCallback( |
| 1211 VCMReceiveStatisticsCallback* callback) { | 1198 VCMReceiveStatisticsCallback* callback) { |
| 1212 CriticalSectionScoped cs(crit_sect_); | 1199 CriticalSectionScoped cs(crit_sect_); |
| 1213 stats_callback_ = callback; | 1200 stats_callback_ = callback; |
| 1214 } | 1201 } |
| 1215 | 1202 |
| 1216 VCMFrameBuffer* VCMJitterBuffer::GetEmptyFrame() { | 1203 VCMFrameBuffer* VCMJitterBuffer::GetEmptyFrame() { |
| 1217 if (free_frames_.empty()) { | 1204 if (free_frames_.empty()) { |
| 1218 if (!TryToIncreaseJitterBufferSize()) { | 1205 if (!TryToIncreaseJitterBufferSize()) { |
| 1219 return NULL; | 1206 return NULL; |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1391 if (nack_module_) | 1378 if (nack_module_) |
| 1392 return nack_module_->TimeUntilNextProcess(); | 1379 return nack_module_->TimeUntilNextProcess(); |
| 1393 return std::numeric_limits<int64_t>::max(); | 1380 return std::numeric_limits<int64_t>::max(); |
| 1394 } | 1381 } |
| 1395 | 1382 |
| 1396 void VCMJitterBuffer::Process() { | 1383 void VCMJitterBuffer::Process() { |
| 1397 if (nack_module_) | 1384 if (nack_module_) |
| 1398 nack_module_->Process(); | 1385 nack_module_->Process(); |
| 1399 } | 1386 } |
| 1400 } // namespace webrtc | 1387 } // namespace webrtc |
| OLD | NEW |