diff --git a/.gn b/.gn index 3e0fcf275e..77394c6440 100644 --- a/.gn +++ b/.gn @@ -42,6 +42,9 @@ check_targets = [ "//webrtc/modules/remote_bitrate_estimator/*", "//webrtc/stats:rtc_stats", "//webrtc/voice_engine", + "//webrtc/voice_engine:audio_coder", + "//webrtc/voice_engine:file_player", + "//webrtc/voice_engine:file_recorder", "//webrtc/voice_engine:level_indicator", ] diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn index bbb5744422..37b5b12ff3 100644 --- a/webrtc/modules/BUILD.gn +++ b/webrtc/modules/BUILD.gn @@ -231,8 +231,6 @@ if (rtc_include_tests) { "//resources/synthetic-trace.rx", "//resources/tmobile-downlink.rx", "//resources/tmobile-uplink.rx", - "//resources/utility/encapsulated_pcm16b_8khz.wav", - "//resources/utility/encapsulated_pcmu_8khz.wav", "//resources/verizon3g-downlink.rx", "//resources/verizon3g-uplink.rx", "//resources/verizon4g-downlink.rx", @@ -483,7 +481,6 @@ if (rtc_include_tests) { "rtp_rtcp/test/testAPI/test_api_audio.cc", "rtp_rtcp/test/testAPI/test_api_rtcp.cc", "rtp_rtcp/test/testAPI/test_api_video.cc", - "utility/source/file_player_unittests.cc", "utility/source/process_thread_impl_unittest.cc", "video_coding/codecs/test/packet_manipulator_unittest.cc", "video_coding/codecs/test/stats_unittest.cc", diff --git a/webrtc/modules/utility/BUILD.gn b/webrtc/modules/utility/BUILD.gn index edd428fe09..48cbf793ed 100644 --- a/webrtc/modules/utility/BUILD.gn +++ b/webrtc/modules/utility/BUILD.gn @@ -11,15 +11,9 @@ import("../../build/webrtc.gni") rtc_static_library("utility") { sources = [ "include/audio_frame_operations.h", - "include/file_player.h", - "include/file_recorder.h", "include/helpers_android.h", "include/jvm_android.h", "include/process_thread.h", - "source/coder.cc", - "source/coder.h", - "source/file_player.cc", - "source/file_recorder.cc", "source/helpers_android.cc", "source/jvm_android.cc", "source/process_thread_impl.cc", diff --git a/webrtc/voice_engine/BUILD.gn b/webrtc/voice_engine/BUILD.gn index 6413c1842a..0591999def 100644 --- a/webrtc/voice_engine/BUILD.gn +++ b/webrtc/voice_engine/BUILD.gn @@ -8,6 +8,64 @@ import("../build/webrtc.gni") +rtc_static_library("audio_coder") { + sources = [ + "coder.cc", + "coder.h", + ] + deps = [ + "..:webrtc_common", + "../modules/audio_coding", + "../modules/audio_coding:audio_format_conversion", + "../modules/audio_coding:builtin_audio_decoder_factory", + "../modules/audio_coding:rent_a_codec", + ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } +} + +rtc_static_library("file_player") { + sources = [ + "file_player.cc", + "file_player.h", + ] + deps = [ + ":audio_coder", + "..:webrtc_common", + "../common_audio", + "../modules/media_file", + "../system_wrappers", + ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } +} + +rtc_static_library("file_recorder") { + sources = [ + "file_recorder.cc", + "file_recorder.h", + ] + deps = [ + ":audio_coder", + "..:webrtc_common", + "../base:rtc_base_approved", + "../common_audio", + "../modules/media_file:media_file", + "../system_wrappers", + ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } +} + rtc_static_library("voice_engine") { sources = [ "channel.cc", @@ -85,6 +143,8 @@ rtc_static_library("voice_engine") { "../modules/audio_coding", ] deps = [ + ":file_player", + ":file_recorder", ":level_indicator", "..:webrtc_common", "../api:audio_mixer_api", @@ -191,6 +251,7 @@ if (rtc_include_tests) { ":voice_engine", "//testing/gmock", "//testing/gtest", + "//third_party/gflags", "//webrtc/common_audio", "//webrtc/modules/audio_coding", "//webrtc/modules/audio_conference_mixer", @@ -210,6 +271,7 @@ if (rtc_include_tests) { sources = [ "channel_unittest.cc", + "file_player_unittests.cc", "test/channel_transport/udp_socket_manager_unittest.cc", "test/channel_transport/udp_socket_wrapper_unittest.cc", "test/channel_transport/udp_transport_unittest.cc", @@ -223,6 +285,11 @@ if (rtc_include_tests) { "voice_engine_fixture.h", ] + data = [ + "//resources/utility/encapsulated_pcm16b_8khz.wav", + "//resources/utility/encapsulated_pcmu_8khz.wav", + ] + if (is_win) { defines = [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ] diff --git a/webrtc/voice_engine/channel.h b/webrtc/voice_engine/channel.h index 01907d269b..11e109e3c8 100644 --- a/webrtc/voice_engine/channel.h +++ b/webrtc/voice_engine/channel.h @@ -28,8 +28,8 @@ #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" -#include "webrtc/modules/utility/include/file_player.h" -#include "webrtc/modules/utility/include/file_recorder.h" +#include "webrtc/voice_engine/file_player.h" +#include "webrtc/voice_engine/file_recorder.h" #include "webrtc/voice_engine/include/voe_audio_processing.h" #include "webrtc/voice_engine/include/voe_base.h" #include "webrtc/voice_engine/include/voe_network.h" diff --git a/webrtc/modules/utility/source/coder.cc b/webrtc/voice_engine/coder.cc similarity index 98% rename from webrtc/modules/utility/source/coder.cc rename to webrtc/voice_engine/coder.cc index 71f969097f..82eb2487b6 100644 --- a/webrtc/modules/utility/source/coder.cc +++ b/webrtc/voice_engine/coder.cc @@ -8,11 +8,12 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include "webrtc/voice_engine/coder.h" + #include "webrtc/common_types.h" #include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h" #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" #include "webrtc/modules/include/module_common_types.h" -#include "webrtc/modules/utility/source/coder.h" namespace webrtc { namespace { diff --git a/webrtc/modules/utility/source/coder.h b/webrtc/voice_engine/coder.h similarity index 93% rename from webrtc/modules/utility/source/coder.h rename to webrtc/voice_engine/coder.h index 4855a00465..5e16b0af66 100644 --- a/webrtc/modules/utility/source/coder.h +++ b/webrtc/voice_engine/coder.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_MODULES_UTILITY_SOURCE_CODER_H_ -#define WEBRTC_MODULES_UTILITY_SOURCE_CODER_H_ +#ifndef WEBRTC_VOICE_ENGINE_CODER_H_ +#define WEBRTC_VOICE_ENGINE_CODER_H_ #include @@ -65,4 +65,4 @@ class AudioCoder : public AudioPacketizationCallback { }; } // namespace webrtc -#endif // WEBRTC_MODULES_UTILITY_SOURCE_CODER_H_ +#endif // WEBRTC_VOICE_ENGINE_CODER_H_ diff --git a/webrtc/modules/utility/source/file_player.cc b/webrtc/voice_engine/file_player.cc similarity index 99% rename from webrtc/modules/utility/source/file_player.cc rename to webrtc/voice_engine/file_player.cc index fa5bc3d2e4..b581d5235b 100644 --- a/webrtc/modules/utility/source/file_player.cc +++ b/webrtc/voice_engine/file_player.cc @@ -8,16 +8,16 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/modules/utility/include/file_player.h" +#include "webrtc/voice_engine/file_player.h" #include "webrtc/common_audio/resampler/include/resampler.h" #include "webrtc/common_types.h" #include "webrtc/modules/media_file/media_file.h" #include "webrtc/modules/media_file/media_file_defines.h" -#include "webrtc/modules/utility/source/coder.h" #include "webrtc/system_wrappers/include/critical_section_wrapper.h" #include "webrtc/system_wrappers/include/logging.h" #include "webrtc/typedefs.h" +#include "webrtc/voice_engine/coder.h" namespace webrtc { diff --git a/webrtc/modules/utility/include/file_player.h b/webrtc/voice_engine/file_player.h similarity index 94% rename from webrtc/modules/utility/include/file_player.h rename to webrtc/voice_engine/file_player.h index 1adbb9d70e..956016f07f 100644 --- a/webrtc/modules/utility/include/file_player.h +++ b/webrtc/voice_engine/file_player.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_FILE_PLAYER_H_ -#define WEBRTC_MODULES_UTILITY_INCLUDE_FILE_PLAYER_H_ +#ifndef WEBRTC_VOICE_ENGINE_FILE_PLAYER_H_ +#define WEBRTC_VOICE_ENGINE_FILE_PLAYER_H_ #include @@ -77,4 +77,4 @@ class FilePlayer { virtual int32_t SetAudioScaling(float scaleFactor) = 0; }; } // namespace webrtc -#endif // WEBRTC_MODULES_UTILITY_INCLUDE_FILE_PLAYER_H_ +#endif // WEBRTC_VOICE_ENGINE_FILE_PLAYER_H_ diff --git a/webrtc/modules/utility/source/file_player_unittests.cc b/webrtc/voice_engine/file_player_unittests.cc similarity index 98% rename from webrtc/modules/utility/source/file_player_unittests.cc rename to webrtc/voice_engine/file_player_unittests.cc index cc7865d150..d41f4044b4 100644 --- a/webrtc/modules/utility/source/file_player_unittests.cc +++ b/webrtc/voice_engine/file_player_unittests.cc @@ -10,7 +10,7 @@ // Unit tests for FilePlayer. -#include "webrtc/modules/utility/include/file_player.h" +#include "webrtc/voice_engine/file_player.h" #include diff --git a/webrtc/modules/utility/source/file_recorder.cc b/webrtc/voice_engine/file_recorder.cc similarity index 98% rename from webrtc/modules/utility/source/file_recorder.cc rename to webrtc/voice_engine/file_recorder.cc index 34bd3945fa..9a0edb057b 100644 --- a/webrtc/modules/utility/source/file_recorder.cc +++ b/webrtc/voice_engine/file_recorder.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/modules/utility/include/file_recorder.h" +#include "webrtc/voice_engine/file_recorder.h" #include @@ -18,10 +18,10 @@ #include "webrtc/modules/include/module_common_types.h" #include "webrtc/modules/media_file/media_file.h" #include "webrtc/modules/media_file/media_file_defines.h" -#include "webrtc/modules/utility/source/coder.h" #include "webrtc/system_wrappers/include/event_wrapper.h" #include "webrtc/system_wrappers/include/logging.h" #include "webrtc/typedefs.h" +#include "webrtc/voice_engine/coder.h" namespace webrtc { diff --git a/webrtc/modules/utility/include/file_recorder.h b/webrtc/voice_engine/file_recorder.h similarity index 91% rename from webrtc/modules/utility/include/file_recorder.h rename to webrtc/voice_engine/file_recorder.h index 6d4d321354..c4195d0eba 100644 --- a/webrtc/modules/utility/include/file_recorder.h +++ b/webrtc/voice_engine/file_recorder.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_FILE_RECORDER_H_ -#define WEBRTC_MODULES_UTILITY_INCLUDE_FILE_RECORDER_H_ +#ifndef WEBRTC_VOICE_ENGINE_FILE_RECORDER_H_ +#define WEBRTC_VOICE_ENGINE_FILE_RECORDER_H_ #include @@ -54,4 +54,4 @@ class FileRecorder { }; } // namespace webrtc -#endif // WEBRTC_MODULES_UTILITY_INCLUDE_FILE_RECORDER_H_ +#endif // WEBRTC_VOICE_ENGINE_FILE_RECORDER_H_ diff --git a/webrtc/voice_engine/output_mixer.h b/webrtc/voice_engine/output_mixer.h index cc8dddfbfc..5e3e2e708e 100644 --- a/webrtc/voice_engine/output_mixer.h +++ b/webrtc/voice_engine/output_mixer.h @@ -18,7 +18,7 @@ #include "webrtc/common_types.h" #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer.h" #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_defines.h" -#include "webrtc/modules/utility/include/file_recorder.h" +#include "webrtc/voice_engine/file_recorder.h" #include "webrtc/voice_engine/level_indicator.h" #include "webrtc/voice_engine/voice_engine_defines.h" diff --git a/webrtc/voice_engine/transmit_mixer.h b/webrtc/voice_engine/transmit_mixer.h index 3147c1036f..13ddaa5492 100644 --- a/webrtc/voice_engine/transmit_mixer.h +++ b/webrtc/voice_engine/transmit_mixer.h @@ -18,8 +18,8 @@ #include "webrtc/common_types.h" #include "webrtc/modules/audio_processing/typing_detection.h" #include "webrtc/modules/include/module_common_types.h" -#include "webrtc/modules/utility/include/file_player.h" -#include "webrtc/modules/utility/include/file_recorder.h" +#include "webrtc/voice_engine/file_player.h" +#include "webrtc/voice_engine/file_recorder.h" #include "webrtc/voice_engine/include/voe_base.h" #include "webrtc/voice_engine/level_indicator.h" #include "webrtc/voice_engine/monitor_module.h"