summaryrefslogtreecommitdiff
path: root/system/btif/include/btif_avrcp_audio_track.h
blob: eeca1c8b8f2169b42fba0d1a8ae564812ac76552 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * Copyright 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Implements an API to be used by A2DP to do streaming of music over a media
 * stream. This API provides mechanism to create and control playback of the
 * media stream depending on the data bits coming from the remote device. The
 * media stream is played over the default audio media stream type and hence
 * volume control is handled entirely by the Audio Manager (which is also the
 * original motivation for this solution.
 *
 * TODO: Once the AudioManager provides support for patching audio sources with
 * volume control we should deprecate this file.
 */

/**
 * Creates an audio track object and returns a void handle. Use this handle to
 * the
 * following functions.
 *
 * The ownership of the handle is maintained by the caller of this API and it
 * should eventually be
 * deleted using BtifAvrcpAudioTrackDelete (see below).
 */
void* BtifAvrcpAudioTrackCreate(int trackFreq, int bitsPerSample,
                                int channelCount);

/**
 * Starts the audio track.
 */
void BtifAvrcpAudioTrackStart(void* handle);

/**
 * Pauses the audio track.
 */
void BtifAvrcpAudioTrackPause(void* handle);

/**
 * Sets audio track gain.
 */
void BtifAvrcpSetAudioTrackGain(void* handle, float gain);

/**
 * Stop / Delete the audio track.
 * Delete should usually be called stop.
 */
void BtifAvrcpAudioTrackStop(void* handle);
void BtifAvrcpAudioTrackDelete(void* handle);

/**
 * Writes the audio track data to file.
 *
 * Used only for debugging.
 */
int BtifAvrcpAudioTrackWriteData(void* handle, void* audioBuffer,
                                 int bufferLength);