OSDN Git Service

Use the correct API to check whether a codec is valid
authorPavlin Radoslavov <pavlin@google.com>
Wed, 5 Oct 2016 21:25:08 +0000 (14:25 -0700)
committerPavlin Radoslavov <pavlin@google.com>
Wed, 5 Oct 2016 21:38:41 +0000 (14:38 -0700)
commita0db321d98c98e10f45720075fb9c83e3ef596bf
tree9ae9d81da0068ed6287e7e02213644b8c57d9f5c
parentbe43ee7658a5e6a5904da56e6735ffed5d4bf88f
Use the correct API to check whether a codec is valid

Use the (new) A2D_IsPeerSinkCodecValid() API call as appropriate
to check whether the codec information of a Sink peer is valid.
Previously, A2D_IsSourceCodecSupported() was used, and that didn't
match the original code (before the refactoring).
A2D_IsSourceCodecSupported() has extra checks, including min/max bitpool
oundaries, and those shouldn't be used for this initial check - the
bitpool boundaries can be adjusted later.

Similarly, use the new A2D_IsPeerSourceCodecValid() API call instead of
A2D_IsSinkCodecSupported().

Also:
 * Replaced A2D_IsValidCodec() with
   A2D_IsSourceCodecValid(), A2D_IsSinkCodecValid()
   A2D_IsPeerSourceCodecValid(), A2D_IsPeerSinkCodecValid()
   and added the appropriate unit tests.

 * Added extra debug messages to help identify similar issues in the future

Bug: 31749230
Test: manual test with a carkit, and unit tests
Change-Id: Iafaeb82744df9758e686194c91624992a0c55bdf
btif/co/bta_av_co.cc
stack/a2dp/a2d_api.c
stack/a2dp/a2d_sbc.c
stack/a2dp/a2d_vendor.c
stack/include/a2d_api.h
stack/include/a2d_sbc.h
stack/include/a2d_vendor.h
stack/test/stack_a2d_test.cc