2 * Copyright 2015 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * Implements an API to be used by A2DP to do streaming of music over a media
19 * stream. This API provides mechanism to create and control playback of the
20 * media stream depending on the data bits coming from the remote device. The
21 * media stream is played over the default audio media stream type and hence
22 * volume control is handled entirely by the Audio Manager (which is also the
23 * original motivation for this solution.
25 * TODO: Once the AudioManager provides support for patching audio sources with
26 * volume control we should deprecate this file.
30 * Creates an audio track object and returns a void handle. Use this handle to
32 * following functions.
34 * The ownership of the handle is maintained by the caller of this API and it
35 * should eventually be
36 * deleted using BtifAvrcpAudioTrackDelete (see below).
38 void* BtifAvrcpAudioTrackCreate(int trackFreq, int channelType);
41 * Starts the audio track.
43 void BtifAvrcpAudioTrackStart(void* handle);
46 * Pauses the audio track.
48 void BtifAvrcpAudioTrackPause(void* handle);
51 * Sets audio track gain.
53 void BtifAvrcpSetAudioTrackGain(void* handle, float gain);
56 * Stop / Delete the audio track.
57 * Delete should usually be called stop.
59 void BtifAvrcpAudioTrackStop(void* handle);
60 void BtifAvrcpAudioTrackDelete(void* handle);
63 * Writes the audio track data to file.
65 * Used only for debugging.
67 int BtifAvrcpAudioTrackWriteData(void* handle, void* audioBuffer,