a2dp_encoding.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2019 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. #pragma once
  17. #include "audio_a2dp_hw/include/audio_a2dp_hw.h"
  18. #include "common/message_loop_thread.h"
  19. namespace bluetooth {
  20. namespace audio {
  21. namespace a2dp {
  22. // Check if new bluetooth_audio is enabled
  23. bool is_hal_2_0_enabled();
  24. // Initialize BluetoothAudio HAL: openProvider
  25. bool init(bluetooth::common::MessageLoopThread* message_loop);
  26. // Clean up BluetoothAudio HAL
  27. void cleanup();
  28. // Set up the codec into BluetoothAudio HAL
  29. bool setup_codec();
  30. // Send command to the BluetoothAudio HAL: StartSession, EndSession,
  31. // StreamStarted, StreamSuspended
  32. void start_session();
  33. void end_session();
  34. void ack_stream_started(const tA2DP_CTRL_ACK& status);
  35. void ack_stream_suspended(const tA2DP_CTRL_ACK& status);
  36. // Read from the FMQ of BluetoothAudio HAL
  37. size_t read(uint8_t* p_buf, uint32_t len);
  38. // Update A2DP delay report to BluetoothAudio HAL
  39. void set_remote_delay(uint16_t delay_report);
  40. } // namespace a2dp
  41. } // namespace audio
  42. } // namespace bluetooth