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@7209 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andresp@webrtc.org 2014-09-17 11:50:19 +00:00
parent 85ef770d92
commit a74eda1b6f
9 changed files with 272 additions and 239 deletions

View File

@ -396,7 +396,6 @@
'dependencies': [
'<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv',
'<(DEPTH)/third_party/usrsctp/usrsctp.gyp:usrsctplib',
'<(webrtc_root)/modules/modules.gyp:video_capture_module',
'<(webrtc_root)/modules/modules.gyp:video_render_module',
'<(webrtc_root)/webrtc.gyp:webrtc',
'<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine',
@ -499,6 +498,15 @@
'media/webrtc/webrtcvoiceengine.h',
],
'conditions': [
['build_with_chromium==1', {
'dependencies': [
'<(webrtc_root)/modules/modules.gyp:video_capture_module_impl',
],
}, {
'dependencies': [
'<(webrtc_root)/modules/modules.gyp:video_capture_module_internal_impl',
],
}],
['OS=="linux"', {
'sources': [
'media/devices/gtkvideorenderer.cc',

View File

@ -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', {

View File

@ -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
}

View File

@ -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",
]
}
all_dependent_configs = [ ":video_capture_config"]
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",
]
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" ]
}
}
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" ]
}
deps += [
"../../common_video",
"../../system_wrappers",
"../utility",
]
}

View File

@ -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',
],
'conditions': [
['include_internal_video_capture==0', {
'sources': [
'external/device_info_external.cc',
'external/video_capture_external.cc',
],
}, { # 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',
],
}], # 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',
],
},
},
}], # ios
], # conditions
}], # include_internal_video_capture
], # conditions
},
{
# 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': [
['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',
],
}], # 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',
],
},
},
}], # 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',

View File

@ -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',

View File

@ -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',

View File

@ -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',

View File

@ -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',