a2dp_vendor_ldac_abr.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright 2017 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. //
  17. // Interface to the A2DP LDAC ABR
  18. //
  19. #ifndef A2DP_VENDOR_LDAC_ABR_H
  20. #define A2DP_VENDOR_LDAC_ABR_H
  21. #include <stdio.h>
  22. #include <ldacBT_abr.h>
  23. // Initial EQMID for ABR mode.
  24. #define LDAC_ABR_MODE_EQMID LDACBT_EQMID_SQ
  25. // Loads the LDAC ABR library.
  26. // Return true on success, otherwise false.
  27. bool A2DP_VendorLoadLdacAbr(void);
  28. // Unloads the LDAC ABR library.
  29. void A2DP_VendorUnloadLdacAbr(void);
  30. // Gets the LDAC ABR handle.
  31. // Return the LDAC ABR handle.
  32. HANDLE_LDAC_ABR a2dp_ldac_abr_get_handle(void);
  33. // Free the LDAC ABR handle.
  34. void a2dp_ldac_abr_free_handle(HANDLE_LDAC_ABR hLdacAbr);
  35. // Initializes the LDAC ABR handle.
  36. // Return 0 on success, or -1 on failure.
  37. int a2dp_ldac_abr_init(HANDLE_LDAC_ABR hLdacAbr, unsigned int interval_ms);
  38. // Sets thresholds for the LDAC ABR handle.
  39. // Return 0 on success, or -1 on failure.
  40. int a2dp_ldac_abr_set_thresholds(HANDLE_LDAC_ABR hLdacAbr,
  41. unsigned int th_critical,
  42. unsigned int th_dangerous_trend,
  43. unsigned int th_4hqsq);
  44. // LDAC ABR main process.
  45. // It controls LDAC encoder bit rate based on A2DP transmit queue length.
  46. // return current EQMID of LDAC encoder.
  47. int a2dp_ldac_abr_proc(HANDLE_LDAC_BT hLdacParam, HANDLE_LDAC_ABR hLdacAbr,
  48. size_t transmit_queue_length, unsigned int flag_enable);
  49. #endif // A2DP_VENDOR_LDAC_ENCODER_H