History log of /system/bt/bta/include/bta_av_co.h
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/include/bta_av_co.h
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/include/bta_av_co.h
31d373be957f094092b9dc94f0b41de23f69fd2a 14-Feb-2017 Pavlin Radoslavov <pavlin@google.com> Update the A2DP MTU if the L2CAP MTU changes during codec reconfiguration

Previously, the MTU was saved inside the AVDTP module after the first
codec setup. However, the MTU wasn't updated after codec reconfiguration.
As a result, if a Sink device uses different (smaller) MTU for
a codec like SBC, then switching fron another codec to SBC will
result in generating SBC frames that are too large to transmit,
and there will be no audio.

Bug: b/35351216
Test: A2DP streaming and codec switch to various Sink devices.
Change-Id: Ieb3caf4ef7a30a7af31ceb2f6132807739829441
/system/bt/bta/include/bta_av_co.h
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/include/bta_av_co.h
ad1e23d50e431fb82ff1b8d3ce02f64ca0c5a940 10-Dec-2016 Jack He <siyuanh@google.com> Remove extern "C" from header files

Since change 290046, most files in system/bt is compiled as C++ source.
Therefore, there is no longer a need for the extern "C" wrapper around
includes that export symbols from those sources.

The following python script is applied to each file in the directory:

front = '#ifdef\s+__cplusplus\s+extern\s+"C"\s+{\s+#endif\s+'
back = '#ifdef\s+__cplusplus\s+}\s+#endif'
with open(sys.argv[1], "r") as f:
data = f.read()
data = re.sub(front, "", data)
data = re.sub(back, "", data)
print data

through a shell script:

for file in $(find . -name "*.h"); do
python remove_cpp_extern_c.py $file > tmp
cat tmp > $file
rm tmp
done

with following files not edited:
* stack/include/a2dp_*
* include/bt_trace.h
* embdrv/sbc/*

Bug: 33492510
Test: Code compilation, BtFunhausMetricsTest, BtStressTest
Change-Id: Iac21cdfb1924b50478dd0b82326e092602cbc9d4
/system/bt/bta/include/bta_av_co.h
cd02ce9c60da962a7981320b26aada8744718941 05-Nov-2016 Pavlin Radoslavov <pavlin@google.com> A2DP Codec related cleanup

* Add new A2DP API and the corresponding unit tests:
- A2DP_InitSource2SinkCodec()
- A2DP_SourceCodecSepIndex()
- A2DP_GetTrackBitsPerSample()
* Use the new API to simplify the codec selection and setup
* Rename A2DP_BldSbcMplHdr() to A2DP_BuildMediaPayloadHeaderSbc()
* Remove the following APIs, because they are not needed anymore:
- A2DP_BuildSinkConfig()
- A2DP_CodecConfigMatchesCapabilities()
- A2DP_SetSourceCodec()
- A2DP_CodecRequiresReconfig()
- A2DP_IsSourceCodecSupported()
* Remove the following generic APIs, and keep only the SBC-specific APIs.
The information returned by those functions is SBC-specific, and doesn't
apply to other codecs:
- A2DP_GetNumberOfSubbands()
- A2DP_GetNumberOfBlocks()
- A2DP_GetAllocationMethodCode()
- A2DP_GetChannelModeCode()
- A2DP_GetSamplingFrequencyCode()
- A2DP_GetMinBitpool()
- A2DP_GetMaxBitpool()
* Rename:
A2DP_GetTrackFrequency() -> A2DP_GetTrackSampleRate()
tA2DP_FEEDING_PARAMS.sampling_freq -> sample_rate
tA2DP_FEEDING_PARAMS.num_channel -> channel_count
tA2DP_FEEDING_PARAMS.bit_per_sample -> bits_per_sample
* Remove btif_a2dp_source_encoder_update(), tA2DP_ENCODER_UPDATE_PARAMS
and associated events and processing mechanism, because they are not
needed anymore.
* Remove tA2DP_ENCODER_INTERFACE.encoder_update, because it is not
used anymore.
Now it is superceded by tA2DP_ENCODER_INTERFACE.encoder_init.
* Fix a bug inside bta_av_api_register() when initializing
the stream control block.
* Refactor bta_av_co_audio_getconfig() and bta_av_co_audio_setconfig()
* Remove tBTA_AV_CO_CB.codec_config_setconfig field, because it is not
needed anymore.
* Remove unused arguments when opening/closing audio stream
* Remove #ifdef BTA_AV_DEBUG guards: BTA_AV_DEBUG is always TRUE
* Remove SBC Mono -> Stereo hack

Test: Manual testing: A2DP streaming to headphones. TestTracker/68727
Change-Id: Ie0b209f7ad6c21c2c6d8d2e6277b86dfa63388c6
/system/bt/bta/include/bta_av_co.h
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/include/bta_av_co.h
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/include/bta_av_co.h
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/include/bta_av_co.h
feee26c3dae12b53773b31f57cf2533a3d993979 25-Oct-2016 Pavlin Radoslavov <pavlin@google.com> A2DP codec related fixes and cleanup

* Update bta_av_co_audio_getconfig() to select the preferred codec
* Fix a bug in selecting the A2DP codec inside
bta_av_co_audio_set_codec()
* No need for function A2DP_ParsSbcMplHdr() to be exposed in the API
* Generalize the following APIs, so they can be used to redirect
the call for vendor-specific codecs:
- A2DP_CodecSepIndexStr()
- A2DP_InitCodecConfig()
- A2DP_SetSourceCodec()
* Change tA2DP_ENCODER_INIT_PARAMS.SamplingFreq from uint16_t to
uint32_t so it can store larger sampling frequency.
* Rename content protection constants from BTA_AV_CP_*
to AVDT_CP_* and move them from bta_av_co.h to avdt_api.h
* Rename some of the internal functions in a2dp_sbc.cc
* Add extra debug logging and fix some comments

Test: A2DP streaming, unit tests passing
Change-Id: I1b67ff18dc568dd859429fcd89c644799fb1438d
/system/bt/bta/include/bta_av_co.h
f66f4e95f2b4bc8d36033f2d65b387e32601fcd8 15-Oct-2016 Pavlin Radoslavov <pavlin@google.com> A2DP-related renaming: a2d_* to a2dp_*

Test: top-level compilation and running A2DP

Change-Id: Ibbd3176b86667885666bfe29025ec2c120fafce6
/system/bt/bta/include/bta_av_co.h
b3e5af36e9e396eafab3001728ecbc1d8d36a339 20-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Removed usage of A2DP codec_type as a separate field

The value of codec_type can be extracted from the codec_info,
so it is not needed to pass it around as an argument, or keep
it as an field.

Also:
* Added new APIs and the corresponding unit tests:
- A2D_GetPacketTimestamp()
- A2D_BuildCodecHeader() - replacement for bta_av_sbc_bld_hdr()
- A2D_CodecName()
* Replaced tBTA_AV_SEP.codec_type with tBTA_AV_SEP.codec_info

Bug: 30958229
Test: A2DP tested manually. Unit tests included in the CL.
Change-Id: I3bfd4750e8639d77a9938ab3c274c9d6ea859fb6
/system/bt/bta/include/bta_av_co.h
79506e8fcd91d066db1c8aa71008a7b53b0e9172 08-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Extended the A2DP codec abstraction API

* Added new A2DP codec-independent API and updated/renamed existing API.
- A2D_InitCodecConfig()
- A2D_InitDefaultCodec()
- A2D_SetCodec()
- A2D_IsCodecSupported() -> A2D_IsSourceCodecSupported()
- A2D_IsSinkCodecSupported()
- A2D_BuildSrc2SinkConfig() - previously bta_av_build_src_cfg()
- A2D_IsSinkCodecSupported() - previously
bta_av_co_audio_sink_supports_config()
- A2D_IsSourceCodecSupported() - previously
bta_av_co_audio_media_supports_config()
- A2D_IsPeerSourceCodecSupported()
- A2D_GetDefaultConfigSbc() - to be deleted
- A2D_CodecSepIndexStr()

* Added the corresponding SBC-specific implementation and a placeholder
for vendor implementation.

* Added the corresponding unit tests

Also:
* Added type tA2D_CODEC_SEP_INDEX and list each known codec (Source or Sink):
A2D_CODEC_SEP_INDEX_*
* Renamed BTIF_SV_AV_AA_SBC_INDEX -> A2D_CODEC_SEP_INDEX_SBC
* Renamed BTIF_SV_AV_AA_SBC_SINK_INDEX -> A2D_CODEC_SEP_INDEX_SBC_SINK
* Renamed BTA_AV_MAX_SEPS -> A2D_CODEC_SEP_INDEX_MAX
* Renamed tA2D_CODEC -> tA2D_CODEC_TYPE
* Renamed tBTIF_AV_MEDIA_FEEDINGS -> tA2D_AV_MEDIA_FEEDINGS
* Renamed tBTIF_AV_CODEC_ID -> tA2D_AV_CODEC_ID (to be deleted)
* Renamed BTIF_AV_CODEC_PCM -> tA2D_AV_CODEC_PCM (to be deleted)
* Renamed BTIF_AV_CODEC_NONE -> tA2D_AV_CODEC_NONE (to be deleted)
* tBTIF_AV_MEDIA_FEED_CFG_PCM -> tA2D_AV_MEDIA_FEED_CFG_PCM (to be
deleted)
* tBTIF_AV_MEDIA_FEED_CFG -> tA2D_AV_MEDIA_FEED_CFG (to be deleted)
* Moved SBC codec-related configuration and capabilities from
btif/co/bta_av_co.cc to stack/a2dp/a2d_sbc.c :
- bta_av_co_sbc_caps -> a2d_sbc_caps
- bta_av_co_sbc_sink_caps -> a2d_sbc_sink_caps
- btif_av_sbc_default_config -> a2d_sbc_default_config
* Replaced usage of BTIF_AV_SBC_DEFAULT_SAMP_FREQ with
A2D_SBC_IE_SAMP_FREQ_44
* Merged bta_av_sbc_cfg_matches_cap() and bta_av_sbc_cfg_in_cap()
into A2D_CodecInfoMatchesCapabilitySbc()
* Misc other fixes and cleanup: use tA2D_STATUS as appropriate, remove
FUNC_TRACE(), etc.

Bug: 30958229
Change-Id: I35e224754041cdce479c87e57d8e2c8b3adc8edd
/system/bt/bta/include/bta_av_co.h
a62c5a302e54568a3d2c164a7dbef52f279512f2 26-Aug-2016 Pavlin Radoslavov <pavlin@google.com> Cleanup and removed BTIF-related unused code

* Removed field tBTIF_MEDIA_CB.av_sm_hdl, because it is never used
after an assignment.
* Removed the corresponding function btif_av_get_sm_handle() which
is not used/needed anymore.
* Declared btif_hf_is_call_idle() function in a new header file
"btif_hf.h"
* Removed tBTIF_STATUS, BTIF_SUCCESS and BTIF_ERROR_SRV_* error codes
which are never used.
* Removed duplicate conditional define of BTA_AV_CO_CP_SCMS_T
* Removed unused typedef tBTA_AV_AUDIO_CODEC_INFO, and unused
BTA_AV_CO_* defines and enums.

Change-Id: I7bb49957fad94073d474fea6ea0d466f36df37fb
/system/bt/bta/include/bta_av_co.h
7aaf7c6c42a06e174ce305000ab7a223dc99cbdf 23-Aug-2016 Pavlin Radoslavov <pavlin@google.com> A2DP-related naming refactoring and cleanup

* Renamed A2DP-related function names, types, constants and fields.
Also, move some of those functions to a better location.
- tAVDT_DATA_CBACK -> tAVDT_SINK_DATA_CBACK
- tAVDT_MEDIA_CBACK -> tAVDT_SINK_MEDIA_CBACK
- p_data_cback -> p_sink_data_cback
- p_media_cback -> p_sink_media_cback
- p_app_data_cback -> p_app_sink_data_cback
- tBTA_AV_DATA_CBACK -> tBTA_AV_SINK_DATA_CBACK
- BTA_AV_MEDIA_SINK_CFG_EVT -> BTA_AV_SINK_MEDIA_CFG_EVT
- BTA_AV_MEDIA_DATA_EVT -> BTA_AV_SINK_MEDIA_DATA_EVT
- bta_av_stream_data_cback() -> bta_av_sink_data_cback()
- bte_av_media_callback() -> bte_av_sink_media_callback()
- tBTA_AV_CODEC -> tA2D_CODEC
- btif_a2dp_get_track_frequency() -> A2D_sbc_get_track_frequency()
- btif_a2dp_get_track_channel_count() -> A2D_sbc_get_track_channel_count()
- dump_codec_info() -> A2D_sbc_dump_codec_info()

* Misc. other cleanup:
- log messages cleanup
- normalize usage of "+=" in Android.mk files

Change-Id: Ida1528fb5d75cc322533f921daefb65be44562f1
/system/bt/bta/include/bta_av_co.h
7738627e6951508e3db3570afc8b6db1cb0acf88 20-Aug-2016 Pavlin Radoslavov <pavlin@google.com> Removed unused code related to Audio, A2DP Sink and Video

* Function BTA_AvEnable_Sink() - never used
- Event BTA_AV_API_SINK_ENABLE_EVT
- Processing function bta_av_api_sink_enable()
- AVDT_SINK_Activate() and AVDT_SINK_Deactivate() : not used anymore

* A2DP SINK related functions that are only declared:
- btif_queue_focus_request()
- audio_focus_status()

* Audio-related function that is never used:
- bta_av_sbc_cfg_for_cap()

* Video-related functions that are only declared:
- bta_av_co_video_src_data_path()
- bta_av_co_video_setconfig()
- bta_av_co_video_open()
- bta_av_co_video_close()
- bta_av_co_video_start()
- bta_av_co_video_report_conn()
- bta_av_co_video_report_rr()
- bta_av_co_video_delay()
- bta_av_co_video_disc_res()
- bta_av_co_video_getconfig()
- bta_av_co_video_stop()

Change-Id: I0c0c80578ab2675d2fe23dea3f11b2a0d82283f0
/system/bt/bta/include/bta_av_co.h
d19e0785e662e640191a075eda07acce61c2aeda 15-Jul-2016 Marie Janssen <jamuraa@google.com> Use standard types, consistent ifdef style everywhere

Remove the typedefs in stack/include/bt_types.h

Use standard types everywhere.
Use standard style for #if statements:
- #if (VAR_NAME == TRUE)
- #if (VAR_NAME1 == TRUE && VAR_NAME2 == TRUE)
Use __func__ instead of __FUNCTION__
Fix some debug statements to use __func__

Update script to be less disruptive to aligned assignment blocks.

Change-Id: I8f8f068e6c26ce74fd3b3707e1e31fd0b919cdd0
/system/bt/bta/include/bta_av_co.h
e9e58ced195ec2c983c7723c9cbdabd45eb0f2fd 17-Jun-2016 Marie Janssen <jamuraa@google.com> bta: use standard types

Use standard types everywhere.
Use standard style for #if statements:
- #if (VAR_NAME == TRUE)
- #if (VAR_NAME1 == TRUE && VAR_NAME2 == TRUE)
Use __func__ instead of __FUNCTION__
Fix some debug statements to use __func__

Change-Id: Ib86de4de9f14529ecaa4f71597260e3b5785360b
/system/bt/bta/include/bta_av_co.h
713993d1784ab7c23aee1fa3cf1ab8676cc0aa69 21-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Convert BTIF code from C to C++

Modifications required:
* added proper casting
* moved variable definitions before goto statements
* added 'extern "C"' markers where needed
* renamed 'operator' to 'operator_name'

Bug: 28485365
Change-Id: I903357967387207e678866c02e008f047f8263f6
/system/bt/bta/include/bta_av_co.h
24933b5b1a06274c47133debac5251a97128a267 25-Sep-2014 June R. Tate-Gans <jtgans@google.com> Removing unnecessary BTAPI #defines.
/system/bt/bta/include/bta_av_co.h
f7dd9f5779680da37dc89e5df2b26d436487818c 24-Oct-2013 Hemant Gupta <hemantg@codeaurora.org> Add A2DP Sink Support

Change-Id: I9affefdd2d00597545e49c593ef3bddb110d4c9c
/system/bt/bta/include/bta_av_co.h
5738f83aeb59361a0a2eda2460113f6dc9194271 13-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot cdeccf6fdd8c2d494ea2867cb37a025bf8879baf

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
/system/bt/bta/include/bta_av_co.h