commit | cc9836b0295bbe5d63723cb45eddffbf01d532f4 | [log] [tgz] |
---|---|---|
author | Pavlin Radoslavov <pavlin@google.com> | Mon Mar 26 23:30:46 2018 -0700 |
committer | Pavlin Radoslavov <pavlin@google.com> | Tue Mar 27 16:31:11 2018 -0700 |
tree | d946b79a2c3d6fae06a90d799ba846c1fecd0528 | |
parent | 44c165bde4b036201b0cd97c9b8cf331f2ea1cf8 [diff] |
A2DP Sink: add a mechanism for selecting the codec Use the existing mechanism for selecting the A2DP Source codec to select the A2DP Sink codec when the local device is A2DP Sink. * Added new method BtaAvCo::SelectSinkCodec() similar to SelectSourceCodec() and use the new method to select the actual codec based on the AVDTP Codec capability discovery. * Renamed method BtaAvCo::UpdateSelectableCodec() to UpdateSelectableSourceCodec() and added similar UpdateSelectableSinkCodec() * Renamed method BtaAvCo::AttemptCodecSelection() to AttemptSourceCodecSelection() and added similar AttemptSinkCodecSelection * Renamed AudioSinkHasContentProtection() to AudioSepHasContentProtection() because it can be used for either A2DP Source or Sink * Removed method BtaAvCo::FindPeerSourceSepForCurrentCodec() because it is not needed anymore. * Added new method A2dpCodecs::findSinkCodecConfig() similar to findSourceCodecConfig() * Added new function A2DP_SinkCodecIndex() similar to A2DP_SourceCodecIndex() * Added new method A2dpCodecs::setSinkCodecConfig() * Reorganize the SBC and AAC Source/Sink codec config classes: - Virtual method A2dpCodecConfig::setCodecConfig() is now implemented for Sink codecs as well: SBC Sink, AAC Sink - Renamed A2dpCodecConfigSbc to A2dpCodecConfigSbcSource - Renamed A2dpCodecConfigAac to A2dpCodecConfigAacSource - Added base class A2dpCodecConfigSbcBase. That class implements method setCodecConfig() for both A2dpCodecConfigSbcSource and A2dpCodecConfigSbcSink - Added base class A2dpCodecConfigAacBase. That class implements method setCodecConfig() for both A2dpCodecConfigAacSource and A2dpCodecConfigAacSink - Updated the A2dpCodecConfigAacBase::setCodecConfig() so it computes correctly the AAC Variable Bit Rate Support flag in the result codec config: The Variable Bit Rate Support is disabled if either side disables it. * Removed A2DP_BuildSrc2SinkConfig() because it is not needed anymore. The correspinding A2DP_BuildSrc2SinkConfigSbc() and A2DP_BuildSrc2SinkConfigAac() are removed as well. * Renamed a2dp_sbc_caps inside a2dp_sbc.cc to a2dp_sbc_source_caps * Renamed a2dp_aac_caps inside a2dp_aac.cc to a2dp_aac_source_caps * Added corresponding unit tests Bug: 74521894 Test: Manual: initiate connection from A2DP Sink. Unit tests in system/bt: test/run_unit_tests.sh net_test_stack Change-Id: I3fc541a068993c123e8d61c209896bb758fd3764 (cherry picked from commit f8dd02a26b01cdccf5424ff340dc954dd10ee671)
Just build AOSP - Fluoride is there by default.
Instructions for Ubuntu, tested on 14.04 with Clang 3.5.0 and 16.10 with Clang 3.8.0
mkdir ~/fluoride cd ~/fluoride git clone https://android.googlesource.com/platform/system/bt
Install dependencies (require sudo access):
cd ~/fluoride/bt build/install_deps.sh
Then fetch third party dependencies:
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
And third party dependencies of third party dependencies:
cd fluoride/bt/third_party/libchrome/base/third_party mkdir valgrind cd valgrind curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/valgrind.h?format=TEXT | base64 -d > valgrind.h curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/memcheck.h?format=TEXT | base64 -d > memcheck.h
NOTE: If system/bt is checked out under AOSP, then create symbolic links instead 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 ../../../external/googletest googletest
cd ~/fluoride/bt gn gen out/Default
cd ~/fluoride/bt ninja -C out/Default all
This will build all targets (the shared library, executables, tests, etc) and put them in out/Default. To build an individual target, replace “all” with the target of your choice, e.g. ninja -C out/Default net_test_osi
.
cd ~/fluoride/bt/out/Default LD_LIBRARY_PATH=./ ./bluetoothtbd -create-ipc-socket=fluoride
Follows the Chromium project Eclipse Setup Instructions until “Optional: Building inside Eclipse” section (don't do that section, we will set it up differently)
Generate Eclipse settings:
cd system/bt gn gen --ide=eclipse out/Default
In Eclipse, do File->Import->C/C++->C/C++ Project Settings, choose the XML location under system/bt/out/Default
Right click on the project. Go to Preferences->C/C++ Build->Builder Settings. Uncheck “Use default build command”, but instead using “ninja -C out/Default”
Goto Behaviour tab, change clean command to “-t clean”