History log of /system/bt/bta/av/bta_av_api.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9e030fde05352ec4385d7baf6cc2af89e95e039c 25-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Rename bt_bdaddr_t into RawAddress (3/3)

Test: compilation test
Change-Id: I4571721a0c6165a66450ee157a53d8d15bfc45d0
/system/bt/bta/av/bta_av_api.cc
903c16685e62e7721d44460b9171e020f38609f5 14-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Use bt_bdaddr_t instead of BD_ADDR in AVDT related code

Test: compilation test
Change-Id: Ibdfd79972d2270303cf1d2e0da26b23d8d5d62d5
/system/bt/bta/av/bta_av_api.cc
5ce0116fbf5b530d5b93f11312096eade1021c1e 05-Dec-2016 Pavlin Radoslavov <pavlin@google.com> Add a mechanism for configuring the A2DP Source codecs

* Codec config internal abstraction:
- Add new classes A2dpCodecConfig and A2dpCodecs that (will)
encapsulate all codec-related APIs
- Add unit tests for the above two classes
- Add method A2dpCodecConfig.buildCodecConfig(), and use it when
creating the codec configuration instead of A2DP_InitSource2SinkCodec().
The new method can build the codec config by taking into account
optional user codec-related configuration preferences.
- Use the A2DP codec config API from the hardware/libhardware bt_av.h API
- Replace enum tA2DP_CODEC_SEP_INDEX with btav_a2dp_codec_index_t
from the bt_av.h API
- Move codec-specific functions from stack/include/a2dp_api.h
and stack/a2dp/a2dp_api.cc to stack/include/a2dp_codec_api.h
and stack/a2dp/a2dp_codec_config.cc
- Create a new base class A2dpCodecConfig() to hold some of the
codec-related state, and implement the corresponding A2dpCodecConfigSbc
and A2dpCodecConfigSbcSink derived classes.
- Move A2DP spec-related constants from stack/include/a2dp_api.h
to stack/include/a2dp_constants.h
- Move A2DP-related error codes from stack/include/a2dp_api.h
to stack/include/a2dp_error_codes.h
- Move A2DP SBC spec-related constants from stack/include/a2dp_sbc.h to
stack/include/a2dp_sbc_constants.h

* Implement the backend mechanism for handling user (re)configuration of
A2DP Source codecs as requested via the JNI API calls.
Also, any codec changes are reported back via JNI API callbacks.
The current audio parameter selection (sample rate, bits per
sample, channel mode - mono/stereo) is as follows:
- If the user selected parameters are acceptable (based on
local codec capability and the remote Sink capability),
those parameters are used.
- Else if the Audio HAL's requested parameters are acceptable,
those are used.
- Else if the default settings are acceptable, those are used.
- Else use the best match among the local and the remote device's
capabilities.

* Update the mechanism for handling OTA configuration requests from the
remote Sink device.
- The OTA prefered codec configuration is ignored if the current
codec configuration contains explicit user configuration, or if the
codec configuration for the same codec contains explicit user
configuration.

* Refactor the Audio HAL <-> Bluetooth audio parameter negotiation
mechanism:
The new mechanism gives some flexibility to the Media Framework to
choose the appropriate audio format (sample rate, bits per sample,
and channel mode - mono/stereo), and at the same time allows
the Bluetooth stack to double-check / overwrite the choice.
- out_get_parameters() on the Audio HAL side asks the Bluetooth stack
for all currently supported formats (for the current codec),
and returns them to the Media Framework: sample rate, bits per sample,
and channel mode (mono/stereo).
- The first time adev_open_output_stream() is called on the Audio HAL,
it asks the Bluetooth stack about the audio format currently selected
by the Bluetooth stack (based on codec negotiation with the Sink device,
and User Configuration).
- The second time adev_open_output_stream() is called on the Audio HAL,
its "config" will eventually contain the audio format selected
internally by the Media Framework. That audio format is sent to the
Bluetooth stack.
If that format is acceptable to the Bluetooth stack, the Bluetooth
stack will reconfigure itself internally, and will respond back with
those values. Otherwise, it will respond back with the values that
should be used instead.

* Misc other fixes and refactoring:
- Fix the BTA handling of A2DP codec reconfiguration
- Fix a bug in the implementation of A2DP_BitsSet(), and add the
approriate unit test. Also, fix the code that was using this function
incorrectly.
- The SBC encoder is compiled as a separate library
- Replace leftover usage of "false" with "FALSE" for macros, and
vice-versa for variable values.

Test: A2DP streaming to headsets, TestPlans/71390
Bug: 30958229
Change-Id: I440b6126e2250e33b0075f9789dd93154c007c2b
/system/bt/bta/av/bta_av_api.cc
f2af1c42ccb2f642b241c2261b42d0be61d45438 13-Dec-2016 Jack He <siyuanh@google.com> Replace assert with CHECK from base/logging.h

* Replace assert with CHECK
* Remove all NDEBUG definitions
* Remove hacks for BT_LIBCHROME_NDEBUG
* Removed some removed directories from Makefile such as hcis, brcm, rpc

Coccinelle-assisted:

@@
@@

- #include "base/logging.h"
+ #include <base/logging.h>

@ assert_included @
@@

@ base_logging_included @
@@

@ depends on (assert_included && !(base_logging_included)) @
@@

- #include <assert.h>
+ #include <base/logging.h>

@ depends on (assert_included && base_logging_included) @
@@

- #include <assert.h>

@@
expression E;
@@

- assert(E);
+ CHECK(E);

And a bash script:

for file in $(find . -name "*.cc"); do
spatch --sp-file replace_assert_with_CHECK.cocci --in-place $file
done

The following files are maually edited:
btif/src/btif_config.cc
btif/src/btif_avrcp_audio_track.cc
btif/src/btif_gatt_client.cc
osi/src/data_dispatcher.cc
osi/src/reactor.cc
osi/src/thread.cc
osi/src/fixed_queue.cc
osi/src/list.cc
osi/src/allocation_tracker.cc
osi/src/alarm.cc
osi/test/wakelock_test.cc

Bug: 31781465
Test: Code compilation, Unit Tests, BtStressTest, BtFunhausMetricsTest
Change-Id: I21dc10a45be31665e41441b75b0515ed87523988
/system/bt/bta/av/bta_av_api.cc
1baaae3f34a667058e7f0c5f778357d98320cf38 09-Nov-2016 Myles Watson <mylesgw@google.com> bta: Fix comment formatting after clang-format

Test: mma -j32
Change-Id: Ic945ac421b1918527105c59674eda89afd3d4126
/system/bt/bta/av/bta_av_api.cc
cd1fd07f1306e08fe048682dd5918987e579f937 09-Nov-2016 Myles Watson <mylesgw@google.com> bta: Apply clang-format

clang-format -i --style=file bta/*/*

(twice)

Test: mma -j32
Change-Id: Ib118b1dfb6a34f9a5bfe153d65841e9041165264
/system/bt/bta/av/bta_av_api.cc
8af480e24549ba51a3f6858d9d9af504715e0bea 09-Nov-2016 Myles Watson <mylesgw@google.com> bta: Remove double asterisks in comments

Double asterisks at the beginning of the line
sed -i s,"^[*][*]"," *", bta/*/*

Double asterisks after a space
sed -i s,"^ [*][*]\([^*]\)"," *\1", bta/*/*
sed -i s,"^ [*][*]$"," *", bta/*/*

Test: mma -j32
Change-Id: Ib83b802c7000176683b4e7f24d1255b3c2c6c01c
/system/bt/bta/av/bta_av_api.cc
cc26bfcba0d5cc2473b34dc1b51913995e2db67e 14-Oct-2016 Pavlin Radoslavov <pavlin@google.com> Renamed files: *.c to *.cc in bta/av and stack/a2dp

Also, fixed C++ related compilation errors.

Test: code compilation from top-level directory
Change-Id: I60367ee7bc54b891cb05bb3f88dd11ebe5b2ca83
/system/bt/bta/av/bta_av_api.cc