chromium/chromecast/media/cma/backend/alsa/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.

import("//build/config/cast.gni")
import("//chromecast/chromecast.gni")
import("//media/media_options.gni")
import("//testing/test.gni")

# Alsa must be used for these targets to build.
assert(use_alsa)

cast_source_set("libcast_media_1.0_audio") {
  sources = [ "cast_media_shlib.cc" ]

  deps = [
    ":volume_control",
    "//base",
    "//chromecast/base",
    "//chromecast/media/cma/backend:audio_codec_support",
    "//chromecast/media/cma/backend:av_sync_dummy",
    "//chromecast/media/cma/backend:for_mixer_audio",
    "//chromecast/media/cma/backend:null_video",
    "//chromecast/public",
    "//chromecast/public/media",
    "//media",
  ]
}

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

  libs = [ "asound" ]

  deps = [
    "//base",
    "//chromecast/media/cma/backend:audio_buildflags",
    "//media",
  ]
}

cast_source_set("volume_control") {
  sources = [
    "alsa_volume_control.cc",
    "alsa_volume_control.h",
    "scoped_alsa_mixer.cc",
    "scoped_alsa_mixer.h",
  ]

  libs = [ "asound" ]

  deps = [
    "//base",
    "//chromecast/base:chromecast_switches",
    "//chromecast/base/metrics",
    "//chromecast/media/cma/backend:public",
    "//media",
  ]
}

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

  libs = [ "asound" ]

  deps = [
    ":alsa_wrapper",
    "//base",
    "//chromecast/base:chromecast_switches",
    "//chromecast/public/media",
    "//media",
  ]
}

cast_source_set("unittests") {
  testonly = true
  sources = [
    "alsa_volume_control_unittest.cc",
    "scoped_alsa_mixer_unittest.cc",
  ]

  deps = [
    ":volume_control",
    "//base",
    "//base/test:test_support",
    "//chromecast/media/cma/backend:public",
    "//media:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
}