2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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.
15 #include "webrtc/video_engine/test/auto_test/interface/vie_autotest.h"
19 #include "webrtc/engine_configurations.h"
20 #include "webrtc/modules/video_render/include/video_render.h"
21 #include "webrtc/test/testsupport/fileutils.h"
22 #include "webrtc/video_engine/test/auto_test/interface/vie_autotest_defines.h"
23 #include "webrtc/video_engine/test/auto_test/primitives/general_primitives.h"
24 #include "webrtc/video_engine/test/libvietest/include/tb_capture_device.h"
25 #include "webrtc/video_engine/test/libvietest/include/tb_interfaces.h"
26 #include "webrtc/video_engine/test/libvietest/include/tb_video_channel.h"
28 DEFINE_bool(include_timing_dependent_tests, true,
29 "If true, we will include tests / parts of tests that are known "
30 "to break in slow execution environments (such as valgrind).");
32 // ViETest implementation
33 FILE* ViETest::log_file_ = NULL;
34 char* ViETest::log_str_ = NULL;
36 std::string ViETest::GetResultOutputPath() {
37 return webrtc::test::OutputPath();
40 // ViEAutoTest implementation
41 ViEAutoTest::ViEAutoTest(void* window1, void* window2) :
44 _renderType(webrtc::kRenderDefault),
45 _vrm1(webrtc::VideoRender::CreateVideoRender(
46 4561, window1, false, _renderType)),
47 _vrm2(webrtc::VideoRender::CreateVideoRender(
48 4562, window2, false, _renderType))
54 ViEAutoTest::~ViEAutoTest()
56 webrtc::VideoRender::DestroyVideoRender(_vrm1);
58 webrtc::VideoRender::DestroyVideoRender(_vrm2);
62 void ViEAutoTest::ViEStandardTest()
64 ViEBaseStandardTest();
65 ViECaptureStandardTest();
66 ViECodecStandardTest();
67 ViEImageProcessStandardTest();
68 ViERenderStandardTest();
69 ViERtpRtcpStandardTest();
72 void ViEAutoTest::ViEExtendedTest()
74 ViEBaseExtendedTest();
75 ViECaptureExtendedTest();
76 ViECodecExtendedTest();
77 ViEImageProcessExtendedTest();
78 ViERenderExtendedTest();
79 ViERtpRtcpExtendedTest();
82 void ViEAutoTest::ViEAPITest()
87 ViEImageProcessAPITest();
92 void ViEAutoTest::PrintVideoCodec(const webrtc::VideoCodec videoCodec)
94 ViETest::Log("Video Codec Information:");
96 switch (videoCodec.codecType)
98 case webrtc::kVideoCodecVP8:
99 ViETest::Log("\tcodecType: VP8");
101 case webrtc::kVideoCodecI420:
102 ViETest::Log("\tcodecType: I420");
104 case webrtc::kVideoCodecH264:
105 ViETest::Log("\tcodecType: H264");
107 case webrtc::kVideoCodecRED:
108 ViETest::Log("\tcodecType: RED");
110 case webrtc::kVideoCodecULPFEC:
111 ViETest::Log("\tcodecType: ULPFEC");
113 case webrtc::kVideoCodecGeneric:
114 ViETest::Log("\tcodecType: GENERIC");
116 case webrtc::kVideoCodecUnknown:
117 ViETest::Log("\tcodecType: UNKNOWN");
121 ViETest::Log("\theight: %u", videoCodec.height);
122 ViETest::Log("\tmaxBitrate: %u", videoCodec.maxBitrate);
123 ViETest::Log("\tmaxFramerate: %u", videoCodec.maxFramerate);
124 ViETest::Log("\tminBitrate: %u", videoCodec.minBitrate);
125 ViETest::Log("\tplName: %s", videoCodec.plName);
126 ViETest::Log("\tplType: %u", videoCodec.plType);
127 ViETest::Log("\tstartBitrate: %u", videoCodec.startBitrate);
128 ViETest::Log("\twidth: %u", videoCodec.width);
132 void ViEAutoTest::PrintAudioCodec(const webrtc::CodecInst audioCodec)
134 ViETest::Log("Audio Codec Information:");
135 ViETest::Log("\tchannels: %u", audioCodec.channels);
136 ViETest::Log("\t: %u", audioCodec.pacsize);
137 ViETest::Log("\t: %u", audioCodec.plfreq);
138 ViETest::Log("\t: %s", audioCodec.plname);
139 ViETest::Log("\t: %u", audioCodec.pltype);
140 ViETest::Log("\t: %u", audioCodec.rate);
144 void ViEAutoTest::RenderCaptureDeviceAndOutputStream(
145 TbInterfaces* video_engine,
146 TbVideoChannel* video_channel,
147 TbCaptureDevice* capture_device) {
149 video_engine->render, capture_device->captureId, _window1, 0);
151 video_engine->render, video_channel->videoChannel, _window2, 1);