SSL video_quality_observer2.cc
Interaktion und PortierbarkeitC
/* * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
void VideoQualityObserver::UpdateHistograms(bool screenshare) { // TODO(bugs.webrtc.org/11489): Called on the decoder thread - which _might_ // be the same as the construction thread.
// Don't report anything on an empty video stream. if (num_frames_rendered_ == 0) { return;
}
// Sum of squared inter frame intervals is used to calculate the harmonic // frame rate metric. The metric aims to reflect overall experience related // to smoothness of video playback and includes both freezes and pauses.
sum_squared_interframe_delays_secs_ +=
interframe_delays_secs * interframe_delays_secs;
if (!is_paused_) {
render_interframe_delays_.AddSample(interframe_delay_ms);
if (was_freeze) {
freezes_durations_.Add(interframe_delay_ms);
smooth_playback_durations_.Add(last_frame_rendered_ms_ -
last_unfreeze_time_ms_);
last_unfreeze_time_ms_ = frame_meta.decode_timestamp.ms();
} else { // Count spatial metrics if there were no freeze.
time_in_resolution_ms_[current_resolution_] += interframe_delay_ms;
if (is_last_frame_blocky_) {
time_in_blocky_video_ms_ += interframe_delay_ms;
}
}
}
}
if (is_paused_) { // If the stream was paused since the previous frame, do not count the // pause toward smooth playback. Explicitly count the part before it and // start the new smooth playback interval from this frame.
is_paused_ = false; if (last_frame_rendered_ms_ > last_unfreeze_time_ms_) {
smooth_playback_durations_.Add(last_frame_rendered_ms_ -
last_unfreeze_time_ms_);
}
last_unfreeze_time_ms_ = frame_meta.decode_timestamp.ms();
if (num_frames_rendered_ > 0) {
pauses_durations_.Add(frame_meta.decode_timestamp.ms() -
last_frame_rendered_ms_);
}
}
std::optional<int> qp_blocky_threshold; // TODO(ilnik): add other codec types when we have QP for them. switch (codec) { case kVideoCodecVP8:
qp_blocky_threshold = kBlockyQpThresholdVp8; break; case kVideoCodecVP9:
qp_blocky_threshold = kBlockyQpThresholdVp9; break; default:
qp_blocky_threshold = std::nullopt;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.