diff --git a/src/modules/video_capture/main/interface/video_capture.h b/src/modules/video_capture/main/interface/video_capture.h index 20b8987c9..d596b71d1 100644 --- a/src/modules/video_capture/main/interface/video_capture.h +++ b/src/modules/video_capture/main/interface/video_capture.h @@ -11,8 +11,8 @@ #ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_INTERFACE_VIDEO_CAPTURE_H_ #define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_INTERFACE_VIDEO_CAPTURE_H_ -#include "module.h" -#include "video_capture_defines.h" +#include "modules/interface/module.h" +#include "modules/video_capture/main/interface/video_capture_defines.h" namespace webrtc { diff --git a/src/modules/video_capture/main/interface/video_capture_defines.h b/src/modules/video_capture/main/interface/video_capture_defines.h index 2a3408be9..72188df05 100644 --- a/src/modules/video_capture/main/interface/video_capture_defines.h +++ b/src/modules/video_capture/main/interface/video_capture_defines.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -13,7 +13,7 @@ // Includes #include "typedefs.h" -#include "module_common_types.h" +#include "modules/interface/module_common_types.h" namespace webrtc { diff --git a/src/video_engine/test/auto_test/automated/two_windows_fixture.cc b/src/video_engine/test/auto_test/automated/two_windows_fixture.cc index d181aa517..a4a551d6d 100644 --- a/src/video_engine/test/auto_test/automated/two_windows_fixture.cc +++ b/src/video_engine/test/auto_test/automated/two_windows_fixture.cc @@ -10,7 +10,7 @@ #include "video_engine/test/auto_test/automated/two_windows_fixture.h" -#include "video_engine/test/auto_test/helpers/vie_window_creator.h" +#include "video_engine/test/auto_test/interface/vie_window_creator.h" #include "video_engine/test/auto_test/interface/vie_autotest_window_manager_interface.h" void TwoWindowsFixture::SetUpTestCase() { diff --git a/src/video_engine/test/auto_test/automated/vie_rtp_fuzz_test.cc b/src/video_engine/test/auto_test/automated/vie_rtp_fuzz_test.cc index f8740be6f..75ca8f600 100644 --- a/src/video_engine/test/auto_test/automated/vie_rtp_fuzz_test.cc +++ b/src/video_engine/test/auto_test/automated/vie_rtp_fuzz_test.cc @@ -13,14 +13,14 @@ #include "gtest/gtest.h" #include "gflags/gflags.h" #include "video_engine/test/auto_test/automated/two_windows_fixture.h" -#include "video_engine/test/auto_test/helpers/bit_flip_encryption.h" -#include "video_engine/test/auto_test/helpers/random_encryption.h" -#include "video_engine/test/auto_test/helpers/vie_window_creator.h" -#include "video_engine/test/auto_test/interface/tb_capture_device.h" -#include "video_engine/test/auto_test/interface/tb_interfaces.h" -#include "video_engine/test/auto_test/interface/tb_video_channel.h" +#include "video_engine/test/auto_test/interface/vie_window_creator.h" #include "video_engine/test/auto_test/interface/vie_autotest_window_manager_interface.h" #include "video_engine/test/auto_test/primitives/general_primitives.h" +#include "video_engine/test/libvietest/include/bit_flip_encryption.h" +#include "video_engine/test/libvietest/include/random_encryption.h" +#include "video_engine/test/libvietest/include/tb_capture_device.h" +#include "video_engine/test/libvietest/include/tb_interfaces.h" +#include "video_engine/test/libvietest/include/tb_video_channel.h" namespace { diff --git a/src/video_engine/test/auto_test/automated/vie_video_verification_test.cc b/src/video_engine/test/auto_test/automated/vie_video_verification_test.cc index 861af8a50..074ae7c18 100644 --- a/src/video_engine/test/auto_test/automated/vie_video_verification_test.cc +++ b/src/video_engine/test/auto_test/automated/vie_video_verification_test.cc @@ -14,10 +14,10 @@ #include "gtest/gtest.h" #include "testsupport/fileutils.h" #include "testsupport/metrics/video_metrics.h" -#include "video_engine/test/auto_test/helpers/vie_to_file_renderer.h" #include "video_engine/test/auto_test/interface/vie_autotest.h" #include "video_engine/test/auto_test/interface/vie_file_based_comparison_tests.h" #include "video_engine/test/auto_test/primitives/framedrop_primitives.h" +#include "video_engine/test/libvietest/include/vie_to_file_renderer.h" namespace { diff --git a/src/video_engine/test/auto_test/helpers/vie_window_creator.h b/src/video_engine/test/auto_test/interface/vie_window_creator.h similarity index 94% rename from src/video_engine/test/auto_test/helpers/vie_window_creator.h rename to src/video_engine/test/auto_test/interface/vie_window_creator.h index 25c23a3f3..c13a8889b 100644 --- a/src/video_engine/test/auto_test/helpers/vie_window_creator.h +++ b/src/video_engine/test/auto_test/interface/vie_window_creator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source diff --git a/src/video_engine/test/auto_test/primitives/framedrop_primitives.cc b/src/video_engine/test/auto_test/primitives/framedrop_primitives.cc index 6767cc6d2..fc7d87b10 100644 --- a/src/video_engine/test/auto_test/primitives/framedrop_primitives.cc +++ b/src/video_engine/test/auto_test/primitives/framedrop_primitives.cc @@ -16,13 +16,13 @@ #include "testsupport/fileutils.h" #include "testsupport/frame_reader.h" #include "testsupport/frame_writer.h" -#include "video_engine/test/auto_test/helpers/vie_to_file_renderer.h" -#include "video_engine/test/auto_test/interface/tb_interfaces.h" -#include "video_engine/test/auto_test/interface/tb_external_transport.h" #include "video_engine/test/auto_test/interface/vie_autotest.h" #include "video_engine/test/auto_test/interface/vie_autotest_defines.h" #include "video_engine/test/auto_test/primitives/framedrop_primitives.h" #include "video_engine/test/auto_test/primitives/general_primitives.h" +#include "video_engine/test/libvietest/include/tb_interfaces.h" +#include "video_engine/test/libvietest/include/tb_external_transport.h" +#include "video_engine/test/libvietest/include/vie_to_file_renderer.h" // Tracks which frames are created on the local side and reports them to the // FrameDropDetector class. diff --git a/src/video_engine/test/auto_test/primitives/framedrop_primitives.h b/src/video_engine/test/auto_test/primitives/framedrop_primitives.h index 80575c3aa..cf3c1de36 100644 --- a/src/video_engine/test/auto_test/primitives/framedrop_primitives.h +++ b/src/video_engine/test/auto_test/primitives/framedrop_primitives.h @@ -17,7 +17,7 @@ #include "video_engine/include/vie_codec.h" #include "video_engine/include/vie_image_process.h" #include "video_engine/test/auto_test/interface/vie_autotest_defines.h" -#include "video_engine/test/auto_test/helpers/vie_to_file_renderer.h" +#include "video_engine/test/libvietest/include/vie_to_file_renderer.h" class FrameDropDetector; class TbInterfaces; diff --git a/src/video_engine/test/auto_test/source/vie_autotest.cc b/src/video_engine/test/auto_test/source/vie_autotest.cc index 8281ea2aa..95337b2e5 100644 --- a/src/video_engine/test/auto_test/source/vie_autotest.cc +++ b/src/video_engine/test/auto_test/source/vie_autotest.cc @@ -12,29 +12,25 @@ // vie_autotest.cc // -#include "vie_autotest.h" +#include "video_engine/test/auto_test/interface/vie_autotest.h" #include #include "engine_configurations.h" -#include "general_primitives.h" -#include "tb_interfaces.h" -#include "tb_video_channel.h" -#include "tb_capture_device.h" +#include "modules/video_render/main/interface/video_render.h" #include "testsupport/fileutils.h" -#include "video_render.h" -#include "vie_autotest_defines.h" +#include "video_engine/test/auto_test/interface/vie_autotest_defines.h" +#include "video_engine/test/auto_test/primitives/general_primitives.h" +#include "video_engine/test/libvietest/include/tb_capture_device.h" +#include "video_engine/test/libvietest/include/tb_interfaces.h" +#include "video_engine/test/libvietest/include/tb_video_channel.h" // ViETest implementation FILE* ViETest::log_file_ = NULL; char* ViETest::log_str_ = NULL; std::string ViETest::GetResultOutputPath() { -#ifdef WEBRTC_ANDROID - return "/sdcard/"; -#else - return webrtc::test::OutputPath(); -#endif + return webrtc::test::OutputPath(); } // ViEAutoTest implementation diff --git a/src/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc b/src/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc index 10c1304c3..c29c5dbe5 100644 --- a/src/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc +++ b/src/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc @@ -702,13 +702,10 @@ void ViEAutoTest::ViERtpRtcpAPITest() // RTP Dump // { -#ifdef WEBRTC_ANDROID - const char* dumpName = "/sdcard/DumpFileName.rtp"; -#else std::string output_file = webrtc::test::OutputPath() + "DumpFileName.rtp"; const char* dumpName = output_file.c_str(); -#endif + EXPECT_EQ(0, ViE.rtp_rtcp->StartRTPDump( tbChannel.videoChannel, dumpName, webrtc::kRtpIncoming)); EXPECT_EQ(0, ViE.rtp_rtcp->StopRTPDump( diff --git a/src/video_engine/test/auto_test/source/vie_file_based_comparison_tests.cc b/src/video_engine/test/auto_test/source/vie_file_based_comparison_tests.cc index 023b91767..4b9d31522 100644 --- a/src/video_engine/test/auto_test/source/vie_file_based_comparison_tests.cc +++ b/src/video_engine/test/auto_test/source/vie_file_based_comparison_tests.cc @@ -10,14 +10,14 @@ #include "video_engine/test/auto_test/interface/vie_file_based_comparison_tests.h" -#include "video_engine/test/auto_test/interface/tb_interfaces.h" #include "video_engine/test/auto_test/interface/vie_autotest_defines.h" -#include "video_engine/test/auto_test/helpers/vie_fake_camera.h" -#include "video_engine/test/auto_test/helpers/vie_to_file_renderer.h" #include "video_engine/test/auto_test/primitives/base_primitives.h" #include "video_engine/test/auto_test/primitives/codec_primitives.h" #include "video_engine/test/auto_test/primitives/framedrop_primitives.h" #include "video_engine/test/auto_test/primitives/general_primitives.h" +#include "video_engine/test/libvietest/include/tb_interfaces.h" +#include "video_engine/test/libvietest/include/vie_fake_camera.h" +#include "video_engine/test/libvietest/include/vie_to_file_renderer.h" bool ViEFileBasedComparisonTests::TestCallSetup( const std::string& i420_video_file, diff --git a/src/video_engine/test/auto_test/helpers/vie_window_creator.cc b/src/video_engine/test/auto_test/source/vie_window_creator.cc similarity index 77% rename from src/video_engine/test/auto_test/helpers/vie_window_creator.cc rename to src/video_engine/test/auto_test/source/vie_window_creator.cc index d3b44a9e2..0ccd121a0 100644 --- a/src/video_engine/test/auto_test/helpers/vie_window_creator.cc +++ b/src/video_engine/test/auto_test/source/vie_window_creator.cc @@ -8,13 +8,13 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "vie_window_creator.h" +#include "video_engine/test/auto_test/interface/vie_window_creator.h" -#include "vie_autotest_main.h" -#include "vie_codec.h" -#include "voe_codec.h" -#include "vie_window_manager_factory.h" -#include "vie_autotest_window_manager_interface.h" +#include "video_engine/include/vie_codec.h" +#include "video_engine/test/auto_test/interface/vie_autotest_main.h" +#include "video_engine/test/auto_test/interface/vie_autotest_window_manager_interface.h" +#include "video_engine/test/auto_test/interface/vie_window_manager_factory.h" +#include "voice_engine/main/interface/voe_codec.h" #if defined(WIN32) #include diff --git a/src/video_engine/test/auto_test/vie_auto_test.gypi b/src/video_engine/test/auto_test/vie_auto_test.gypi index 2ba10e819..675a864f4 100644 --- a/src/video_engine/test/auto_test/vie_auto_test.gypi +++ b/src/video_engine/test/auto_test/vie_auto_test.gypi @@ -21,6 +21,7 @@ '<(webrtc_root)/../test/metrics.gyp:metrics', '<(webrtc_root)/../test/test.gyp:test_support', 'video_engine_core', + 'libvietest', ], 'include_dirs': [ 'interface/', @@ -32,11 +33,6 @@ '../../../common_video/interface', ], 'sources': [ - 'interface/tb_capture_device.h', - 'interface/tb_external_transport.h', - 'interface/tb_I420_codec.h', - 'interface/tb_interfaces.h', - 'interface/tb_video_channel.h', 'interface/vie_autotest.h', 'interface/vie_autotest_defines.h', 'interface/vie_autotest_linux.h', @@ -47,20 +43,7 @@ 'interface/vie_autotest_windows.h', 'interface/vie_file_based_comparison_tests.h', 'interface/vie_window_manager_factory.h', - - # Helper classes - 'helpers/bit_flip_encryption.cc', - 'helpers/bit_flip_encryption.h', - 'helpers/random_encryption.cc', - 'helpers/random_encryption.h', - 'helpers/vie_fake_camera.cc', - 'helpers/vie_fake_camera.h', - 'helpers/vie_file_capture_device.cc', - 'helpers/vie_file_capture_device.h', - 'helpers/vie_to_file_renderer.cc', - 'helpers/vie_to_file_renderer.h', - 'helpers/vie_window_creator.cc', - 'helpers/vie_window_creator.h', + 'interface/vie_window_creator.h', # New, fully automated tests 'automated/legacy_fixture.cc', @@ -83,11 +66,6 @@ 'primitives/general_primitives.h', # Platform independent - 'source/tb_capture_device.cc', - 'source/tb_external_transport.cc', - 'source/tb_I420_codec.cc', - 'source/tb_interfaces.cc', - 'source/tb_video_channel.cc', 'source/vie_autotest.cc', 'source/vie_autotest_base.cc', 'source/vie_autotest_capture.cc', @@ -103,6 +81,7 @@ 'source/vie_autotest_custom_call.cc', 'source/vie_autotest_simulcast.cc', 'source/vie_file_based_comparison_tests.cc', + 'source/vie_window_creator.cc', # Platform dependent # Android diff --git a/src/video_engine/test/auto_test/helpers/bit_flip_encryption.cc b/src/video_engine/test/libvietest/helpers/bit_flip_encryption.cc similarity index 89% rename from src/video_engine/test/auto_test/helpers/bit_flip_encryption.cc rename to src/video_engine/test/libvietest/helpers/bit_flip_encryption.cc index 423ad5adc..20a69e7f3 100644 --- a/src/video_engine/test/auto_test/helpers/bit_flip_encryption.cc +++ b/src/video_engine/test/libvietest/helpers/bit_flip_encryption.cc @@ -8,12 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "video_engine/test/auto_test/helpers/bit_flip_encryption.h" +#include "video_engine/test/libvietest/include/bit_flip_encryption.h" #include -#include "video_engine/test/auto_test/interface/vie_autotest_defines.h" - float NormalizedRand() { return static_cast(rand()) / static_cast(RAND_MAX); diff --git a/src/video_engine/test/auto_test/helpers/random_encryption.cc b/src/video_engine/test/libvietest/helpers/random_encryption.cc similarity index 95% rename from src/video_engine/test/auto_test/helpers/random_encryption.cc rename to src/video_engine/test/libvietest/helpers/random_encryption.cc index 04904b51f..8f5579e8f 100644 --- a/src/video_engine/test/auto_test/helpers/random_encryption.cc +++ b/src/video_engine/test/libvietest/helpers/random_encryption.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "video_engine/test/auto_test/helpers/random_encryption.h" +#include "video_engine/test/libvietest/include/random_encryption.h" #include #include diff --git a/src/video_engine/test/auto_test/helpers/vie_fake_camera.cc b/src/video_engine/test/libvietest/helpers/vie_fake_camera.cc similarity index 88% rename from src/video_engine/test/auto_test/helpers/vie_fake_camera.cc rename to src/video_engine/test/libvietest/helpers/vie_fake_camera.cc index f7dae2f01..b9b7281eb 100644 --- a/src/video_engine/test/auto_test/helpers/vie_fake_camera.cc +++ b/src/video_engine/test/libvietest/helpers/vie_fake_camera.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -7,13 +7,13 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "vie_fake_camera.h" +#include "video_engine/test/libvietest/include/vie_fake_camera.h" #include -#include "vie_capture.h" -#include "vie_file_capture_device.h" -#include "thread_wrapper.h" +#include "system_wrappers/interface/thread_wrapper.h" +#include "video_engine/include/vie_capture.h" +#include "video_engine/test/libvietest/include/vie_file_capture_device.h" // This callback runs the camera thread: bool StreamVideoFileRepeatedlyIntoCaptureDevice(void* data) { diff --git a/src/video_engine/test/auto_test/helpers/vie_file_capture_device.cc b/src/video_engine/test/libvietest/helpers/vie_file_capture_device.cc similarity index 87% rename from src/video_engine/test/auto_test/helpers/vie_file_capture_device.cc rename to src/video_engine/test/libvietest/helpers/vie_file_capture_device.cc index e4caa2a30..5d6abfae9 100644 --- a/src/video_engine/test/auto_test/helpers/vie_file_capture_device.cc +++ b/src/video_engine/test/libvietest/helpers/vie_file_capture_device.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -7,17 +7,16 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "vie_file_capture_device.h" +#include "video_engine/test/libvietest/include/vie_file_capture_device.h" #include #include "common_types.h" -#include "critical_section_wrapper.h" -#include "event_wrapper.h" -#include "module_common_types.h" -#include "vie_autotest_defines.h" -#include "vie_capture.h" -#include "tick_util.h" +#include "modules/interface/module_common_types.h" +#include "system_wrappers/interface/critical_section_wrapper.h" +#include "system_wrappers/interface/event_wrapper.h" +#include "system_wrappers/interface/tick_util.h" +#include "video_engine/include/vie_capture.h" // This class ensures we are not exceeding the max FPS. class FramePacemaker { diff --git a/src/video_engine/test/auto_test/helpers/vie_to_file_renderer.cc b/src/video_engine/test/libvietest/helpers/vie_to_file_renderer.cc similarity index 97% rename from src/video_engine/test/auto_test/helpers/vie_to_file_renderer.cc rename to src/video_engine/test/libvietest/helpers/vie_to_file_renderer.cc index d9c8da31b..f186aaddb 100644 --- a/src/video_engine/test/auto_test/helpers/vie_to_file_renderer.cc +++ b/src/video_engine/test/libvietest/helpers/vie_to_file_renderer.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "vie_to_file_renderer.h" +#include "video_engine/test/libvietest/include/vie_to_file_renderer.h" #include diff --git a/src/video_engine/test/auto_test/helpers/bit_flip_encryption.h b/src/video_engine/test/libvietest/include/bit_flip_encryption.h similarity index 100% rename from src/video_engine/test/auto_test/helpers/bit_flip_encryption.h rename to src/video_engine/test/libvietest/include/bit_flip_encryption.h diff --git a/src/video_engine/test/auto_test/helpers/random_encryption.h b/src/video_engine/test/libvietest/include/random_encryption.h similarity index 100% rename from src/video_engine/test/auto_test/helpers/random_encryption.h rename to src/video_engine/test/libvietest/include/random_encryption.h diff --git a/src/video_engine/test/auto_test/interface/tb_I420_codec.h b/src/video_engine/test/libvietest/include/tb_I420_codec.h similarity index 98% rename from src/video_engine/test/auto_test/interface/tb_I420_codec.h rename to src/video_engine/test/libvietest/include/tb_I420_codec.h index 085379669..f5467f4ce 100644 --- a/src/video_engine/test/auto_test/interface/tb_I420_codec.h +++ b/src/video_engine/test/libvietest/include/tb_I420_codec.h @@ -9,17 +9,14 @@ */ /* - * tb_I420_codec.h - * * This file contains the interface to I420 "codec" * This is a dummy wrapper to allow VCM deal with raw I420 sequences - * */ #ifndef WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_TB_I420_CODEC_H_ #define WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_TB_I420_CODEC_H_ -#include "video_codec_interface.h" +#include "modules/video_coding/codecs/interface/video_codec_interface.h" class TbI420Encoder: public webrtc::VideoEncoder { diff --git a/src/video_engine/test/auto_test/interface/tb_capture_device.h b/src/video_engine/test/libvietest/include/tb_capture_device.h similarity index 91% rename from src/video_engine/test/auto_test/interface/tb_capture_device.h rename to src/video_engine/test/libvietest/include/tb_capture_device.h index 233b81240..10f8db80c 100644 --- a/src/video_engine/test/auto_test/interface/tb_capture_device.h +++ b/src/video_engine/test/libvietest/include/tb_capture_device.h @@ -13,8 +13,9 @@ #include -#include "tb_interfaces.h" -#include "video_capture_factory.h" +#include "modules/video_capture/main/interface/video_capture_factory.h" + +class TbInterfaces; class TbCaptureDevice { diff --git a/src/video_engine/test/auto_test/interface/tb_external_transport.h b/src/video_engine/test/libvietest/include/tb_external_transport.h similarity index 100% rename from src/video_engine/test/auto_test/interface/tb_external_transport.h rename to src/video_engine/test/libvietest/include/tb_external_transport.h diff --git a/src/video_engine/test/auto_test/interface/tb_interfaces.h b/src/video_engine/test/libvietest/include/tb_interfaces.h similarity index 65% rename from src/video_engine/test/auto_test/interface/tb_interfaces.h rename to src/video_engine/test/libvietest/include/tb_interfaces.h index 63e78a32c..69d8b5360 100644 --- a/src/video_engine/test/auto_test/interface/tb_interfaces.h +++ b/src/video_engine/test/libvietest/include/tb_interfaces.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -11,26 +11,27 @@ #ifndef WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_TB_INTERFACES_H_ #define WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_TB_INTERFACES_H_ -#include "vie_autotest_defines.h" +#include #include "common_types.h" -#include "vie_base.h" -#include "vie_capture.h" -#include "vie_codec.h" -#include "vie_image_process.h" -#include "vie_network.h" -#include "vie_render.h" -#include "vie_rtp_rtcp.h" -#include "vie_encryption.h" -#include "vie_defines.h" +#include "video_engine/include/vie_base.h" +#include "video_engine/include/vie_capture.h" +#include "video_engine/include/vie_codec.h" +#include "video_engine/include/vie_image_process.h" +#include "video_engine/include/vie_network.h" +#include "video_engine/include/vie_render.h" +#include "video_engine/include/vie_rtp_rtcp.h" +#include "video_engine/include/vie_encryption.h" +#include "video_engine/vie_defines.h" // This class deals with all the tedium of setting up video engine interfaces. // It does its work in constructor and destructor, so keeping it in scope is -// enough. +// enough. It also sets up tracing. class TbInterfaces { public: - TbInterfaces(const char* test_name); + // Sets up all interfaces and creates a trace file + TbInterfaces(std::string test_name); ~TbInterfaces(void); webrtc::VideoEngine* video_engine; diff --git a/src/video_engine/test/auto_test/interface/tb_video_channel.h b/src/video_engine/test/libvietest/include/tb_video_channel.h similarity index 90% rename from src/video_engine/test/auto_test/interface/tb_video_channel.h rename to src/video_engine/test/libvietest/include/tb_video_channel.h index 5961e6207..5c7e6f8b8 100644 --- a/src/video_engine/test/auto_test/interface/tb_video_channel.h +++ b/src/video_engine/test/libvietest/include/tb_video_channel.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -11,7 +11,8 @@ #ifndef WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_TB_VIDEO_CHANNEL_H_ #define WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_TB_VIDEO_CHANNEL_H_ -#include "tb_interfaces.h" +#include "video_engine/test/libvietest/include/tb_interfaces.h" + class TbVideoChannel { public: diff --git a/src/video_engine/test/auto_test/helpers/vie_fake_camera.h b/src/video_engine/test/libvietest/include/vie_fake_camera.h similarity index 96% rename from src/video_engine/test/auto_test/helpers/vie_fake_camera.h rename to src/video_engine/test/libvietest/include/vie_fake_camera.h index 0b9c2e732..abc5d40cf 100644 --- a/src/video_engine/test/auto_test/helpers/vie_fake_camera.h +++ b/src/video_engine/test/libvietest/include/vie_fake_camera.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source diff --git a/src/video_engine/test/auto_test/helpers/vie_file_capture_device.h b/src/video_engine/test/libvietest/include/vie_file_capture_device.h similarity index 96% rename from src/video_engine/test/auto_test/helpers/vie_file_capture_device.h rename to src/video_engine/test/libvietest/include/vie_file_capture_device.h index 5e62c48d3..7c986858e 100644 --- a/src/video_engine/test/auto_test/helpers/vie_file_capture_device.h +++ b/src/video_engine/test/libvietest/include/vie_file_capture_device.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source diff --git a/src/video_engine/test/auto_test/helpers/vie_to_file_renderer.h b/src/video_engine/test/libvietest/include/vie_to_file_renderer.h similarity index 100% rename from src/video_engine/test/auto_test/helpers/vie_to_file_renderer.h rename to src/video_engine/test/libvietest/include/vie_to_file_renderer.h diff --git a/src/video_engine/test/libvietest/libvietest.gypi b/src/video_engine/test/libvietest/libvietest.gypi new file mode 100644 index 000000000..e93212a20 --- /dev/null +++ b/src/video_engine/test/libvietest/libvietest.gypi @@ -0,0 +1,57 @@ +# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. +{ + 'targets': [ + { + 'target_name': 'libvietest', + 'type': '<(library)', + 'dependencies': [ + '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', + '<(webrtc_root)/../testing/gtest.gyp:gtest', + '<(webrtc_root)/../test/test.gyp:test_support', + 'video_engine_core', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'include/', + ] + }, + 'include_dirs': [ + 'include/', + 'helpers/', + ], + 'sources': [ + # Helper classes + 'include/bit_flip_encryption.h', + 'include/random_encryption.h', + 'include/vie_fake_camera.h', + 'include/vie_file_capture_device.h', + 'include/vie_to_file_renderer.h', + + 'helpers/bit_flip_encryption.cc', + 'helpers/random_encryption.cc', + 'helpers/vie_fake_camera.cc', + 'helpers/vie_file_capture_device.cc', + 'helpers/vie_to_file_renderer.cc', + + # Testbed classes + 'include/tb_capture_device.h', + 'include/tb_external_transport.h', + 'include/tb_I420_codec.h', + 'include/tb_interfaces.h', + 'include/tb_video_channel.h', + + 'testbed/tb_capture_device.cc', + 'testbed/tb_external_transport.cc', + 'testbed/tb_I420_codec.cc', + 'testbed/tb_interfaces.cc', + 'testbed/tb_video_channel.cc', + ], + }, + ], +} diff --git a/src/video_engine/test/auto_test/source/tb_I420_codec.cc b/src/video_engine/test/libvietest/testbed/tb_I420_codec.cc similarity index 99% rename from src/video_engine/test/auto_test/source/tb_I420_codec.cc rename to src/video_engine/test/libvietest/testbed/tb_I420_codec.cc index c94c0b70b..afab59aa2 100644 --- a/src/video_engine/test/auto_test/source/tb_I420_codec.cc +++ b/src/video_engine/test/libvietest/testbed/tb_I420_codec.cc @@ -8,12 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -/* - * tb_I420_codec.cc - * - */ +#include "video_engine/test/libvietest/include/tb_I420_codec.h" -#include "tb_I420_codec.h" #include #include #include diff --git a/src/video_engine/test/auto_test/source/tb_capture_device.cc b/src/video_engine/test/libvietest/testbed/tb_capture_device.cc similarity index 88% rename from src/video_engine/test/auto_test/source/tb_capture_device.cc rename to src/video_engine/test/libvietest/testbed/tb_capture_device.cc index 66f161906..684bff978 100644 --- a/src/video_engine/test/auto_test/source/tb_capture_device.cc +++ b/src/video_engine/test/libvietest/testbed/tb_capture_device.cc @@ -8,7 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "tb_capture_device.h" +#include "video_engine/test/libvietest/include/tb_capture_device.h" + +#include "gtest/gtest.h" +#include "video_engine/test/libvietest/include/tb_interfaces.h" TbCaptureDevice::TbCaptureDevice(TbInterfaces& Engine) : captureId(-1), @@ -45,8 +48,6 @@ TbCaptureDevice::TbCaptureDevice(TbInterfaces& Engine) : int error = ViE.capture->AllocateCaptureDevice(*vcpm_, captureId); if (error == 0) { - ViETest::Log("Using capture device: %s, captureId: %d", deviceName, - captureId); captureDeviceSet = true; break; } @@ -58,14 +59,11 @@ TbCaptureDevice::TbCaptureDevice(TbInterfaces& Engine) : } device_name_ = deviceName; - ViETest::Log("Starting capture device %s with captureId %d\n", deviceName, - captureId); EXPECT_EQ(0, ViE.capture->StartCapture(captureId)); } TbCaptureDevice::~TbCaptureDevice(void) { - ViETest::Log("Stopping capture device with id %d\n", captureId); EXPECT_EQ(0, ViE.capture->StopCapture(captureId)); EXPECT_EQ(0, ViE.capture->ReleaseCaptureDevice(captureId)); vcpm_->Release(); diff --git a/src/video_engine/test/auto_test/source/tb_external_transport.cc b/src/video_engine/test/libvietest/testbed/tb_external_transport.cc similarity index 97% rename from src/video_engine/test/auto_test/source/tb_external_transport.cc rename to src/video_engine/test/libvietest/testbed/tb_external_transport.cc index 8670c40fe..e1e30be85 100644 --- a/src/video_engine/test/auto_test/source/tb_external_transport.cc +++ b/src/video_engine/test/libvietest/testbed/tb_external_transport.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "tb_external_transport.h" +#include "video_engine/test/libvietest/include/tb_external_transport.h" #include // printf #include // rand @@ -21,11 +21,11 @@ #include #endif -#include "critical_section_wrapper.h" -#include "event_wrapper.h" -#include "thread_wrapper.h" -#include "tick_util.h" -#include "vie_network.h" +#include "system_wrappers/interface/critical_section_wrapper.h" +#include "system_wrappers/interface/event_wrapper.h" +#include "system_wrappers/interface/thread_wrapper.h" +#include "system_wrappers/interface/tick_util.h" +#include "video_engine/include/vie_network.h" #if defined(_WIN32) #pragma warning(disable: 4355) // 'this' : used in base member initializer list @@ -110,7 +110,7 @@ int TbExternalTransport::SendPacket(int channel, const void *data, int len) ssrc += ptr[10] << 8; ssrc += ptr[11]; if (ssrc != _SSRC) - { + { return len; // return len to avoid error in trace file } } diff --git a/src/video_engine/test/auto_test/source/tb_interfaces.cc b/src/video_engine/test/libvietest/testbed/tb_interfaces.cc similarity index 82% rename from src/video_engine/test/auto_test/source/tb_interfaces.cc rename to src/video_engine/test/libvietest/testbed/tb_interfaces.cc index b6b13a292..80a161c2c 100644 --- a/src/video_engine/test/auto_test/source/tb_interfaces.cc +++ b/src/video_engine/test/libvietest/testbed/tb_interfaces.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -8,20 +8,19 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "tb_interfaces.h" +#include "video_engine/test/libvietest/include/tb_interfaces.h" #include "gtest/gtest.h" +#include "testsupport/fileutils.h" -TbInterfaces::TbInterfaces(const char* test_name) { - std::string trace_file_path = - (ViETest::GetResultOutputPath() + test_name) + "_trace.txt"; - - ViETest::Log("Creating ViE Interfaces for test %s\n", test_name); +TbInterfaces::TbInterfaces(std::string test_name) { + std::string complete_path = + webrtc::test::OutputPath() + test_name + "_trace.txt"; video_engine = webrtc::VideoEngine::Create(); EXPECT_TRUE(video_engine != NULL); - EXPECT_EQ(0, video_engine->SetTraceFile(trace_file_path.c_str())); + EXPECT_EQ(0, video_engine->SetTraceFile(complete_path.c_str())); EXPECT_EQ(0, video_engine->SetTraceFilter(webrtc::kTraceAll)); base = webrtc::ViEBase::GetInterface(video_engine); diff --git a/src/video_engine/test/auto_test/source/tb_video_channel.cc b/src/video_engine/test/libvietest/testbed/tb_video_channel.cc similarity index 94% rename from src/video_engine/test/auto_test/source/tb_video_channel.cc rename to src/video_engine/test/libvietest/testbed/tb_video_channel.cc index 1e62a6ba2..3359f18ed 100644 --- a/src/video_engine/test/auto_test/source/tb_video_channel.cc +++ b/src/video_engine/test/libvietest/testbed/tb_video_channel.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -8,7 +8,9 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "tb_video_channel.h" +#include "video_engine/test/libvietest/include/tb_video_channel.h" + +#include "gtest/gtest.h" TbVideoChannel::TbVideoChannel(TbInterfaces& Engine, webrtc::VideoCodecType sendCodec, int width, diff --git a/src/video_engine/video_engine.gyp b/src/video_engine/video_engine.gyp index 261292c7c..1ca51425b 100644 --- a/src/video_engine/video_engine.gyp +++ b/src/video_engine/video_engine.gyp @@ -16,6 +16,7 @@ 'conditions': [ ['build_with_chromium==0', { 'includes': [ + 'test/libvietest/libvietest.gypi', 'test/auto_test/vie_auto_test.gypi', 'main/test/WindowsTest/windowstest.gypi', ], diff --git a/src/voice_engine/main/test/cmd_test/voe_cmd_test.cc b/src/voice_engine/main/test/cmd_test/voe_cmd_test.cc index 99e88d27a..a57649171 100644 --- a/src/voice_engine/main/test/cmd_test/voe_cmd_test.cc +++ b/src/voice_engine/main/test/cmd_test/voe_cmd_test.cc @@ -144,11 +144,7 @@ int main() { MyObserver my_observer; -#if defined(WEBRTC_ANDROID) - const std::string out_path = "/sdcard/"; -#else const std::string out_path = webrtc::test::OutputPath(); -#endif const std::string trace_filename = out_path + "webrtc_trace.txt"; printf("Set trace filenames (enable trace)\n"); diff --git a/test/testsupport/fileutils.cc b/test/testsupport/fileutils.cc index 1e6bbcaa4..530530867 100644 --- a/test/testsupport/fileutils.cc +++ b/test/testsupport/fileutils.cc @@ -68,6 +68,16 @@ std::string ProjectRootPath() { return kCannotFindProjectRootDir; } +#ifdef WEBRTC_ANDROID + +std::string OutputPath() { + // We need to touch this variable so it doesn't get flagged as unused. + (void)kOutputDirName; + return "/sdcard/"; +} + +#else // WEBRTC_ANDROID + std::string OutputPath() { std::string path = ProjectRootPath(); if (path == kCannotFindProjectRootDir) { @@ -80,6 +90,8 @@ std::string OutputPath() { return path + kPathDelimiter; } +#endif // !WEBRTC_ANDROID + std::string WorkingDir() { char path_buffer[FILENAME_MAX]; if (!GET_CURRENT_DIR(path_buffer, sizeof(path_buffer))) { diff --git a/test/testsupport/fileutils.h b/test/testsupport/fileutils.h index c89ac29d2..b6c134692 100644 --- a/test/testsupport/fileutils.h +++ b/test/testsupport/fileutils.h @@ -92,9 +92,10 @@ extern const char* kCannotFindProjectRootDir; std::string ProjectRootPath(); // Creates and returns the absolute path to the output directory where log files -// and other test artifacts should be put. The output directory is always a +// and other test artifacts should be put. The output directory is generally a // directory named "out" at the top-level of the project, i.e. a subfolder to -// the path returned by ProjectRootPath(). +// the path returned by ProjectRootPath(). The exception is Android where we use +// /sdcard/ instead. // // Details described for ProjectRootPath() apply here too. //