OSDN Git Service

A2DP Codec related cleanup
authorPavlin Radoslavov <pavlin@google.com>
Sat, 5 Nov 2016 00:18:51 +0000 (17:18 -0700)
committerPavlin Radoslavov <pavlin@google.com>
Thu, 1 Dec 2016 23:40:19 +0000 (15:40 -0800)
commitcd02ce9c60da962a7981320b26aada8744718941
tree46eccc069c2066f5857fdaccd63ddae35a8b9e48
parentee96a3c60fca590d38025925c072d264e06493c4
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
21 files changed:
bta/av/bta_av_aact.cc
bta/av/bta_av_int.h
bta/av/bta_av_main.cc
bta/av/bta_av_ssm.cc
bta/include/bta_av_co.h
btif/co/bta_av_co.cc
btif/include/btif_a2dp_source.h
btif/include/btif_av_co.h
btif/src/btif_a2dp_control.cc
btif/src/btif_a2dp_sink.cc
btif/src/btif_a2dp_source.cc
btif/src/btif_av.cc
stack/a2dp/a2dp_api.cc
stack/a2dp/a2dp_sbc.cc
stack/a2dp/a2dp_sbc_encoder.cc
stack/a2dp/a2dp_vendor.cc
stack/include/a2dp_api.h
stack/include/a2dp_sbc.h
stack/include/a2dp_sbc_encoder.h
stack/include/a2dp_vendor.h
stack/test/stack_a2dp_test.cc