Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Unified Diff: media/gpu/BUILD.gn

Issue 1939683002: Test X11 header pollution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/vp9_parser.h ('k') | media/gpu/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/BUILD.gn
diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..e52aa3e4e74430c2cac96632b377708049c833c8
--- /dev/null
+++ b/media/gpu/BUILD.gn
@@ -0,0 +1,436 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/features.gni")
+import("//build/config/ui.gni")
+import("//media/gpu/args.gni")
+import("//media/media_options.gni")
+import("//testing/test.gni")
+
+if (is_mac) {
+ import("//build/config/mac/mac_sdk.gni")
+}
+
+if (is_chromeos && current_cpu != "arm") {
+ action("libva_generate_stubs") {
+ extra_header = "va_stub_header.fragment"
+
+ script = "../../tools/generate_stubs/generate_stubs.py"
+ sources = [
+ "va.sigs",
+ ]
+ inputs = [
+ extra_header,
+ ]
+ if (use_x11) {
+ sources += [ "va_x11.sigs" ]
+ }
+ if (use_ozone) {
+ sources += [ "va_drm.sigs" ]
+ }
+ stubs_filename_root = "va_stubs"
+
+ outputs = [
+ "$target_gen_dir/$stubs_filename_root.cc",
+ "$target_gen_dir/$stubs_filename_root.h",
+ ]
+ args = [
+ "-i",
+ rebase_path("$target_gen_dir", root_build_dir),
+ "-o",
+ rebase_path("$target_gen_dir", root_build_dir),
+ "-t",
+ "posix_stubs",
+ "-e",
+ rebase_path(extra_header, root_build_dir),
+ "-s",
+ stubs_filename_root,
+ "-p",
+ "media/gpu",
+ ]
+
+ args += rebase_path(sources, root_build_dir)
+ }
+}
+
+if (is_chromeos && use_v4lplugin) {
+ action("libv4l2_generate_stubs") {
+ extra_header = "v4l2_stub_header.fragment"
+
+ script = "../../tools/generate_stubs/generate_stubs.py"
+ sources = [
+ "v4l2.sig",
+ ]
+ inputs = [
+ extra_header,
+ ]
+ stubs_filename_root = "v4l2_stubs"
+
+ outputs = [
+ "$target_gen_dir/$stubs_filename_root.cc",
+ "$target_gen_dir/$stubs_filename_root.h",
+ ]
+ args = [
+ "-i",
+ rebase_path("$target_gen_dir", root_build_dir),
+ "-o",
+ rebase_path("$target_gen_dir", root_build_dir),
+ "-t",
+ "posix_stubs",
+ "-e",
+ rebase_path(extra_header, root_build_dir),
+ "-s",
+ stubs_filename_root,
+ "-p",
+ "media/gpu",
+ ]
+
+ args += rebase_path(sources, root_build_dir)
+ }
+}
+
+if (is_mac) {
+ action("libvt_generate_stubs") {
+ extra_header = "vt_stubs_header.fragment"
+
+ script = "../../tools/generate_stubs/generate_stubs.py"
+ sources = [
+ "vt.sig",
+ ]
+ inputs = [
+ extra_header,
+ ]
+ stubs_filename_root = "vt_stubs"
+
+ outputs = [
+ "$target_gen_dir/$stubs_filename_root.cc",
+ "$target_gen_dir/$stubs_filename_root.h",
+ ]
+ args = [
+ "-i",
+ rebase_path("$target_gen_dir", root_build_dir),
+ "-o",
+ rebase_path("$target_gen_dir", root_build_dir),
+ "-t",
+ "posix_stubs",
+ "-e",
+ rebase_path(extra_header, root_build_dir),
+ "-s",
+ stubs_filename_root,
+ "-p",
+ "media/gpu",
+ ]
+
+ args += rebase_path(sources, root_build_dir)
+ }
+}
+
+component("gpu") {
+ output_name = "media_gpu"
+
+ # Only local test code, GPU-related IPC code in the media layer, and
+ # media-related content code should access //media/gpu.
+ visibility = [
+ "//content/gpu:*",
+ "//content/public/gpu:*",
+ "//content/renderer:*",
+ "//media/gpu/ipc/*",
+ ":*",
+ ]
+
+ defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
+
+ sources = [
+ "fake_video_decode_accelerator.cc",
+ "fake_video_decode_accelerator.h",
+ "gpu_video_accelerator_util.cc",
+ "gpu_video_accelerator_util.h",
+ "gpu_video_decode_accelerator_factory_impl.cc",
+ "gpu_video_decode_accelerator_factory_impl.h",
+ "gpu_video_decode_accelerator_helpers.h",
+ "shared_memory_region.cc",
+ "shared_memory_region.h",
+ ]
+
+ public_deps = [
+ "//base",
+ "//gpu",
+ "//media",
+ "//ui/gfx/geometry",
+ ]
+ deps = [
+ "//ui/display/types",
+ "//ui/gl",
+ "//ui/platform_window",
+ ]
+ libs = []
+ ldflags = []
+
+ if (is_mac) {
+ sources += [
+ "vt_mac.h",
+ "vt_video_decode_accelerator_mac.cc",
+ "vt_video_decode_accelerator_mac.h",
+ "vt_video_encode_accelerator_mac.cc",
+ "vt_video_encode_accelerator_mac.h",
+ ] + get_target_outputs(":libvt_generate_stubs")
+ deps += [ ":libvt_generate_stubs" ]
+ lib_dirs = [ "$mac_sdk_path/usr/lib" ]
+
+ # TODO(markdittmer): Determine which libs are needed here.
+ libs += [
+ # "AVFoundation.framework",
+ # "CoreMedia.framework",
+ # "CoreVideo.framework",
+ # "IOSurface.framework",
+ # "OpenGL.framework",
+ # "QuartzCore.framework",
+ # "sandbox",
+ ]
+ }
+
+ if (is_android) {
+ sources += [
+ "android_copying_backing_strategy.cc",
+ "android_copying_backing_strategy.h",
+ "android_deferred_rendering_backing_strategy.cc",
+ "android_deferred_rendering_backing_strategy.h",
+ "android_video_decode_accelerator.cc",
+ "android_video_decode_accelerator.h",
+ "avda_codec_image.cc",
+ "avda_codec_image.h",
+ "avda_return_on_failure.h",
+ "avda_shared_state.cc",
+ "avda_shared_state.h",
+ "avda_state_provider.h",
+ "avda_surface_tracker.cc",
+ "avda_surface_tracker.h",
+ ]
+
+ if (enable_webrtc) {
+ deps += [ "//third_party/libyuv" ]
+ sources += [
+ "android_video_encode_accelerator.cc",
+ "android_video_encode_accelerator.h",
+ ]
+ }
+
+ if (mojo_media_host == "gpu") {
+ deps += [ "//media/mojo/services:cdm_service" ]
+ }
+ }
+
+ if (is_chromeos) {
+ sources += [
+ "accelerated_video_decoder.h",
+ "h264_decoder.cc",
+ "h264_decoder.h",
+ "h264_dpb.cc",
+ "h264_dpb.h",
+ "vp8_decoder.cc",
+ "vp8_decoder.h",
+ "vp8_picture.cc",
+ "vp8_picture.h",
+ "vp9_decoder.cc",
+ "vp9_decoder.h",
+ "vp9_picture.cc",
+ "vp9_picture.h",
+ ]
+ if (use_v4lplugin) {
+ defines += [ "USE_LIBV4L2" ]
+ sources += get_target_outputs(":libv4l2_generate_stubs")
+ deps += [ ":libv4l2_generate_stubs" ]
+ }
+ if (use_v4l2_codec) {
+ defines += [ "USE_V4L2_CODEC" ]
+ deps += [ "//third_party/libyuv" ]
+ sources += [
+ "generic_v4l2_device.cc",
+ "generic_v4l2_device.h",
+ "v4l2_device.cc",
+ "v4l2_device.h",
+ "v4l2_image_processor.cc",
+ "v4l2_image_processor.h",
+ "v4l2_jpeg_decode_accelerator.cc",
+ "v4l2_jpeg_decode_accelerator.h",
+ "v4l2_slice_video_decode_accelerator.cc",
+ "v4l2_slice_video_decode_accelerator.h",
+ "v4l2_video_decode_accelerator.cc",
+ "v4l2_video_decode_accelerator.h",
+ "v4l2_video_encode_accelerator.cc",
+ "v4l2_video_encode_accelerator.h",
+ ]
+ libs = [
+ "EGL",
+ "GLESv2",
+ ]
+ }
+ if (current_cpu == "arm") {
+ sources += [
+ "tegra_v4l2_device.cc",
+ "tegra_v4l2_device.h",
+ ]
+ }
+ if (current_cpu != "arm") {
+ sources += [
+ "va_surface.h",
+ "vaapi_jpeg_decode_accelerator.cc",
+ "vaapi_jpeg_decode_accelerator.h",
+ "vaapi_jpeg_decoder.cc",
+ "vaapi_jpeg_decoder.h",
+ "vaapi_picture.cc",
+ "vaapi_picture.h",
+ "vaapi_video_decode_accelerator.cc",
+ "vaapi_video_decode_accelerator.h",
+ "vaapi_video_encode_accelerator.cc",
+ "vaapi_video_encode_accelerator.h",
+ "vaapi_wrapper.cc",
+ "vaapi_wrapper.h",
+ ] + get_target_outputs(":libva_generate_stubs")
+ configs += [
+ "//third_party/libva:libva_config",
+ "//third_party/libyuv:libyuv_config",
+ ]
+ deps += [
+ ":libva_generate_stubs",
+ "//media",
+ "//third_party/libyuv",
+ ]
+ if (use_x11) {
+ sources += [
+ "vaapi_tfp_picture.cc",
+ "vaapi_tfp_picture.h",
+ ]
+ }
+ if (use_ozone) {
+ sources += [
+ "vaapi_drm_picture.cc",
+ "vaapi_drm_picture.h",
+ ]
+ }
+ }
+ }
+
+ if (is_win) {
+ sources += [
+ "dxva_video_decode_accelerator_win.cc",
+ "dxva_video_decode_accelerator_win.h",
+ ]
+ configs += [
+ "//build/config/compiler:no_size_t_to_int_warning",
+ "//third_party/khronos:khronos_headers",
+ ]
+ deps += [ "//ui/gl" ]
+ libs += [
+ "d3d9.lib",
+ "d3d11.lib",
+ "dxva2.lib",
+ "strmiids.lib",
+ "mf.lib",
+ "mfplat.lib",
+ "mfuuid.lib",
+ ]
+ ldflags += [
+ "/DELAYLOAD:d3d9.dll",
+ "/DELAYLOAD:d3d11.dll",
+ "/DELAYLOAD:dxva2.dll",
+ "/DELAYLOAD:mf.dll",
+ "/DELAYLOAD:mfplat.dll",
+ ]
+
+ # TODO(GYP): extract_xinput action.
+ }
+
+ if (use_x11) {
+ deps += [ "//ui/gfx/x" ]
+ }
+}
+
+if (is_android || is_chromeos) {
+ # TODO(GYP): Port Windows logic.
+ test("video_decode_accelerator_unittest") {
+ deps = [
+ ":gpu",
+ "//base",
+ "//media",
+ "//media/gpu",
+ "//testing/gtest",
+ "//ui/base",
+ "//ui/gfx",
+ "//ui/gfx:test_support",
+ "//ui/gfx/geometry",
+ "//ui/gl",
+ "//ui/gl:test_support",
+ ]
+ configs += [ "//third_party/khronos:khronos_headers" ]
+ if (is_chromeos && target_cpu != "arm") {
+ configs += [ "//third_party/libva:libva_config" ]
+ }
+ sources = [
+ "video_accelerator_unittest_helpers.h",
+ ]
+ if (is_android) {
+ sources += [ "android_video_decode_accelerator_unittest.cc" ]
+ } else {
+ sources += [
+ "rendering_helper.cc",
+ "rendering_helper.h",
+ "video_decode_accelerator_unittest.cc",
+ ]
+ }
+
+ if (is_android) {
+ deps += [
+ "//gpu:test_support",
+ "//media/base/android",
+ "//media/base/android:media_java",
+ "//media/capture/video/android:capture_java",
+ "//testing/gmock",
+ "//ui/android:ui_java",
+ ]
+ }
+ if (is_chromeos && use_ozone) {
+ deps += [
+ "//ui/display", # Used by rendering_helper.cc
+ "//ui/ozone", # Used by rendering_helper.cc
+ ]
+ }
+ if (use_x11) {
+ configs += [ "//build/config/linux:x11" ]
+ deps += [ "//ui/gfx/x" ]
+ }
+ }
+}
+
+if (is_chromeos || is_mac) {
+ test("video_encode_accelerator_unittest") {
+ deps = [
+ "//base",
+ "//media",
+ "//media/base:test_support",
+ "//media/gpu",
+ "//testing/gtest",
+ "//ui/base",
+ "//ui/gfx",
+ "//ui/gfx:test_support",
+ "//ui/gfx/geometry",
+ "//ui/gl",
+ "//ui/gl:test_support",
+ ]
+ configs += [
+ "//third_party/libva:libva_config",
+ "//third_party/libyuv:libyuv_config",
+ ]
+ sources = [
+ "video_accelerator_unittest_helpers.h",
+ "video_encode_accelerator_unittest.cc",
+ ]
+ if (use_x11) {
+ deps += [ "//ui/gfx/x" ]
+ }
+ if (use_ozone) {
+ deps += [ "//ui/ozone" ]
+ }
+ }
+}
« no previous file with comments | « media/filters/vp9_parser.h ('k') | media/gpu/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698