Index: webrtc/modules/video_coding/timing.h |
diff --git a/webrtc/modules/video_coding/timing.h b/webrtc/modules/video_coding/timing.h |
index e593c9acbc35a7a1c3973d36a0274c161e880a84..85a3dd0ca0aa9d50dc1dc2e254a16df941ef4363 100644 |
--- a/webrtc/modules/video_coding/timing.h |
+++ b/webrtc/modules/video_coding/timing.h |
@@ -35,14 +35,23 @@ class VCMTiming { |
void ResetDecodeTime(); |
// Set the amount of time needed to render an image. Defaults to 10 ms. |
- void set_render_delay(uint32_t render_delay_ms); |
+ void set_render_delay(int render_delay_ms); |
// Set the minimum time the video must be delayed on the receiver to |
// get the desired jitter buffer level. |
- void SetJitterDelay(uint32_t required_delay_ms); |
+ void SetJitterDelay(int required_delay_ms); |
- // Set the minimum playout delay required to sync video with audio. |
- void set_min_playout_delay(uint32_t min_playout_delay); |
+ // Set the minimum playout delay from capture to render in ms. |
+ void set_min_playout_delay(int min_playout_delay_ms); |
+ |
+ // Returns the minimum playout delay from capture to render in ms. |
+ int min_playout_delay(); |
+ |
+ // Set the maximum playout delay from capture to render in ms. |
+ void set_max_playout_delay(int max_playout_delay_ms); |
+ |
+ // Returns the maximum playout delay from capture to render in ms. |
+ int max_playout_delay(); |
// Increases or decreases the current delay to get closer to the target delay. |
// Calculates how long it has been since the previous call to this function, |
@@ -77,7 +86,7 @@ class VCMTiming { |
// Returns the current target delay which is required delay + decode time + |
// render delay. |
- uint32_t TargetVideoDelay() const; |
+ int TargetVideoDelay() const; |
// Calculates whether or not there is enough time to decode a frame given a |
// certain amount of processing time. |
@@ -96,11 +105,10 @@ class VCMTiming { |
enum { kDelayMaxChangeMsPerS = 100 }; |
protected: |
- int64_t RequiredDecodeTimeMs() const |
- EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
+ int RequiredDecodeTimeMs() const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
int64_t RenderTimeMsInternal(uint32_t frame_timestamp, int64_t now_ms) const |
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
- uint32_t TargetDelayInternal() const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
+ int TargetDelayInternal() const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
private: |
void UpdateHistograms() const; |
@@ -110,10 +118,16 @@ class VCMTiming { |
bool master_ GUARDED_BY(crit_sect_); |
TimestampExtrapolator* ts_extrapolator_ GUARDED_BY(crit_sect_); |
std::unique_ptr<VCMCodecTimer> codec_timer_ GUARDED_BY(crit_sect_); |
- uint32_t render_delay_ms_ GUARDED_BY(crit_sect_); |
- uint32_t min_playout_delay_ms_ GUARDED_BY(crit_sect_); |
- uint32_t jitter_delay_ms_ GUARDED_BY(crit_sect_); |
- uint32_t current_delay_ms_ GUARDED_BY(crit_sect_); |
+ int render_delay_ms_ GUARDED_BY(crit_sect_); |
+ // Best-effort playout delay range for frames from capture to render. |
+ // The receiver tries to keep the delay between |min_playout_delay_ms_| |
+ // and |max_playout_delay_ms_| taking the network jitter into account. |
+ // A special case is where min_playout_delay_ms_ = max_playout_delay_ms_ = 0, |
+ // in which case the receiver tries to play the frames as they arrive. |
+ int min_playout_delay_ms_ GUARDED_BY(crit_sect_); |
+ int max_playout_delay_ms_ GUARDED_BY(crit_sect_); |
+ int jitter_delay_ms_ GUARDED_BY(crit_sect_); |
+ int current_delay_ms_ GUARDED_BY(crit_sect_); |
int last_decode_ms_ GUARDED_BY(crit_sect_); |
uint32_t prev_frame_timestamp_ GUARDED_BY(crit_sect_); |