| # Copyright 2019 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/chromeos/ui_mode.gni") |
| import("//media/gpu/args.gni") |
| import("//testing/test.gni") |
| |
| assert(use_v4l2_codec || use_vaapi) |
| |
| # V4L2 or Vaapi imply the OS is Linux or ChromeOS |
| assert(is_linux || is_chromeos) |
| |
| # This target can depend on targets in //media/gpu/{v4l2,vaapi}. |
| source_set("chromeos") { |
| # TODO(crbug.com/1006266): consider using |use_chromeos_video_acceleration|. |
| defines = [ "MEDIA_GPU_IMPLEMENTATION" ] |
| sources = [ |
| "image_processor_factory.cc", |
| "video_decoder_pipeline.cc", |
| ] |
| |
| public_deps = [ ":common" ] |
| |
| deps = [ |
| "//base", |
| "//media", |
| "//media/gpu:buildflags", |
| "//media/gpu:command_buffer_helper", |
| "//media/gpu:common", |
| ] |
| |
| if (use_vaapi) { |
| deps += [ |
| "//media/gpu/vaapi", |
| "//media/gpu/vaapi:common", |
| ] |
| } |
| |
| if (use_v4l2_codec) { |
| deps += [ "//media/gpu/v4l2" ] |
| } |
| } |
| |
| # This target can be depended by targets in //media/gpu/{v4l2,vaapi}. |
| source_set("common") { |
| defines = [ "MEDIA_GPU_IMPLEMENTATION" ] |
| sources = [ |
| "dmabuf_video_frame_pool.cc", |
| "dmabuf_video_frame_pool.h", |
| "gpu_buffer_layout.cc", |
| "gpu_buffer_layout.h", |
| "image_processor.cc", |
| "image_processor.h", |
| "image_processor_backend.cc", |
| "image_processor_backend.h", |
| "image_processor_factory.h", |
| "image_processor_with_pool.cc", |
| "image_processor_with_pool.h", |
| "libyuv_image_processor_backend.cc", |
| "libyuv_image_processor_backend.h", |
| "mailbox_video_frame_converter.cc", |
| "mailbox_video_frame_converter.h", |
| "platform_video_frame_pool.cc", |
| "platform_video_frame_pool.h", |
| "platform_video_frame_utils.cc", |
| "platform_video_frame_utils.h", |
| "vd_video_decode_accelerator.cc", |
| "vd_video_decode_accelerator.h", |
| "vda_video_frame_pool.cc", |
| "vda_video_frame_pool.h", |
| "video_decoder_pipeline.h", |
| "video_frame_converter.cc", |
| "video_frame_converter.h", |
| ] |
| |
| # TODO(crbug.com/1012587): Merge :fourcc to :common. |
| public_deps = [ ":fourcc" ] |
| |
| deps = [ |
| ":fourcc", |
| "//base", |
| "//build:chromeos_buildflags", |
| "//build/config/linux/libdrm", |
| "//gpu/ipc/common:common", |
| "//media", |
| "//media/gpu:buildflags", |
| "//media/gpu:command_buffer_helper", |
| "//media/gpu:common", |
| "//media/gpu:video_frame_mapper_common", |
| "//third_party/libyuv", |
| "//ui/gfx:buffer_types", |
| "//ui/gfx:memory_buffer", |
| "//ui/gfx/geometry", |
| "//ui/gfx/linux:drm", |
| "//ui/gfx/linux:gbm", |
| "//ui/gl", |
| ] |
| if (is_chromeos_ash) { |
| sources += [ |
| "decoder_buffer_transcryptor.cc", |
| "decoder_buffer_transcryptor.h", |
| ] |
| deps += |
| [ "//chromeos/components/cdm_factory_daemon:cdm_factory_daemon_gpu" ] |
| } |
| } |
| |
| # Although fourcc is platform-agnostic; however, it is restricted by the above |
| # assert(use_v4l2_codec || use_vaapi). |
| source_set("fourcc") { |
| defines = [ "MEDIA_GPU_IMPLEMENTATION" ] |
| sources = [ |
| "fourcc.cc", |
| "fourcc.h", |
| ] |
| |
| deps = [ |
| "//base", |
| "//media", |
| "//media/gpu:buildflags", |
| "//media/gpu:common", |
| ] |
| } |
| |
| source_set("video_frame_mapper") { |
| defines = [ "MEDIA_GPU_IMPLEMENTATION" ] |
| sources = [ |
| "generic_dmabuf_video_frame_mapper.cc", |
| "generic_dmabuf_video_frame_mapper.h", |
| "gpu_memory_buffer_video_frame_mapper.cc", |
| "gpu_memory_buffer_video_frame_mapper.h", |
| ] |
| |
| deps = [ |
| "//base", |
| "//media", |
| "//media/gpu:command_buffer_helper", |
| "//media/gpu:common", |
| "//media/gpu:video_frame_mapper_common", |
| ] |
| } |
| |
| source_set("unit_tests") { |
| testonly = true |
| deps = [ |
| ":common", |
| "//base", |
| "//base/test:test_support", |
| "//gpu/ipc/service:service", |
| "//media", |
| "//media:test_support", |
| "//media/gpu:buildflags", |
| "//skia", |
| "//testing/gmock", |
| "//testing/gtest", |
| "//ui/gfx:buffer_types", |
| "//ui/gfx:memory_buffer", |
| "//ui/gfx/geometry", |
| ] |
| sources = [ |
| "fourcc_unittests.cc", |
| "mailbox_video_frame_converter_unittest.cc", |
| "platform_video_frame_pool_unittest.cc", |
| "platform_video_frame_utils_unittest.cc", |
| "video_decoder_pipeline_unittest.cc", |
| ] |
| if (is_chromeos_ash) { |
| deps += |
| [ "//chromeos/components/cdm_factory_daemon:cdm_factory_daemon_gpu" ] |
| } |
| } |
| |
| test("image_processor_test") { |
| sources = [ "image_processor_test.cc" ] |
| deps = [ |
| ":chromeos", |
| "//base/test:test_support", |
| "//build:chromeos_buildflags", |
| "//media:test_support", |
| "//media/gpu:buildflags", |
| "//media/gpu/test:frame_file_writer", |
| "//media/gpu/test:frame_validator", |
| "//media/gpu/test:helpers", |
| "//media/gpu/test:image_processor", |
| "//media/gpu/test:video_test_environment", |
| "//mojo/core/embedder", |
| "//testing/gtest", |
| ] |
| } |