Now run EndToEndTest with the WebRTC-NewVideoJitterBuffer experiment.
In this CL: - EndToEndTests is now parameterized. - Added VP8 non-rotated unittest. - CanReceiveUlpfec/CanReceiveFlexFec now use multisets for timestamps. - pre_decode_image_callback_ is now called before decoding a frame with the new video jitter buffer. - Set video rotation when FrameObjects are created. - Calculate KeyFramesReceivedInPermille in new video jitter buffer. BUG=webrtc:5514 Review-Url: https://codereview.webrtc.org/2522493002 Cr-Commit-Position: refs/heads/master@{#15274}
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#include "webrtc/modules/video_coding/jitter_estimator.h"
|
||||
#include "webrtc/modules/video_coding/timing.h"
|
||||
#include "webrtc/system_wrappers/include/clock.h"
|
||||
#include "webrtc/system_wrappers/include/metrics.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace video_coding {
|
||||
@ -44,7 +45,13 @@ FrameBuffer::FrameBuffer(Clock* clock,
|
||||
num_frames_history_(0),
|
||||
num_frames_buffered_(0),
|
||||
stopped_(false),
|
||||
protection_mode_(kProtectionNack) {}
|
||||
protection_mode_(kProtectionNack),
|
||||
num_total_frames_(0),
|
||||
num_key_frames_(0) {}
|
||||
|
||||
FrameBuffer::~FrameBuffer() {
|
||||
UpdateHistograms();
|
||||
}
|
||||
|
||||
FrameBuffer::ReturnReason FrameBuffer::NextFrame(
|
||||
int64_t max_wait_time_ms,
|
||||
@ -155,6 +162,10 @@ int FrameBuffer::InsertFrame(std::unique_ptr<FrameObject> frame) {
|
||||
rtc::CritScope lock(&crit_);
|
||||
RTC_DCHECK(frame);
|
||||
|
||||
++num_total_frames_;
|
||||
if (frame->num_references == 0)
|
||||
++num_key_frames_;
|
||||
|
||||
FrameKey key(frame->picture_id, frame->spatial_layer);
|
||||
int last_continuous_picture_id =
|
||||
last_continuous_frame_it_ == frames_.end()
|
||||
@ -353,5 +364,16 @@ bool FrameBuffer::UpdateFrameInfoWithIncomingFrame(const FrameObject& frame,
|
||||
return true;
|
||||
}
|
||||
|
||||
void FrameBuffer::UpdateHistograms() const {
|
||||
rtc::CritScope lock(&crit_);
|
||||
if (num_total_frames_ > 0) {
|
||||
int key_frames_permille = (static_cast<float>(num_key_frames_) * 1000.0f /
|
||||
static_cast<float>(num_total_frames_) +
|
||||
0.5f);
|
||||
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesReceivedInPermille",
|
||||
key_frames_permille);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace video_coding
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user