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 | 10 |
11 #ifndef WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_ |
12 #define WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_ | 12 #define WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
15 #include <map> | 15 #include <map> |
16 #include <memory> | 16 #include <memory> |
17 #include <set> | 17 #include <set> |
18 #include <vector> | 18 #include <vector> |
19 | 19 |
20 #include "webrtc/base/constructormagic.h" | 20 #include "webrtc/base/constructormagic.h" |
| 21 #include "webrtc/base/criticalsection.h" |
21 #include "webrtc/base/thread_annotations.h" | 22 #include "webrtc/base/thread_annotations.h" |
22 #include "webrtc/modules/include/module_common_types.h" | 23 #include "webrtc/modules/include/module_common_types.h" |
23 #include "webrtc/modules/utility/include/process_thread.h" | 24 #include "webrtc/modules/utility/include/process_thread.h" |
24 #include "webrtc/modules/video_coding/include/video_coding.h" | 25 #include "webrtc/modules/video_coding/include/video_coding.h" |
25 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 26 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
26 #include "webrtc/modules/video_coding/decoding_state.h" | 27 #include "webrtc/modules/video_coding/decoding_state.h" |
27 #include "webrtc/modules/video_coding/inter_frame_delay.h" | 28 #include "webrtc/modules/video_coding/inter_frame_delay.h" |
28 #include "webrtc/modules/video_coding/jitter_buffer_common.h" | 29 #include "webrtc/modules/video_coding/jitter_buffer_common.h" |
29 #include "webrtc/modules/video_coding/jitter_estimator.h" | 30 #include "webrtc/modules/video_coding/jitter_estimator.h" |
30 #include "webrtc/modules/video_coding/nack_module.h" | 31 #include "webrtc/modules/video_coding/nack_module.h" |
31 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | |
32 #include "webrtc/typedefs.h" | 32 #include "webrtc/typedefs.h" |
33 | 33 |
34 namespace webrtc { | 34 namespace webrtc { |
35 | 35 |
36 enum VCMNackMode { kNack, kNoNack }; | 36 enum VCMNackMode { kNack, kNoNack }; |
37 | 37 |
38 // forward declarations | 38 // forward declarations |
39 class Clock; | 39 class Clock; |
40 class EventFactory; | 40 class EventFactory; |
41 class EventWrapper; | 41 class EventWrapper; |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 308 |
309 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 309 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
310 | 310 |
311 // Reset frame buffer and return it to free_frames_. | 311 // Reset frame buffer and return it to free_frames_. |
312 void RecycleFrameBuffer(VCMFrameBuffer* frame) | 312 void RecycleFrameBuffer(VCMFrameBuffer* frame) |
313 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 313 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
314 | 314 |
315 Clock* clock_; | 315 Clock* clock_; |
316 // If we are running (have started) or not. | 316 // If we are running (have started) or not. |
317 bool running_; | 317 bool running_; |
318 CriticalSectionWrapper* crit_sect_; | 318 rtc::CriticalSection crit_sect_; |
319 // Event to signal when we have a frame ready for decoder. | 319 // Event to signal when we have a frame ready for decoder. |
320 std::unique_ptr<EventWrapper> frame_event_; | 320 std::unique_ptr<EventWrapper> frame_event_; |
321 // Number of allocated frames. | 321 // Number of allocated frames. |
322 int max_number_of_frames_; | 322 int max_number_of_frames_; |
323 UnorderedFrameList free_frames_ GUARDED_BY(crit_sect_); | 323 UnorderedFrameList free_frames_ GUARDED_BY(crit_sect_); |
324 FrameList decodable_frames_ GUARDED_BY(crit_sect_); | 324 FrameList decodable_frames_ GUARDED_BY(crit_sect_); |
325 FrameList incomplete_frames_ GUARDED_BY(crit_sect_); | 325 FrameList incomplete_frames_ GUARDED_BY(crit_sect_); |
326 VCMDecodingState last_decoded_state_ GUARDED_BY(crit_sect_); | 326 VCMDecodingState last_decoded_state_ GUARDED_BY(crit_sect_); |
327 bool first_packet_since_reset_; | 327 bool first_packet_since_reset_; |
328 | 328 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 float average_packets_per_frame_; | 371 float average_packets_per_frame_; |
372 // average_packets_per_frame converges fast if we have fewer than this many | 372 // average_packets_per_frame converges fast if we have fewer than this many |
373 // frames. | 373 // frames. |
374 int frame_counter_; | 374 int frame_counter_; |
375 | 375 |
376 RTC_DISALLOW_COPY_AND_ASSIGN(VCMJitterBuffer); | 376 RTC_DISALLOW_COPY_AND_ASSIGN(VCMJitterBuffer); |
377 }; | 377 }; |
378 } // namespace webrtc | 378 } // namespace webrtc |
379 | 379 |
380 #endif // WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_ | 380 #endif // WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_ |
OLD | NEW |