chromium/media/base/win/BUILD.gn

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

assert(is_win)

config("delay_load_mf") {
  ldflags = [
    "/DELAYLOAD:d3d11.dll",
    "/DELAYLOAD:mf.dll",
    "/DELAYLOAD:mfplat.dll",
    "/DELAYLOAD:mfreadwrite.dll",
  ]
}

source_set("media_foundation_util") {
  sources = [
    "dxgi_device_manager.cc",
    "dxgi_device_manager.h",
    "hresults.h",
    "mf_helpers.cc",
    "mf_helpers.h",
    "mf_initializer.cc",
    "mf_initializer.h",
  ]
  configs += [ "//media:subcomponent_config" ]
  deps = [
    "//base",
    "//gpu/ipc/common",
    "//media:shared_memory_support",
    "//media/base",
    "//third_party/libyuv",
  ]
  libs = [
    "d3d11.lib",
    "mf.lib",
    "mfplat.lib",
    "mfreadwrite.lib",
    "dxguid.lib",
    "dxgi.lib",
  ]

  # MediaFoundation is not available on Windows N, so must be delay loaded.
  all_dependent_configs = [ ":delay_load_mf" ]
}

component("color_space_util_win") {
  defines = [ "IS_MEDIA_IMPL" ]
  sources = [
    "color_space_util_win.cc",
    "color_space_util_win.h",
  ]
  configs += [ "//media:media_config" ]
  deps = [
    "//media:shared_memory_support",
    "//media/base",
    "//ui/gfx:color_space",
  ]
  libs = [
    "mf.lib",
    "mfplat.lib",
    "mfreadwrite.lib",
  ]

  # MediaFoundation is not available on Windows N, so must be delay loaded.
  all_dependent_configs = [ ":delay_load_mf" ]
}

source_set("mf_cdm_proxy") {
  sources = [ "media_foundation_cdm_proxy.h" ]
  deps = [ "//base" ]
}

source_set("dcomp_texture_wrapper") {
  sources = [ "dcomp_texture_wrapper.h" ]
  deps = [
    "//base",
    "//ui/gfx:memory_buffer",
  ]
}

source_set("overlay_state_observer_subscription") {
  sources = [ "overlay_state_observer_subscription.h" ]
  deps = [ "//base" ]
}

source_set("test_support") {
  testonly = true
  sources = [
    "d3d11_mocks.cc",
    "d3d11_mocks.h",
    "d3d12_mocks.cc",
    "d3d12_mocks.h",
    "mf_mocks.cc",
    "mf_mocks.h",
    "test_utils.h",
  ]
  deps = [
    "//base",
    "//testing/gmock",
    "//testing/gtest",
  ]
}