summaryrefslogtreecommitdiff
path: root/chromium/chromecast/media/cma/backend/mixer/BUILD.gn
blob: c3870f886287040360f0b1d8a45970440839561d (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# Copyright 2019 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/config/chromecast_build.gni")
import("//chromecast/chromecast.gni")
import("//media/media_options.gni")

declare_args() {
  mixer_output = ""
}

cast_source_set("post_processor_paths") {
  sources = [
    "post_processor_paths.cc",
    "post_processor_paths.h",
  ]
  deps = [ "//base" ]
}

cast_source_set("loopback") {
  sources = [
    "loopback_handler.cc",
    "loopback_handler.h",
    "mixer_loopback_connection.cc",
    "mixer_loopback_connection.h",
  ]

  deps = [
    "//base",
    "//chromecast/media/audio:libcast_external_audio_pipeline_1.0",
    "//chromecast/media/audio/mixer_service:common",
    "//chromecast/media/audio/mixer_service:proto",
    "//chromecast/net:io_buffer_pool",
    "//chromecast/public/media",
  ]
}

cast_source_set("mixer") {
  sources = [
    "audio_output_redirector.cc",
    "audio_output_redirector.h",
    "audio_output_redirector_input.h",
    "channel_layout.cc",
    "channel_layout.h",
    "filter_group.cc",
    "filter_group.h",
    "mixer_input.cc",
    "mixer_input.h",
    "mixer_input_connection.cc",
    "mixer_input_connection.h",
    "mixer_pipeline.cc",
    "mixer_pipeline.h",
    "mixer_service_receiver.cc",
    "mixer_service_receiver.h",
    "post_processing_pipeline.h",
    "post_processing_pipeline_impl.cc",
    "post_processing_pipeline_impl.h",
    "post_processing_pipeline_parser.cc",
    "post_processing_pipeline_parser.h",
    "post_processor_factory.cc",
    "post_processor_factory.h",
    "stream_mixer.cc",
    "stream_mixer.h",
  ]

  deps = [
    ":loopback",
    ":post_processor_paths",
    "//base",
    "//chromecast/base",
    "//chromecast/base:chromecast_switches",
    "//chromecast/base:thread_health_checker",
    "//chromecast/media/audio:audio_io_thread",
    "//chromecast/media/audio:interleaved_channel_mixer",
    "//chromecast/media/audio:libcast_external_audio_pipeline_1.0",
    "//chromecast/media/audio:processing",
    "//chromecast/media/audio/mixer_service:common",
    "//chromecast/media/audio/mixer_service:proto",
    "//chromecast/media/audio/mixer_service:redirected_audio_connection",
    "//chromecast/media/audio/mixer_service/receiver",
    "//chromecast/media/base",
    "//chromecast/media/base:slew_volume",
    "//chromecast/media/cma/backend:cast_audio_json",
    "//chromecast/media/cma/backend:volume_map",
    "//chromecast/media/cma/backend/mixer/post_processors:post_processor_wrapper",
    "//chromecast/media/cma/base",
    "//chromecast/net:io_buffer_pool",
    "//chromecast/public",
    "//chromecast/public/media",
    "//media",
    "//media:shared_memory_support",
  ]

  if (use_alsa) {
    deps += [ "//chromecast/media/cma/backend/alsa:mixer_output" ]
  } else if (is_fuchsia) {
    deps += [ "//chromecast/media/cma/backend/fuchsia:mixer_output" ]
  } else {
    # If enable_video_with_mixed_audio && !use_alsa, the platform needs to
    # provide its own mixer output.
    if (!enable_video_with_mixed_audio) {
      sources += [ "mixer_output_stream_dummy.cc" ]
    } else {
      assert("$mixer_output" != "")
      deps += [ "$mixer_output" ]
    }
  }
}

cast_source_set("loopback_test_support") {
  testonly = true
  sources = [
    "loopback_test_support.cc",
    "loopback_test_support.h",
  ]

  deps = [
    ":loopback",
    "//base",
    "//chromecast/media/audio/mixer_service:common",
    "//chromecast/net:test_support",
  ]
}

cast_source_set("unittests") {
  testonly = true
  sources = [
    "filter_group_unittest.cc",
    "mock_mixer_source.cc",
    "mock_mixer_source.h",
    "mock_post_processor_factory.cc",
    "mock_post_processor_factory.h",
    "mock_redirected_audio_output.cc",
    "mock_redirected_audio_output.h",
    "stream_mixer_external_audio_pipeline_unittest.cc",
    "stream_mixer_unittest.cc",
  ]

  deps = [
    ":loopback",
    ":loopback_test_support",
    ":mixer",
    "//base",
    "//base/test:test_support",
    "//chromecast/media/audio:fake_external_audio_pipeline",
    "//chromecast/media/audio/mixer_service:common",
    "//chromecast/media/audio/mixer_service:loopback_connection",
    "//chromecast/media/audio/mixer_service:redirected_audio_connection",
    "//chromecast/media/cma/backend/mixer/post_processors:unittests",
    "//chromecast/public",
    "//chromecast/public/media",
    "//media",
    "//media:shared_memory_support",
    "//net",
    "//testing/gmock",
    "//testing/gtest",
  ]
}