OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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_RECEIVER_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_RECEIVER_H_ |
12 #define WEBRTC_MODULES_VIDEO_CODING_RECEIVER_H_ | 12 #define WEBRTC_MODULES_VIDEO_CODING_RECEIVER_H_ |
13 | 13 |
| 14 #include <memory> |
14 #include <vector> | 15 #include <vector> |
15 | 16 |
16 #include "webrtc/modules/video_coding/jitter_buffer.h" | 17 #include "webrtc/modules/video_coding/jitter_buffer.h" |
17 #include "webrtc/modules/video_coding/packet.h" | 18 #include "webrtc/modules/video_coding/packet.h" |
18 #include "webrtc/modules/video_coding/timing.h" | 19 #include "webrtc/modules/video_coding/timing.h" |
19 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 20 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
20 #include "webrtc/modules/video_coding/include/video_coding.h" | 21 #include "webrtc/modules/video_coding/include/video_coding.h" |
21 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 22 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
22 | 23 |
23 namespace webrtc { | 24 namespace webrtc { |
24 | 25 |
25 class Clock; | 26 class Clock; |
26 class VCMEncodedFrame; | 27 class VCMEncodedFrame; |
27 | 28 |
28 class VCMReceiver { | 29 class VCMReceiver { |
29 public: | 30 public: |
30 VCMReceiver(VCMTiming* timing, Clock* clock, EventFactory* event_factory); | 31 VCMReceiver(VCMTiming* timing, Clock* clock, EventFactory* event_factory); |
31 | 32 |
32 // Using this constructor, you can specify a different event factory for the | 33 // Using this constructor, you can specify a different event factory for the |
33 // jitter buffer. Useful for unit tests when you want to simulate incoming | 34 // jitter buffer. Useful for unit tests when you want to simulate incoming |
34 // packets, in which case the jitter buffer's wait event is different from | 35 // packets, in which case the jitter buffer's wait event is different from |
35 // that of VCMReceiver itself. | 36 // that of VCMReceiver itself. |
36 VCMReceiver(VCMTiming* timing, | 37 VCMReceiver(VCMTiming* timing, |
37 Clock* clock, | 38 Clock* clock, |
38 rtc::scoped_ptr<EventWrapper> receiver_event, | 39 std::unique_ptr<EventWrapper> receiver_event, |
39 rtc::scoped_ptr<EventWrapper> jitter_buffer_event); | 40 std::unique_ptr<EventWrapper> jitter_buffer_event); |
40 | 41 |
41 ~VCMReceiver(); | 42 ~VCMReceiver(); |
42 | 43 |
43 void Reset(); | 44 void Reset(); |
44 void UpdateRtt(int64_t rtt); | 45 void UpdateRtt(int64_t rtt); |
45 int32_t InsertPacket(const VCMPacket& packet, | 46 int32_t InsertPacket(const VCMPacket& packet, |
46 uint16_t frame_width, | 47 uint16_t frame_width, |
47 uint16_t frame_height); | 48 uint16_t frame_height); |
48 VCMEncodedFrame* FrameForDecoding(uint16_t max_wait_time_ms, | 49 VCMEncodedFrame* FrameForDecoding(uint16_t max_wait_time_ms, |
49 int64_t* next_render_time_ms, | 50 int64_t* next_render_time_ms, |
(...skipping 26 matching lines...) Expand all Loading... |
76 | 77 |
77 void RegisterStatsCallback(VCMReceiveStatisticsCallback* callback); | 78 void RegisterStatsCallback(VCMReceiveStatisticsCallback* callback); |
78 | 79 |
79 void TriggerDecoderShutdown(); | 80 void TriggerDecoderShutdown(); |
80 | 81 |
81 private: | 82 private: |
82 CriticalSectionWrapper* crit_sect_; | 83 CriticalSectionWrapper* crit_sect_; |
83 Clock* const clock_; | 84 Clock* const clock_; |
84 VCMJitterBuffer jitter_buffer_; | 85 VCMJitterBuffer jitter_buffer_; |
85 VCMTiming* timing_; | 86 VCMTiming* timing_; |
86 rtc::scoped_ptr<EventWrapper> render_wait_event_; | 87 std::unique_ptr<EventWrapper> render_wait_event_; |
87 int max_video_delay_ms_; | 88 int max_video_delay_ms_; |
88 }; | 89 }; |
89 | 90 |
90 } // namespace webrtc | 91 } // namespace webrtc |
91 | 92 |
92 #endif // WEBRTC_MODULES_VIDEO_CODING_RECEIVER_H_ | 93 #endif // WEBRTC_MODULES_VIDEO_CODING_RECEIVER_H_ |
OLD | NEW |