Do not call OnDecoderTiming before timing values are set.
Wait until first frame is decoded to avoid include zeros in stats. BUG=b/32659204 Review-Url: https://codereview.webrtc.org/2582313002 Cr-Commit-Position: refs/heads/master@{#15752}
This commit is contained in:
@ -288,7 +288,7 @@ int VCMTiming::TargetDelayInternal() const {
|
||||
jitter_delay_ms_ + RequiredDecodeTimeMs() + render_delay_ms_);
|
||||
}
|
||||
|
||||
void VCMTiming::GetTimings(int* decode_ms,
|
||||
bool VCMTiming::GetTimings(int* decode_ms,
|
||||
int* max_decode_ms,
|
||||
int* current_delay_ms,
|
||||
int* target_delay_ms,
|
||||
@ -303,6 +303,7 @@ void VCMTiming::GetTimings(int* decode_ms,
|
||||
*jitter_buffer_ms = jitter_delay_ms_;
|
||||
*min_playout_delay_ms = min_playout_delay_ms_;
|
||||
*render_delay_ms = render_delay_ms_;
|
||||
return (num_decoded_frames_ > 0);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -92,8 +92,9 @@ class VCMTiming {
|
||||
// certain amount of processing time.
|
||||
bool EnoughTimeToDecode(uint32_t available_processing_time_ms) const;
|
||||
|
||||
// Return current timing information.
|
||||
void GetTimings(int* decode_ms,
|
||||
// Return current timing information. Returns true if the first frame has been
|
||||
// decoded, false otherwise.
|
||||
bool GetTimings(int* decode_ms,
|
||||
int* max_decode_ms,
|
||||
int* current_delay_ms,
|
||||
int* target_delay_ms,
|
||||
|
||||
@ -74,12 +74,13 @@ void VideoReceiver::Process() {
|
||||
int jitter_buffer_ms;
|
||||
int min_playout_delay_ms;
|
||||
int render_delay_ms;
|
||||
_timing->GetTimings(&decode_ms, &max_decode_ms, ¤t_delay_ms,
|
||||
&target_delay_ms, &jitter_buffer_ms,
|
||||
&min_playout_delay_ms, &render_delay_ms);
|
||||
_decoderTimingCallback->OnDecoderTiming(
|
||||
decode_ms, max_decode_ms, current_delay_ms, target_delay_ms,
|
||||
jitter_buffer_ms, min_playout_delay_ms, render_delay_ms);
|
||||
if (_timing->GetTimings(&decode_ms, &max_decode_ms, ¤t_delay_ms,
|
||||
&target_delay_ms, &jitter_buffer_ms,
|
||||
&min_playout_delay_ms, &render_delay_ms)) {
|
||||
_decoderTimingCallback->OnDecoderTiming(
|
||||
decode_ms, max_decode_ms, current_delay_ms, target_delay_ms,
|
||||
jitter_buffer_ms, min_playout_delay_ms, render_delay_ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user