Home | History | Annotate | Download | only in include
      1 /*
      2  * Copyright 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 /**
     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.
     24  *
     25  * TODO: Once the AudioManager provides support for patching audio sources with
     26  * volume control we should deprecate this file.
     27  */
     28 
     29 /**
     30  * Creates an audio track object and returns a void handle. Use this handle to
     31  * the
     32  * following functions.
     33  *
     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).
     37  */
     38 void* BtifAvrcpAudioTrackCreate(int trackFreq, int channelType);
     39 
     40 /**
     41  * Starts the audio track.
     42  */
     43 void BtifAvrcpAudioTrackStart(void* handle);
     44 
     45 /**
     46  * Pauses the audio track.
     47  */
     48 void BtifAvrcpAudioTrackPause(void* handle);
     49 
     50 /**
     51  * Sets audio track gain.
     52  */
     53 void BtifAvrcpSetAudioTrackGain(void* handle, float gain);
     54 
     55 /**
     56  * Stop / Delete the audio track.
     57  * Delete should usually be called stop.
     58  */
     59 void BtifAvrcpAudioTrackStop(void* handle);
     60 void BtifAvrcpAudioTrackDelete(void* handle);
     61 
     62 /**
     63  * Writes the audio track data to file.
     64  *
     65  * Used only for debugging.
     66  */
     67 int BtifAvrcpAudioTrackWriteData(void* handle, void* audioBuffer,
     68                                  int bufferlen);
     69