# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//media/gpu/args.gni")

assert(is_chromeos)

if (use_linux_video_acceleration) {
  static_library("video_accelerator") {
    sources = [
      "gpu_arc_video_decode_accelerator.cc",
      "gpu_arc_video_decode_accelerator.h",
      "gpu_arc_video_decoder.cc",
      "gpu_arc_video_decoder.h",
      "gpu_arc_video_encode_accelerator.cc",
      "gpu_arc_video_encode_accelerator.h",
      "gpu_arc_video_frame_pool.cc",
      "gpu_arc_video_frame_pool.h",
      "gpu_arc_video_protected_buffer_allocator.cc",
      "gpu_arc_video_protected_buffer_allocator.h",
      "oop_arc_video_accelerator_factory.cc",
      "oop_arc_video_accelerator_factory.h",
      "protected_buffer_manager_proxy.cc",
      "protected_buffer_manager_proxy.h",
    ]

    deps = [
      ":common",
      "//chromeos/ash/experiences/arc:arc_features",
      "//chromeos/ash/experiences/arc/mojom:media",
      "//chromeos/components/cdm_factory_daemon:cdm_factory_daemon_gpu",
      "//gpu/ipc/common",
      "//media",
      "//media/gpu:buffer_validation",
      "//media/gpu/chromeos:common",
    ]
  }
}

source_set("common") {
  sources = [
    "arc_video_accelerator_util.cc",
    "arc_video_accelerator_util.h",
    "protected_buffer_manager.cc",
    "protected_buffer_manager.h",
    "video_frame_plane.h",
  ]

  deps = [
    "//media",
    "//media/gpu",
    "//media/gpu:buffer_validation",
    "//mojo/public/cpp/system",
    "//ui/gfx:memory_buffer",
    "//ui/ozone",
  ]

  if (use_linux_video_acceleration) {
    deps += [ "//media/gpu/chromeos" ]
  }
}

source_set("protected_native_pixmap_query_client") {
  sources = [
    "protected_native_pixmap_query_client.cc",
    "protected_native_pixmap_query_client.h",
  ]

  deps = [
    "//chromeos/ash/experiences/arc/mojom:media",
    "//components/exo",
    "//content/public/browser",
  ]
}
