Skip to content

Commit

Permalink
GN: Implement video_engine, video_capture and video_render.
Browse files Browse the repository at this point in the history
Also add more from common.gypi to webrtc.gni.

These GN configs are based on GYP files in r6997.

BUG=3441
TEST=Trybots and local compile using:
gn gen out/Default --args="build_with_chromium=false" && ninja -C out/Default
gn gen out/Default --args="build_with_chromium=false is_debug=true" && ninja -C out/Default

Passed compile from a Chromium checkout with src/third_party/webrtc linked to the webrtc/ dir of a checkout with this patch applied.

R=brettw@chromium.org, glaznev@webrtc.org, mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/18709004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6999 4adac7df-926f-26a2-2b94-8c16560cd09d
  • Loading branch information
kjellander@webrtc.org committed Aug 28, 2014
1 parent df9fef6 commit 788f058
Show file tree
Hide file tree
Showing 5 changed files with 414 additions and 12 deletions.
43 changes: 35 additions & 8 deletions webrtc/build/webrtc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ declare_args() {
build_with_chromium = true
build_with_libjingle = true

if (build_with_libjingle) {
include_tests = false
restrict_webrtc_logging = true
} else {
include_tests = true
restrict_webrtc_logging = false
}

# Adds video support to dependencies shared by voice and video engine.
# This should normally be enabled; the intended use is to disable only
# when building voice engine exclusively.
Expand Down Expand Up @@ -59,6 +51,41 @@ declare_args() {

enable_android_opensl = true

if (build_with_chromium) {
# Exclude pulse audio on Chromium since its prerequisites don't require
# pulse audio.
include_pulse_audio = false

# Exclude internal ADM since Chromium uses its own IO handling.
include_internal_audio_device = false

# Exclude internal VCM in Chromium build.
include_internal_video_capture = false

# Exclude internal video render module in Chromium build.
include_internal_video_render = false
} else {
# Settings for the standalone (not-in-Chromium) build.

# TODO(andrew): For now, disable the Chrome plugins, which causes a
# flood of chromium-style warnings. Investigate enabling them:
# http://code.google.com/p/webrtc/issues/detail?id=163
clang_use_chrome_plugins = false

include_pulse_audio = true
include_internal_audio_device = true
include_internal_video_capture = true
include_internal_video_render = true
}

if (build_with_libjingle) {
include_tests = false
restrict_webrtc_logging = true
} else {
include_tests = true
restrict_webrtc_logging = false
}

if (is_ios) {
build_libjpeg = false
enable_protobuf = false
Expand Down
128 changes: 127 additions & 1 deletion webrtc/modules/video_capture/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,132 @@

import("../../build/webrtc.gni")

config("video_capture_config") {
if (is_ios) {
libs = [
"AVFoundation.framework",
"CoreMedia.framework",
"CoreVideo.framework",
]
}
}

source_set("video_capture") {
# TODO(glaznev): Implement.
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_config.h",
"video_capture_delay.h",
"video_capture_factory.cc",
"video_capture_impl.cc",
"video_capture_impl.h",
]

libs = []
deps = []

if (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"]

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",
]
}
132 changes: 131 additions & 1 deletion webrtc/modules/video_render/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,136 @@

import("../../build/webrtc.gni")

config("video_render_config") {
if (is_ios) {
libs = [
"OpenGLES.framework",
"QuartzCore.framework",
]
}
}

source_set("video_render") {
# TODO(wuchengli): Implement.
sources = [
"external/video_render_external_impl.cc",
"external/video_render_external_impl.h",
"i_video_render.h",
"include/video_render.h",
"include/video_render_defines.h",
"incoming_video_stream.cc",
"incoming_video_stream.h",
"video_render_frames.cc",
"video_render_frames.h",
"video_render_impl.cc",
"video_render_impl.h",
]

libs = []
deps = []

if (include_internal_video_render) {
defines += [ "WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER" ]

if (is_linux) {
sources += [
"linux/video_render_linux_impl.cc",
"linux/video_render_linux_impl.h",
"linux/video_x11_channel.cc",
"linux/video_x11_channel.h",
"linux/video_x11_render.cc",
"linux/video_x11_render.h",
]

libs += [ "Xext" ]
}
if (is_mac) {
sources += [
"mac/cocoa_full_screen_window.h",
"mac/cocoa_full_screen_window.mm",
"mac/cocoa_render_view.h",
"mac/cocoa_render_view.mm",
"mac/video_render_agl.cc",
"mac/video_render_agl.h",
"mac/video_render_mac_carbon_impl.cc",
"mac/video_render_mac_carbon_impl.h",
"mac/video_render_mac_cocoa_impl.h",
"mac/video_render_mac_cocoa_impl.mm",
"mac/video_render_nsopengl.h",
"mac/video_render_nsopengl.mm",
]

libs += [
"CoreVideo.framework",
"QTKit.framework",
]
}
if (is_win) {
sources += [
"windows/i_video_render_win.h",
"windows/video_render_direct3d9.cc",
"windows/video_render_direct3d9.h",
"windows/video_render_windows_impl.cc",
"windows/video_render_windows_impl.h",
]

directxsdk_exists =
(exec_script("//build/dir_exists.py",
[ rebase_path("//third_party/directxsdk/files",
root_build_dir) ],
"trim string") == "True")
if (directxsdk_exists) {
directxsdk_path = "//third_party/directxsdk/files"
} else {
directxsdk_path = getenv("DXSDK_DIR")
}
include_dirs = [ directxsdk_path + "/Include" ]

}
if (is_android) {
sources += [
"android/video_render_android_impl.cc",
"android/video_render_android_impl.h",
"android/video_render_android_native_opengl2.cc",
"android/video_render_android_native_opengl2.h",
"android/video_render_android_surface_view.cc",
"android/video_render_android_surface_view.h",
"android/video_render_opengles20.cc",
"android/video_render_opengles20.h",
]

libs += [ "GLESv2" ]
}
if (is_ios) {
sources += [
"ios/open_gles20.h",
"ios/open_gles20.mm",
"ios/video_render_ios_channel.h",
"ios/video_render_ios_channel.mm",
"ios/video_render_ios_gles20.h",
"ios/video_render_ios_gles20.mm",
"ios/video_render_ios_impl.h",
"ios/video_render_ios_impl.mm",
"ios/video_render_ios_view.h",
"ios/video_render_ios_view.mm",
]
}
}

all_dependent_configs = [ ":video_render_config"]

if (is_ios) {
cflags += [ "-fobjc-arc" ] # CLANG_ENABLE_OBJC_ARC = YES.
}

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",
]
}
24 changes: 23 additions & 1 deletion webrtc/video/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@
import("../build/webrtc.gni")

source_set("video") {
# TODO(pbos): Implement when video_engine_core is done.
sources = [
"call.cc",
"encoded_frame_callback_adapter.cc",
"encoded_frame_callback_adapter.h",
"receive_statistics_proxy.cc",
"receive_statistics_proxy.h",
"send_statistics_proxy.cc",
"send_statistics_proxy.h",
"transport_adapter.cc",
"transport_adapter.h",
"video_receive_stream.cc",
"video_receive_stream.h",
"video_send_stream.cc",
"video_send_stream.h",
]

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 = [ "../video_engine:video_engine_core" ]
}

Loading

0 comments on commit 788f058

Please sign in to comment.