OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_ |
12 #define WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_ | 12 #define WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_ |
13 | 13 |
14 /* | |
15 * General declarations used through out VCM offline tests. | |
16 */ | |
17 | |
18 #include <string> | |
19 | |
20 #include "webrtc/base/constructormagic.h" | |
21 #include "webrtc/modules/include/module_common_types.h" | |
22 #include "webrtc/modules/video_coding/include/video_coding.h" | |
23 #include "webrtc/system_wrappers/include/event_wrapper.h" | 14 #include "webrtc/system_wrappers/include/event_wrapper.h" |
24 | 15 |
25 enum { kMaxNackListSize = 250 }; | |
26 enum { kMaxPacketAgeToNack = 450 }; | |
27 | |
28 class NullEvent : public webrtc::EventWrapper { | |
29 public: | |
30 virtual ~NullEvent() {} | |
31 | |
32 bool Set() override { return true; } | |
33 | |
34 webrtc::EventTypeWrapper Wait(unsigned long max_time) override { // NOLINT | |
35 return webrtc::kEventTimeout; | |
36 } | |
37 }; | |
38 | |
39 class NullEventFactory : public webrtc::EventFactory { | 16 class NullEventFactory : public webrtc::EventFactory { |
40 public: | 17 public: |
41 virtual ~NullEventFactory() {} | 18 virtual ~NullEventFactory() {} |
42 | 19 |
43 webrtc::EventWrapper* CreateEvent() override { return new NullEvent; } | 20 webrtc::EventWrapper* CreateEvent() override { return new NullEvent; } |
44 }; | |
45 | |
46 class FileOutputFrameReceiver : public webrtc::VCMReceiveCallback { | |
47 public: | |
48 FileOutputFrameReceiver(const std::string& base_out_filename, uint32_t ssrc); | |
49 virtual ~FileOutputFrameReceiver(); | |
50 | |
51 // VCMReceiveCallback | |
52 int32_t FrameToRender(webrtc::VideoFrame& video_frame, | |
53 rtc::Optional<uint8_t> qp) override; | |
54 | |
55 private: | 21 private: |
56 std::string out_filename_; | 22 // Private class to avoid more dependencies on it in tests. |
57 FILE* out_file_; | 23 class NullEvent : public webrtc::EventWrapper { |
58 FILE* timing_file_; | 24 public: |
59 int width_; | 25 ~NullEvent() override {} |
60 int height_; | 26 bool Set() override { return true; } |
61 int count_; | 27 webrtc::EventTypeWrapper Wait(unsigned long max_time) override { // NOLINT |
62 | 28 return webrtc::kEventTimeout; |
63 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FileOutputFrameReceiver); | 29 } |
64 }; | 30 }; |
65 | |
66 class CmdArgs { | |
67 public: | |
68 CmdArgs(); | |
69 | |
70 std::string codecName; | |
71 webrtc::VideoCodecType codecType; | |
72 int width; | |
73 int height; | |
74 int rtt; | |
75 std::string inputFile; | |
76 std::string outputFile; | |
77 }; | 31 }; |
78 | 32 |
79 #endif // WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_ | 33 #endif // WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_ |
OLD | NEW |