diff options
Diffstat (limited to 'webrtc/modules/video_capture')
15 files changed, 76 insertions, 40 deletions
diff --git a/webrtc/modules/video_capture/BUILD.gn b/webrtc/modules/video_capture/BUILD.gn index b0ed6f4e6c..78f5212950 100644 --- a/webrtc/modules/video_capture/BUILD.gn +++ b/webrtc/modules/video_capture/BUILD.gn @@ -16,11 +16,11 @@ source_set("video_capture_module") { sources = [ "device_info_impl.cc", "device_info_impl.h", - "include/video_capture.h", - "include/video_capture_defines.h", - "include/video_capture_factory.h", + "video_capture.h", "video_capture_config.h", + "video_capture_defines.h", "video_capture_delay.h", + "video_capture_factory.h", "video_capture_factory.cc", "video_capture_impl.cc", "video_capture_impl.h", diff --git a/webrtc/modules/video_capture/device_info_impl.h b/webrtc/modules/video_capture/device_info_impl.h index 420808bcee..44e7dd596b 100644 --- a/webrtc/modules/video_capture/device_info_impl.h +++ b/webrtc/modules/video_capture/device_info_impl.h @@ -13,7 +13,7 @@ #include <vector> -#include "webrtc/modules/video_capture/include/video_capture.h" +#include "webrtc/modules/video_capture/video_capture.h" #include "webrtc/modules/video_capture/video_capture_delay.h" #include "webrtc/system_wrappers/include/rw_lock_wrapper.h" diff --git a/webrtc/modules/video_capture/ios/device_info_ios_objc.h b/webrtc/modules/video_capture/ios/device_info_ios_objc.h index 65444bedcb..d67b559972 100644 --- a/webrtc/modules/video_capture/ios/device_info_ios_objc.h +++ b/webrtc/modules/video_capture/ios/device_info_ios_objc.h @@ -13,7 +13,7 @@ #import <AVFoundation/AVFoundation.h> -#include "webrtc/modules/video_capture/include/video_capture_defines.h" +#include "webrtc/modules/video_capture/video_capture_defines.h" @interface DeviceInfoIosObjC : NSObject + (int)captureDeviceCount; diff --git a/webrtc/modules/video_capture/linux/video_capture_linux.cc b/webrtc/modules/video_capture/linux/video_capture_linux.cc index fe99c7136f..401a69d8c1 100644 --- a/webrtc/modules/video_capture/linux/video_capture_linux.cc +++ b/webrtc/modules/video_capture/linux/video_capture_linux.cc @@ -280,10 +280,10 @@ int32_t VideoCaptureModuleV4L2::StartCapture( //start capture thread; if (!_captureThread) { - _captureThread = ThreadWrapper::CreateThread( - VideoCaptureModuleV4L2::CaptureThread, this, "CaptureThread"); + _captureThread.reset(new rtc::PlatformThread( + VideoCaptureModuleV4L2::CaptureThread, this, "CaptureThread")); _captureThread->Start(); - _captureThread->SetPriority(kHighPriority); + _captureThread->SetPriority(rtc::kHighPriority); } // Needed to start UVC camera - from the uvcview application diff --git a/webrtc/modules/video_capture/linux/video_capture_linux.h b/webrtc/modules/video_capture/linux/video_capture_linux.h index 996f8e10ca..8172eb8d2a 100644 --- a/webrtc/modules/video_capture/linux/video_capture_linux.h +++ b/webrtc/modules/video_capture/linux/video_capture_linux.h @@ -11,9 +11,9 @@ #ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_LINUX_VIDEO_CAPTURE_LINUX_H_ #define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_LINUX_VIDEO_CAPTURE_LINUX_H_ +#include "webrtc/base/platform_thread.h" #include "webrtc/common_types.h" #include "webrtc/modules/video_capture/video_capture_impl.h" -#include "webrtc/system_wrappers/include/thread_wrapper.h" namespace webrtc { @@ -39,7 +39,8 @@ private: bool AllocateVideoBuffers(); bool DeAllocateVideoBuffers(); - rtc::scoped_ptr<ThreadWrapper> _captureThread; + // TODO(pbos): Stop using scoped_ptr and resetting the thread. + rtc::scoped_ptr<rtc::PlatformThread> _captureThread; CriticalSectionWrapper* _captureCritSect; int32_t _deviceId; diff --git a/webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit_info.mm b/webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit_info.mm index 1251ecd830..0c0c6a1261 100644 --- a/webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit_info.mm +++ b/webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit_info.mm @@ -9,7 +9,7 @@ */ #import "webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit_info_objc.h" -#include "webrtc/modules/video_capture/include/video_capture.h" +#include "webrtc/modules/video_capture/video_capture.h" #include "webrtc/modules/video_capture/video_capture_config.h" #include "webrtc/system_wrappers/include/trace.h" diff --git a/webrtc/modules/video_capture/test/video_capture_unittest.cc b/webrtc/modules/video_capture/test/video_capture_unittest.cc index 2b8786b0fe..45d2d2f241 100644 --- a/webrtc/modules/video_capture/test/video_capture_unittest.cc +++ b/webrtc/modules/video_capture/test/video_capture_unittest.cc @@ -17,13 +17,12 @@ #include "webrtc/base/scoped_ptr.h" #include "webrtc/base/scoped_ref_ptr.h" #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" -#include "webrtc/modules/utility/interface/process_thread.h" -#include "webrtc/modules/video_capture/include/video_capture.h" -#include "webrtc/modules/video_capture/include/video_capture_factory.h" +#include "webrtc/modules/utility/include/process_thread.h" +#include "webrtc/modules/video_capture/video_capture.h" +#include "webrtc/modules/video_capture/video_capture_factory.h" #include "webrtc/system_wrappers/include/critical_section_wrapper.h" #include "webrtc/system_wrappers/include/sleep.h" #include "webrtc/system_wrappers/include/tick_util.h" -#include "webrtc/test/testsupport/gtest_disable.h" #include "webrtc/video_frame.h" using rtc::scoped_ptr; @@ -47,14 +46,14 @@ using webrtc::VideoCaptureModule; SleepMs(5); \ res = (ex); \ } \ - } while (0);\ + } while (0) #define EXPECT_TRUE_WAIT(ex, timeout) \ do { \ bool res; \ WAIT_(ex, timeout, res); \ if (!res) EXPECT_TRUE(ex); \ - } while (0); + } while (0) static const int kTimeOut = 5000; @@ -275,7 +274,14 @@ class VideoCaptureTest : public testing::Test { unsigned int number_of_devices_; }; -TEST_F(VideoCaptureTest, CreateDelete) { +#ifdef WEBRTC_MAC +// Currently fails on Mac 64-bit, see +// https://bugs.chromium.org/p/webrtc/issues/detail?id=5406 +#define MAYBE_CreateDelete DISABLED_CreateDelete +#else +#define MAYBE_CreateDelete CreateDelete +#endif +TEST_F(VideoCaptureTest, MAYBE_CreateDelete) { for (int i = 0; i < 5; ++i) { int64_t start_time = TickTime::MillisecondTimestamp(); TestVideoCaptureCallback capture_observer; @@ -312,7 +318,14 @@ TEST_F(VideoCaptureTest, CreateDelete) { } } -TEST_F(VideoCaptureTest, Capabilities) { +#ifdef WEBRTC_MAC +// Currently fails on Mac 64-bit, see +// https://bugs.chromium.org/p/webrtc/issues/detail?id=5406 +#define MAYBE_Capabilities DISABLED_Capabilities +#else +#define MAYBE_Capabilities Capabilities +#endif +TEST_F(VideoCaptureTest, MAYBE_Capabilities) { #ifdef WEBRTC_MAC printf("Video capture capabilities are not supported on Mac.\n"); return; @@ -479,7 +492,12 @@ TEST_F(VideoCaptureExternalTest, TestExternalCapture) { // Test frame rate and no picture alarm. // Flaky on Win32, see webrtc:3270. -TEST_F(VideoCaptureExternalTest, DISABLED_ON_WIN(FrameRate)) { +#if defined(WEBRTC_WIN) +#define MAYBE_FrameRate DISABLED_FrameRate +#else +#define MAYBE_FrameRate FrameRate +#endif +TEST_F(VideoCaptureExternalTest, MAYBE_FrameRate) { int64_t testTime = 3; TickTime startTime = TickTime::Now(); diff --git a/webrtc/modules/video_capture/video_capture.gypi b/webrtc/modules/video_capture/video_capture.gypi index f552df7758..c80f2bf5b5 100644 --- a/webrtc/modules/video_capture/video_capture.gypi +++ b/webrtc/modules/video_capture/video_capture.gypi @@ -23,11 +23,11 @@ 'sources': [ 'device_info_impl.cc', 'device_info_impl.h', - 'include/video_capture.h', - 'include/video_capture_defines.h', - 'include/video_capture_factory.h', + 'video_capture.h', 'video_capture_config.h', + 'video_capture_defines.h', 'video_capture_delay.h', + 'video_capture_factory.h', 'video_capture_factory.cc', 'video_capture_impl.cc', 'video_capture_impl.h', @@ -116,6 +116,23 @@ ], }, }], # win + ['OS=="win" and clang==1', { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalOptions': [ + # Disable warnings failing when compiling with Clang on Windows. + # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366 + '-Wno-comment', + '-Wno-ignored-attributes', + '-Wno-microsoft-extra-qualification', + '-Wno-missing-braces', + '-Wno-overloaded-virtual', + '-Wno-reorder', + '-Wno-writable-strings', + ], + }, + }, + }], ['OS=="ios"', { 'sources': [ 'ios/device_info_ios.h', diff --git a/webrtc/modules/video_capture/include/video_capture.h b/webrtc/modules/video_capture/video_capture.h index 09b4502115..08d02211c7 100644 --- a/webrtc/modules/video_capture/include/video_capture.h +++ b/webrtc/modules/video_capture/video_capture.h @@ -8,12 +8,12 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_H_ -#define WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_H_ +#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_H_ +#define WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_H_ #include "webrtc/common_video/rotation.h" -#include "webrtc/modules/interface/module.h" -#include "webrtc/modules/video_capture/include/video_capture_defines.h" +#include "webrtc/modules/include/module.h" +#include "webrtc/modules/video_capture/video_capture_defines.h" namespace webrtc { @@ -157,4 +157,4 @@ protected: }; } // namespace webrtc -#endif // WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_H_ +#endif // WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_H_ diff --git a/webrtc/modules/video_capture/include/video_capture_defines.h b/webrtc/modules/video_capture/video_capture_defines.h index 1dee4fa814..ef97ecab9d 100644 --- a/webrtc/modules/video_capture/include/video_capture_defines.h +++ b/webrtc/modules/video_capture/video_capture_defines.h @@ -8,10 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_DEFINES_H_ -#define WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_DEFINES_H_ +#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_DEFINES_H_ +#define WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_DEFINES_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" @@ -115,4 +115,4 @@ protected: } // namespace webrtc -#endif // WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_DEFINES_H_ +#endif // WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_DEFINES_H_ diff --git a/webrtc/modules/video_capture/video_capture_factory.cc b/webrtc/modules/video_capture/video_capture_factory.cc index f88f916ba4..618c08bac6 100644 --- a/webrtc/modules/video_capture/video_capture_factory.cc +++ b/webrtc/modules/video_capture/video_capture_factory.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/modules/video_capture/include/video_capture_factory.h" +#include "webrtc/modules/video_capture/video_capture_factory.h" #include "webrtc/modules/video_capture/video_capture_impl.h" diff --git a/webrtc/modules/video_capture/include/video_capture_factory.h b/webrtc/modules/video_capture/video_capture_factory.h index f78437d1a0..4765be1fde 100644 --- a/webrtc/modules/video_capture/include/video_capture_factory.h +++ b/webrtc/modules/video_capture/video_capture_factory.h @@ -11,10 +11,10 @@ // This file contains interfaces used for creating the VideoCaptureModule // and DeviceInfo. -#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_FACTORY_H_ -#define WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_FACTORY_H_ +#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_FACTORY_H_ +#define WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_FACTORY_H_ -#include "webrtc/modules/video_capture/include/video_capture.h" +#include "webrtc/modules/video_capture/video_capture.h" namespace webrtc { @@ -42,4 +42,4 @@ class VideoCaptureFactory { } // namespace webrtc -#endif // WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_FACTORY_H_ +#endif // WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_FACTORY_H_ diff --git a/webrtc/modules/video_capture/video_capture_impl.cc b/webrtc/modules/video_capture/video_capture_impl.cc index 4046181505..90730cd984 100644 --- a/webrtc/modules/video_capture/video_capture_impl.cc +++ b/webrtc/modules/video_capture/video_capture_impl.cc @@ -14,7 +14,7 @@ #include "webrtc/base/trace_event.h" #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" -#include "webrtc/modules/interface/module_common_types.h" +#include "webrtc/modules/include/module_common_types.h" #include "webrtc/modules/video_capture/video_capture_config.h" #include "webrtc/system_wrappers/include/clock.h" #include "webrtc/system_wrappers/include/critical_section_wrapper.h" diff --git a/webrtc/modules/video_capture/video_capture_impl.h b/webrtc/modules/video_capture/video_capture_impl.h index deb989c251..164421776c 100644 --- a/webrtc/modules/video_capture/video_capture_impl.h +++ b/webrtc/modules/video_capture/video_capture_impl.h @@ -17,7 +17,7 @@ #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" #include "webrtc/common_video/rotation.h" -#include "webrtc/modules/video_capture/include/video_capture.h" +#include "webrtc/modules/video_capture/video_capture.h" #include "webrtc/modules/video_capture/video_capture_config.h" #include "webrtc/system_wrappers/include/tick_util.h" #include "webrtc/video_frame.h" diff --git a/webrtc/modules/video_capture/windows/sink_filter_ds.h b/webrtc/modules/video_capture/windows/sink_filter_ds.h index 064cd9d7d3..6be74f69f9 100644 --- a/webrtc/modules/video_capture/windows/sink_filter_ds.h +++ b/webrtc/modules/video_capture/windows/sink_filter_ds.h @@ -13,7 +13,7 @@ #include <Streams.h> // Include base DS filter header files -#include "webrtc/modules/video_capture/include/video_capture_defines.h" +#include "webrtc/modules/video_capture/video_capture_defines.h" namespace webrtc { |