chromium/components/cast_streaming/renderer/BUILD.gn

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

visibility = [ ":*" ]

# Public target on which all external code requiring a resource_provider
# implementation should depend.
source_set("renderer") {
  visibility += [ "*" ]
  public = [ "public/resource_provider_factory.h" ]
  sources = [
    "resource_provider_impl.cc",
    "resource_provider_impl.h",
  ]
  public_deps = [ ":resource_provider" ]
  deps = [
    "//base",
    "//components/cast_streaming/common",
    "//components/cast_streaming/common:mojom",
    "//components/cast_streaming/renderer/control",
    "//components/cast_streaming/renderer/frame",
    "//media",
    "//media/mojo/common",
    "//media/mojo/mojom",
    "//mojo/public/cpp/bindings",
    "//url",
  ]
}

# Public target used by the //content code to inject the Renderer used for
# cast_streaming operations. This target is included in ALL chromium builds
# that use the Chromium media pipeline, so be careful when adding new
# dependencies here.
source_set("resource_provider") {
  visibility += [
    "//components/cast_streaming/renderer/*",
    "//content/renderer:renderer",
  ]
  public = [
    "public/resource_provider.h",
    "public/wrapping_renderer_factory_selector.h",
  ]
  sources = [
    "resource_provider.cc",
    "wrapping_renderer_factory_selector.cc",
  ]
  public_deps = [
    "//base",
    "//components/cast_streaming/common:mojom",
    "//media/mojo/mojom",
    "//mojo/public/cpp/bindings",
  ]
  deps = [
    "//components/cast_streaming/renderer/control:renderer",
    "//media",
  ]
}

# This file is to be used with the WebCodecs-based receiver. An instance of this
# type will be directly handled by blink.
source_set("decoder_buffer_provider") {
  visibility += [ "*" ]
  public = [ "public/decoder_buffer_provider.h" ]
  public_deps = [ "//base" ]
}

source_set("unit_tests") {
  testonly = true
  visibility += [ "//components/cast_streaming:unit_tests" ]
  sources = []
  deps = [
    "//components/cast_streaming/renderer/common:unit_tests",
    "//components/cast_streaming/renderer/control:unit_tests",
    "//components/cast_streaming/renderer/web_codecs:unit_tests",
  ]

  # The following are not used by the tests, but have been explicitly added
  # as deps to ensure changes outside of this component do not remove their CQ
  # coverage.
  # TODO(crbug.com/1357085): Add tests or handle this in a more appropriate way.
  deps += [
    ":decoder_buffer_provider",
    ":renderer",
    ":resource_provider",
  ]
}