OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2011 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 | |
11 | |
12 #include <stdlib.h> | |
13 #include <string.h> | |
14 | |
15 #include "gflags/gflags.h" | |
16 #include "webrtc/modules/video_coding/main/interface/video_coding.h" | |
17 #include "webrtc/modules/video_coding/main/test/receiver_tests.h" | |
18 #include "webrtc/test/testsupport/fileutils.h" | |
19 | |
20 DEFINE_string(codec, "VP8", "Codec to use (VP8 or I420)."); | |
21 DEFINE_int32(width, 352, "Width in pixels of the frames in the input file."); | |
22 DEFINE_int32(height, 288, "Height in pixels of the frames in the input file."); | |
23 DEFINE_int32(rtt, 0, "RTT (round-trip time), in milliseconds."); | |
24 DEFINE_string(input_filename, webrtc::test::ProjectRootPath() + | |
25 "/resources/foreman_cif.yuv", "Input file."); | |
26 DEFINE_string(output_filename, webrtc::test::OutputPath() + | |
27 "video_coding_test_output_352x288.yuv", "Output file."); | |
28 | |
29 using namespace webrtc; | |
30 | |
31 /* | |
32 * Build with EVENT_DEBUG defined | |
33 * to build the tests with simulated events. | |
34 */ | |
35 | |
36 int vcmMacrosTests = 0; | |
37 int vcmMacrosErrors = 0; | |
38 | |
39 int ParseArguments(CmdArgs& args) { | |
40 args.width = FLAGS_width; | |
41 args.height = FLAGS_height; | |
42 if (args.width < 1 || args.height < 1) { | |
43 return -1; | |
44 } | |
45 args.codecName = FLAGS_codec; | |
46 if (args.codecName == "VP8") { | |
47 args.codecType = kVideoCodecVP8; | |
48 } else if (args.codecName == "VP9") { | |
49 args.codecType = kVideoCodecVP9; | |
50 } else if (args.codecName == "I420") { | |
51 args.codecType = kVideoCodecI420; | |
52 } else { | |
53 printf("Invalid codec: %s\n", args.codecName.c_str()); | |
54 return -1; | |
55 } | |
56 args.inputFile = FLAGS_input_filename; | |
57 args.outputFile = FLAGS_output_filename; | |
58 args.rtt = FLAGS_rtt; | |
59 return 0; | |
60 } | |
61 | |
62 int main(int argc, char **argv) { | |
63 // Initialize WebRTC fileutils.h so paths to resources can be resolved. | |
64 webrtc::test::SetExecutablePath(argv[0]); | |
65 google::ParseCommandLineFlags(&argc, &argv, true); | |
66 | |
67 CmdArgs args; | |
68 if (ParseArguments(args) != 0) { | |
69 printf("Unable to parse input arguments\n"); | |
70 return -1; | |
71 } | |
72 | |
73 printf("Running video coding tests...\n"); | |
74 return RtpPlay(args); | |
75 } | |
OLD | NEW |