summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-01-17 21:13:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-01-17 21:13:06 +0000
commit9a2a29ce9ea69382aafd8b895b80f7bbd028cb00 (patch)
tree2c927ccf503d820a28915f5b0d19ac84e4a11e28 /include
parent1071915ad4ffb47825a946706f8fa73c0d22d7f8 (diff)
parentd631d962a831de8b7614b14d7368eae60c816893 (diff)
downloadframeworks_av-9a2a29ce9ea69382aafd8b895b80f7bbd028cb00.zip
frameworks_av-9a2a29ce9ea69382aafd8b895b80f7bbd028cb00.tar.gz
frameworks_av-9a2a29ce9ea69382aafd8b895b80f7bbd028cb00.tar.bz2
Merge "Document the reference count rules for I/O handles"
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioSystem.h8
-rw-r--r--include/media/IAudioFlinger.h7
2 files changed, 15 insertions, 0 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index 706344a..5abab8a 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -200,12 +200,16 @@ public:
static status_t setPhoneState(audio_mode_t state);
static status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config);
static audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage);
+
+ // Client must successfully hand off the handle reference to AudioFlinger via createTrack(),
+ // or release it with releaseOutput().
static audio_io_handle_t getOutput(audio_stream_type_t stream,
uint32_t samplingRate = 0,
audio_format_t format = AUDIO_FORMAT_DEFAULT,
audio_channel_mask_t channelMask = AUDIO_CHANNEL_OUT_STEREO,
audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE,
const audio_offload_info_t *offloadInfo = NULL);
+
static status_t startOutput(audio_io_handle_t output,
audio_stream_type_t stream,
int session);
@@ -213,11 +217,15 @@ public:
audio_stream_type_t stream,
int session);
static void releaseOutput(audio_io_handle_t output);
+
+ // Client must successfully hand off the handle reference to AudioFlinger via openRecord(),
+ // or release it with releaseInput().
static audio_io_handle_t getInput(audio_source_t inputSource,
uint32_t samplingRate,
audio_format_t format,
audio_channel_mask_t channelMask,
int sessionId);
+
static status_t startInput(audio_io_handle_t input);
static status_t stopInput(audio_io_handle_t input);
static void releaseInput(audio_io_handle_t input);
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index c9cffe3..a794e87 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -67,6 +67,9 @@ public:
size_t frameCount,
track_flags_t *flags,
const sp<IMemory>& sharedBuffer,
+ // On successful return, AudioFlinger takes over the handle
+ // reference and will release it when the track is destroyed.
+ // However on failure, the client is responsible for release.
audio_io_handle_t output,
pid_t tid, // -1 means unused, otherwise must be valid non-0
int *sessionId,
@@ -78,6 +81,9 @@ public:
status_t *status) = 0;
virtual sp<IAudioRecord> openRecord(
+ // On successful return, AudioFlinger takes over the handle
+ // reference and will release it when the track is destroyed.
+ // However on failure, the client is responsible for release.
audio_io_handle_t input,
uint32_t sampleRate,
audio_format_t format,
@@ -188,6 +194,7 @@ public:
effect_descriptor_t *pDesc,
const sp<IEffectClient>& client,
int32_t priority,
+ // AudioFlinger doesn't take over handle reference from client
audio_io_handle_t output,
int sessionId,
status_t *status,