aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/utility
diff options
context:
space:
mode:
Diffstat (limited to 'webrtc/modules/utility')
-rw-r--r--webrtc/modules/utility/BUILD.gn12
-rw-r--r--webrtc/modules/utility/OWNERS5
-rw-r--r--webrtc/modules/utility/include/audio_frame_operations.h (renamed from webrtc/modules/utility/interface/audio_frame_operations.h)6
-rw-r--r--webrtc/modules/utility/include/file_player.h (renamed from webrtc/modules/utility/interface/file_player.h)8
-rw-r--r--webrtc/modules/utility/include/file_recorder.h (renamed from webrtc/modules/utility/interface/file_recorder.h)10
-rw-r--r--webrtc/modules/utility/include/helpers_android.h (renamed from webrtc/modules/utility/interface/helpers_android.h)6
-rw-r--r--webrtc/modules/utility/include/helpers_ios.h (renamed from webrtc/modules/utility/interface/helpers_ios.h)6
-rw-r--r--webrtc/modules/utility/include/jvm_android.h (renamed from webrtc/modules/utility/interface/jvm_android.h)8
-rw-r--r--webrtc/modules/utility/include/mock/mock_process_thread.h (renamed from webrtc/modules/utility/interface/mock/mock_process_thread.h)8
-rw-r--r--webrtc/modules/utility/include/process_thread.h (renamed from webrtc/modules/utility/interface/process_thread.h)6
-rw-r--r--webrtc/modules/utility/source/audio_frame_operations.cc4
-rw-r--r--webrtc/modules/utility/source/audio_frame_operations_unittest.cc4
-rw-r--r--webrtc/modules/utility/source/coder.cc2
-rw-r--r--webrtc/modules/utility/source/coder.h2
-rw-r--r--webrtc/modules/utility/source/file_player_impl.h6
-rw-r--r--webrtc/modules/utility/source/file_player_unittests.cc17
-rw-r--r--webrtc/modules/utility/source/file_recorder_impl.cc2
-rw-r--r--webrtc/modules/utility/source/file_recorder_impl.h10
-rw-r--r--webrtc/modules/utility/source/helpers_android.cc2
-rw-r--r--webrtc/modules/utility/source/helpers_ios.mm2
-rw-r--r--webrtc/modules/utility/source/jvm_android.cc2
-rw-r--r--webrtc/modules/utility/source/process_thread_impl.cc13
-rw-r--r--webrtc/modules/utility/source/process_thread_impl.h7
-rw-r--r--webrtc/modules/utility/source/process_thread_impl_unittest.cc13
-rw-r--r--webrtc/modules/utility/utility.gypi14
25 files changed, 95 insertions, 80 deletions
diff --git a/webrtc/modules/utility/BUILD.gn b/webrtc/modules/utility/BUILD.gn
index 163515c466..6704cd6d9a 100644
--- a/webrtc/modules/utility/BUILD.gn
+++ b/webrtc/modules/utility/BUILD.gn
@@ -10,12 +10,12 @@ import("../../build/webrtc.gni")
source_set("utility") {
sources = [
- "interface/audio_frame_operations.h",
- "interface/file_player.h",
- "interface/file_recorder.h",
- "interface/helpers_android.h",
- "interface/jvm_android.h",
- "interface/process_thread.h",
+ "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/audio_frame_operations.cc",
"source/coder.cc",
"source/coder.h",
diff --git a/webrtc/modules/utility/OWNERS b/webrtc/modules/utility/OWNERS
index 347d278614..65cb70c9b9 100644
--- a/webrtc/modules/utility/OWNERS
+++ b/webrtc/modules/utility/OWNERS
@@ -1,4 +1,9 @@
asapersson@webrtc.org
perkj@webrtc.org
+# These are for the common case of adding or renaming files. If you're doing
+# structural changes, please get a review from a reviewer in this file.
+per-file *.gyp=*
+per-file *.gypi=*
+
per-file BUILD.gn=kjellander@webrtc.org
diff --git a/webrtc/modules/utility/interface/audio_frame_operations.h b/webrtc/modules/utility/include/audio_frame_operations.h
index c2af68ab1b..1551d86894 100644
--- a/webrtc/modules/utility/interface/audio_frame_operations.h
+++ b/webrtc/modules/utility/include/audio_frame_operations.h
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_VOICE_ENGINE_AUDIO_FRAME_OPERATIONS_H_
-#define WEBRTC_VOICE_ENGINE_AUDIO_FRAME_OPERATIONS_H_
+#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_AUDIO_FRAME_OPERATIONS_H_
+#define WEBRTC_MODULES_UTILITY_INCLUDE_AUDIO_FRAME_OPERATIONS_H_
#include "webrtc/typedefs.h"
@@ -55,4 +55,4 @@ class AudioFrameOperations {
} // namespace webrtc
-#endif // #ifndef WEBRTC_VOICE_ENGINE_AUDIO_FRAME_OPERATIONS_H_
+#endif // #ifndef WEBRTC_MODULES_UTILITY_INCLUDE_AUDIO_FRAME_OPERATIONS_H_
diff --git a/webrtc/modules/utility/interface/file_player.h b/webrtc/modules/utility/include/file_player.h
index 44f03e475a..4ca134a669 100644
--- a/webrtc/modules/utility/interface/file_player.h
+++ b/webrtc/modules/utility/include/file_player.h
@@ -8,12 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_MODULES_UTILITY_INTERFACE_FILE_PLAYER_H_
-#define WEBRTC_MODULES_UTILITY_INTERFACE_FILE_PLAYER_H_
+#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_FILE_PLAYER_H_
+#define WEBRTC_MODULES_UTILITY_INCLUDE_FILE_PLAYER_H_
#include "webrtc/common_types.h"
#include "webrtc/engine_configurations.h"
-#include "webrtc/modules/interface/module_common_types.h"
+#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/typedefs.h"
#include "webrtc/video_frame.h"
@@ -108,4 +108,4 @@ protected:
};
} // namespace webrtc
-#endif // WEBRTC_MODULES_UTILITY_INTERFACE_FILE_PLAYER_H_
+#endif // WEBRTC_MODULES_UTILITY_INCLUDE_FILE_PLAYER_H_
diff --git a/webrtc/modules/utility/interface/file_recorder.h b/webrtc/modules/utility/include/file_recorder.h
index f2ce785368..09ed8ae350 100644
--- a/webrtc/modules/utility/interface/file_recorder.h
+++ b/webrtc/modules/utility/include/file_recorder.h
@@ -8,13 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_MODULES_UTILITY_INTERFACE_FILE_RECORDER_H_
-#define WEBRTC_MODULES_UTILITY_INTERFACE_FILE_RECORDER_H_
+#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_FILE_RECORDER_H_
+#define WEBRTC_MODULES_UTILITY_INCLUDE_FILE_RECORDER_H_
#include "webrtc/common_types.h"
#include "webrtc/engine_configurations.h"
-#include "webrtc/modules/interface/module_common_types.h"
-#include "webrtc/modules/media_file/interface/media_file_defines.h"
+#include "webrtc/modules/include/module_common_types.h"
+#include "webrtc/modules/media_file/media_file_defines.h"
#include "webrtc/system_wrappers/include/tick_util.h"
#include "webrtc/typedefs.h"
#include "webrtc/video_frame.h"
@@ -81,4 +81,4 @@ protected:
};
} // namespace webrtc
-#endif // WEBRTC_MODULES_UTILITY_INTERFACE_FILE_RECORDER_H_
+#endif // WEBRTC_MODULES_UTILITY_INCLUDE_FILE_RECORDER_H_
diff --git a/webrtc/modules/utility/interface/helpers_android.h b/webrtc/modules/utility/include/helpers_android.h
index 5c73fe4566..2840ca965e 100644
--- a/webrtc/modules/utility/interface/helpers_android.h
+++ b/webrtc/modules/utility/include/helpers_android.h
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_MODULES_UTILITY_INTERFACE_HELPERS_ANDROID_H_
-#define WEBRTC_MODULES_UTILITY_INTERFACE_HELPERS_ANDROID_H_
+#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_ANDROID_H_
+#define WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_ANDROID_H_
#include <jni.h>
#include <string>
@@ -84,4 +84,4 @@ class ScopedGlobalRef {
} // namespace webrtc
-#endif // WEBRTC_MODULES_UTILITY_INTERFACE_HELPERS_ANDROID_H_
+#endif // WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_ANDROID_H_
diff --git a/webrtc/modules/utility/interface/helpers_ios.h b/webrtc/modules/utility/include/helpers_ios.h
index a5edee0279..a5a07ace17 100644
--- a/webrtc/modules/utility/interface/helpers_ios.h
+++ b/webrtc/modules/utility/include/helpers_ios.h
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_MODULES_UTILITY_INTERFACE_HELPERS_IOS_H_
-#define WEBRTC_MODULES_UTILITY_INTERFACE_HELPERS_IOS_H_
+#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_IOS_H_
+#define WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_IOS_H_
#if defined(WEBRTC_IOS)
@@ -56,4 +56,4 @@ std::string GetDeviceName();
#endif // defined(WEBRTC_IOS)
-#endif // WEBRTC_MODULES_UTILITY_INTERFACE_HELPERS_IOS_H_
+#endif // WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_IOS_H_
diff --git a/webrtc/modules/utility/interface/jvm_android.h b/webrtc/modules/utility/include/jvm_android.h
index 0744fdbf12..f527dff632 100644
--- a/webrtc/modules/utility/interface/jvm_android.h
+++ b/webrtc/modules/utility/include/jvm_android.h
@@ -8,15 +8,15 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_MODULES_UTILITY_SOURCE_JVM_H_
-#define WEBRTC_MODULES_UTILITY_SOURCE_JVM_H_
+#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_JVM_ANDROID_H_
+#define WEBRTC_MODULES_UTILITY_INCLUDE_JVM_ANDROID_H_
#include <jni.h>
#include <string>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread_checker.h"
-#include "webrtc/modules/utility/interface/helpers_android.h"
+#include "webrtc/modules/utility/include/helpers_android.h"
namespace webrtc {
@@ -182,4 +182,4 @@ class JVM {
} // namespace webrtc
-#endif // WEBRTC_MODULES_UTILITY_SOURCE_JVM_H_
+#endif // WEBRTC_MODULES_UTILITY_INCLUDE_JVM_ANDROID_H_
diff --git a/webrtc/modules/utility/interface/mock/mock_process_thread.h b/webrtc/modules/utility/include/mock/mock_process_thread.h
index fd108a8354..56d92f4527 100644
--- a/webrtc/modules/utility/interface/mock/mock_process_thread.h
+++ b/webrtc/modules/utility/include/mock/mock_process_thread.h
@@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_MODULES_UTILITY_INTERFACE_MOCK_PROCESS_THREAD_H_
-#define WEBRTC_MODULES_UTILITY_INTERFACE_MOCK_PROCESS_THREAD_H_
+#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_MOCK_MOCK_PROCESS_THREAD_H_
+#define WEBRTC_MODULES_UTILITY_INCLUDE_MOCK_MOCK_PROCESS_THREAD_H_
-#include "webrtc/modules/utility/interface/process_thread.h"
+#include "webrtc/modules/utility/include/process_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -35,4 +35,4 @@ class MockProcessThread : public ProcessThread {
};
} // namespace webrtc
-#endif // WEBRTC_MODULES_UTILITY_INTERFACE_MOCK_PROCESS_THREAD_H_
+#endif // WEBRTC_MODULES_UTILITY_INCLUDE_MOCK_MOCK_PROCESS_THREAD_H_
diff --git a/webrtc/modules/utility/interface/process_thread.h b/webrtc/modules/utility/include/process_thread.h
index 451a5a301b..285a5ea587 100644
--- a/webrtc/modules/utility/interface/process_thread.h
+++ b/webrtc/modules/utility/include/process_thread.h
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_MODULES_UTILITY_INTERFACE_PROCESS_THREAD_H_
-#define WEBRTC_MODULES_UTILITY_INTERFACE_PROCESS_THREAD_H_
+#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_PROCESS_THREAD_H_
+#define WEBRTC_MODULES_UTILITY_INCLUDE_PROCESS_THREAD_H_
#include "webrtc/typedefs.h"
#include "webrtc/base/scoped_ptr.h"
@@ -63,4 +63,4 @@ class ProcessThread {
} // namespace webrtc
-#endif // WEBRTC_MODULES_UTILITY_INTERFACE_PROCESS_THREAD_H_
+#endif // WEBRTC_MODULES_UTILITY_INCLUDE_PROCESS_THREAD_H_
diff --git a/webrtc/modules/utility/source/audio_frame_operations.cc b/webrtc/modules/utility/source/audio_frame_operations.cc
index c07ca1fdf6..fe09d7972f 100644
--- a/webrtc/modules/utility/source/audio_frame_operations.cc
+++ b/webrtc/modules/utility/source/audio_frame_operations.cc
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "webrtc/modules/interface/module_common_types.h"
-#include "webrtc/modules/utility/interface/audio_frame_operations.h"
+#include "webrtc/modules/include/module_common_types.h"
+#include "webrtc/modules/utility/include/audio_frame_operations.h"
namespace webrtc {
diff --git a/webrtc/modules/utility/source/audio_frame_operations_unittest.cc b/webrtc/modules/utility/source/audio_frame_operations_unittest.cc
index c278cdddcd..fff8f4407b 100644
--- a/webrtc/modules/utility/source/audio_frame_operations_unittest.cc
+++ b/webrtc/modules/utility/source/audio_frame_operations_unittest.cc
@@ -10,8 +10,8 @@
#include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/modules/interface/module_common_types.h"
-#include "webrtc/modules/utility/interface/audio_frame_operations.h"
+#include "webrtc/modules/include/module_common_types.h"
+#include "webrtc/modules/utility/include/audio_frame_operations.h"
namespace webrtc {
namespace {
diff --git a/webrtc/modules/utility/source/coder.cc b/webrtc/modules/utility/source/coder.cc
index 4ec5f9b4e2..18b690dc67 100644
--- a/webrtc/modules/utility/source/coder.cc
+++ b/webrtc/modules/utility/source/coder.cc
@@ -9,7 +9,7 @@
*/
#include "webrtc/common_types.h"
-#include "webrtc/modules/interface/module_common_types.h"
+#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/modules/utility/source/coder.h"
namespace webrtc {
diff --git a/webrtc/modules/utility/source/coder.h b/webrtc/modules/utility/source/coder.h
index 4270e9b380..abfa87efe1 100644
--- a/webrtc/modules/utility/source/coder.h
+++ b/webrtc/modules/utility/source/coder.h
@@ -13,7 +13,7 @@
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_types.h"
-#include "webrtc/modules/audio_coding/main/include/audio_coding_module.h"
+#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
#include "webrtc/typedefs.h"
namespace webrtc {
diff --git a/webrtc/modules/utility/source/file_player_impl.h b/webrtc/modules/utility/source/file_player_impl.h
index f411db9151..beb6379ff0 100644
--- a/webrtc/modules/utility/source/file_player_impl.h
+++ b/webrtc/modules/utility/source/file_player_impl.h
@@ -14,9 +14,9 @@
#include "webrtc/common_audio/resampler/include/resampler.h"
#include "webrtc/common_types.h"
#include "webrtc/engine_configurations.h"
-#include "webrtc/modules/media_file/interface/media_file.h"
-#include "webrtc/modules/media_file/interface/media_file_defines.h"
-#include "webrtc/modules/utility/interface/file_player.h"
+#include "webrtc/modules/media_file/media_file.h"
+#include "webrtc/modules/media_file/media_file_defines.h"
+#include "webrtc/modules/utility/include/file_player.h"
#include "webrtc/modules/utility/source/coder.h"
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
#include "webrtc/system_wrappers/include/tick_util.h"
diff --git a/webrtc/modules/utility/source/file_player_unittests.cc b/webrtc/modules/utility/source/file_player_unittests.cc
index 4b65acdeef..58471e5e8d 100644
--- a/webrtc/modules/utility/source/file_player_unittests.cc
+++ b/webrtc/modules/utility/source/file_player_unittests.cc
@@ -10,7 +10,7 @@
// Unit tests for FilePlayer.
-#include "webrtc/modules/utility/interface/file_player.h"
+#include "webrtc/modules/utility/include/file_player.h"
#include <stdio.h>
#include <string>
@@ -20,7 +20,6 @@
#include "webrtc/base/md5digest.h"
#include "webrtc/base/stringencode.h"
#include "webrtc/test/testsupport/fileutils.h"
-#include "webrtc/test/testsupport/gtest_disable.h"
DEFINE_bool(file_player_output, false, "Generate reference files.");
@@ -82,7 +81,12 @@ class FilePlayerTest : public ::testing::Test {
FILE* output_file_;
};
-TEST_F(FilePlayerTest, DISABLED_ON_IOS(PlayWavPcmuFile)) {
+#if defined(WEBRTC_IOS)
+#define MAYBE_PlayWavPcmuFile DISABLED_PlayWavPcmuFile
+#else
+#define MAYBE_PlayWavPcmuFile PlayWavPcmuFile
+#endif
+TEST_F(FilePlayerTest, MAYBE_PlayWavPcmuFile) {
const std::string kFileName =
test::ResourcePath("utility/encapsulated_pcmu_8khz", "wav");
// The file is longer than this, but keeping the output shorter limits the
@@ -93,7 +97,12 @@ TEST_F(FilePlayerTest, DISABLED_ON_IOS(PlayWavPcmuFile)) {
PlayFileAndCheck(kFileName, kRefChecksum, kOutputLengthMs);
}
-TEST_F(FilePlayerTest, DISABLED_ON_IOS(PlayWavPcm16File)) {
+#if defined(WEBRTC_IOS)
+#define MAYBE_PlayWavPcm16File DISABLED_PlayWavPcm16File
+#else
+#define MAYBE_PlayWavPcm16File PlayWavPcm16File
+#endif
+TEST_F(FilePlayerTest, MAYBE_PlayWavPcm16File) {
const std::string kFileName =
test::ResourcePath("utility/encapsulated_pcm16b_8khz", "wav");
// The file is longer than this, but keeping the output shorter limits the
diff --git a/webrtc/modules/utility/source/file_recorder_impl.cc b/webrtc/modules/utility/source/file_recorder_impl.cc
index 13926deb4a..88b20eeac2 100644
--- a/webrtc/modules/utility/source/file_recorder_impl.cc
+++ b/webrtc/modules/utility/source/file_recorder_impl.cc
@@ -10,7 +10,7 @@
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/engine_configurations.h"
-#include "webrtc/modules/media_file/interface/media_file.h"
+#include "webrtc/modules/media_file/media_file.h"
#include "webrtc/modules/utility/source/file_recorder_impl.h"
#include "webrtc/system_wrappers/include/logging.h"
diff --git a/webrtc/modules/utility/source/file_recorder_impl.h b/webrtc/modules/utility/source/file_recorder_impl.h
index 8ea96bdad4..697d759375 100644
--- a/webrtc/modules/utility/source/file_recorder_impl.h
+++ b/webrtc/modules/utility/source/file_recorder_impl.h
@@ -17,16 +17,16 @@
#include <list>
+#include "webrtc/base/platform_thread.h"
#include "webrtc/common_audio/resampler/include/resampler.h"
#include "webrtc/common_types.h"
#include "webrtc/engine_configurations.h"
-#include "webrtc/modules/interface/module_common_types.h"
-#include "webrtc/modules/media_file/interface/media_file.h"
-#include "webrtc/modules/media_file/interface/media_file_defines.h"
-#include "webrtc/modules/utility/interface/file_recorder.h"
+#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/include/file_recorder.h"
#include "webrtc/modules/utility/source/coder.h"
#include "webrtc/system_wrappers/include/event_wrapper.h"
-#include "webrtc/system_wrappers/include/thread_wrapper.h"
#include "webrtc/system_wrappers/include/tick_util.h"
#include "webrtc/typedefs.h"
diff --git a/webrtc/modules/utility/source/helpers_android.cc b/webrtc/modules/utility/source/helpers_android.cc
index 25652f237e..aea35f8d5a 100644
--- a/webrtc/modules/utility/source/helpers_android.cc
+++ b/webrtc/modules/utility/source/helpers_android.cc
@@ -9,7 +9,7 @@
*/
#include "webrtc/base/checks.h"
-#include "webrtc/modules/utility/interface/helpers_android.h"
+#include "webrtc/modules/utility/include/helpers_android.h"
#include <android/log.h>
#include <assert.h>
diff --git a/webrtc/modules/utility/source/helpers_ios.mm b/webrtc/modules/utility/source/helpers_ios.mm
index 90b7c8f605..2d0ac098c1 100644
--- a/webrtc/modules/utility/source/helpers_ios.mm
+++ b/webrtc/modules/utility/source/helpers_ios.mm
@@ -18,7 +18,7 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/scoped_ptr.h"
-#include "webrtc/modules/utility/interface/helpers_ios.h"
+#include "webrtc/modules/utility/include/helpers_ios.h"
namespace webrtc {
namespace ios {
diff --git a/webrtc/modules/utility/source/jvm_android.cc b/webrtc/modules/utility/source/jvm_android.cc
index 648c1685ea..eb37fda040 100644
--- a/webrtc/modules/utility/source/jvm_android.cc
+++ b/webrtc/modules/utility/source/jvm_android.cc
@@ -10,7 +10,7 @@
#include <android/log.h>
-#include "webrtc/modules/utility/interface/jvm_android.h"
+#include "webrtc/modules/utility/include/jvm_android.h"
#include "webrtc/base/checks.h"
diff --git a/webrtc/modules/utility/source/process_thread_impl.cc b/webrtc/modules/utility/source/process_thread_impl.cc
index 04fa88739f..8cdf01634c 100644
--- a/webrtc/modules/utility/source/process_thread_impl.cc
+++ b/webrtc/modules/utility/source/process_thread_impl.cc
@@ -11,7 +11,7 @@
#include "webrtc/modules/utility/source/process_thread_impl.h"
#include "webrtc/base/checks.h"
-#include "webrtc/modules/interface/module.h"
+#include "webrtc/modules/include/module.h"
#include "webrtc/system_wrappers/include/logging.h"
#include "webrtc/system_wrappers/include/tick_util.h"
@@ -38,8 +38,7 @@ ProcessThread::~ProcessThread() {}
// static
rtc::scoped_ptr<ProcessThread> ProcessThread::Create(
const char* thread_name) {
- return rtc::scoped_ptr<ProcessThread>(new ProcessThreadImpl(thread_name))
- .Pass();
+ return rtc::scoped_ptr<ProcessThread>(new ProcessThreadImpl(thread_name));
}
ProcessThreadImpl::ProcessThreadImpl(const char* thread_name)
@@ -76,9 +75,9 @@ void ProcessThreadImpl::Start() {
m.module->ProcessThreadAttached(this);
}
- thread_ = ThreadWrapper::CreateThread(&ProcessThreadImpl::Run, this,
- thread_name_);
- RTC_CHECK(thread_->Start());
+ thread_.reset(
+ new rtc::PlatformThread(&ProcessThreadImpl::Run, this, thread_name_));
+ thread_->Start();
}
void ProcessThreadImpl::Stop() {
@@ -93,7 +92,7 @@ void ProcessThreadImpl::Stop() {
wake_up_->Set();
- RTC_CHECK(thread_->Stop());
+ thread_->Stop();
stop_ = false;
// TODO(tommi): Since DeRegisterModule is currently being called from
diff --git a/webrtc/modules/utility/source/process_thread_impl.h b/webrtc/modules/utility/source/process_thread_impl.h
index 4e5861b41e..1c0a0cdfdd 100644
--- a/webrtc/modules/utility/source/process_thread_impl.h
+++ b/webrtc/modules/utility/source/process_thread_impl.h
@@ -15,10 +15,10 @@
#include <queue>
#include "webrtc/base/criticalsection.h"
+#include "webrtc/base/platform_thread.h"
#include "webrtc/base/thread_checker.h"
-#include "webrtc/modules/utility/interface/process_thread.h"
+#include "webrtc/modules/utility/include/process_thread.h"
#include "webrtc/system_wrappers/include/event_wrapper.h"
-#include "webrtc/system_wrappers/include/thread_wrapper.h"
#include "webrtc/typedefs.h"
namespace webrtc {
@@ -70,7 +70,8 @@ class ProcessThreadImpl : public ProcessThread {
rtc::ThreadChecker thread_checker_;
const rtc::scoped_ptr<EventWrapper> wake_up_;
- rtc::scoped_ptr<ThreadWrapper> thread_;
+ // TODO(pbos): Remove scoped_ptr and stop recreating the thread.
+ rtc::scoped_ptr<rtc::PlatformThread> thread_;
ModuleList modules_;
// TODO(tommi): Support delayed tasks.
diff --git a/webrtc/modules/utility/source/process_thread_impl_unittest.cc b/webrtc/modules/utility/source/process_thread_impl_unittest.cc
index e080545312..0b35fad7d2 100644
--- a/webrtc/modules/utility/source/process_thread_impl_unittest.cc
+++ b/webrtc/modules/utility/source/process_thread_impl_unittest.cc
@@ -8,9 +8,11 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <utility>
+
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/modules/interface/module.h"
+#include "webrtc/modules/include/module.h"
#include "webrtc/modules/utility/source/process_thread_impl.h"
#include "webrtc/system_wrappers/include/tick_util.h"
@@ -251,8 +253,9 @@ TEST(ProcessThreadImpl, WakeUp) {
rtc::scoped_ptr<EventWrapper> called(EventWrapper::Create());
MockModule module;
- int64_t start_time = 0;
- int64_t called_time = 0;
+ int64_t start_time;
+ int64_t called_time;
+
// Ask for a callback after 1000ms.
// TimeUntilNextProcess will be called twice.
// The first time we use it to get the thread into a waiting state.
@@ -281,8 +284,6 @@ TEST(ProcessThreadImpl, WakeUp) {
EXPECT_CALL(module, ProcessThreadAttached(nullptr)).Times(1);
thread.Stop();
- ASSERT_GT(start_time, 0);
- ASSERT_GT(called_time, 0);
EXPECT_GE(called_time, start_time);
uint32_t diff = called_time - start_time;
// We should have been called back much quicker than 1sec.
@@ -296,7 +297,7 @@ TEST(ProcessThreadImpl, PostTask) {
rtc::scoped_ptr<EventWrapper> task_ran(EventWrapper::Create());
rtc::scoped_ptr<RaiseEventTask> task(new RaiseEventTask(task_ran.get()));
thread.Start();
- thread.PostTask(task.Pass());
+ thread.PostTask(std::move(task));
EXPECT_EQ(kEventSignaled, task_ran->Wait(100));
thread.Stop();
}
diff --git a/webrtc/modules/utility/utility.gypi b/webrtc/modules/utility/utility.gypi
index 38c9e3ebd9..e5b0a4d9c0 100644
--- a/webrtc/modules/utility/utility.gypi
+++ b/webrtc/modules/utility/utility.gypi
@@ -18,13 +18,13 @@
'<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
],
'sources': [
- 'interface/audio_frame_operations.h',
- 'interface/file_player.h',
- 'interface/file_recorder.h',
- 'interface/helpers_android.h',
- 'interface/helpers_ios.h',
- 'interface/jvm_android.h',
- 'interface/process_thread.h',
+ 'include/audio_frame_operations.h',
+ 'include/file_player.h',
+ 'include/file_recorder.h',
+ 'include/helpers_android.h',
+ 'include/helpers_ios.h',
+ 'include/jvm_android.h',
+ 'include/process_thread.h',
'source/audio_frame_operations.cc',
'source/coder.cc',
'source/coder.h',