Home | History | Annotate | Download | only in audio_device
      1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
      2 #
      3 # Use of this source code is governed by a BSD-style license
      4 # that can be found in the LICENSE file in the root of the source
      5 # tree. An additional intellectual property rights grant can be found
      6 # in the file PATENTS.  All contributing project authors may
      7 # be found in the AUTHORS file in the root of the source tree.
      8 
      9 import("../../build/webrtc.gni")
     10 
     11 config("audio_device_config") {
     12   include_dirs = [
     13     "../interface",
     14     "include",
     15     "dummy",  # Contains dummy audio device implementations.
     16   ]
     17 }
     18 
     19 source_set("audio_device") {
     20   sources = [
     21     "include/audio_device.h",
     22     "include/audio_device_defines.h",
     23     "audio_device_buffer.cc",
     24     "audio_device_buffer.h",
     25     "audio_device_generic.cc",
     26     "audio_device_generic.h",
     27     "audio_device_utility.cc",
     28     "audio_device_utility.h",
     29     "audio_device_impl.cc",
     30     "audio_device_impl.h",
     31     "audio_device_config.h",
     32     "dummy/audio_device_dummy.cc",
     33     "dummy/audio_device_dummy.h",
     34     "dummy/audio_device_utility_dummy.cc",
     35     "dummy/audio_device_utility_dummy.h",
     36     "dummy/file_audio_device.cc",
     37     "dummy/file_audio_device.h",
     38   ]
     39 
     40   direct_dependent_configs = [ ":audio_device_config"]
     41 
     42   include_dirs = []
     43   if (is_linux) {
     44     include_dirs += [ "linux" ]
     45   }
     46   if (is_ios) {
     47     include_dirs += [ "ios" ]
     48   }
     49   if (is_mac) {
     50     include_dirs += [ "mac" ]
     51   }
     52   if (is_win) {
     53     include_dirs += [ "win" ]
     54   }
     55   if (is_android) {
     56     include_dirs += [ "android" ]
     57   }
     58   if (rtc_include_internal_audio_device) {
     59     sources += [
     60       "linux/alsasymboltable_linux.cc",
     61       "linux/alsasymboltable_linux.h",
     62       "linux/audio_device_alsa_linux.cc",
     63       "linux/audio_device_alsa_linux.h",
     64       "linux/audio_device_utility_linux.cc",
     65       "linux/audio_device_utility_linux.h",
     66       "linux/audio_mixer_manager_alsa_linux.cc",
     67       "linux/audio_mixer_manager_alsa_linux.h",
     68       "linux/latebindingsymboltable_linux.cc",
     69       "linux/latebindingsymboltable_linux.h",
     70       "ios/audio_device_ios.mm",
     71       "ios/audio_device_ios.h",
     72       "ios/audio_device_utility_ios.cc",
     73       "ios/audio_device_utility_ios.h",
     74       "mac/audio_device_mac.cc",
     75       "mac/audio_device_mac.h",
     76       "mac/audio_device_utility_mac.cc",
     77       "mac/audio_device_utility_mac.h",
     78       "mac/audio_mixer_manager_mac.cc",
     79       "mac/audio_mixer_manager_mac.h",
     80       "mac/portaudio/pa_memorybarrier.h",
     81       "mac/portaudio/pa_ringbuffer.c",
     82       "mac/portaudio/pa_ringbuffer.h",
     83       "win/audio_device_core_win.cc",
     84       "win/audio_device_core_win.h",
     85       "win/audio_device_wave_win.cc",
     86       "win/audio_device_wave_win.h",
     87       "win/audio_device_utility_win.cc",
     88       "win/audio_device_utility_win.h",
     89       "win/audio_mixer_manager_win.cc",
     90       "win/audio_mixer_manager_win.h",
     91       "android/audio_device_template.h",
     92       "android/audio_device_utility_android.cc",
     93       "android/audio_device_utility_android.h",
     94       "android/audio_manager_jni.cc",
     95       "android/audio_manager_jni.h",
     96       "android/audio_record_jni.cc",
     97       "android/audio_record_jni.h",
     98       "android/audio_track_jni.cc",
     99       "android/audio_track_jni.h",
    100       "android/fine_audio_buffer.cc",
    101       "android/fine_audio_buffer.h",
    102       "android/low_latency_event_posix.cc",
    103       "android/low_latency_event.h",
    104       "android/opensles_common.cc",
    105       "android/opensles_common.h",
    106       "android/opensles_input.cc",
    107       "android/opensles_input.h",
    108       "android/opensles_output.cc",
    109       "android/opensles_output.h",
    110       "android/single_rw_fifo.cc",
    111       "android/single_rw_fifo.h",
    112     ]
    113     if (is_linux) {
    114       defines += [ "LINUX_ALSA" ]
    115 
    116       libs = [
    117         "dl",
    118         "X11",
    119       ]
    120 
    121       if (rtc_include_pulse_audio) {
    122         sources += [
    123           "linux/audio_device_pulse_linux.cc",
    124           "linux/audio_device_pulse_linux.h",
    125           "linux/audio_mixer_manager_pulse_linux.cc",
    126           "linux/audio_mixer_manager_pulse_linux.h",
    127           "linux/pulseaudiosymboltable_linux.cc",
    128           "linux/pulseaudiosymboltable_linux.h",
    129         ]
    130 
    131         defines += [ "LINUX_PULSE" ]
    132       }
    133     }
    134     if (is_mac) {
    135       libs = [
    136         "AudioToolbox.framework",
    137         "CoreAudio.framework",
    138       ]
    139     }
    140     if (is_ios) {
    141       cflags += [ "-fobjc-arc" ]  # CLANG_ENABLE_OBJC_ARC = YES.
    142 
    143       libs = [
    144         "AudioToolbox.framework",
    145         "AVFoundation.framework",
    146       ]
    147     }
    148     if (is_win) {
    149       libs = [
    150         # Required for the built-in WASAPI AEC.
    151         "dmoguids.lib",
    152         "wmcodecdspuuid.lib",
    153         "amstrmid.lib",
    154         "msdmo.lib",
    155       ]
    156     }
    157   } else {
    158     defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ]
    159   }
    160 
    161   if (!build_with_chromium) {
    162     sources += [
    163       # Do not link these into Chrome since they contain static data.
    164       "dummy/file_audio_device_factory.cc",
    165       "dummy/file_audio_device_factory.h",
    166     ]
    167   }
    168 
    169   if (is_clang) {
    170     # Suppress warnings from Chrome's Clang plugins.
    171     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
    172     configs -= [ "//build/config/clang:find_bad_constructs" ]
    173   }
    174 
    175   deps = [
    176     "../../common_audio",
    177     "../../system_wrappers",
    178     "../utility",
    179   ]
    180 }
    181 
    182 
    183