chromium/chromecast/media/audio/mixer_service/BUILD.gn

# 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/buildflag_header.gni")
import("//chromecast/chromecast.gni")
import("//third_party/protobuf/proto_library.gni")

buildflag_header("buildflags") {
  header = "buildflags.h"

  flags = [ "HAVE_FULL_MIXER=$have_full_mixer" ]
}

proto_library("proto") {
  proto_in_dir = "../../../.."
  proto_out_dir = "chromecast/media/audio/mixer_service"
  sources = [ "mixer_service_transport.proto" ]
  link_deps = [ "//chromecast/media/audio/net:proto" ]
}

cast_source_set("common") {
  sources = [
    "constants.cc",
    "constants.h",
    "loopback_interrupt_reason.h",
    "mixer_socket.cc",
    "mixer_socket.h",
  ]

  deps = [
    ":buildflags",
    "//base",
    "//chromecast/net:io_buffer_pool",
    "//net",
  ]

  public_deps = [
    ":proto",
    "//chromecast/media/audio/net:audio_socket",
  ]
}

cast_source_set("connection") {
  sources = [
    "mixer_connection.cc",
    "mixer_connection.h",
  ]

  deps = [
    ":common",
    "//base",
    "//chromecast/base",
    "//chromecast/media/audio/net:audio_socket_service",
    "//net",
  ]
}

cast_source_set("output_stream_connection") {
  sources = [
    "output_stream_connection.cc",
    "output_stream_connection.h",
  ]

  deps = [
    ":common",
    ":connection",
    ":proto",
    "//base",
    "//chromecast/media/audio/net:common",
    "//chromecast/media/audio/net:proto",
    "//chromecast/metrics:metrics_recorder",
    "//chromecast/net:io_buffer_pool",
    "//net",
  ]
}

cast_source_set("control_connection") {
  sources = [
    "control_connection.cc",
    "control_connection.h",
  ]

  deps = [
    ":common",
    ":connection",
    ":proto",
    "//base",
    "//chromecast/media/audio/net:common",
    "//chromecast/media/audio/net:proto",
    "//chromecast/public",
    "//net",
  ]
}

cast_source_set("mixer_control") {
  sources = [
    "mixer_control.cc",
    "mixer_control.h",
  ]

  deps = [
    ":common",
    ":control_connection",
    "//base",
    "//chromecast/media/audio:audio_io_thread",
  ]
}

cast_source_set("loopback_connection") {
  sources = [
    "loopback_connection.cc",
    "loopback_connection.h",
  ]

  public_deps = [ ":common" ]

  deps = [
    ":connection",
    ":proto",
    "//base",
    "//chromecast/media/audio/net:common",
    "//chromecast/media/audio/net:proto",
    "//chromecast/net:io_buffer_pool",
    "//chromecast/public/media",
    "//net",
  ]
}

cast_source_set("redirected_audio_connection") {
  sources = [
    "redirected_audio_connection.cc",
    "redirected_audio_connection.h",
  ]

  deps = [
    ":common",
    ":connection",
    ":proto",
    "//base",
    "//chromecast/media/audio/net:common",
    "//chromecast/media/audio/net:proto",
    "//chromecast/net:io_buffer_pool",
    "//chromecast/public",
    "//chromecast/public/media",
    "//net",
  ]
}

cast_source_set("test_support") {
  testonly = true

  sources = [
    "mock_mixer_socket.cc",
    "mock_mixer_socket.h",
  ]

  deps = [
    ":common",
    "//base",
    "//chromecast/net:io_buffer_pool",
    "//net",
    "//testing/gmock",
    "//testing/gtest",
  ]
}

cast_source_set("unittests") {
  testonly = true

  sources = [
    "redirected_audio_connection_unittest.cc",
  ]

  deps = [
    ":common",
    ":redirected_audio_connection",
    ":test_support",
    "//base/test:test_support",
    "//chromecast/net:test_support",
    "//net",
    "//testing/gmock",
    "//testing/gtest",
  ]
}