kwiberg | 087bd34 | 2017-02-10 08:15:44 -0800 | [diff] [blame] | 1 | # Copyright (c) 2017 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("../../webrtc.gni") |
| 10 | if (is_android) { |
| 11 | import("//build/config/android/config.gni") |
| 12 | import("//build/config/android/rules.gni") |
| 13 | } |
| 14 | |
| 15 | rtc_source_set("audio_codecs_api") { |
| 16 | sources = [ |
| 17 | "audio_decoder.cc", |
| 18 | "audio_decoder.h", |
| 19 | "audio_decoder_factory.h", |
kwiberg | 0eacd88 | 2017-06-17 15:45:28 -0700 | [diff] [blame] | 20 | "audio_decoder_factory_template.h", |
ossu | eb1fde4 | 2017-05-02 06:46:30 -0700 | [diff] [blame] | 21 | "audio_encoder.cc", |
| 22 | "audio_encoder.h", |
| 23 | "audio_encoder_factory.h", |
kwiberg | 6531583 | 2017-06-16 10:42:05 -0700 | [diff] [blame] | 24 | "audio_encoder_factory_template.h", |
kwiberg | 087bd34 | 2017-02-10 08:15:44 -0800 | [diff] [blame] | 25 | "audio_format.cc", |
| 26 | "audio_format.h", |
| 27 | ] |
| 28 | deps = [ |
kwiberg | 529662a | 2017-09-04 05:43:17 -0700 | [diff] [blame^] | 29 | "..:array_view", |
kwiberg | 087bd34 | 2017-02-10 08:15:44 -0800 | [diff] [blame] | 30 | "../..:webrtc_common", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 31 | "../../rtc_base:rtc_base_approved", |
kwiberg | 087bd34 | 2017-02-10 08:15:44 -0800 | [diff] [blame] | 32 | ] |
| 33 | } |
| 34 | |
| 35 | rtc_static_library("builtin_audio_decoder_factory") { |
| 36 | sources = [ |
| 37 | "builtin_audio_decoder_factory.cc", |
| 38 | "builtin_audio_decoder_factory.h", |
| 39 | ] |
| 40 | deps = [ |
| 41 | ":audio_codecs_api", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 42 | "../../rtc_base:rtc_base_approved", |
kwiberg | e5eb724 | 2017-08-25 03:10:50 -0700 | [diff] [blame] | 43 | "L16:audio_decoder_L16", |
| 44 | "g711:audio_decoder_g711", |
kwiberg | 087bd34 | 2017-02-10 08:15:44 -0800 | [diff] [blame] | 45 | ] |
kwiberg | e5eb724 | 2017-08-25 03:10:50 -0700 | [diff] [blame] | 46 | defines = [] |
| 47 | if (rtc_include_ilbc) { |
| 48 | deps += [ "ilbc:audio_decoder_ilbc" ] |
| 49 | defines += [ "WEBRTC_USE_BUILTIN_ILBC=1" ] |
| 50 | } else { |
| 51 | defines += [ "WEBRTC_USE_BUILTIN_ILBC=0" ] |
| 52 | } |
| 53 | if (rtc_include_opus) { |
| 54 | deps += [ "opus:audio_decoder_opus" ] |
| 55 | defines += [ "WEBRTC_USE_BUILTIN_OPUS=1" ] |
| 56 | } else { |
| 57 | defines += [ "WEBRTC_USE_BUILTIN_OPUS=0" ] |
| 58 | } |
| 59 | if (build_with_mozilla) { |
| 60 | defines += [ |
| 61 | "WEBRTC_USE_BUILTIN_G722=0", |
| 62 | "WEBRTC_USE_BUILTIN_ISAC_FIX=0", |
| 63 | "WEBRTC_USE_BUILTIN_ISAC_FLOAT=0", |
| 64 | ] |
| 65 | } else { |
| 66 | if (current_cpu == "arm") { |
| 67 | deps += [ "isac:audio_decoder_isac_fix" ] |
| 68 | defines += [ |
| 69 | "WEBRTC_USE_BUILTIN_ISAC_FIX=1", |
| 70 | "WEBRTC_USE_BUILTIN_ISAC_FLOAT=0", |
| 71 | ] |
| 72 | } else { |
| 73 | deps += [ "isac:audio_decoder_isac_float" ] |
| 74 | defines += [ |
| 75 | "WEBRTC_USE_BUILTIN_ISAC_FIX=0", |
| 76 | "WEBRTC_USE_BUILTIN_ISAC_FLOAT=1", |
| 77 | ] |
| 78 | } |
| 79 | deps += [ "g722:audio_decoder_g722" ] |
| 80 | defines += [ "WEBRTC_USE_BUILTIN_G722=1" ] |
| 81 | } |
kwiberg | 087bd34 | 2017-02-10 08:15:44 -0800 | [diff] [blame] | 82 | } |
ossu | eb1fde4 | 2017-05-02 06:46:30 -0700 | [diff] [blame] | 83 | |
| 84 | rtc_static_library("builtin_audio_encoder_factory") { |
| 85 | sources = [ |
| 86 | "builtin_audio_encoder_factory.cc", |
| 87 | "builtin_audio_encoder_factory.h", |
| 88 | ] |
| 89 | deps = [ |
| 90 | ":audio_codecs_api", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 91 | "../../rtc_base:rtc_base_approved", |
kwiberg | e5eb724 | 2017-08-25 03:10:50 -0700 | [diff] [blame] | 92 | "L16:audio_encoder_L16", |
| 93 | "g711:audio_encoder_g711", |
ossu | eb1fde4 | 2017-05-02 06:46:30 -0700 | [diff] [blame] | 94 | ] |
kwiberg | e5eb724 | 2017-08-25 03:10:50 -0700 | [diff] [blame] | 95 | defines = [] |
| 96 | if (rtc_include_ilbc) { |
| 97 | deps += [ "ilbc:audio_encoder_ilbc" ] |
| 98 | defines += [ "WEBRTC_USE_BUILTIN_ILBC=1" ] |
| 99 | } else { |
| 100 | defines += [ "WEBRTC_USE_BUILTIN_ILBC=0" ] |
| 101 | } |
| 102 | if (rtc_include_opus) { |
| 103 | deps += [ "opus:audio_encoder_opus" ] |
| 104 | defines += [ "WEBRTC_USE_BUILTIN_OPUS=1" ] |
| 105 | } else { |
| 106 | defines += [ "WEBRTC_USE_BUILTIN_OPUS=0" ] |
| 107 | } |
| 108 | if (build_with_mozilla) { |
| 109 | defines += [ |
| 110 | "WEBRTC_USE_BUILTIN_G722=0", |
| 111 | "WEBRTC_USE_BUILTIN_ISAC_FIX=0", |
| 112 | "WEBRTC_USE_BUILTIN_ISAC_FLOAT=0", |
| 113 | ] |
| 114 | } else { |
| 115 | if (current_cpu == "arm") { |
| 116 | deps += [ "isac:audio_encoder_isac_fix" ] |
| 117 | defines += [ |
| 118 | "WEBRTC_USE_BUILTIN_ISAC_FIX=1", |
| 119 | "WEBRTC_USE_BUILTIN_ISAC_FLOAT=0", |
| 120 | ] |
| 121 | } else { |
| 122 | deps += [ "isac:audio_encoder_isac_float" ] |
| 123 | defines += [ |
| 124 | "WEBRTC_USE_BUILTIN_ISAC_FIX=0", |
| 125 | "WEBRTC_USE_BUILTIN_ISAC_FLOAT=1", |
| 126 | ] |
| 127 | } |
| 128 | deps += [ "g722:audio_encoder_g722" ] |
| 129 | defines += [ "WEBRTC_USE_BUILTIN_G722=1" ] |
| 130 | } |
ossu | eb1fde4 | 2017-05-02 06:46:30 -0700 | [diff] [blame] | 131 | } |