Skip to content
Snippets Groups Projects
Commit ebc2dab0 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

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
parent 067d3607
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment