Index: webrtc/video/full_stack_mod.cc |
diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/full_stack_mod.cc |
similarity index 76% |
copy from webrtc/video/video_quality_test.cc |
copy to webrtc/video/full_stack_mod.cc |
index c452e11895f082f30788a3d30503da1e81d92abc..364041e13073197f7ce1428634996d3f6b165de9 100644 |
--- a/webrtc/video/video_quality_test.cc |
+++ b/webrtc/video/full_stack_mod.cc |
@@ -7,6 +7,93 @@ |
* in the file PATENTS. All contributing project authors may |
* be found in the AUTHORS file in the root of the source tree. |
*/ |
+#include <string> |
+ |
+#include "webrtc/test/call_test.h" |
+#include "webrtc/test/frame_generator.h" |
+#include "webrtc/test/testsupport/trace_to_stderr.h" |
+ |
+namespace webrtc { |
+namespace mod { |
+ |
+class VideoQualityTest : public ::webrtc::test::CallTest { |
+ public: |
+ // Parameters are grouped into smaller structs to make it easier to set |
+ // the desired elements and skip unused, using aggregate initialization. |
+ // Unfortunately, C++11 (as opposed to C11) doesn't support unnamed structs, |
+ // which makes the implementation of VideoQualityTest a bit uglier. |
+ struct Params { |
+ struct { |
+ size_t width; |
+ size_t height; |
+ int32_t fps; |
+ int min_bitrate_bps; |
+ int target_bitrate_bps; |
+ int max_bitrate_bps; |
+ std::string codec; |
+ size_t num_temporal_layers; |
+ |
+ int min_transmit_bps; |
+ Call::Config::BitrateConfig call_bitrate_config; |
+ size_t tl_discard_threshold; |
+ bool send_side_bwe; |
+ } common; |
+ struct { // Video-specific settings. |
+ std::string clip_name; |
+ } video; |
+ struct { // Screenshare-specific settings. |
+ bool enabled; |
+ int32_t slide_change_interval; |
+ int32_t scroll_duration; |
+ } screenshare; |
+ struct { // Analyzer settings. |
+ std::string test_label; |
+ double avg_psnr_threshold; |
+ double avg_ssim_threshold; |
+ int test_durations_secs; |
+ std::string graph_data_output_filename; |
+ } analyzer; |
+ FakeNetworkPipe::Config pipe; |
+ bool logs; |
+ }; |
+ |
+ VideoQualityTest(); |
+ void RunWithAnalyzer(const Params& params); |
+ void RunWithVideoRenderer(const Params& params); |
+ |
+ protected: |
+ // No-op implementation to be able to instantiate this class from non-TEST_F |
+ // locations. |
+ void TestBody() override; |
+ |
+ void CreateCapturer(const Params& params, VideoCaptureInput* input); |
+ void ValidateParams(const Params& params); |
+ void SetupFullStack(const Params& params, |
+ Transport* send_transport, |
+ Transport* recv_transport); |
+ void SetupScreenshare(const Params& params); |
+ |
+ // We need a more general capturer than the FrameGeneratorCapturer. |
+ rtc::scoped_ptr<test::VideoCapturer> capturer_; |
+ rtc::scoped_ptr<test::TraceToStderr> trace_to_stderr_; |
+ rtc::scoped_ptr<test::FrameGenerator> frame_generator_; |
+ rtc::scoped_ptr<VideoEncoder> encoder_; |
+ VideoCodecUnion codec_settings_; |
+ Clock* const clock_; |
+}; |
+ |
+} // namespace mod; |
+} // namespace webrtc |
+ |
+/* |
+ * Copyright (c) 2015 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. |
+ */ |
#include <stdio.h> |
#include <algorithm> |
@@ -28,9 +115,9 @@ |
#include "webrtc/test/statistics.h" |
#include "webrtc/test/testsupport/fileutils.h" |
#include "webrtc/test/video_renderer.h" |
-#include "webrtc/video/video_quality_test.h" |
namespace webrtc { |
+namespace mod { |
static const int kTransportSeqExtensionId = |
VideoQualityTest::kAbsSendTimeExtensionId + 1; |
@@ -838,4 +925,179 @@ void VideoQualityTest::RunWithVideoRenderer(const Params& params) { |
transport.StopSending(); |
} |
+} // namespace mod |
+} // namespace webrtc |
+ |
+ |
+ |
+ |
+/* |
+ * Copyright (c) 2013 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. |
+ */ |
+#include <stdio.h> |
+ |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+namespace webrtc { |
+ |
+static const int kFullStackTestDurationSecs = 60; |
+ |
+class FullStackTestMod : public mod::VideoQualityTest { |
+ public: |
+ void RunTestMod(const VideoQualityTest::Params ¶ms) { |
+ RunWithAnalyzer(params); |
+ } |
+}; |
+ |
+ |
+// TEST_F(FullStackTestMod, ParisQcifWithoutPacketLoss) { |
+// VideoQualityTest::Params paris_qcif = { |
+// {176, 144, 30, 300000, 300000, 300000, "VP8", 1}, |
+// {"paris_qcif"}, |
+// {}, |
+// {"net_delay_0_0_plr_0", 36.0, 0.96, kFullStackTestDurationSecs}}; |
+// RunTestMod(paris_qcif); |
+// } |
+// |
+// TEST_F(FullStackTestMod, ForemanCifWithoutPacketLoss) { |
+// // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. |
+// VideoQualityTest::Params foreman_cif = { |
+// {352, 288, 30, 700000, 700000, 700000, "VP8", 1}, |
+// {"foreman_cif"}, |
+// {}, |
+// {"foreman_cif_net_delay_0_0_plr_0", 0.0, 0.0, kFullStackTestDurationSecs} |
+// }; |
+// RunTestMod(foreman_cif); |
+// } |
+// |
+// TEST_F(FullStackTestMod, ForemanCifPlr5) { |
+// VideoQualityTest::Params foreman_cif = { |
+// {352, 288, 30, 30000, 500000, 2000000, "VP8", 1}, |
+// {"foreman_cif"}, |
+// {}, |
+// {"foreman_cif_delay_50_0_plr_5", 0.0, 0.0, kFullStackTestDurationSecs}}; |
+// foreman_cif.pipe.loss_percent = 5; |
+// foreman_cif.pipe.queue_delay_ms = 50; |
+// RunTestMod(foreman_cif); |
+// } |
+// |
+// TEST_F(FullStackTestMod, ForemanCif500kbps) { |
+// VideoQualityTest::Params foreman_cif = { |
+// {352, 288, 30, 30000, 500000, 2000000, "VP8", 1}, |
+// {"foreman_cif"}, |
+// {}, |
+// {"foreman_cif_500kbps", 0.0, 0.0, kFullStackTestDurationSecs}}; |
+// foreman_cif.pipe.queue_length_packets = 0; |
+// foreman_cif.pipe.queue_delay_ms = 0; |
+// foreman_cif.pipe.link_capacity_kbps = 500; |
+// RunTestMod(foreman_cif); |
+// } |
+// |
+// TEST_F(FullStackTestMod, ForemanCif500kbpsLimitedQueue) { |
+// VideoQualityTest::Params foreman_cif = { |
+// {352, 288, 30, 30000, 500000, 2000000, "VP8", 1}, |
+// {"foreman_cif"}, |
+// {}, |
+// {"foreman_cif_500kbps_32pkts_queue", 0.0, 0.0, kFullStackTestDurationSecs} |
+// }; |
+// foreman_cif.pipe.queue_length_packets = 32; |
+// foreman_cif.pipe.queue_delay_ms = 0; |
+// foreman_cif.pipe.link_capacity_kbps = 500; |
+// RunTestMod(foreman_cif); |
+// } |
+// |
+// TEST_F(FullStackTestMod, ForemanCif500kbps100ms) { |
+// VideoQualityTest::Params foreman_cif = { |
+// {352, 288, 30, 30000, 500000, 2000000, "VP8", 1}, |
+// {"foreman_cif"}, |
+// {}, |
+// {"foreman_cif_500kbps_100ms", 0.0, 0.0, kFullStackTestDurationSecs}}; |
+// foreman_cif.pipe.queue_length_packets = 0; |
+// foreman_cif.pipe.queue_delay_ms = 100; |
+// foreman_cif.pipe.link_capacity_kbps = 500; |
+// RunTestMod(foreman_cif); |
+// } |
+// |
+// TEST_F(FullStackTestMod, ForemanCif500kbps100msLimitedQueue) { |
+// VideoQualityTest::Params foreman_cif = { |
+// {352, 288, 30, 30000, 500000, 2000000, "VP8", 1}, |
+// {"foreman_cif"}, |
+// {}, |
+// {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0, |
+// kFullStackTestDurationSecs}}; |
+// foreman_cif.pipe.queue_length_packets = 32; |
+// foreman_cif.pipe.queue_delay_ms = 100; |
+// foreman_cif.pipe.link_capacity_kbps = 500; |
+// RunTestMod(foreman_cif); |
+// } |
+// |
+// TEST_F(FullStackTestMod, ForemanCif1000kbps100msLimitedQueue) { |
+// VideoQualityTest::Params foreman_cif = { |
+// {352, 288, 30, 30000, 2000000, 2000000, "VP8", 1}, |
+// {"foreman_cif"}, |
+// {}, |
+// {"foreman_cif_1000kbps_100ms_32pkts_queue", 0.0, 0.0, |
+// kFullStackTestDurationSecs}}; |
+// foreman_cif.pipe.queue_length_packets = 32; |
+// foreman_cif.pipe.queue_delay_ms = 100; |
+// foreman_cif.pipe.link_capacity_kbps = 1000; |
+// RunTestMod(foreman_cif); |
+// } |
+// |
+// // Temporarily disabled on Android due to low test timeouts. |
+// // https://code.google.com/p/chromium/issues/detail?id=513170 |
+// #include "webrtc/test/testsupport/gtest_disable.h" |
+// TEST_F(FullStackTestMod, DISABLED_ON_ANDROID(ScreenshareSlidesVP8_2TL)) { |
+// VideoQualityTest::Params screenshare = { |
+// {1850, 1110, 5, 50000, 200000, 2000000, "VP8", 2, 400000}, |
+// {}, // Video-specific. |
+// {true, 10}, // Screenshare-specific. |
+// {"screenshare_slides", 0.0, 0.0, kFullStackTestDurationSecs}}; |
+// RunTestMod(screenshare); |
+// } |
+// |
+// TEST_F(FullStackTestMod, DISABLED_ON_ANDROID(ScreenshareSlidesVP8_2TL_Scroll)) { |
+// VideoQualityTest::Params config = { |
+// {1850, 1110 / 2, 5, 50000, 200000, 2000000, "VP8", 2, 400000}, |
+// {}, |
+// {true, 10, 2}, |
+// {"screenshare_slides_scrolling", 0.0, 0.0, kFullStackTestDurationSecs}}; |
+// RunTestMod(config); |
+// } |
+ |
+#define SCREENSHARE_VP8_2TL { \ |
+ VideoQualityTest::Params screenshare = { \ |
+ {1850, 1110, 5, 50000, 200000, 2000000, "VP8", 2, 400000}, \ |
+ {}, \ |
+ {true, 10}, \ |
+ {"screenshare_slides", 0.0, 0.0, kFullStackTestDurationSecs}}; \ |
+ RunTestMod(screenshare); \ |
+} |
+ |
+#define SCREENSHARE_VP9_2TL { \ |
+ VideoQualityTest::Params screenshare = { \ |
+ {1850, 1110, 5, 50000, 200000, 2000000, "VP9", 2, 400000}, \ |
+ {}, \ |
+ {true, 10}, \ |
+ {"screenshare_slides_vp9_2tl", 0.0, 0.0, kFullStackTestDurationSecs}}; \ |
+ RunTestMod(screenshare); \ |
+} |
+ |
+TEST_F(FullStackTestMod, ScreenshareSlidesVP8_2TL_Mod_0) SCREENSHARE_VP8_2TL; |
+TEST_F(FullStackTestMod, ScreenshareSlidesVP8_2TL_Mod_1) SCREENSHARE_VP8_2TL; |
+TEST_F(FullStackTestMod, ScreenshareSlidesVP8_2TL_Mod_2) SCREENSHARE_VP8_2TL; |
+TEST_F(FullStackTestMod, ScreenshareSlidesVP8_2TL_Mod_3) SCREENSHARE_VP8_2TL; |
+TEST_F(FullStackTestMod, ScreenshareSlidesVP8_2TL_Mod_4) SCREENSHARE_VP8_2TL; |
+TEST_F(FullStackTestMod, ScreenshareSlidesVP8_2TL_Mod_5) SCREENSHARE_VP8_2TL; |
+TEST_F(FullStackTestMod, ScreenshareSlidesVP8_2TL_Mod_6) SCREENSHARE_VP8_2TL; |
+TEST_F(FullStackTestMod, ScreenshareSlidesVP8_2TL_Mod_7) SCREENSHARE_VP8_2TL; |
+TEST_F(FullStackTestMod, ScreenshareSlidesVP8_2TL_Mod_8) SCREENSHARE_VP8_2TL; |
+TEST_F(FullStackTestMod, ScreenshareSlidesVP8_2TL_Mod_9) SCREENSHARE_VP8_2TL; |
+ |
} // namespace webrtc |