1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef AUDIO_BLUETOOTH_MANAGER_H 17 #define AUDIO_BLUETOOTH_MANAGER_H 18 19 #include "bluetooth_a2dp_codec.h" 20 #include "bluetooth_a2dp_a2dpCodecInfo.h" 21 #include "bluetooth_a2dp_a2dpCodecStatus.h" 22 #include "raw_address.h" 23 24 namespace OHOS { 25 namespace Bluetooth { 26 using namespace OHOS::bluetooth; 27 28 typedef struct BtA2dpAudioCallback { 29 void (*OnConnectionStateChanged)(const RawAddress &device, int state); 30 void (*OnPlayingStatusChanged)(const RawAddress &device, int playingState, int error); 31 void (*OnConfigurationChanged)(const RawAddress &device, const BluetoothA2dpCodecInfo &info, int error); 32 }BtA2dpAudioCallback; 33 34 int GetPlayingState(); 35 void GetProxy(); 36 void RegisterObserver(); 37 void DeRegisterObserver(); 38 39 #ifdef A2DP_HDI_SERVICE 40 bool SetUp(); 41 void TearDown(); 42 #endif 43 44 int WriteFrame(const uint8_t *data, uint32_t size); 45 int StartPlaying(); 46 int SuspendPlaying(); 47 int StopPlaying(); 48 } 49 } 50 51 #endif