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

Unified Diff: media/gpu/BUILD.gn

Issue 1882373004: Migrate content/common/gpu/media code to media/gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix several more bot-identified build issues 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
Index: media/gpu/BUILD.gn
diff --git a/content/common/BUILD.gn b/media/gpu/BUILD.gn
similarity index 25%
copy from content/common/BUILD.gn
copy to media/gpu/BUILD.gn
index 9ff78fe061d85a28b86f201aea310141a6ba148c..ead834039bf74300eb8fa4172fa6581819551785 100644
--- a/content/common/BUILD.gn
+++ b/media/gpu/BUILD.gn
@@ -1,44 +1,45 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
+# 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("//content/common/common.gni")
+import("//media/gpu/args.gni")
import("//media/media_options.gni")
-import("//mojo/public/tools/bindings/mojom.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 = "gpu/media/va_stub_header.fragment"
+ extra_header = "va_stub_header.fragment"
script = "../../tools/generate_stubs/generate_stubs.py"
sources = [
- "gpu/media/va.sigs",
+ "va.sigs",
]
inputs = [
extra_header,
]
if (use_x11) {
- sources += [ "gpu/media/va_x11.sigs" ]
+ sources += [ "va_x11.sigs" ]
}
if (use_ozone) {
- sources += [ "gpu/media/va_drm.sigs" ]
+ sources += [ "va_drm.sigs" ]
}
stubs_filename_root = "va_stubs"
outputs = [
- "$target_gen_dir/gpu/media/$stubs_filename_root.cc",
- "$target_gen_dir/gpu/media/$stubs_filename_root.h",
+ "$target_gen_dir/$stubs_filename_root.cc",
+ "$target_gen_dir/$stubs_filename_root.h",
]
args = [
"-i",
- rebase_path("$target_gen_dir/gpu/media", root_build_dir),
+ rebase_path("$target_gen_dir", root_build_dir),
"-o",
- rebase_path("$target_gen_dir/gpu/media", root_build_dir),
+ rebase_path("$target_gen_dir", root_build_dir),
"-t",
"posix_stubs",
"-e",
@@ -46,7 +47,7 @@ if (is_chromeos && current_cpu != "arm") {
"-s",
stubs_filename_root,
"-p",
- "content/common/gpu/media",
+ "media/gpu",
]
args += rebase_path(sources, root_build_dir)
@@ -55,11 +56,11 @@ if (is_chromeos && current_cpu != "arm") {
if (is_chromeos && use_v4lplugin) {
action("libv4l2_generate_stubs") {
- extra_header = "gpu/media/v4l2_stub_header.fragment"
+ extra_header = "v4l2_stub_header.fragment"
script = "../../tools/generate_stubs/generate_stubs.py"
sources = [
- "gpu/media/v4l2.sig",
+ "v4l2.sig",
]
inputs = [
extra_header,
@@ -67,14 +68,14 @@ if (is_chromeos && use_v4lplugin) {
stubs_filename_root = "v4l2_stubs"
outputs = [
- "$target_gen_dir/gpu/media/$stubs_filename_root.cc",
- "$target_gen_dir/gpu/media/$stubs_filename_root.h",
+ "$target_gen_dir/$stubs_filename_root.cc",
+ "$target_gen_dir/$stubs_filename_root.h",
]
args = [
"-i",
- rebase_path("$target_gen_dir/gpu/media", root_build_dir),
+ rebase_path("$target_gen_dir", root_build_dir),
"-o",
- rebase_path("$target_gen_dir/gpu/media", root_build_dir),
+ rebase_path("$target_gen_dir", root_build_dir),
"-t",
"posix_stubs",
"-e",
@@ -82,7 +83,7 @@ if (is_chromeos && use_v4lplugin) {
"-s",
stubs_filename_root,
"-p",
- "content/common/gpu/media",
+ "media/gpu",
]
args += rebase_path(sources, root_build_dir)
@@ -91,11 +92,11 @@ if (is_chromeos && use_v4lplugin) {
if (is_mac) {
action("libvt_generate_stubs") {
- extra_header = "gpu/media/vt_stubs_header.fragment"
+ extra_header = "vt_stubs_header.fragment"
script = "../../tools/generate_stubs/generate_stubs.py"
sources = [
- "gpu/media/vt.sig",
+ "vt.sig",
]
inputs = [
extra_header,
@@ -103,14 +104,14 @@ if (is_mac) {
stubs_filename_root = "vt_stubs"
outputs = [
- "$target_gen_dir/gpu/media/$stubs_filename_root.cc",
- "$target_gen_dir/gpu/media/$stubs_filename_root.h",
+ "$target_gen_dir/$stubs_filename_root.cc",
+ "$target_gen_dir/$stubs_filename_root.h",
]
args = [
"-i",
- rebase_path("$target_gen_dir/gpu/media", root_build_dir),
+ rebase_path("$target_gen_dir", root_build_dir),
"-o",
- rebase_path("$target_gen_dir/gpu/media", root_build_dir),
+ rebase_path("$target_gen_dir", root_build_dir),
"-t",
"posix_stubs",
"-e",
@@ -118,227 +119,87 @@ if (is_mac) {
"-s",
stubs_filename_root,
"-p",
- "content/common/gpu/media",
+ "media/gpu",
]
args += rebase_path(sources, root_build_dir)
}
}
-source_set("common") {
- # Targets external to content should always link to the public API.
- # In addition, targets outside of the content component (shell and tests)
- # must not link to this because it will duplicate the code in the component
- # build.
- visibility = [ "//content/*" ]
+component("gpu") {
+ output_name = "media_gpu"
+
+ # Only GPU service code in the media layer should access //media/gpu.
+ visibility = [ "//media/gpu/ipc/service" ]
- sources = rebase_path(content_common_gypi_values.private_common_sources,
- ".",
- "//content")
+ defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
- configs += [
- "//content:content_implementation",
- "//build/config:precompiled_headers",
- "//build/config/compiler:no_size_t_to_int_warning",
+ sources = [
+ "fake_video_decode_accelerator.cc",
+ "fake_video_decode_accelerator.h",
+ "gpu_video_decode_accelerator_helpers.h",
+ "shared_memory_region.cc",
+ "shared_memory_region.h",
]
public_deps = [
- ":mojo_bindings",
- "//gpu/command_buffer/common",
- "//ipc",
- "//third_party/WebKit/public:blink_headers",
- ]
- deps = [
"//base",
- "//base/third_party/dynamic_annotations",
- "//build/util:webkit_version",
- "//cc",
- "//cc/blink",
- "//cc/surfaces",
- "//components/mus/public/interfaces",
- "//components/tracing",
- "//components/tracing:startup_tracing",
- "//device/bluetooth",
-
- # TODO: the dependency on gl_in_process_context should be decoupled from
- # content and moved to android_webview. See crbug.com/365797.
"//gpu",
- "//gpu/blink",
- "//gpu/command_buffer/client:gl_in_process_context",
- "//gpu/command_buffer/client:gles2_c_lib",
- "//gpu/command_buffer/client:gles2_cmd_helper",
- "//gpu/command_buffer/client:gles2_implementation",
- "//gpu/command_buffer/client:gles2_interface",
- "//gpu/command_buffer/common:gles2_utils",
- "//gpu/command_buffer/service",
- "//gpu/ipc/client",
- "//gpu/ipc/common",
-
- # TODO(markdittmer): This should be removed once content/common/gpu/media
- # is refactored into media/ipc.
- "//gpu/ipc/service",
- "//gpu/skia_bindings",
- "//ipc",
- "//ipc/mojo",
"//media",
- "//media:shared_memory_support",
- "//media/gpu/ipc/client",
- "//media/gpu/ipc/common",
- "//media/midi",
- "//mojo/common:common_base",
- "//mojo/edk/system",
- "//net",
- "//sandbox",
- "//services/shell",
- "//services/shell/public/cpp",
- "//services/shell/public/interfaces",
- "//services/shell/runner/common",
- "//skia",
- "//storage/common",
- "//third_party/WebKit/public:blink",
- "//third_party/boringssl",
- "//third_party/icu",
- "//third_party/libjingle",
- "//third_party/webrtc/base:rtc_base",
- "//ui/accessibility",
- "//ui/base",
- "//ui/base/ime",
- "//ui/gfx",
"//ui/gfx/geometry",
- "//ui/gfx/ipc",
- "//ui/gfx/ipc/skia",
+ ]
+ deps = [
+ "//ui/display/types",
"//ui/gl",
- "//ui/latency_info/ipc",
- "//ui/shell_dialogs",
- "//url",
- "//url/ipc:url_ipc",
+ "//ui/platform_window",
]
-
- defines = []
- include_dirs = []
libs = []
ldflags = []
- if (is_android && use_seccomp_bpf) {
- set_sources_assignment_filter([])
- sources += [
- "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
- "sandbox_linux/sandbox_bpf_base_policy_linux.h",
- ]
- set_sources_assignment_filter(sources_assignment_filter)
- }
-
if (is_mac) {
sources += [
- "gpu/media/vt_mac.h",
- "gpu/media/vt_video_decode_accelerator_mac.cc",
- "gpu/media/vt_video_decode_accelerator_mac.h",
- "gpu/media/vt_video_encode_accelerator_mac.cc",
- "gpu/media/vt_video_encode_accelerator_mac.h",
+ "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",
- "//content:resources",
- "//content/app/resources",
- "//sandbox/mac:seatbelt",
- "//third_party/WebKit/public:image_resources",
- "//third_party/WebKit/public:resources",
- "//ui/accelerated_widget_mac",
- ]
+ deps += [ ":libvt_generate_stubs" ]
lib_dirs = [ "$mac_sdk_path/usr/lib" ]
- libs += [
- "AVFoundation.framework",
- "CoreMedia.framework",
- "CoreVideo.framework",
- "IOSurface.framework",
- "OpenGL.framework",
- "QuartzCore.framework",
- "sandbox",
- ]
- }
-
- if (is_android) {
- deps += [
- "//content/public/android:common_aidl",
- "//content/public/android:jni",
- ]
-
- libs += [ "android" ]
- }
- if (is_debug && !is_component_build && enable_plugins) {
- # Content depends on the PPAPI message logging stuff; if this isn't here,
- # some unit test binaries won't compile. This only worked in release mode
- # because logging is disabled there.
- deps += [ "//ppapi/proxy:ipc_sources" ]
- }
-
- if (use_ozone) {
- deps += [ "//ui/ozone" ]
- } else {
- sources -= [
- "cursors/webcursor_ozone.cc",
- "font_list_ozone.cc",
- ]
- }
-
- if (!use_aura || is_android) {
- sources -= [ "cursors/webcursor_aura.cc" ]
- }
-
- if (!use_aura || !use_x11) {
- sources -= [ "cursors/webcursor_aurax11.cc" ]
- }
-
- if (use_pango) {
- configs += [ "//build/config/linux:pangocairo" ]
- if (use_ozone) {
- # If we're using pango, never use this ozone file (it was removed in all
- # non-ozone cases above).
- sources -= [ "font_list_ozone.cc" ]
- }
- } else {
- sources -= [ "font_list_pango.cc" ]
- }
-
- if (enable_plugins) {
- deps += [ "//ppapi/shared_impl" ]
- } else {
- sources -= [
- "pepper_file_util.cc",
- "pepper_file_util.h",
- "pepper_messages.h",
- "pepper_plugin_list.cc",
- "pepper_plugin_list.h",
- "pepper_renderer_instance_data.cc",
- "pepper_renderer_instance_data.h",
- "plugin_list.cc",
- "plugin_list.h",
+ # 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 += [
- "gpu/media/android_copying_backing_strategy.cc",
- "gpu/media/android_copying_backing_strategy.h",
- "gpu/media/android_deferred_rendering_backing_strategy.cc",
- "gpu/media/android_deferred_rendering_backing_strategy.h",
- "gpu/media/android_video_decode_accelerator.cc",
- "gpu/media/android_video_decode_accelerator.h",
- "gpu/media/avda_codec_image.cc",
- "gpu/media/avda_codec_image.h",
- "gpu/media/avda_return_on_failure.h",
- "gpu/media/avda_shared_state.cc",
- "gpu/media/avda_shared_state.h",
- "gpu/media/avda_state_provider.h",
+ "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",
]
if (enable_webrtc) {
deps += [ "//third_party/libyuv" ]
sources += [
- "gpu/media/android_video_encode_accelerator.cc",
- "gpu/media/android_video_encode_accelerator.h",
+ "android_video_encode_accelerator.cc",
+ "android_video_encode_accelerator.h",
]
}
@@ -349,19 +210,19 @@ source_set("common") {
if (is_chromeos) {
sources += [
- "gpu/media/accelerated_video_decoder.h",
- "gpu/media/h264_decoder.cc",
- "gpu/media/h264_decoder.h",
- "gpu/media/h264_dpb.cc",
- "gpu/media/h264_dpb.h",
- "gpu/media/vp8_decoder.cc",
- "gpu/media/vp8_decoder.h",
- "gpu/media/vp8_picture.cc",
- "gpu/media/vp8_picture.h",
- "gpu/media/vp9_decoder.cc",
- "gpu/media/vp9_decoder.h",
- "gpu/media/vp9_picture.cc",
- "gpu/media/vp9_picture.h",
+ "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" ]
@@ -372,20 +233,20 @@ source_set("common") {
defines += [ "USE_V4L2_CODEC" ]
deps += [ "//third_party/libyuv" ]
sources += [
- "gpu/media/generic_v4l2_device.cc",
- "gpu/media/generic_v4l2_device.h",
- "gpu/media/v4l2_device.cc",
- "gpu/media/v4l2_device.h",
- "gpu/media/v4l2_image_processor.cc",
- "gpu/media/v4l2_image_processor.h",
- "gpu/media/v4l2_jpeg_decode_accelerator.cc",
- "gpu/media/v4l2_jpeg_decode_accelerator.h",
- "gpu/media/v4l2_slice_video_decode_accelerator.cc",
- "gpu/media/v4l2_slice_video_decode_accelerator.h",
- "gpu/media/v4l2_video_decode_accelerator.cc",
- "gpu/media/v4l2_video_decode_accelerator.h",
- "gpu/media/v4l2_video_encode_accelerator.cc",
- "gpu/media/v4l2_video_encode_accelerator.h",
+ "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",
@@ -394,25 +255,25 @@ source_set("common") {
}
if (current_cpu == "arm") {
sources += [
- "gpu/media/tegra_v4l2_device.cc",
- "gpu/media/tegra_v4l2_device.h",
+ "tegra_v4l2_device.cc",
+ "tegra_v4l2_device.h",
]
}
if (current_cpu != "arm") {
sources += [
- "gpu/media/va_surface.h",
- "gpu/media/vaapi_jpeg_decode_accelerator.cc",
- "gpu/media/vaapi_jpeg_decode_accelerator.h",
- "gpu/media/vaapi_jpeg_decoder.cc",
- "gpu/media/vaapi_jpeg_decoder.h",
- "gpu/media/vaapi_picture.cc",
- "gpu/media/vaapi_picture.h",
- "gpu/media/vaapi_video_decode_accelerator.cc",
- "gpu/media/vaapi_video_decode_accelerator.h",
- "gpu/media/vaapi_video_encode_accelerator.cc",
- "gpu/media/vaapi_video_encode_accelerator.h",
- "gpu/media/vaapi_wrapper.cc",
- "gpu/media/vaapi_wrapper.h",
+ "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",
@@ -425,14 +286,14 @@ source_set("common") {
]
if (use_x11) {
sources += [
- "gpu/media/vaapi_tfp_picture.cc",
- "gpu/media/vaapi_tfp_picture.h",
+ "vaapi_tfp_picture.cc",
+ "vaapi_tfp_picture.h",
]
}
if (use_ozone) {
sources += [
- "gpu/media/vaapi_drm_picture.cc",
- "gpu/media/vaapi_drm_picture.h",
+ "vaapi_drm_picture.cc",
+ "vaapi_drm_picture.h",
]
}
}
@@ -440,10 +301,13 @@ source_set("common") {
if (is_win) {
sources += [
- "gpu/media/dxva_video_decode_accelerator_win.cc",
- "gpu/media/dxva_video_decode_accelerator_win.h",
+ "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",
]
- configs += [ "//third_party/khronos:khronos_headers" ]
deps += [ "//ui/gl" ]
libs += [
"d3d9.lib",
@@ -465,81 +329,48 @@ source_set("common") {
# TODO(GYP): extract_xinput action.
}
- if (!is_win || !use_aura) {
- sources -= [ "cursors/webcursor_aurawin.cc" ]
+ if (use_x11) {
+ deps += [ "//ui/gfx/x" ]
}
+}
- if (use_seccomp_bpf) {
- defines += [ "USE_SECCOMP_BPF" ]
- } else {
- if (is_linux) {
- sources -= [
- "sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc",
- "sandbox_linux/bpf_cros_arm_gpu_policy_linux.h",
- "sandbox_linux/bpf_gpu_policy_linux.cc",
- "sandbox_linux/bpf_gpu_policy_linux.h",
- "sandbox_linux/bpf_ppapi_policy_linux.cc",
- "sandbox_linux/bpf_ppapi_policy_linux.h",
- "sandbox_linux/bpf_renderer_policy_linux.cc",
- "sandbox_linux/bpf_renderer_policy_linux.h",
- "sandbox_linux/bpf_utility_policy_linux.cc",
- "sandbox_linux/bpf_utility_policy_linux.h",
- "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
- "sandbox_linux/sandbox_bpf_base_policy_linux.h",
+if (is_android) {
+ # TODO(GYP): Port Windows and ChromeOS logic.
+ test("video_decode_accelerator_unittest") {
+ deps = [
+ "//base",
+ "//media",
+ "//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" ]
+ 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) {
- sources -= [
- "sandbox_linux/android/sandbox_bpf_base_policy_android.cc",
- "sandbox_linux/android/sandbox_bpf_base_policy_android.h",
+ deps += [
+ "//gpu:test_support",
+ "//media/base/android",
+ "//media/base/android:media_java",
+ "//media/capture/video/android:capture_java",
+ "//testing/gmock",
+ "//ui/android:ui_java",
]
}
}
}
-
-# See comment at the top of //content/BUILD.gn for how this works.
-group("for_content_tests") {
- visibility = [ "//content/test/*" ]
- if (!is_component_build) {
- public_deps = [
- ":common",
- ]
- }
-}
-
-mojom("mojo_bindings") {
- # This interface is internal to content. However, this is not exported from
- # the content component shared library. Code in content but outside of the
- # content component (content/test or content/shell) should link to this
- # directly.
- visibility = [ "//content/*" ]
-
- sources = [
- "application_setup.mojom",
- "background_sync_service.mojom",
- "image_downloader/image_downloader.mojom",
- "leveldb_wrapper.mojom",
- "presentation/presentation_service.mojom",
- "process_control.mojom",
- "render_frame_setup.mojom",
- "render_widget_window_tree_client_factory.mojom",
- "service_worker/embedded_worker_setup.mojom",
- "storage_partition_service.mojom",
- "vr_service.mojom",
- ]
-
- import_dirs = [ "//mojo/services" ]
-
- typemaps = [ "//url/mojo/origin.typemap" ]
-
- public_deps = [
- "//components/leveldb/public/interfaces",
- "//components/mus/public/interfaces",
- "//content/public/common:mojo_bindings",
- "//services/shell/public/interfaces",
- "//skia/public/interfaces",
- "//third_party/WebKit/public:mojo_bindings",
- "//ui/mojo/geometry:interfaces",
- "//url/mojo:url_mojom_origin",
- ]
-}
« no previous file with comments | « media/filters/vp9_parser.h ('k') | media/gpu/DEPS » ('j') | media/gpu/h264_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698