OSDN Git Service

Compile audio codec libraries on linux
authorJakub Pawlowski <jpawlowski@google.com>
Mon, 20 Feb 2017 19:18:51 +0000 (20:18 +0100)
committerMyles Watson <mylesgw@google.com>
Tue, 21 Feb 2017 19:12:34 +0000 (19:12 +0000)
Test: build on linux
Change-Id: I72c7621fde1f229e3dd2a8cfa0cf0339e601914c

README.md
build/secondary/third_party/aac/BUILD.gn [new file with mode: 0644]
build/secondary/third_party/libldac/BUILD.gn [new file with mode: 0644]
stack/BUILD.gn

index 4664c39..e937e81 100644 (file)
--- a/README.md
+++ b/README.md
@@ -30,7 +30,9 @@ cd ~/fluoride/bt
 mkdir third_party
 cd third_party
 git clone https://github.com/google/googletest.git
+git clone https://android.googlesource.com/platform/external/aac
 git clone https://android.googlesource.com/platform/external/libchrome
+git clone https://android.googlesource.com/platform/external/libldac
 git clone https://android.googlesource.com/platform/external/modp_b64
 git clone https://android.googlesource.com/platform/external/tinyxml2
 git clone https://android.googlesource.com/platform/hardware/libhardware
@@ -53,7 +55,9 @@ of downloading sources
 cd system/bt
 mkdir third_party
 cd third_party
+ln -s ../../../external/aac aac
 ln -s ../../../external/libchrome libchrome
+ln -s ../../../external/libldac libldac
 ln -s ../../../external/modp_b64 modp_b64
 ln -s ../../../external/tinyxml2 tinyxml2
 ln -s ../../../hardware/libhardware libhardware
diff --git a/build/secondary/third_party/aac/BUILD.gn b/build/secondary/third_party/aac/BUILD.gn
new file mode 100644 (file)
index 0000000..183e2a2
--- /dev/null
@@ -0,0 +1,182 @@
+#
+#  Copyright (C) 2017 Google, Inc.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at:
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+
+config("libFraunhoferAAC_config") {
+  include_dirs = [
+    "libAACdec/include",
+    "libAACenc/include",
+    "libPCMutils/include",
+    "libFDK/include",
+    "libSYS/include",
+    "libMpegTPDec/include",
+    "libMpegTPEnc/include",
+    "libSBRdec/include",
+    "libSBRenc/include",
+  ]
+}
+
+#TODO(jpawlowski): this files are not build right now, but might be useful when
+# arm platform linux compilation is in use:
+#    "libAACdec/src/arm/block_arm.cpp",
+#    "libFDK/src/arm/autocorr2nd.cpp",
+#    "libFDK/src/arm/dct_arm.cpp",
+#    "libFDK/src/arm/fft_rad2_arm.cpp",
+#    "libFDK/src/arm/qmf_arm.cpp",
+#    "libFDK/src/arm/scale_arm.cpp",
+#    "libSBRdec/src/arm/env_calc_arm.cpp",
+#    "libSBRdec/src/arm/lpp_tran_arm.cpp",
+#    "libSYS/src/mips/genericStds_mips.cpp",
+#    "libFDK/src/mips/fft_rad2_mips.cpp",
+#    "libFDK/src/mips/mips_fft_twiddles.cpp",
+#    "libFDK/src/mips/scale.cpp",
+
+static_library("libFraunhoferAAC") {
+  sources = [
+    "libAACdec/src/aacdec_drc.cpp",
+    "libAACdec/src/aacdec_hcr_bit.cpp",
+    "libAACdec/src/aacdec_hcr.cpp",
+    "libAACdec/src/aacdec_hcrs.cpp",
+    "libAACdec/src/aacdecoder.cpp",
+    "libAACdec/src/aacdecoder_lib.cpp",
+    "libAACdec/src/aacdec_pns.cpp",
+    "libAACdec/src/aacdec_tns.cpp",
+    "libAACdec/src/aac_ram.cpp",
+    "libAACdec/src/aac_rom.cpp",
+    "libAACdec/src/block.cpp",
+    "libAACdec/src/channel.cpp",
+    "libAACdec/src/channelinfo.cpp",
+    "libAACdec/src/conceal.cpp",
+    "libAACdec/src/ldfiltbank.cpp",
+    "libAACdec/src/pulsedata.cpp",
+    "libAACdec/src/rvlcbit.cpp",
+    "libAACdec/src/rvlcconceal.cpp",
+    "libAACdec/src/rvlc.cpp",
+    "libAACdec/src/stereo.cpp",
+    "libAACenc/src/aacenc.cpp",
+    "libAACenc/src/aacenc_lib.cpp",
+    "libAACenc/src/aacenc_pns.cpp",
+    "libAACenc/src/aacEnc_ram.cpp",
+    "libAACenc/src/aacEnc_rom.cpp",
+    "libAACenc/src/aacenc_tns.cpp",
+    "libAACenc/src/adj_thr.cpp",
+    "libAACenc/src/band_nrg.cpp",
+    "libAACenc/src/bandwidth.cpp",
+    "libAACenc/src/bit_cnt.cpp",
+    "libAACenc/src/bitenc.cpp",
+    "libAACenc/src/block_switch.cpp",
+    "libAACenc/src/channel_map.cpp",
+    "libAACenc/src/chaosmeasure.cpp",
+    "libAACenc/src/dyn_bits.cpp",
+    "libAACenc/src/grp_data.cpp",
+    "libAACenc/src/intensity.cpp",
+    "libAACenc/src/line_pe.cpp",
+    "libAACenc/src/metadata_compressor.cpp",
+    "libAACenc/src/metadata_main.cpp",
+    "libAACenc/src/ms_stereo.cpp",
+    "libAACenc/src/noisedet.cpp",
+    "libAACenc/src/pnsparam.cpp",
+    "libAACenc/src/pre_echo_control.cpp",
+    "libAACenc/src/psy_configuration.cpp",
+    "libAACenc/src/psy_main.cpp",
+    "libAACenc/src/qc_main.cpp",
+    "libAACenc/src/quantize.cpp",
+    "libAACenc/src/sf_estim.cpp",
+    "libAACenc/src/spreading.cpp",
+    "libAACenc/src/tonality.cpp",
+    "libAACenc/src/transform.cpp",
+    "libFDK/src/autocorr2nd.cpp",
+    "libFDK/src/dct.cpp",
+    "libFDK/src/FDK_bitbuffer.cpp",
+    "libFDK/src/FDK_core.cpp",
+    "libFDK/src/FDK_crc.cpp",
+    "libFDK/src/FDK_hybrid.cpp",
+    "libFDK/src/FDK_tools_rom.cpp",
+    "libFDK/src/FDK_trigFcts.cpp",
+    "libFDK/src/fft.cpp",
+    "libFDK/src/fft_rad2.cpp",
+    "libFDK/src/fixpoint_math.cpp",
+    "libFDK/src/mdct.cpp",
+    "libFDK/src/qmf.cpp",
+    "libFDK/src/scale.cpp",
+    "libMpegTPDec/src/tpdec_adif.cpp",
+    "libMpegTPDec/src/tpdec_adts.cpp",
+    "libMpegTPDec/src/tpdec_asc.cpp",
+    "libMpegTPDec/src/tpdec_drm.cpp",
+    "libMpegTPDec/src/tpdec_latm.cpp",
+    "libMpegTPDec/src/tpdec_lib.cpp",
+    "libMpegTPEnc/src/tpenc_adif.cpp",
+    "libMpegTPEnc/src/tpenc_adts.cpp",
+    "libMpegTPEnc/src/tpenc_asc.cpp",
+    "libMpegTPEnc/src/tpenc_latm.cpp",
+    "libMpegTPEnc/src/tpenc_lib.cpp",
+    "libPCMutils/src/limiter.cpp",
+    "libPCMutils/src/pcmutils_lib.cpp",
+    "libSBRdec/src/env_calc.cpp",
+    "libSBRdec/src/env_dec.cpp",
+    "libSBRdec/src/env_extr.cpp",
+    "libSBRdec/src/huff_dec.cpp",
+    "libSBRdec/src/lpp_tran.cpp",
+    "libSBRdec/src/psbitdec.cpp",
+    "libSBRdec/src/psdec.cpp",
+    "libSBRdec/src/psdec_hybrid.cpp",
+    "libSBRdec/src/sbr_crc.cpp",
+    "libSBRdec/src/sbr_deb.cpp",
+    "libSBRdec/src/sbr_dec.cpp",
+    "libSBRdec/src/sbrdec_drc.cpp",
+    "libSBRdec/src/sbrdec_freq_sca.cpp",
+    "libSBRdec/src/sbrdecoder.cpp",
+    "libSBRdec/src/sbr_ram.cpp",
+    "libSBRdec/src/sbr_rom.cpp",
+    "libSBRenc/src/bit_sbr.cpp",
+    "libSBRenc/src/code_env.cpp",
+    "libSBRenc/src/env_bit.cpp",
+    "libSBRenc/src/env_est.cpp",
+    "libSBRenc/src/fram_gen.cpp",
+    "libSBRenc/src/invf_est.cpp",
+    "libSBRenc/src/mh_det.cpp",
+    "libSBRenc/src/nf_est.cpp",
+    "libSBRenc/src/ps_bitenc.cpp",
+    "libSBRenc/src/ps_encode.cpp",
+    "libSBRenc/src/ps_main.cpp",
+    "libSBRenc/src/resampler.cpp",
+    "libSBRenc/src/sbrenc_freq_sca.cpp",
+    "libSBRenc/src/sbr_encoder.cpp",
+    "libSBRenc/src/sbr_misc.cpp",
+    "libSBRenc/src/sbr_ram.cpp",
+    "libSBRenc/src/sbr_rom.cpp",
+    "libSBRenc/src/ton_corr.cpp",
+    "libSBRenc/src/tran_det.cpp",
+    "libSYS/src/cmdl_parser.cpp",
+    "libSYS/src/conv_string.cpp",
+    "libSYS/src/genericStds.cpp",
+    "libSYS/src/linux/audio_linux.cpp",
+    "libSYS/src/linux/coresup_linux.cpp",
+    "libSYS/src/linux/FDK_stackload_linux.cpp",
+    "libSYS/src/linux/genericStds_linux.cpp",
+    "libSYS/src/linux/uart_linux.cpp",
+    "libSYS/src/wav_file.cpp",
+  ]
+
+  public_configs = [ ":libFraunhoferAAC_config" ]
+
+  cflags = [
+        "-Wno-sequence-point",
+        "-Wno-extra",
+        "-Wno-#warnings",
+        "-Wno-constant-logical-operand",
+        "-Wno-self-assign",
+  ]
+}
diff --git a/build/secondary/third_party/libldac/BUILD.gn b/build/secondary/third_party/libldac/BUILD.gn
new file mode 100644 (file)
index 0000000..8e197d7
--- /dev/null
@@ -0,0 +1,30 @@
+#
+#  Copyright (C) 2017 Google, Inc.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at:
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+
+config("libldacBT_config") {
+  include_dirs = [ "inc" ]
+}
+
+shared_library("libldacBT_enc") {
+  sources = [
+    "src/ldaclib.c",
+    "src/ldacBT.c",
+  ]
+
+  public_configs = [ ":libldacBT_config" ]
+
+  cflags = [ "-O2" ]
+}
index 371f016..2e4bb18 100644 (file)
@@ -16,6 +16,8 @@
 
 static_library("stack") {
   sources = [
+    "a2dp/a2dp_aac.cc",
+    "a2dp/a2dp_aac_encoder.cc",
     "a2dp/a2dp_api.cc",
     "a2dp/a2dp_codec_config.cc",
     "a2dp/a2dp_sbc.cc",
@@ -177,7 +179,9 @@ static_library("stack") {
   ]
 
   deps = [
-    "//third_party/libchrome:base"
+    "//third_party/libchrome:base",
+    "//third_party/libldac:libldacBT_enc",
+    "//third_party/aac:libFraunhoferAAC",
   ]
 }