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 namespace webrtc { | 21 namespace webrtc { |
22 | 22 |
23 class Clock; | 23 class Clock; |
24 class TimestampExtrapolator; | 24 class TimestampExtrapolator; |
25 | 25 |
26 class VCMTiming { | 26 class VCMTiming { |
27 public: | 27 public: |
28 // The primary timing component should be passed | 28 // The primary timing component should be passed |
29 // if this is the dual timing component. | 29 // if this is the dual timing component. |
30 explicit VCMTiming(Clock* clock, VCMTiming* master_timing = NULL); | 30 explicit VCMTiming(Clock* clock, VCMTiming* master_timing = NULL); |
31 ~VCMTiming(); | 31 virtual ~VCMTiming(); |
32 | 32 |
33 // Resets the timing to the initial state. | 33 // Resets the timing to the initial state. |
34 void Reset(); | 34 void Reset(); |
35 void ResetDecodeTime(); | 35 void ResetDecodeTime(); |
36 | 36 |
37 // Set the amount of time needed to render an image. Defaults to 10 ms. | 37 // Set the amount of time needed to render an image. Defaults to 10 ms. |
38 void set_render_delay(uint32_t render_delay_ms); | 38 void set_render_delay(uint32_t render_delay_ms); |
39 | 39 |
40 // Set the minimum time the video must be delayed on the receiver to | 40 // Set the minimum time the video must be delayed on the receiver to |
41 // get the desired jitter buffer level. | 41 // get the desired jitter buffer level. |
(...skipping 20 matching lines...) Expand all Loading... |
62 int32_t decode_time_ms, | 62 int32_t decode_time_ms, |
63 int64_t now_ms, | 63 int64_t now_ms, |
64 int64_t render_time_ms); | 64 int64_t render_time_ms); |
65 | 65 |
66 // Used to report that a frame is passed to decoding. Updates the timestamp | 66 // Used to report that a frame is passed to decoding. Updates the timestamp |
67 // filter which is used to map between timestamps and receiver system time. | 67 // filter which is used to map between timestamps and receiver system time. |
68 void IncomingTimestamp(uint32_t time_stamp, int64_t last_packet_time_ms); | 68 void IncomingTimestamp(uint32_t time_stamp, int64_t last_packet_time_ms); |
69 // Returns the receiver system time when the frame with timestamp | 69 // Returns the receiver system time when the frame with timestamp |
70 // frame_timestamp should be rendered, assuming that the system time currently | 70 // frame_timestamp should be rendered, assuming that the system time currently |
71 // is now_ms. | 71 // is now_ms. |
72 int64_t RenderTimeMs(uint32_t frame_timestamp, int64_t now_ms) const; | 72 virtual int64_t RenderTimeMs(uint32_t frame_timestamp, int64_t now_ms) const; |
73 | 73 |
74 // Returns the maximum time in ms that we can wait for a frame to become | 74 // Returns the maximum time in ms that we can wait for a frame to become |
75 // complete before we must pass it to the decoder. | 75 // complete before we must pass it to the decoder. |
76 uint32_t MaxWaitingTime(int64_t render_time_ms, int64_t now_ms) const; | 76 virtual uint32_t MaxWaitingTime(int64_t render_time_ms, int64_t now_ms) const; |
77 | 77 |
78 // Returns the current target delay which is required delay + decode time + | 78 // Returns the current target delay which is required delay + decode time + |
79 // render delay. | 79 // render delay. |
80 uint32_t TargetVideoDelay() const; | 80 uint32_t TargetVideoDelay() const; |
81 | 81 |
82 // Calculates whether or not there is enough time to decode a frame given a | 82 // Calculates whether or not there is enough time to decode a frame given a |
83 // certain amount of processing time. | 83 // certain amount of processing time. |
84 bool EnoughTimeToDecode(uint32_t available_processing_time_ms) const; | 84 bool EnoughTimeToDecode(uint32_t available_processing_time_ms) const; |
85 | 85 |
86 // Return current timing information. | 86 // Return current timing information. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 // Statistics. | 120 // Statistics. |
121 size_t num_decoded_frames_ GUARDED_BY(crit_sect_); | 121 size_t num_decoded_frames_ GUARDED_BY(crit_sect_); |
122 size_t num_delayed_decoded_frames_ GUARDED_BY(crit_sect_); | 122 size_t num_delayed_decoded_frames_ GUARDED_BY(crit_sect_); |
123 int64_t first_decoded_frame_ms_ GUARDED_BY(crit_sect_); | 123 int64_t first_decoded_frame_ms_ GUARDED_BY(crit_sect_); |
124 uint64_t sum_missed_render_deadline_ms_ GUARDED_BY(crit_sect_); | 124 uint64_t sum_missed_render_deadline_ms_ GUARDED_BY(crit_sect_); |
125 }; | 125 }; |
126 } // namespace webrtc | 126 } // namespace webrtc |
127 | 127 |
128 #endif // WEBRTC_MODULES_VIDEO_CODING_TIMING_H_ | 128 #endif // WEBRTC_MODULES_VIDEO_CODING_TIMING_H_ |
OLD | NEW |