Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(913)

Unified Diff: webrtc/video/video_quality_test.cc

Issue 2630333002: Drop frames until specified bitrate is achieved. (Closed)
Patch Set: Turn off quality scaling for screensharing in tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/video_quality_test.h ('k') | webrtc/video/vie_encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_quality_test.cc
diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/video_quality_test.cc
index c438274fcaac472a2c7ba64cc45bde8ef21231b0..989892dc8b6990c01f49911f8228189d7ec6045c 100644
--- a/webrtc/video/video_quality_test.cc
+++ b/webrtc/video/video_quality_test.cc
@@ -241,6 +241,7 @@ class VideoAnalyzer : public PacketReceiver,
void PreEncodeOnFrame(const VideoFrame& video_frame) {
rtc::CritScope lock(&crit_);
if (!first_send_timestamp_ && rtp_timestamp_delta_ == 0) {
+ printf("pre-encode: setting first_send_timestamp\n");
while (frames_.front().timestamp() != video_frame.timestamp()) {
++dropped_frames_before_first_encode_;
frames_.pop_front();
@@ -264,6 +265,7 @@ class VideoAnalyzer : public PacketReceiver,
rtc::CritScope lock(&crit_);
if (rtp_timestamp_delta_ == 0) {
+ printf("Now setting delta\n");
rtp_timestamp_delta_ = header.timestamp - *first_send_timestamp_;
first_send_timestamp_ = rtc::Optional<uint32_t>();
}
@@ -307,16 +309,18 @@ class VideoAnalyzer : public PacketReceiver,
// No previous frame rendered, this one was dropped after sending but
// before rendering.
++dropped_frames_before_rendering_;
- frames_.pop_front();
- RTC_CHECK(!frames_.empty());
- continue;
+ } else {
+ AddFrameComparison(frames_.front(), *last_rendered_frame_, true,
+ render_time_ms);
}
- AddFrameComparison(frames_.front(), *last_rendered_frame_, true,
- render_time_ms);
frames_.pop_front();
RTC_DCHECK(!frames_.empty());
}
+ printf("send_timestamp: %ld\n", send_timestamp);
+ printf("frame_timestamp: %ld\n",
+ wrap_handler_.Unwrap(frames_.front().timestamp()));
+
VideoFrame reference_frame = frames_.front();
frames_.pop_front();
int64_t reference_timestamp =
@@ -326,6 +330,7 @@ class VideoAnalyzer : public PacketReceiver,
// Look at RTPSender::BuildRTPHeader.
++send_timestamp;
}
+ printf("diff: %ld\n", reference_timestamp - send_timestamp);
ASSERT_EQ(reference_timestamp, send_timestamp);
AddFrameComparison(reference_frame, video_frame, false, render_time_ms);
@@ -1156,6 +1161,8 @@ void VideoQualityTest::SetupScreenshare() {
// Fill out codec settings.
video_encoder_config_.content_type = VideoEncoderConfig::ContentType::kScreen;
+ degradation_preference_ =
+ VideoSendStream::DegradationPreference::kMaintainResolution;
if (params_.video.codec == "VP8") {
VideoCodecVP8 vp8_settings = VideoEncoder::GetDefaultVp8Settings();
vp8_settings.denoisingOn = false;
@@ -1309,9 +1316,8 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) {
CreateFlexfecStreams();
CreateVideoStreams();
analyzer.SetSendStream(video_send_stream_);
- video_send_stream_->SetSource(
- analyzer.OutputInterface(),
- VideoSendStream::DegradationPreference::kBalanced);
+ video_send_stream_->SetSource(analyzer.OutputInterface(),
+ degradation_preference_);
CreateCapturer();
rtc::VideoSinkWants wants;
@@ -1453,9 +1459,8 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
video_receive_stream = call->CreateVideoReceiveStream(
video_receive_configs_[stream_id].Copy());
CreateCapturer();
- video_send_stream_->SetSource(
- video_capturer_.get(),
- VideoSendStream::DegradationPreference::kBalanced);
+ video_send_stream_->SetSource(video_capturer_.get(),
+ degradation_preference_);
}
AudioReceiveStream* audio_receive_stream = nullptr;
« no previous file with comments | « webrtc/video/video_quality_test.h ('k') | webrtc/video/vie_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698