Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / video_engine / test / auto_test / interface / vie_autotest.h
1 /*
2  *  Copyright (c) 2012 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 // vie_autotest.h
13 //
14
15 #ifndef WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_VIE_AUTOTEST_H_
16 #define WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_VIE_AUTOTEST_H_
17
18 #include "gflags/gflags.h"
19 #include "webrtc/common_types.h"
20 #include "webrtc/modules/video_render/include/video_render_defines.h"
21 #include "webrtc/video_engine/include/vie_base.h"
22 #include "webrtc/video_engine/include/vie_capture.h"
23 #include "webrtc/video_engine/include/vie_codec.h"
24 #include "webrtc/video_engine/include/vie_errors.h"
25 #include "webrtc/video_engine/include/vie_network.h"
26 #include "webrtc/video_engine/include/vie_render.h"
27 #include "webrtc/video_engine/include/vie_rtp_rtcp.h"
28 #include "webrtc/video_engine/test/auto_test/interface/vie_autotest_defines.h"
29 #include "webrtc/video_engine/vie_defines.h"
30 #include "webrtc/voice_engine/include/voe_audio_processing.h"
31 #include "webrtc/voice_engine/include/voe_base.h"
32 #include "webrtc/voice_engine/include/voe_codec.h"
33 #include "webrtc/voice_engine/include/voe_hardware.h"
34
35 #ifndef WEBRTC_ANDROID
36 #include <string>
37 #endif
38
39 class TbCaptureDevice;
40 class TbInterfaces;
41 class TbVideoChannel;
42 class ViEToFileRenderer;
43
44 DECLARE_bool(include_timing_dependent_tests);
45
46 // This class provides a bunch of methods, implemented across several .cc
47 // files, which runs tests on the video engine. All methods will report
48 // errors using standard googletest macros, except when marked otherwise.
49 class ViEAutoTest
50 {
51 public:
52     ViEAutoTest(void* window1, void* window2);
53     ~ViEAutoTest();
54
55     // These three are special and should not be run in a googletest harness.
56     // They keep track of their errors by themselves and return the number
57     // of errors.
58     int ViELoopbackCall();
59     int ViESimulcastCall();
60     int ViECustomCall();
61     int ViERecordCall();
62
63     // All functions except the three above are meant to run in a
64     // googletest harness.
65     void ViEStandardTest();
66     void ViEExtendedTest();
67     void ViEAPITest();
68
69     // vie_autotest_base.cc
70     void ViEBaseStandardTest();
71     void ViEBaseExtendedTest();
72     void ViEBaseAPITest();
73
74     // vie_autotest_capture.cc
75     void ViECaptureStandardTest();
76     void ViECaptureExtendedTest();
77     void ViECaptureAPITest();
78     void ViECaptureExternalCaptureTest();
79
80     // vie_autotest_codec.cc
81     void ViECodecStandardTest();
82     void ViECodecExtendedTest();
83     void ViECodecExternalCodecTest();
84     void ViECodecAPITest();
85
86     // vie_autotest_image_process.cc
87     void ViEImageProcessStandardTest();
88     void ViEImageProcessExtendedTest();
89     void ViEImageProcessAPITest();
90
91     // vie_autotest_network.cc
92     void ViENetworkStandardTest();
93     void ViENetworkExtendedTest();
94     void ViENetworkAPITest();
95
96     // vie_autotest_render.cc
97     void ViERenderStandardTest();
98     void ViERenderExtendedTest();
99     void ViERenderAPITest();
100
101     // vie_autotest_rtp_rtcp.cc
102     void ViERtpRtcpStandardTest();
103     void ViERtpRtcpExtendedTest();
104     void ViERtpRtcpAPITest();
105
106 private:
107     void PrintAudioCodec(const webrtc::CodecInst audioCodec);
108     void PrintVideoCodec(const webrtc::VideoCodec videoCodec);
109
110     // Sets up rendering so the capture device output goes to window 1 and
111     // the video engine output goes to window 2.
112     void RenderCaptureDeviceAndOutputStream(TbInterfaces* video_engine,
113                                             TbVideoChannel* video_channel,
114                                             TbCaptureDevice* capture_device);
115
116     void* _window1;
117     void* _window2;
118
119     webrtc::VideoRenderType _renderType;
120     webrtc::VideoRender* _vrm1;
121     webrtc::VideoRender* _vrm2;
122 };
123
124 #endif  // WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_VIE_AUTOTEST_H_