Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license | |
| 5 * that can be found in the LICENSE file in the root of the source | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 #ifndef WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | |
| 11 #define WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | |
| 12 | |
| 13 #include <string> | |
| 14 | |
| 15 #include "webrtc/test/call_test.h" | |
| 16 #include "webrtc/test/frame_generator.h" | |
| 17 #include "webrtc/test/testsupport/trace_to_stderr.h" | |
| 18 | |
| 19 namespace webrtc { | |
| 20 | |
| 21 class VideoQualityTest : public test::CallTest { | |
| 22 public: | |
| 23 // Parameters are grouped into smaller structs to make it easier to fill out | |
|
sprang_webrtc
2015/09/11 08:01:34
s/fill out/set
ivica
2015/09/14 17:12:55
Done.
| |
| 24 // the desired elements and skip unused, using aggregate initialization. | |
| 25 // Unfortunately, C++11 (as opposed to C11) doesn't support unnamed structs, | |
| 26 // which makes the implementation of VideoQualityTest a bit uglier. | |
| 27 // Also, C++11 doesn't support both aggregate initialization and default | |
| 28 // values simultaneously, so default values are manually set in | |
| 29 // FillDefaultParams(Params *). | |
| 30 struct Params { | |
| 31 struct { | |
| 32 size_t width; | |
| 33 size_t height; | |
| 34 int32_t fps; | |
| 35 size_t min_bitrate_bps; | |
| 36 size_t target_bitrate_bps; | |
| 37 size_t max_bitrate_bps; | |
| 38 | |
| 39 std::string codec; // Default: "VP8" | |
| 40 size_t num_temporal_layers; // Default: 2 | |
| 41 size_t start_bitrate_bps; // Default: 400 * 1000 | |
| 42 size_t min_transmit_bps; // Default: 0 | |
| 43 size_t tl_discard_threshold; | |
| 44 } general; | |
| 45 struct { // Video-specific settings. | |
| 46 std::string clip_name; | |
| 47 } video; | |
| 48 struct { // Screenshare-specific settings. | |
| 49 bool enabled; | |
| 50 int32_t slide_change_interval; // Default: 10 | |
| 51 int32_t scroll_duration; | |
| 52 } screenshare; | |
| 53 struct { // Analyzer settings. | |
| 54 std::string test_label; | |
| 55 double avg_psnr_threshold; | |
| 56 double avg_ssim_threshold; | |
| 57 int test_durations_secs; | |
| 58 std::string graph_data_output_filename; | |
| 59 } analyzer; | |
| 60 FakeNetworkPipe::Config pipe; | |
| 61 bool logs; | |
| 62 }; | |
| 63 | |
| 64 VideoQualityTest(); | |
| 65 void RunWithAnalyzer(const Params ¶ms); | |
| 66 void RunWithVideoRenderer(const Params ¶ms); | |
| 67 | |
| 68 protected: | |
| 69 void TestBody() override; | |
| 70 | |
| 71 void CreateCapturer(const Params ¶ms, VideoCaptureInput *input); | |
| 72 void FillDefaultParams(Params *params); | |
| 73 void ValidateParams(const Params ¶ms); | |
| 74 void SetupFullStack(const Params ¶ms, | |
| 75 newapi::Transport *send_transport, | |
| 76 newapi::Transport *recv_transport); | |
| 77 void SetupScreenshare(const Params ¶ms); | |
| 78 | |
| 79 rtc::scoped_ptr<test::TraceToStderr> trace_to_stderr_; | |
| 80 rtc::scoped_ptr<test::FrameGenerator> frame_generator_; | |
| 81 rtc::scoped_ptr<VideoEncoder> encoder_; | |
| 82 VideoCodecUnion codec_settings_; | |
| 83 Clock* const clock_; | |
| 84 }; | |
| 85 | |
| 86 } // namespace webrtc | |
| 87 | |
| 88 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | |
| OLD | NEW |