• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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     void (*OnMediaStackChanged)(const RawAddress &device, int action);
33 }BtA2dpAudioCallback;
34 
35 int GetPlayingState();
36 void GetProxy();
37 void RegisterObserver();
38 void DeRegisterObserver();
39 
40 #ifdef A2DP_HDI_SERVICE
41 bool SetUp();
42 void TearDown();
43 #endif
44 
45 int WriteFrame(const uint8_t *data, uint32_t size);
46 int StartPlaying();
47 int SuspendPlaying();
48 int StopPlaying();
49 }
50 }
51 
52 #endif