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 |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "webrtc/modules/video_coding/include/video_coding.h" | 21 #include "webrtc/modules/video_coding/include/video_coding.h" |
22 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 22 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
23 | 23 |
24 namespace webrtc { | 24 namespace webrtc { |
25 | 25 |
26 class Clock; | 26 class Clock; |
27 class VCMEncodedFrame; | 27 class VCMEncodedFrame; |
28 | 28 |
29 class VCMReceiver { | 29 class VCMReceiver { |
30 public: | 30 public: |
| 31 // Constructor for current interface, will be removed when the |
| 32 // new jitter buffer is in place. |
31 VCMReceiver(VCMTiming* timing, Clock* clock, EventFactory* event_factory); | 33 VCMReceiver(VCMTiming* timing, Clock* clock, EventFactory* event_factory); |
32 | 34 |
| 35 // Create method for the new jitter buffer. |
| 36 VCMReceiver(VCMTiming* timing, |
| 37 Clock* clock, |
| 38 EventFactory* event_factory, |
| 39 NackSender* nack_sender, |
| 40 KeyFrameRequestSender* keyframe_request_sender); |
| 41 |
33 // Using this constructor, you can specify a different event factory for the | 42 // Using this constructor, you can specify a different event factory for the |
34 // jitter buffer. Useful for unit tests when you want to simulate incoming | 43 // jitter buffer. Useful for unit tests when you want to simulate incoming |
35 // packets, in which case the jitter buffer's wait event is different from | 44 // packets, in which case the jitter buffer's wait event is different from |
36 // that of VCMReceiver itself. | 45 // that of VCMReceiver itself. |
| 46 // |
| 47 // Constructor for current interface, will be removed when the |
| 48 // new jitter buffer is in place. |
37 VCMReceiver(VCMTiming* timing, | 49 VCMReceiver(VCMTiming* timing, |
38 Clock* clock, | 50 Clock* clock, |
39 std::unique_ptr<EventWrapper> receiver_event, | 51 std::unique_ptr<EventWrapper> receiver_event, |
40 std::unique_ptr<EventWrapper> jitter_buffer_event); | 52 std::unique_ptr<EventWrapper> jitter_buffer_event); |
41 | 53 |
| 54 // Create method for the new jitter buffer. |
| 55 VCMReceiver(VCMTiming* timing, |
| 56 Clock* clock, |
| 57 std::unique_ptr<EventWrapper> receiver_event, |
| 58 std::unique_ptr<EventWrapper> jitter_buffer_event, |
| 59 NackSender* nack_sender, |
| 60 KeyFrameRequestSender* keyframe_request_sender); |
| 61 |
42 ~VCMReceiver(); | 62 ~VCMReceiver(); |
43 | 63 |
44 void Reset(); | 64 void Reset(); |
45 void UpdateRtt(int64_t rtt); | 65 void UpdateRtt(int64_t rtt); |
46 int32_t InsertPacket(const VCMPacket& packet, | 66 int32_t InsertPacket(const VCMPacket& packet, |
47 uint16_t frame_width, | 67 uint16_t frame_width, |
48 uint16_t frame_height); | 68 uint16_t frame_height); |
49 VCMEncodedFrame* FrameForDecoding(uint16_t max_wait_time_ms, | 69 VCMEncodedFrame* FrameForDecoding(uint16_t max_wait_time_ms, |
50 int64_t* next_render_time_ms, | 70 int64_t* next_render_time_ms, |
51 bool prefer_late_decoding); | 71 bool prefer_late_decoding); |
(...skipping 20 matching lines...) Expand all Loading... |
72 | 92 |
73 // Returns size in time (milliseconds) of complete continuous frames in the | 93 // Returns size in time (milliseconds) of complete continuous frames in the |
74 // jitter buffer. The render time is estimated based on the render delay at | 94 // jitter buffer. The render time is estimated based on the render delay at |
75 // the time this function is called. | 95 // the time this function is called. |
76 int RenderBufferSizeMs(); | 96 int RenderBufferSizeMs(); |
77 | 97 |
78 void RegisterStatsCallback(VCMReceiveStatisticsCallback* callback); | 98 void RegisterStatsCallback(VCMReceiveStatisticsCallback* callback); |
79 | 99 |
80 void TriggerDecoderShutdown(); | 100 void TriggerDecoderShutdown(); |
81 | 101 |
| 102 int64_t TimeUntilNextProcess(); |
| 103 void Process(); |
| 104 |
82 private: | 105 private: |
83 CriticalSectionWrapper* crit_sect_; | 106 CriticalSectionWrapper* crit_sect_; |
84 Clock* const clock_; | 107 Clock* const clock_; |
85 VCMJitterBuffer jitter_buffer_; | 108 VCMJitterBuffer jitter_buffer_; |
86 VCMTiming* timing_; | 109 VCMTiming* timing_; |
87 std::unique_ptr<EventWrapper> render_wait_event_; | 110 std::unique_ptr<EventWrapper> render_wait_event_; |
88 int max_video_delay_ms_; | 111 int max_video_delay_ms_; |
89 }; | 112 }; |
90 | 113 |
91 } // namespace webrtc | 114 } // namespace webrtc |
92 | 115 |
93 #endif // WEBRTC_MODULES_VIDEO_CODING_RECEIVER_H_ | 116 #endif // WEBRTC_MODULES_VIDEO_CODING_RECEIVER_H_ |
OLD | NEW |