# Copyright 2018 The Chromium Authors
# 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("//build/config/features.gni")
import("//build/config/ui.gni")
import("//media/gpu/args.gni")
import("//media/media_options.gni")
import("//testing/test.gni")
import("//tools/generate_stubs/rules.gni")
import("//ui/gl/features.gni")

assert(is_linux || is_chromeos)
assert(use_vaapi)

generate_stubs("libva_stubs") {
  extra_header = "va_stub_header.fragment"
  sigs = [ "va.sigs" ]
  if (use_vaapi_x11) {
    sigs += [ "va_x11.sigs" ]
  }
  if (is_chromeos_ash) {
    sigs += [ "va_prot.sigs" ]
  }
  sigs += [ "va_drm.sigs" ]

  output_name = "va_stubs"
  deps = [
    "//base",
    "//media/gpu:buildflags",
  ]
}

source_set("vaapi") {
  assert(use_libgav1_parser)
  defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
  sources = [
    "av1_vaapi_video_decoder_delegate.cc",
    "av1_vaapi_video_decoder_delegate.h",
    "av1_vaapi_video_encoder_delegate.cc",
    "av1_vaapi_video_encoder_delegate.h",
    "h264_vaapi_video_decoder_delegate.cc",
    "h264_vaapi_video_decoder_delegate.h",
    "h264_vaapi_video_encoder_delegate.cc",
    "h264_vaapi_video_encoder_delegate.h",
    "vaapi_dmabuf_video_frame_mapper.cc",
    "vaapi_dmabuf_video_frame_mapper.h",
    "vaapi_image_decode_accelerator_worker.cc",
    "vaapi_image_decode_accelerator_worker.h",
    "vaapi_image_decoder.cc",
    "vaapi_image_decoder.h",
    "vaapi_image_processor_backend.cc",
    "vaapi_image_processor_backend.h",
    "vaapi_jpeg_decoder.cc",
    "vaapi_jpeg_decoder.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_decoder.cc",
    "vaapi_video_decoder.h",
    "vaapi_video_decoder_delegate.cc",
    "vaapi_video_decoder_delegate.h",
    "vaapi_video_encode_accelerator.cc",
    "vaapi_video_encode_accelerator.h",
    "vaapi_video_encoder_delegate.cc",
    "vaapi_video_encoder_delegate.h",
    "vaapi_webp_decoder.cc",
    "vaapi_webp_decoder.h",
    "vp8_vaapi_video_decoder_delegate.cc",
    "vp8_vaapi_video_decoder_delegate.h",
    "vp8_vaapi_video_encoder_delegate.cc",
    "vp8_vaapi_video_encoder_delegate.h",
    "vp9_vaapi_video_decoder_delegate.cc",
    "vp9_vaapi_video_decoder_delegate.h",
    "vp9_vaapi_video_encoder_delegate.cc",
    "vp9_vaapi_video_encoder_delegate.h",
  ]
  if (enable_hevc_parser_and_hw_decoder) {
    sources += [
      "h265_vaapi_video_decoder_delegate.cc",
      "h265_vaapi_video_decoder_delegate.h",
    ]
  }

  configs += [
    "//build/config/linux/libva",
    "//third_party/libvpx:libvpx_config",
  ]

  deps = [
    ":common",
    ":vaapi_status",
    "//base",
    "//build:chromeos_buildflags",
    "//gpu/command_buffer/service:gles2",
    "//gpu/config",
    "//gpu/ipc/common",
    "//gpu/ipc/service",
    "//media/gpu:common",
    "//media/gpu:video_frame_mapper_common",
    "//media/gpu/chromeos:common",
    "//media/parsers",
    "//mojo/public/cpp/bindings",
    "//third_party/libaom:libaomrc",
    "//third_party/libvpx:libvpxrc",
    "//third_party/libyuv",
    "//ui/gfx",
    "//ui/gfx/geometry",
  ]

  public_deps = [
    "//media",
    "//skia",
    "//ui/gl",
  ]

  if (is_chromeos_ash) {
    sources += [
      "vaapi_jpeg_encode_accelerator.cc",
      "vaapi_jpeg_encode_accelerator.h",
      "vaapi_mjpeg_decode_accelerator.cc",
      "vaapi_mjpeg_decode_accelerator.h",
    ]

    deps += [
      "//chromeos/components/cdm_factory_daemon:cdm_factory_daemon_gpu",
      "//components/chromeos_camera:jpeg_encode_accelerator",
      "//components/chromeos_camera:mjpeg_decode_accelerator",
    ]
  }

  if (use_ozone || use_egl) {
    sources += [
      "vaapi_picture_native_pixmap.cc",
      "vaapi_picture_native_pixmap.h",
    ]
  }

  if (use_vaapi_x11) {
    deps += [ "//ui/gfx/x" ]
    sources += [
      "gl_image_egl_pixmap.cc",
      "gl_image_egl_pixmap.h",
      "vaapi_picture_native_pixmap_angle.cc",
      "vaapi_picture_native_pixmap_angle.h",
    ]
  }

  if (use_ozone) {
    deps += [
      "//media/gpu:buffer_validation",
      "//ui/ozone",
    ]
    sources += [
      "vaapi_picture_native_pixmap_ozone.cc",
      "vaapi_picture_native_pixmap_ozone.h",
    ]
  }

  if (use_egl) {
    sources += [
      "gl_image_gl_texture.cc",
      "gl_image_gl_texture.h",
      "vaapi_picture_native_pixmap_egl.cc",
      "vaapi_picture_native_pixmap_egl.h",
    ]
  }
}

# The vaapi status functionality is in its own source set so that it can be
# depended on without pulling the //media/gpu/vaapi:vaapi target.
source_set("vaapi_status") {
  sources = [ "vaapi_status.h" ]

  visibility = [
    ":vaapi",
    "//media/mojo/mojom/stable:*",
  ]

  deps = [ "//media" ]
}

source_set("common") {
  defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
  sources = [
    "va_surface.cc",
    "va_surface.h",
    "vaapi_common.cc",
    "vaapi_common.h",
    "vaapi_utils.cc",
    "vaapi_utils.h",
    "vaapi_wrapper.cc",
    "vaapi_wrapper.h",
  ]
  public_deps = [
    "//base",
    "//build/config/linux/libdrm",
    "//gpu",
    "//media",
    "//media/gpu:common",
    "//media/gpu/chromeos:fourcc",
    "//ui/gfx/geometry",
  ]
  deps = [
    ":libva_stubs",
    "//build:chromeos_buildflags",
    "//third_party/libyuv",
    "//ui/base:features",
    "//ui/gfx:memory_buffer",
    "//ui/gfx/linux:drm",
    "//ui/gl",
  ]
  if (use_ozone) {
    deps += [ "//ui/ozone" ]
  }

  if (use_vaapi_x11) {
    deps += [ "//ui/gfx/x" ]
  }

  configs += [ "//build/config/linux/libva" ]
}

source_set("vaapi_test_utils") {
  testonly = true
  sources = [
    "test_utils.cc",
    "test_utils.h",
  ]
  deps = [
    ":common",
    "//base",
    "//testing/gtest",
    "//third_party/libyuv:libyuv",
  ]
  public_deps = [ "//ui/gfx/geometry" ]
}

source_set("unit_test") {
  testonly = true
  sources = [
    "h264_vaapi_video_encoder_delegate_unittest.cc",
    "vaapi_image_decode_accelerator_worker_unittest.cc",
    "vaapi_video_decode_accelerator_unittest.cc",
    "vaapi_video_encode_accelerator_unittest.cc",
    "vaapi_wrapper_unittest.cc",
    "vp9_vaapi_video_encoder_delegate_unittest.cc",
  ]
  configs += [ "//third_party/libvpx:libvpx_config" ]
  deps = [
    ":common",
    ":vaapi",
    "//base",
    "//base/test:test_support",
    "//gpu:test_support",
    "//gpu/ipc/service",
    "//media:test_support",
    "//media/gpu:common",
    "//mojo/core/embedder",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/libvpx:libvpxrc",
    "//ui/gfx:memory_buffer",
    "//ui/gfx:test_support",
    "//ui/gfx/geometry",
  ]
}

source_set("vaapi_image_decoder_test_common") {
  testonly = true
  sources = [
    "vaapi_image_decoder_test_common.cc",
    "vaapi_image_decoder_test_common.h",
  ]
  deps = [
    ":vaapi",
    ":vaapi_test_utils",
    "//base",
    "//media:test_support",
    "//testing/gtest",
  ]
}

# TODO(https://crbug.com/1043007): remove is_chromeos.
if (is_chromeos_ash) {
  source_set("jpeg_decoder_unit_test") {
    testonly = true
    sources = [ "vaapi_jpeg_decoder_unittest.cc" ]
    deps = [
      ":common",
      ":vaapi",
      ":vaapi_image_decoder_test_common",
      ":vaapi_test_utils",
      "//base",
      "//media/gpu/test:local_gpu_memory_buffer_manager",
      "//media/parsers",
      "//testing/gtest",
      "//third_party/libyuv:libyuv",
      "//ui/gfx:memory_buffer",
      "//ui/gfx/codec",
      "//ui/gfx/geometry",
    ]
  }

  source_set("webp_decoder_unit_test") {
    testonly = true
    sources = [ "vaapi_webp_decoder_unittest.cc" ]
    deps = [
      ":common",
      ":vaapi",
      ":vaapi_image_decoder_test_common",
      ":vaapi_test_utils",
      "//base",
      "//media/gpu/test:local_gpu_memory_buffer_manager",
      "//media/parsers",
      "//testing/gtest",
      "//third_party/libwebp",
      "//ui/gfx:memory_buffer",
      "//ui/gfx/geometry",
    ]
  }
}

source_set("vaapi_utils_unittest") {
  testonly = true
  sources = [ "vaapi_utils_unittest.cc" ]
  deps = [
    ":common",
    "//base",
    "//base/test:test_support",
    "//testing/gtest",
    "//ui/gfx/geometry",
  ]
}

test("vaapi_unittest") {
  sources = [ "vaapi_unittest.cc" ]
  deps = [
    ":common",
    ":vaapi_utils_unittest",
    "//base",
    "//base/test:test_support",
    "//build:chromeos_buildflags",
    "//gpu",
    "//media/gpu/test:helpers",
    "//testing/gtest",
    "//third_party/minigbm",
    "//ui/gfx/linux:gbm",
  ]

  # TODO(andrescj): the Chrome bots run vaapi_unittest with the fake driver, but
  # the ChromeOS tests rely on a real driver. Therefore, we shouldn't need this
  # unconditional data_deps. Instead, we should try to re-structure things so
  # that ChromeOS can build the vaapi_unittest without building the fake driver.
  data_deps = [ "//media/gpu/vaapi/test/fake_libva_driver:fake_drv_video" ]

  # TODO(https://crbug.com/1043007): remove is_chromeos.
  if (is_chromeos_ash) {
    deps += [
      ":jpeg_decoder_unit_test",
      ":webp_decoder_unit_test",
    ]
  }

  if (use_ozone && is_linux) {
    deps += [ "//ui/ozone" ]
  }
}

group("vaapi_fuzzers") {
  testonly = true
  public_deps =
      [ "//media/gpu/vaapi/fuzzers/jpeg_decoder:vaapi_jpeg_decoder_fuzzertest" ]
}

executable("decode_test") {
  testonly = true
  sources = [
    "test/av1_decoder.cc",
    "test/av1_decoder.h",
    "test/decode.cc",
    "test/h264_decoder.cc",
    "test/h264_decoder.h",
    "test/h264_dpb.cc",
    "test/h264_dpb.h",
    "test/h264_vaapi_wrapper.cc",
    "test/h264_vaapi_wrapper.h",
    "test/macros.h",
    "test/scoped_va_config.cc",
    "test/scoped_va_config.h",
    "test/scoped_va_context.cc",
    "test/scoped_va_context.h",
    "test/shared_va_surface.cc",
    "test/shared_va_surface.h",
    "test/vaapi_device.cc",
    "test/vaapi_device.h",
    "test/video_decoder.cc",
    "test/video_decoder.h",
    "test/vp8_decoder.cc",
    "test/vp8_decoder.h",
    "test/vp9_decoder.cc",
    "test/vp9_decoder.h",
  ]

  if (enable_platform_hevc) {
    sources += [
      "test/h265_decoder.cc",
      "test/h265_decoder.h",
      "test/h265_dpb.cc",
      "test/h265_dpb.h",
      "test/h265_vaapi_wrapper.cc",
      "test/h265_vaapi_wrapper.h",
    ]
  }

  deps = [
    ":libva_stubs",
    "//base",
    "//build/config/linux/libdrm",
    "//media",
    "//media:test_support",
    "//media/gpu:common",
    "//media/parsers:parsers",
    "//third_party/libgav1:libgav1_parser",
    "//third_party/libyuv",
    "//ui/gfx/codec:codec",
    "//ui/gfx/geometry",
  ]
}
