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 set | |
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 struct Params { | |
28 struct { | |
29 size_t width; | |
30 size_t height; | |
31 int32_t fps; | |
32 int min_bitrate_bps; | |
33 int target_bitrate_bps; | |
34 int max_bitrate_bps; | |
35 std::string codec; | |
36 size_t num_temporal_layers; | |
37 | |
38 Call::Config::BitrateConfig call_bitrate_config; | |
39 int min_transmit_bps; | |
40 size_t tl_discard_threshold; | |
41 } general; | |
pbos-webrtc
2015/09/16 12:02:33
s/general/common
ivica
2015/09/16 12:51:21
Done.
| |
42 struct { // Video-specific settings. | |
43 std::string clip_name; | |
44 } video; | |
45 struct { // Screenshare-specific settings. | |
46 bool enabled; | |
47 int32_t slide_change_interval; | |
48 int32_t scroll_duration; | |
49 } screenshare; | |
50 struct { // Analyzer settings. | |
51 std::string test_label; | |
52 double avg_psnr_threshold; | |
53 double avg_ssim_threshold; | |
54 int test_durations_secs; | |
55 std::string graph_data_output_filename; | |
56 } analyzer; | |
57 FakeNetworkPipe::Config pipe; | |
58 bool logs; | |
59 }; | |
60 | |
61 VideoQualityTest(); | |
62 void RunWithAnalyzer(const Params ¶ms); | |
63 void RunWithVideoRenderer(const Params ¶ms); | |
64 | |
65 protected: | |
66 void TestBody() override; | |
67 | |
68 void CreateCapturer(const Params ¶ms, VideoCaptureInput *input); | |
69 void ValidateParams(const Params ¶ms); | |
70 void SetupFullStack(const Params ¶ms, | |
71 newapi::Transport *send_transport, | |
72 newapi::Transport *recv_transport); | |
73 void SetupScreenshare(const Params ¶ms); | |
74 | |
75 rtc::scoped_ptr<test::TraceToStderr> trace_to_stderr_; | |
76 rtc::scoped_ptr<test::FrameGenerator> frame_generator_; | |
77 rtc::scoped_ptr<VideoEncoder> encoder_; | |
78 VideoCodecUnion codec_settings_; | |
79 Clock* const clock_; | |
80 }; | |
81 | |
82 } // namespace webrtc | |
83 | |
84 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | |
OLD | NEW |