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
Showing
- system/btif/co/bta_av_co.cc 210 additions, 77 deletionssystem/btif/co/bta_av_co.cc
- system/stack/a2dp/a2dp_aac.cc 57 additions, 58 deletionssystem/stack/a2dp/a2dp_aac.cc
- system/stack/a2dp/a2dp_aac_encoder.cc 3 additions, 3 deletionssystem/stack/a2dp/a2dp_aac_encoder.cc
- system/stack/a2dp/a2dp_codec_config.cc 49 additions, 23 deletionssystem/stack/a2dp/a2dp_codec_config.cc
- system/stack/a2dp/a2dp_sbc.cc 81 additions, 125 deletionssystem/stack/a2dp/a2dp_sbc.cc
- system/stack/a2dp/a2dp_sbc_encoder.cc 3 additions, 3 deletionssystem/stack/a2dp/a2dp_sbc_encoder.cc
- system/stack/a2dp/a2dp_vendor.cc 9 additions, 11 deletionssystem/stack/a2dp/a2dp_vendor.cc
- system/stack/include/a2dp_aac.h 24 additions, 16 deletionssystem/stack/include/a2dp_aac.h
- system/stack/include/a2dp_codec_api.h 17 additions, 8 deletionssystem/stack/include/a2dp_codec_api.h
- system/stack/include/a2dp_sbc.h 24 additions, 16 deletionssystem/stack/include/a2dp_sbc.h
- system/stack/include/a2dp_vendor.h 5 additions, 9 deletionssystem/stack/include/a2dp_vendor.h
- system/stack/test/stack_a2dp_test.cc 83 additions, 40 deletionssystem/stack/test/stack_a2dp_test.cc
Loading
Please register or sign in to comment