From a5017872000a938667c76d760a866547c3719d09 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Fri, 20 Mar 2015 10:56:35 -0700 Subject: Update AudioTrack constructor and set() comments Comments were missing for recently added parameters. Change-Id: I414594fed56317112be5f3b415871d77e7f7e282 --- include/media/AudioRecord.h | 2 +- include/media/AudioTrack.h | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index 0b15f27..5fd055c 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -61,7 +61,7 @@ public: public: // FIXME use m prefix size_t frameCount; // number of sample frames corresponding to size; - // on input to obtainBuffer() it is the number of frames desired, + // on input to obtainBuffer() it is the number of frames desired // on output from obtainBuffer() it is the number of available // frames to be read // on input to releaseBuffer() it is currently ignored diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index e919dd4..81b1181 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -150,9 +150,6 @@ public: /* Creates an AudioTrack object and registers it with AudioFlinger. * Once created, the track needs to be started before it can be used. * Unspecified values are set to appropriate default values. - * With this constructor, the track is configured for streaming mode. - * Data to be rendered is supplied by write() or by the callback EVENT_MORE_DATA. - * Intermixing a combination of write() and non-ignored EVENT_MORE_DATA is not allowed. * * Parameters: * @@ -170,13 +167,21 @@ public: * configuration. Zero means to use a default value. * flags: See comments on audio_output_flags_t in . * cbf: Callback function. If not null, this function is called periodically - * to provide new data and inform of marker, position updates, etc. + * to provide new data in TRANSFER_CALLBACK mode + * and inform of marker, position updates, etc. * user: Context for use by the callback receiver. * notificationFrames: The callback function is called each time notificationFrames PCM * frames have been consumed from track input buffer. * This is expressed in units of frames at the initial source sample rate. * sessionId: Specific session ID, or zero to use default. * transferType: How data is transferred to AudioTrack. + * offloadInfo: If not NULL, provides offload parameters for + * AudioSystem::getOutputForAttr(). + * uid: User ID of the app which initially requested this AudioTrack + * for power management tracking, or -1 for current user ID. + * pid: Process ID of the app which initially requested this AudioTrack + * for power management tracking, or -1 for current process ID. + * pAttributes: If not NULL, supersedes streamType for use case selection. * threadCanCallJava: Not present in parameter list, and so is fixed at false. */ @@ -199,7 +204,9 @@ public: /* Creates an audio track and registers it with AudioFlinger. * With this constructor, the track is configured for static buffer mode. * Data to be rendered is passed in a shared memory buffer - * identified by the argument sharedBuffer, which must be non-0. + * identified by the argument sharedBuffer, which should be non-0. + * If sharedBuffer is zero, this constructor is equivalent to the previous constructor + * but without the ability to specify a non-zero value for the frameCount parameter. * The memory should be initialized to the desired data before calling start(). * The write() method is not supported in this case. * It is recommended to pass a callback function to be notified of playback end by an -- cgit v1.1