1 /*
2  * Copyright (C) 2015 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 #if defined (__cplusplus) || (cplusplus)
18 extern "C" {
19 #endif
20 
21 /**
22  * Implements an API to be used by A2DP to do streaming of music over a media
23  * stream. This API provides mechanism to create and control playback of the
24  * media stream depending on the data bits coming from the remote device. The
25  * media stream is played over the default audio media stream type and hence
26  * volume control is handled entirely by the Audio Manager (which is also the
27  * original motivation for this solution.
28  *
29  * TODO: Once the AudioManager provides support for patching audio sources with
30  * volume control we should deprecate this file.
31  */
32 
33 /**
34  * Creates an audio track object and returns a void handle. Use this handle to the
35  * following functions.
36  *
37  * The ownership of the handle is maintained by the caller of this API and it should eventually be
38  * deleted using BtifAvrcpAudioTrackDelete (see below).
39  */
40 void* BtifAvrcpAudioTrackCreate(int trackFreq, int channelType);
41 
42 /**
43  * Starts the audio track.
44  */
45 void BtifAvrcpAudioTrackStart(void *handle);
46 
47 /**
48  * Pauses the audio track.
49  */
50 void BtifAvrcpAudioTrackPause(void *handle);
51 
52 /**
53  * Sets audio track gain.
54  */
55 void BtifAvrcpSetAudioTrackGain(void *handle, float gain);
56 
57 /**
58  * Stop / Delete the audio track.
59  * Delete should usually be called stop.
60  */
61 void BtifAvrcpAudioTrackStop(void *handle);
62 void BtifAvrcpAudioTrackDelete(void *handle);
63 
64 /**
65  * Writes the audio track data to file.
66  *
67  * Used only for debugging.
68  */
69 int BtifAvrcpAudioTrackWriteData(void *handle, void *audioBuffer, int bufferlen);
70 
71 #if defined (__cplusplus) || (cplusplus)
72 }
73 #endif
74