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 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 RawAddress& GetDevice(); 36 void GetProxy(); 37 void RegisterObserver(); 38 BluetoothA2dpCodecStatus GetCodecStatus(); 39 int WriteFrame(const uint8_t *data, uint32_t size); 40 int StartPlaying(); 41 int SuspendPlaying(); 42 int StopPlaying(); 43 void GetRenderPosition(uint16_t &delayValue, uint16_t &dataSize, uint32_t &timeStamp); 44 } 45 } 46 47 #endif