summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandresp@webrtc.org <andresp@webrtc.org>2014-09-17 11:50:19 +0000
committerandresp@webrtc.org <andresp@webrtc.org>2014-09-17 11:50:19 +0000
commit36e363e0aabab232f7fe2e94a104a72c8a7e6c92 (patch)
tree90ddcbbd9f8517e523aa30a46caec15cc589b261
parent8d6e944bee3e0228ca0e52e23fabea8ed787d5ec (diff)
downloadwebrtc-36e363e0aabab232f7fe2e94a104a72c8a7e6c92.tar.gz
Split video_capture_module specific implementation (external vs internal capture)
into its own targets. Dependencies must link directly with the desired one. Targets linking with libjingle_media: - internal implementation when build_with_chromium=0, default otherwise. Targets linking with default/external capture implementation: - anything dependent on webrtc_test_common - anything dependent on video_engine_core Targets linking with internal capture implementation: - vie_auto_test - anything dependent on webrtc_test_renderer GN changes: - Not many since there is almost no test definitions. TESTED: passes all the bots. If this inadvertently breaks a target please fix the linking rules so the target has the desired implementation linked in. BUG=3768 R=glaznev@webrtc.org TBR=kjellander@webrtc.org Review URL: https://webrtc-codereview.appspot.com/24589004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@7209 4adac7df-926f-26a2-2b94-8c16560cd09d
-rw-r--r--build/common.gypi4
-rw-r--r--build/webrtc.gni4
-rw-r--r--modules/video_capture/BUILD.gn232
-rw-r--r--modules/video_capture/video_capture.gypi235
-rw-r--r--test/webrtc_test_common.gyp4
-rw-r--r--video_engine/test/auto_test/vie_auto_test.gypi2
-rw-r--r--video_engine/video_engine_core.gypi1
-rw-r--r--webrtc_examples.gyp1
8 files changed, 254 insertions, 229 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 4b17eb4d..72876009 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -132,9 +132,6 @@
# Exclude internal ADM since Chromium uses its own IO handling.
'include_internal_audio_device%': 0,
- # Exclude internal VCM in Chromium build.
- 'include_internal_video_capture%': 0,
-
# Exclude internal video render module in Chromium build.
'include_internal_video_render%': 0,
}, { # Settings for the standalone (not-in-Chromium) build.
@@ -145,7 +142,6 @@
'include_pulse_audio%': 1,
'include_internal_audio_device%': 1,
- 'include_internal_video_capture%': 1,
'include_internal_video_render%': 1,
}],
['build_with_libjingle==1', {
diff --git a/build/webrtc.gni b/build/webrtc.gni
index d46b8c64..5e3adfaa 100644
--- a/build/webrtc.gni
+++ b/build/webrtc.gni
@@ -74,9 +74,6 @@ declare_args() {
# Exclude internal ADM since Chromium uses its own IO handling.
rtc_include_internal_audio_device = false
- # Exclude internal VCM in Chromium build.
- rtc_include_internal_video_capture = false
-
# Exclude internal video render module in Chromium build.
rtc_include_internal_video_render = false
} else {
@@ -89,7 +86,6 @@ declare_args() {
rtc_include_pulse_audio = true
rtc_include_internal_audio_device = true
- rtc_include_internal_video_capture = true
rtc_include_internal_video_render = true
}
diff --git a/modules/video_capture/BUILD.gn b/modules/video_capture/BUILD.gn
index 7d6ddc0e..56322738 100644
--- a/modules/video_capture/BUILD.gn
+++ b/modules/video_capture/BUILD.gn
@@ -8,16 +8,10 @@
import("../../build/webrtc.gni")
-config("video_capture_config") {
- if (is_ios) {
- libs = [
- "AVFoundation.framework",
- "CoreMedia.framework",
- "CoreVideo.framework",
- ]
- }
-}
-
+# Note this target is missing an implementation for the video capture.
+# Targets must link with either 'video_capture_impl' or
+# 'video_capture_internal_impl' depending on whether they want to
+# use the internal capturer.
source_set("video_capture") {
sources = [
"device_info_impl.cc",
@@ -32,108 +26,138 @@ source_set("video_capture") {
"video_capture_impl.h",
]
- libs = []
- deps = []
-
- if (rtc_include_internal_video_capture) {
- if (is_linux) {
- sources += [
- "linux/device_info_linux.cc",
- "linux/device_info_linux.h",
- "linux/video_capture_linux.cc",
- "linux/video_capture_linux.h",
- ]
- }
- if (is_mac) {
- sources += [
- "mac/qtkit/video_capture_qtkit.h",
- "mac/qtkit/video_capture_qtkit.mm",
- "mac/qtkit/video_capture_qtkit_info.h",
- "mac/qtkit/video_capture_qtkit_info.mm",
- "mac/qtkit/video_capture_qtkit_info_objc.h",
- "mac/qtkit/video_capture_qtkit_info_objc.mm",
- "mac/qtkit/video_capture_qtkit_objc.h",
- "mac/qtkit/video_capture_qtkit_objc.mm",
- "mac/qtkit/video_capture_qtkit_utility.h",
- "mac/video_capture_mac.mm",
- ]
-
- libs += [
- "CoreVideo.framework",
- "QTKit.framework",
- ]
- }
- if (is_win) {
- sources += [
- "windows/device_info_ds.cc",
- "windows/device_info_ds.h",
- "windows/device_info_mf.cc",
- "windows/device_info_mf.h",
- "windows/help_functions_ds.cc",
- "windows/help_functions_ds.h",
- "windows/sink_filter_ds.cc",
- "windows/sink_filter_ds.h",
- "windows/video_capture_ds.cc",
- "windows/video_capture_ds.h",
- "windows/video_capture_factory_windows.cc",
- "windows/video_capture_mf.cc",
- "windows/video_capture_mf.h",
- ]
-
- libs += [ "Strmiids.lib" ]
- deps += [ "//third_party/winsdk_samples"]
- }
- if (is_android) {
- sources += [
- "android/device_info_android.cc",
- "android/device_info_android.h",
- "android/video_capture_android.cc",
- "android/video_capture_android.h",
- ]
-
- deps += [
- "//third_party/icu:icuuc",
- "//third_party/jsoncpp",
- ]
- }
- if (is_ios) {
- sources += [
- "ios/device_info_ios.h",
- "ios/device_info_ios.mm",
- "ios/device_info_ios_objc.h",
- "ios/device_info_ios_objc.mm",
- "ios/rtc_video_capture_ios_objc.h",
- "ios/rtc_video_capture_ios_objc.mm",
- "ios/video_capture_ios.h",
- "ios/video_capture_ios.mm",
- ]
-
- cflags += [
- "-fobjc-arc", # CLANG_ENABLE_OBJC_ARC = YES.
- # To avoid warnings for deprecated videoMinFrameDuration and
- # videoMaxFrameDuration properties in iOS 7.0.
- # See webrtc:3705 for more details.
- "-Wno-deprecated-declarations",
- ]
- }
- } else {
- sources += [
- "external/device_info_external.cc",
- "external/video_capture_external.cc",
- ]
+ deps = [
+ "../../common_video",
+ "../../system_wrappers",
+ "../utility",
+ ]
+
+ if (is_clang) {
+ # Suppress warnings from Chrome's Clang plugins.
+ # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
+ configs -= [ "//build/config/clang:find_bad_constructs" ]
}
+}
+
+source_set("video_capture_impl") {
+ sources = [
+ "external/device_info_external.cc",
+ "external/video_capture_external.cc",
+ ]
- all_dependent_configs = [ ":video_capture_config"]
+ deps = [
+ ":video_capture",
+ ]
if (is_clang) {
# Suppress warnings from Chrome's Clang plugins.
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
configs -= [ "//build/config/clang:find_bad_constructs" ]
}
+}
- deps += [
- "../../common_video",
- "../../system_wrappers",
- "../utility",
+config("video_capture_internal_impl_config") {
+ if (is_ios) {
+ libs = [
+ "AVFoundation.framework",
+ "CoreMedia.framework",
+ "CoreVideo.framework",
+ ]
+ }
+}
+
+source_set("video_capture_internal_impl") {
+ deps = [
+ ":video_capture",
]
+
+ if (is_linux) {
+ sources = [
+ "linux/device_info_linux.cc",
+ "linux/device_info_linux.h",
+ "linux/video_capture_linux.cc",
+ "linux/video_capture_linux.h",
+ ]
+ }
+ if (is_mac) {
+ sources = [
+ "mac/qtkit/video_capture_qtkit.h",
+ "mac/qtkit/video_capture_qtkit.mm",
+ "mac/qtkit/video_capture_qtkit_info.h",
+ "mac/qtkit/video_capture_qtkit_info.mm",
+ "mac/qtkit/video_capture_qtkit_info_objc.h",
+ "mac/qtkit/video_capture_qtkit_info_objc.mm",
+ "mac/qtkit/video_capture_qtkit_objc.h",
+ "mac/qtkit/video_capture_qtkit_objc.mm",
+ "mac/qtkit/video_capture_qtkit_utility.h",
+ "mac/video_capture_mac.mm",
+ ]
+
+ libs = [
+ "CoreVideo.framework",
+ "QTKit.framework",
+ ]
+ }
+ if (is_win) {
+ sources = [
+ "windows/device_info_ds.cc",
+ "windows/device_info_ds.h",
+ "windows/device_info_mf.cc",
+ "windows/device_info_mf.h",
+ "windows/help_functions_ds.cc",
+ "windows/help_functions_ds.h",
+ "windows/sink_filter_ds.cc",
+ "windows/sink_filter_ds.h",
+ "windows/video_capture_ds.cc",
+ "windows/video_capture_ds.h",
+ "windows/video_capture_factory_windows.cc",
+ "windows/video_capture_mf.cc",
+ "windows/video_capture_mf.h",
+ ]
+
+ libs = [ "Strmiids.lib" ]
+
+ deps += [ "//third_party/winsdk_samples"]
+ }
+ if (is_android) {
+ sources = [
+ "android/device_info_android.cc",
+ "android/device_info_android.h",
+ "android/video_capture_android.cc",
+ "android/video_capture_android.h",
+ ]
+
+ deps += [
+ "//third_party/icu:icuuc",
+ "//third_party/jsoncpp",
+ ]
+ }
+ if (is_ios) {
+ sources = [
+ "ios/device_info_ios.h",
+ "ios/device_info_ios.mm",
+ "ios/device_info_ios_objc.h",
+ "ios/device_info_ios_objc.mm",
+ "ios/rtc_video_capture_ios_objc.h",
+ "ios/rtc_video_capture_ios_objc.mm",
+ "ios/video_capture_ios.h",
+ "ios/video_capture_ios.mm",
+ ]
+
+ cflags = [
+ "-fobjc-arc", # CLANG_ENABLE_OBJC_ARC = YES.
+ # To avoid warnings for deprecated videoMinFrameDuration and
+ # videoMaxFrameDuration properties in iOS 7.0.
+ # See webrtc:3705 for more details.
+ "-Wno-deprecated-declarations",
+ ]
+ }
+
+ all_dependent_configs = [ ":video_capture_internal_impl_config" ]
+
+ if (is_clang) {
+ # Suppress warnings from Chrome's Clang plugins.
+ # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
+ configs -= [ "//build/config/clang:find_bad_constructs" ]
+ }
}
diff --git a/modules/video_capture/video_capture.gypi b/modules/video_capture/video_capture.gypi
index 68d41968..1843405e 100644
--- a/modules/video_capture/video_capture.gypi
+++ b/modules/video_capture/video_capture.gypi
@@ -9,6 +9,10 @@
{
'targets': [
{
+ # Note this library is missing an implementation for the video capture.
+ # Targets must link with either 'video_capture_module_impl' or
+ # 'video_capture_module_internal_impl' depending on whether they want to
+ # use the internal capturer.
'target_name': 'video_capture_module',
'type': 'static_library',
'dependencies': [
@@ -28,128 +32,130 @@
'video_capture_impl.cc',
'video_capture_impl.h',
],
+ },
+ {
+ # Default video capture module implementation that only supports external
+ # capture.
+ 'target_name': 'video_capture_module_impl',
+ 'type': 'static_library',
+ 'dependencies': [
+ 'video_capture_module',
+ ],
+ 'sources': [
+ 'external/device_info_external.cc',
+ 'external/video_capture_external.cc',
+ ],
+ },
+ {
+ 'target_name': 'video_capture_module_internal_impl',
+ 'type': 'static_library',
+ 'dependencies': [
+ 'video_capture_module',
+ ],
'conditions': [
- ['include_internal_video_capture==0', {
+ ['OS=="linux"', {
'sources': [
- 'external/device_info_external.cc',
- 'external/video_capture_external.cc',
+ 'linux/device_info_linux.cc',
+ 'linux/device_info_linux.h',
+ 'linux/video_capture_linux.cc',
+ 'linux/video_capture_linux.h',
],
- }, { # include_internal_video_capture == 1
- 'conditions': [
- ['OS=="linux"', {
- 'sources': [
- 'linux/device_info_linux.cc',
- 'linux/device_info_linux.h',
- 'linux/video_capture_linux.cc',
- 'linux/video_capture_linux.h',
- ],
- }], # linux
- ['OS=="mac"', {
- 'sources': [
- 'mac/qtkit/video_capture_qtkit.h',
- 'mac/qtkit/video_capture_qtkit.mm',
- 'mac/qtkit/video_capture_qtkit_info.h',
- 'mac/qtkit/video_capture_qtkit_info.mm',
- 'mac/qtkit/video_capture_qtkit_info_objc.h',
- 'mac/qtkit/video_capture_qtkit_info_objc.mm',
- 'mac/qtkit/video_capture_qtkit_objc.h',
- 'mac/qtkit/video_capture_qtkit_objc.mm',
- 'mac/qtkit/video_capture_qtkit_utility.h',
- 'mac/video_capture_mac.mm',
- ],
- 'link_settings': {
- 'xcode_settings': {
- 'OTHER_LDFLAGS': [
- '-framework Cocoa',
- '-framework CoreVideo',
- '-framework QTKit',
- ],
- },
- },
- }], # mac
- ['OS=="win"', {
- 'dependencies': [
- '<(DEPTH)/third_party/winsdk_samples/winsdk_samples.gyp:directshow_baseclasses',
- ],
- 'sources': [
- 'windows/device_info_ds.cc',
- 'windows/device_info_ds.h',
- 'windows/device_info_mf.cc',
- 'windows/device_info_mf.h',
- 'windows/help_functions_ds.cc',
- 'windows/help_functions_ds.h',
- 'windows/sink_filter_ds.cc',
- 'windows/sink_filter_ds.h',
- 'windows/video_capture_ds.cc',
- 'windows/video_capture_ds.h',
- 'windows/video_capture_factory_windows.cc',
- 'windows/video_capture_mf.cc',
- 'windows/video_capture_mf.h',
- ],
- 'link_settings': {
- 'libraries': [
- '-lStrmiids.lib',
- ],
- },
- }], # win
- ['OS=="android"', {
- 'dependencies': [
- '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
- '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
- ],
- 'sources': [
- 'android/device_info_android.cc',
- 'android/device_info_android.h',
- 'android/video_capture_android.cc',
- 'android/video_capture_android.h',
+ }], # linux
+ ['OS=="mac"', {
+ 'sources': [
+ 'mac/qtkit/video_capture_qtkit.h',
+ 'mac/qtkit/video_capture_qtkit.mm',
+ 'mac/qtkit/video_capture_qtkit_info.h',
+ 'mac/qtkit/video_capture_qtkit_info.mm',
+ 'mac/qtkit/video_capture_qtkit_info_objc.h',
+ 'mac/qtkit/video_capture_qtkit_info_objc.mm',
+ 'mac/qtkit/video_capture_qtkit_objc.h',
+ 'mac/qtkit/video_capture_qtkit_objc.mm',
+ 'mac/qtkit/video_capture_qtkit_utility.h',
+ 'mac/video_capture_mac.mm',
+ ],
+ 'link_settings': {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ '-framework Cocoa',
+ '-framework CoreVideo',
+ '-framework QTKit',
],
- }], # android
- ['OS=="ios"', {
- 'sources': [
- 'ios/device_info_ios.h',
- 'ios/device_info_ios.mm',
- 'ios/device_info_ios_objc.h',
- 'ios/device_info_ios_objc.mm',
- 'ios/rtc_video_capture_ios_objc.h',
- 'ios/rtc_video_capture_ios_objc.mm',
- 'ios/video_capture_ios.h',
- 'ios/video_capture_ios.mm',
+ },
+ },
+ }], # mac
+ ['OS=="win"', {
+ 'dependencies': [
+ '<(DEPTH)/third_party/winsdk_samples/winsdk_samples.gyp:directshow_baseclasses',
+ ],
+ 'sources': [
+ 'windows/device_info_ds.cc',
+ 'windows/device_info_ds.h',
+ 'windows/device_info_mf.cc',
+ 'windows/device_info_mf.h',
+ 'windows/help_functions_ds.cc',
+ 'windows/help_functions_ds.h',
+ 'windows/sink_filter_ds.cc',
+ 'windows/sink_filter_ds.h',
+ 'windows/video_capture_ds.cc',
+ 'windows/video_capture_ds.h',
+ 'windows/video_capture_factory_windows.cc',
+ 'windows/video_capture_mf.cc',
+ 'windows/video_capture_mf.h',
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '-lStrmiids.lib',
+ ],
+ },
+ }], # win
+ ['OS=="android"', {
+ 'dependencies': [
+ '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
+ '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
+ ],
+ 'sources': [
+ 'android/device_info_android.cc',
+ 'android/device_info_android.h',
+ 'android/video_capture_android.cc',
+ 'android/video_capture_android.h',
+ ],
+ }], # android
+ ['OS=="ios"', {
+ 'sources': [
+ 'ios/device_info_ios.h',
+ 'ios/device_info_ios.mm',
+ 'ios/device_info_ios_objc.h',
+ 'ios/device_info_ios_objc.mm',
+ 'ios/rtc_video_capture_ios_objc.h',
+ 'ios/rtc_video_capture_ios_objc.mm',
+ 'ios/video_capture_ios.h',
+ 'ios/video_capture_ios.mm',
+ ],
+ 'xcode_settings': {
+ 'CLANG_ENABLE_OBJC_ARC': 'YES',
+ 'WARNING_CFLAGS': [
+ # To avoid warnings for deprecated videoMinFrameDuration and
+ # videoMaxFrameDuration properties in iOS 7.0.
+ # See webrtc:3705 for more details.
+ '-Wno-deprecated-declarations',
+ ],
+ },
+ 'all_dependent_settings': {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ '-framework AVFoundation',
+ '-framework CoreMedia',
+ '-framework CoreVideo',
+ '-framework UIKit',
],
- 'xcode_settings': {
- 'CLANG_ENABLE_OBJC_ARC': 'YES',
- 'WARNING_CFLAGS': [
- # To avoid warnings for deprecated videoMinFrameDuration and
- # videoMaxFrameDuration properties in iOS 7.0.
- # See webrtc:3705 for more details.
- '-Wno-deprecated-declarations',
- ],
- },
- 'all_dependent_settings': {
- 'xcode_settings': {
- 'OTHER_LDFLAGS': [
- '-framework AVFoundation',
- '-framework CoreMedia',
- '-framework CoreVideo',
- '-framework UIKit',
- ],
- },
- },
- }], # ios
- ], # conditions
- }], # include_internal_video_capture
+ },
+ },
+ }], # ios
], # conditions
- },
+ }
],
'conditions': [
- ['include_tests==1 and OS=="android"', {
- # Use WebRTC capture code for Android APK tests that are built from a
- # Chromium checkout. Normally when built as a part of Chromium the
- # Chromium video capture code is used. This overrides the default in
- # webrtc/build/common.gypi.
- 'variables': {
- 'include_internal_video_capture': 1,
- },
- }],
['include_tests==1', {
'targets': [
{
@@ -157,6 +163,7 @@
'type': '<(gtest_target_type)',
'dependencies': [
'video_capture_module',
+ 'video_capture_module_internal_impl',
'webrtc_utility',
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
'<(DEPTH)/testing/gtest.gyp:gtest',
diff --git a/test/webrtc_test_common.gyp b/test/webrtc_test_common.gyp
index be6b303f..9d7cfce5 100644
--- a/test/webrtc_test_common.gyp
+++ b/test/webrtc_test_common.gyp
@@ -59,7 +59,7 @@
'<(DEPTH)/testing/gtest.gyp:gtest',
'<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
'<(webrtc_root)/modules/modules.gyp:media_file',
- '<(webrtc_root)/modules/modules.gyp:video_capture_module',
+ '<(webrtc_root)/modules/modules.gyp:video_capture_module_impl',
'<(webrtc_root)/test/test.gyp:frame_generator',
'<(webrtc_root)/test/test.gyp:test_support',
'<(webrtc_root)/webrtc.gyp:webrtc',
@@ -107,7 +107,7 @@
],
'dependencies': [
'<(DEPTH)/testing/gtest.gyp:gtest',
- '<(webrtc_root)/modules/modules.gyp:video_capture_module',
+ '<(webrtc_root)/modules/modules.gyp:video_capture_module_internal_impl',
'<(webrtc_root)/modules/modules.gyp:media_file',
'<(webrtc_root)/test/test.gyp:frame_generator',
'<(webrtc_root)/test/test.gyp:test_support',
diff --git a/video_engine/test/auto_test/vie_auto_test.gypi b/video_engine/test/auto_test/vie_auto_test.gypi
index 96291660..60290849 100644
--- a/video_engine/test/auto_test/vie_auto_test.gypi
+++ b/video_engine/test/auto_test/vie_auto_test.gypi
@@ -15,7 +15,7 @@
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:field_trial_default',
'<(webrtc_root)/modules/modules.gyp:video_render_module',
- '<(webrtc_root)/modules/modules.gyp:video_capture_module',
+ '<(webrtc_root)/modules/modules.gyp:video_capture_module_internal_impl',
'<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine',
'<(DEPTH)/testing/gtest.gyp:gtest',
'<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
diff --git a/video_engine/video_engine_core.gypi b/video_engine/video_engine_core.gypi
index 8ce25234..ffe63c56 100644
--- a/video_engine/video_engine_core.gypi
+++ b/video_engine/video_engine_core.gypi
@@ -122,6 +122,7 @@
'type': '<(gtest_target_type)',
'dependencies': [
'video_engine_core',
+ '<(webrtc_root)/modules/modules.gyp:video_capture_module_internal_impl',
'<(DEPTH)/testing/gtest.gyp:gtest',
'<(DEPTH)/testing/gmock.gyp:gmock',
'<(webrtc_root)/test/test.gyp:test_support_main',
diff --git a/webrtc_examples.gyp b/webrtc_examples.gyp
index 8d8e2277..f4e3f6f7 100644
--- a/webrtc_examples.gyp
+++ b/webrtc_examples.gyp
@@ -15,6 +15,7 @@
'type': 'loadable_module',
'dependencies': [
'<(DEPTH)/third_party/icu/icu.gyp:icuuc',
+ '<(webrtc_root)/modules/modules.gyp:video_capture_module_internal_impl',
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:field_trial_default',
'<(webrtc_root)/test/test.gyp:channel_transport',
'<(webrtc_root)/video_engine/video_engine.gyp:video_engine_core',