summaryrefslogtreecommitdiffstats
path: root/chromecast/media/cma/backend/alsa/BUILD.gn
blob: c12367d8a9be472b2ef6d5c77ce0d89a342d24d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Copyright 2015 The Chromium Authors. All rights reserved.
# 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("//media/media_options.gni")
import("//testing/test.gni")

declare_args() {
  # Set true to use raw timestamps. This should only be enabled when the ALSA
  # library supports it.
  use_alsa_monotonic_raw_tstamps = false
}

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

# GYP target: chromecast/media/media.gyp:libcast_media_1.0_audio
shared_library("libcast_media_1.0_audio") {
  sources = [
    "//chromecast/media/base/media_caps.cc",
    "//chromecast/media/base/media_caps.h",
    "cast_media_shlib.cc",
    "media_codec_support_cast_audio.cc",
  ]
  deps = [
    ":alsa_cma_backend",
    "//base",
    "//chromecast/base",
    "//chromecast/public",
    "//media",
  ]
}

# GYP target: chromecast/media/media.gyp:alsa_cma_backend
source_set("alsa_cma_backend") {
  sources = [
    "alsa_wrapper.cc",
    "alsa_wrapper.h",
    "audio_decoder_alsa.cc",
    "audio_decoder_alsa.h",
    "media_pipeline_backend_alsa.cc",
    "media_pipeline_backend_alsa.h",
    "stream_mixer_alsa.cc",
    "stream_mixer_alsa.h",
    "stream_mixer_alsa_input.cc",
    "stream_mixer_alsa_input.h",
    "stream_mixer_alsa_input_impl.cc",
    "stream_mixer_alsa_input_impl.h",
  ]

  deps = [
    ":alsa_features",
    "//base",
    "//chromecast/base",
    "//chromecast/media/cma/backend",
    "//chromecast/media/cma/base",
    "//chromecast/media/cma/decoder",
    "//chromecast/public/media",
    "//media",
    "//media:shared_memory_support",
  ]
}

# GYP target: chromecast/media/media.gyp:chromecast_alsa_features
buildflag_header("alsa_features") {
  header = "alsa_features.h"

  flags = [ "ALSA_MONOTONIC_RAW_TSTAMPS=$use_alsa_monotonic_raw_tstamps" ]
}

# GYP target: chromecast/media/media.gyp:alsa_cma_backend_unittests
test("alsa_cma_backend_unittests") {
  sources = [
    "stream_mixer_alsa_unittest.cc",
  ]

  deps = [
    ":test_support",
    "//base",
    "//base/test:run_all_unittests",
    "//chromecast/media/base",
    "//chromecast/media/base:libcast_media_1.0_default_core",
    "//media",
    "//media:shared_memory_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
}

# GYP target: n/a
source_set("test_support") {
  testonly = true

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

  public_deps = [
    ":alsa_cma_backend",
  ]

  deps = [
    "//base",
    "//media",
    "//testing/gmock",
  ]
}