blob: 04a5238f848395ac97fd7336413ce5a67edb5466 [file] [log] [blame]
kwiberg087bd342017-02-10 08:15:44 -08001# 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
9import("../../webrtc.gni")
10if (is_android) {
11 import("//build/config/android/config.gni")
12 import("//build/config/android/rules.gni")
13}
14
15rtc_source_set("audio_codecs_api") {
16 sources = [
17 "audio_decoder.cc",
18 "audio_decoder.h",
19 "audio_decoder_factory.h",
kwiberg0eacd882017-06-17 15:45:28 -070020 "audio_decoder_factory_template.h",
ossueb1fde42017-05-02 06:46:30 -070021 "audio_encoder.cc",
22 "audio_encoder.h",
23 "audio_encoder_factory.h",
kwiberg65315832017-06-16 10:42:05 -070024 "audio_encoder_factory_template.h",
kwiberg087bd342017-02-10 08:15:44 -080025 "audio_format.cc",
26 "audio_format.h",
27 ]
28 deps = [
kwiberg529662a2017-09-04 05:43:17 -070029 "..:array_view",
kwiberg84f6a3f2017-09-05 08:43:13 -070030 "..:optional",
kwiberg087bd342017-02-10 08:15:44 -080031 "../..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -070032 "../../rtc_base:rtc_base_approved",
kwiberg087bd342017-02-10 08:15:44 -080033 ]
34}
35
36rtc_static_library("builtin_audio_decoder_factory") {
37 sources = [
38 "builtin_audio_decoder_factory.cc",
39 "builtin_audio_decoder_factory.h",
40 ]
41 deps = [
42 ":audio_codecs_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -070043 "../../rtc_base:rtc_base_approved",
kwiberge5eb7242017-08-25 03:10:50 -070044 "L16:audio_decoder_L16",
45 "g711:audio_decoder_g711",
kwiberg087bd342017-02-10 08:15:44 -080046 ]
kwiberge5eb7242017-08-25 03:10:50 -070047 defines = []
48 if (rtc_include_ilbc) {
49 deps += [ "ilbc:audio_decoder_ilbc" ]
50 defines += [ "WEBRTC_USE_BUILTIN_ILBC=1" ]
51 } else {
52 defines += [ "WEBRTC_USE_BUILTIN_ILBC=0" ]
53 }
54 if (rtc_include_opus) {
55 deps += [ "opus:audio_decoder_opus" ]
56 defines += [ "WEBRTC_USE_BUILTIN_OPUS=1" ]
57 } else {
58 defines += [ "WEBRTC_USE_BUILTIN_OPUS=0" ]
59 }
60 if (build_with_mozilla) {
61 defines += [
62 "WEBRTC_USE_BUILTIN_G722=0",
63 "WEBRTC_USE_BUILTIN_ISAC_FIX=0",
64 "WEBRTC_USE_BUILTIN_ISAC_FLOAT=0",
65 ]
66 } else {
67 if (current_cpu == "arm") {
68 deps += [ "isac:audio_decoder_isac_fix" ]
69 defines += [
70 "WEBRTC_USE_BUILTIN_ISAC_FIX=1",
71 "WEBRTC_USE_BUILTIN_ISAC_FLOAT=0",
72 ]
73 } else {
74 deps += [ "isac:audio_decoder_isac_float" ]
75 defines += [
76 "WEBRTC_USE_BUILTIN_ISAC_FIX=0",
77 "WEBRTC_USE_BUILTIN_ISAC_FLOAT=1",
78 ]
79 }
80 deps += [ "g722:audio_decoder_g722" ]
81 defines += [ "WEBRTC_USE_BUILTIN_G722=1" ]
82 }
kwiberg087bd342017-02-10 08:15:44 -080083}
ossueb1fde42017-05-02 06:46:30 -070084
85rtc_static_library("builtin_audio_encoder_factory") {
86 sources = [
87 "builtin_audio_encoder_factory.cc",
88 "builtin_audio_encoder_factory.h",
89 ]
90 deps = [
91 ":audio_codecs_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -070092 "../../rtc_base:rtc_base_approved",
kwiberge5eb7242017-08-25 03:10:50 -070093 "L16:audio_encoder_L16",
94 "g711:audio_encoder_g711",
ossueb1fde42017-05-02 06:46:30 -070095 ]
kwiberge5eb7242017-08-25 03:10:50 -070096 defines = []
97 if (rtc_include_ilbc) {
98 deps += [ "ilbc:audio_encoder_ilbc" ]
99 defines += [ "WEBRTC_USE_BUILTIN_ILBC=1" ]
100 } else {
101 defines += [ "WEBRTC_USE_BUILTIN_ILBC=0" ]
102 }
103 if (rtc_include_opus) {
104 deps += [ "opus:audio_encoder_opus" ]
105 defines += [ "WEBRTC_USE_BUILTIN_OPUS=1" ]
106 } else {
107 defines += [ "WEBRTC_USE_BUILTIN_OPUS=0" ]
108 }
109 if (build_with_mozilla) {
110 defines += [
111 "WEBRTC_USE_BUILTIN_G722=0",
112 "WEBRTC_USE_BUILTIN_ISAC_FIX=0",
113 "WEBRTC_USE_BUILTIN_ISAC_FLOAT=0",
114 ]
115 } else {
116 if (current_cpu == "arm") {
117 deps += [ "isac:audio_encoder_isac_fix" ]
118 defines += [
119 "WEBRTC_USE_BUILTIN_ISAC_FIX=1",
120 "WEBRTC_USE_BUILTIN_ISAC_FLOAT=0",
121 ]
122 } else {
123 deps += [ "isac:audio_encoder_isac_float" ]
124 defines += [
125 "WEBRTC_USE_BUILTIN_ISAC_FIX=0",
126 "WEBRTC_USE_BUILTIN_ISAC_FLOAT=1",
127 ]
128 }
129 deps += [ "g722:audio_encoder_g722" ]
130 defines += [ "WEBRTC_USE_BUILTIN_G722=1" ]
131 }
ossueb1fde42017-05-02 06:46:30 -0700132}