Commit b23e6413 authored by Miguel Casas's avatar Miguel Casas Committed by Commit Bot

RELAND: Vaapi: extract a new BUILD.gn

Original CL got reverted after breaking linux-chromeos-dbg:
FAILED: viz.service
...
error: undefined reference to 'media::VaapiWrapper::PreSandboxInitialization()'

because the original CL was missing a
  defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
inside the new BUILD.gn

Also this CL removes an extra level of vaapi/ folder in the auto
generated stub files.

Cq-Include-Trybots: master.tryserver.chromium.chromiumos:linux-chromeos-dbg
TBR=dalecurtis@chromium.org (minor changes)

Original CL description -----------------------------------------------

This CL adds a new //media/gpu/vaapi/BUILD.gn and extracts the necesary
parts of //media/gpu/BUILD.gn into it.  The files in ...vaapi/ include
a few of //media/gpu, so I extracted those into a //media/gpu:common
source_set.

TEST= simplechrome on soraka; CQ should cover this changes nonetheless.

Bug: 811912
Change-Id: I76a24913c48cd407131712ff6d573c5ee94fe14e
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Reviewed-on: https://chromium-review.googlesource.com/919301Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#536825}
Reviewed-on: https://chromium-review.googlesource.com/919971Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537007}
parent e10bedf4
...@@ -24,48 +24,6 @@ if (is_mac) { ...@@ -24,48 +24,6 @@ if (is_mac) {
import("//build/config/mac/mac_sdk.gni") import("//build/config/mac/mac_sdk.gni")
} }
if (use_vaapi) {
action("libva_generate_stubs") {
extra_header = "vaapi/va_stub_header.fragment"
script = "../../tools/generate_stubs/generate_stubs.py"
sources = [
"vaapi/va.sigs",
]
inputs = [
extra_header,
]
if (use_x11) {
sources += [ "vaapi/va_x11.sigs" ]
}
if (is_linux) {
sources += [ "vaapi/va_drm.sigs" ]
}
stubs_filename_root = "va_stubs"
outputs = [
"$target_gen_dir/vaapi/$stubs_filename_root.cc",
"$target_gen_dir/vaapi/$stubs_filename_root.h",
]
args = [
"-i",
rebase_path("$target_gen_dir/vaapi", root_build_dir),
"-o",
rebase_path("$target_gen_dir/vaapi", root_build_dir),
"-t",
"posix_stubs",
"-e",
rebase_path(extra_header, root_build_dir),
"-s",
stubs_filename_root,
"-p",
"media/gpu/vaapi",
]
args += rebase_path(sources, root_build_dir)
}
}
if (is_chromeos && use_v4lplugin) { if (is_chromeos && use_v4lplugin) {
action("libv4l2_generate_stubs") { action("libv4l2_generate_stubs") {
extra_header = "v4l2/v4l2_stub_header.fragment" extra_header = "v4l2/v4l2_stub_header.fragment"
...@@ -114,6 +72,7 @@ component("gpu") { ...@@ -114,6 +72,7 @@ component("gpu") {
"//content/gpu:*", "//content/gpu:*",
"//content/renderer:*", "//content/renderer:*",
"//media/gpu/ipc/*", "//media/gpu/ipc/*",
"//media/gpu/vaapi/*",
"//media/mojo/*", "//media/mojo/*",
"//remoting/codec:encoder", "//remoting/codec:encoder",
":*", ":*",
...@@ -128,13 +87,10 @@ component("gpu") { ...@@ -128,13 +87,10 @@ component("gpu") {
defines = [ "MEDIA_GPU_IMPLEMENTATION" ] defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
sources = [ sources = [
"accelerated_video_decoder.h",
"fake_jpeg_decode_accelerator.cc", "fake_jpeg_decode_accelerator.cc",
"fake_jpeg_decode_accelerator.h", "fake_jpeg_decode_accelerator.h",
"fake_video_decode_accelerator.cc", "fake_video_decode_accelerator.cc",
"fake_video_decode_accelerator.h", "fake_video_decode_accelerator.h",
"format_utils.cc",
"format_utils.h",
"gles2_decoder_helper.cc", "gles2_decoder_helper.cc",
"gles2_decoder_helper.h", "gles2_decoder_helper.h",
"gpu_jpeg_decode_accelerator_factory.cc", "gpu_jpeg_decode_accelerator_factory.cc",
...@@ -143,18 +99,12 @@ component("gpu") { ...@@ -143,18 +99,12 @@ component("gpu") {
"gpu_video_accelerator_util.h", "gpu_video_accelerator_util.h",
"gpu_video_decode_accelerator_factory.cc", "gpu_video_decode_accelerator_factory.cc",
"gpu_video_decode_accelerator_factory.h", "gpu_video_decode_accelerator_factory.h",
"gpu_video_decode_accelerator_helpers.h",
"gpu_video_encode_accelerator_factory.cc", "gpu_video_encode_accelerator_factory.cc",
"gpu_video_encode_accelerator_factory.h", "gpu_video_encode_accelerator_factory.h",
"h264_decoder.cc",
"h264_decoder.h",
"h264_dpb.cc",
"h264_dpb.h",
"shared_memory_region.cc",
"shared_memory_region.h",
] ]
public_deps = [ public_deps = [
":common",
":features", ":features",
"//base", "//base",
"//gpu", "//gpu",
...@@ -254,19 +204,6 @@ component("gpu") { ...@@ -254,19 +204,6 @@ component("gpu") {
} }
} }
if (use_v4l2_codec || use_vaapi) {
sources += [
"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) { if (use_v4lplugin) {
sources += get_target_outputs(":libv4l2_generate_stubs") sources += get_target_outputs(":libv4l2_generate_stubs")
deps += [ ":libv4l2_generate_stubs" ] deps += [ ":libv4l2_generate_stubs" ]
...@@ -306,53 +243,7 @@ component("gpu") { ...@@ -306,53 +243,7 @@ component("gpu") {
} }
if (use_vaapi) { if (use_vaapi) {
sources += [ public_deps += [ "//media/gpu/vaapi" ]
"vaapi/va_surface.cc",
"vaapi/va_surface.h",
"vaapi/vaapi_jpeg_decode_accelerator.cc",
"vaapi/vaapi_jpeg_decode_accelerator.h",
"vaapi/vaapi_jpeg_decoder.cc",
"vaapi/vaapi_jpeg_decoder.h",
"vaapi/vaapi_jpeg_encode_accelerator.cc",
"vaapi/vaapi_jpeg_encode_accelerator.h",
"vaapi/vaapi_jpeg_encoder.cc",
"vaapi/vaapi_jpeg_encoder.h",
"vaapi/vaapi_picture.cc",
"vaapi/vaapi_picture.h",
"vaapi/vaapi_picture_factory.cc",
"vaapi/vaapi_picture_factory.h",
"vaapi/vaapi_video_decode_accelerator.cc",
"vaapi/vaapi_video_decode_accelerator.h",
"vaapi/vaapi_video_encode_accelerator.cc",
"vaapi/vaapi_video_encode_accelerator.h",
"vaapi/vaapi_wrapper.cc",
"vaapi/vaapi_wrapper.h",
] + get_target_outputs(":libva_generate_stubs")
configs += [ "//third_party/libyuv:libyuv_config" ]
deps += [
":libva_generate_stubs",
"//media",
"//third_party/libyuv",
]
if (use_x11) {
configs += [ "//build/config/linux:x11" ]
deps += [ "//ui/gfx/x" ]
sources += [
"vaapi/vaapi_tfp_picture.cc",
"vaapi/vaapi_tfp_picture.h",
]
}
if (is_linux) {
sources += [
"vaapi/vaapi_drm_picture.cc",
"vaapi/vaapi_drm_picture.h",
]
}
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
} }
if (is_win) { if (is_win) {
...@@ -407,6 +298,42 @@ component("gpu") { ...@@ -407,6 +298,42 @@ component("gpu") {
} }
} }
source_set("common") {
defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
sources = [
"accelerated_video_decoder.h",
"format_utils.cc",
"format_utils.h",
"gpu_video_decode_accelerator_helpers.h",
"h264_decoder.cc",
"h264_decoder.h",
"h264_dpb.cc",
"h264_dpb.h",
"shared_memory_region.cc",
"shared_memory_region.h",
]
if (use_v4l2_codec || use_vaapi) {
sources += [
"vp8_decoder.cc",
"vp8_decoder.h",
"vp8_picture.cc",
"vp8_picture.h",
"vp9_decoder.cc",
"vp9_decoder.h",
"vp9_picture.cc",
"vp9_picture.h",
]
}
deps = [
":features",
"//base",
"//media",
"//ui/gfx:buffer_types",
"//ui/gfx/geometry",
]
}
# TODO(watk): Run this on bots. http://crbug.com/461437 # TODO(watk): Run this on bots. http://crbug.com/461437
if (is_win || is_android || use_v4l2_codec || use_vaapi) { if (is_win || is_android || use_v4l2_codec || use_vaapi) {
test("video_decode_accelerator_unittest") { test("video_decode_accelerator_unittest") {
...@@ -419,6 +346,7 @@ if (is_win || is_android || use_v4l2_codec || use_vaapi) { ...@@ -419,6 +346,7 @@ if (is_win || is_android || use_v4l2_codec || use_vaapi) {
] ]
deps = [ deps = [
":common",
":gpu", ":gpu",
"//base", "//base",
"//base/test:test_support", "//base/test:test_support",
...@@ -506,6 +434,7 @@ source_set("android_video_decode_accelerator_unittests") { ...@@ -506,6 +434,7 @@ source_set("android_video_decode_accelerator_unittests") {
"android/video_frame_factory_impl_unittest.cc", "android/video_frame_factory_impl_unittest.cc",
] ]
deps = [ deps = [
":common",
":gpu", ":gpu",
"//base/test:test_support", "//base/test:test_support",
"//gpu:test_support", "//gpu:test_support",
...@@ -624,13 +553,6 @@ source_set("unit_tests") { ...@@ -624,13 +553,6 @@ source_set("unit_tests") {
] ]
if (use_vaapi) { if (use_vaapi) {
sources += [ "vaapi/vaapi_video_decode_accelerator_unittest.cc" ] deps += [ "//media/gpu/vaapi:unit_test" ]
deps += [
":gpu",
"//base/test:test_support",
"//gpu:test_support",
"//ui/gfx:test_support",
"//ui/gfx/geometry",
]
} }
} }
# Copyright 2018 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")
assert(use_vaapi)
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 (is_linux) {
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/vaapi",
]
args += rebase_path(sources, root_build_dir)
}
source_set("vaapi") {
defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
sources = [
"va_surface.cc",
"va_surface.h",
"vaapi_jpeg_decode_accelerator.cc",
"vaapi_jpeg_decode_accelerator.h",
"vaapi_jpeg_decoder.cc",
"vaapi_jpeg_decoder.h",
"vaapi_jpeg_encode_accelerator.cc",
"vaapi_jpeg_encode_accelerator.h",
"vaapi_jpeg_encoder.cc",
"vaapi_jpeg_encoder.h",
"vaapi_picture.cc",
"vaapi_picture.h",
"vaapi_picture_factory.cc",
"vaapi_picture_factory.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/libyuv:libyuv_config" ]
deps = [
":libva_generate_stubs",
"//gpu/ipc/service",
"//media",
"//media/gpu:common",
"//third_party/libyuv",
]
if (use_x11) {
configs += [ "//build/config/linux:x11" ]
deps += [ "//ui/gfx/x" ]
sources += [
"vaapi_tfp_picture.cc",
"vaapi_tfp_picture.h",
]
}
if (is_linux) {
sources += [
"vaapi_drm_picture.cc",
"vaapi_drm_picture.h",
]
}
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
}
source_set("unit_test") {
testonly = true
sources = [
"vaapi_video_decode_accelerator_unittest.cc",
]
deps = [
":vaapi",
"//base/test:test_support",
"//gpu:test_support",
"//media/gpu:common",
"//testing/gmock",
"//testing/gtest",
"//ui/gfx:test_support",
"//ui/gfx/geometry",
]
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment