chromium/media/gpu/mac/BUILD.gn

# Copyright 2019 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/features.gni")
import("//build/config/ui.gni")
import("//media/gpu/args.gni")
import("//media/media_options.gni")
import("//ui/gl/features.gni")

assert(is_apple)

if (is_mac) {
  import("//build/config/mac/mac_sdk.gni")
}

source_set("mac") {
  defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
  visibility = [ "//media/gpu" ]

  sources = [
    "video_toolbox_av1_accelerator.cc",
    "video_toolbox_av1_accelerator.h",
    "video_toolbox_decompression_metadata.cc",
    "video_toolbox_decompression_metadata.h",
    "video_toolbox_decompression_session.cc",
    "video_toolbox_decompression_session.h",
    "video_toolbox_decompression_session_manager.h",
    "video_toolbox_decompression_session_manager.mm",
    "video_toolbox_frame_converter.cc",
    "video_toolbox_frame_converter.h",
    "video_toolbox_h264_accelerator.cc",
    "video_toolbox_h264_accelerator.h",
    "video_toolbox_output_queue.cc",
    "video_toolbox_output_queue.h",
    "video_toolbox_video_decoder.cc",
    "video_toolbox_video_decoder.h",
    "video_toolbox_vp9_accelerator.cc",
    "video_toolbox_vp9_accelerator.h",
    "vt_config_util.h",
    "vt_config_util.mm",
    "vt_video_encode_accelerator_mac.h",
    "vt_video_encode_accelerator_mac.mm",
  ]
  if (enable_hevc_parser_and_hw_decoder) {
    sources += [
      "video_toolbox_h265_accelerator.cc",
      "video_toolbox_h265_accelerator.h",
    ]
  }
  public_deps = [ "//third_party/webrtc_overrides:webrtc_component" ]
  frameworks = [
    "CoreFoundation.framework",
    "CoreMedia.framework",
    "Foundation.framework",
    "IOSurface.framework",
    "QuartzCore.framework",
    "VideoToolbox.framework",
  ]
  deps = [
    "//base",
    "//components/crash/core/common:crash_key",
    "//components/viz/common:shared_image_format",
    "//gpu/command_buffer/service",
    "//gpu/command_buffer/service:gles2",
    "//gpu/ipc/service",
    "//media",
    "//media/gpu:common",
    "//ui/gfx/geometry",
    "//ui/gl",
  ]
}

source_set("unit_tests") {
  testonly = true
  frameworks = [
    "CoreFoundation.framework",
    "CoreMedia.framework",
  ]
  deps = [
    "//base/test:test_support",
    "//media:test_support",
    "//media/gpu:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]

  if (media_use_ffmpeg) {
    deps += [ "//third_party/ffmpeg" ]
  }

  sources = [
    "video_toolbox_av1_accelerator_unittest.cc",
    "video_toolbox_decompression_session_manager_unittest.cc",
    "video_toolbox_h264_accelerator_unittest.cc",
    "video_toolbox_output_queue_unittest.cc",
    "video_toolbox_vp9_accelerator_unittest.cc",
    "vt_config_util_unittest.mm",
  ]
  if (enable_hevc_parser_and_hw_decoder) {
    sources += [ "video_toolbox_h265_accelerator_unittest.cc" ]
  }
}