summaryrefslogtreecommitdiffstats
path: root/include/media/AudioRecord.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-01-13 10:21:48 -0800
committerGlenn Kasten <gkasten@google.com>2014-01-24 13:19:59 -0800
commit38e905b3cbba4da443d799b16999989781afc6d8 (patch)
tree47b872b97f1af95c3e0ceefb1f8d56c9ae7a67fc /include/media/AudioRecord.h
parentf0002d142e6d24c5438600b2c259679de710f8ac (diff)
downloadframeworks_av-38e905b3cbba4da443d799b16999989781afc6d8.zip
frameworks_av-38e905b3cbba4da443d799b16999989781afc6d8.tar.gz
frameworks_av-38e905b3cbba4da443d799b16999989781afc6d8.tar.bz2
Refactor code related to I/O handles to reduce chance for leaks
The AudioRecord input handle code was refactored earlier to fix a potential handle leak, and to simplify the code: > Change-Id: I124dce344b1d11c2dd66ca5e2c9aec0c52c230e2 This changelist refactors AudioTrack similarly, and adds further cleanup of both AudioTrack and AudioRecord. We attempt to implement the rules for referencing counting I/O handles, but there is still the possibility of a handle leak if the client process dies after allocating the handle reference but before releasing it. That issue is being tracked separately. Details: - AudioSystem::getOutput() is now called within createTrack_l - restoreTrack_l was missing offload info now it has the info available, but is not yet being called for offloaded tracks - AudioTrack::getOutput() is now const - Remove getOutput_l() Change-Id: I44a0a623d24fc5847bcac0939c276400568adbca
Diffstat (limited to 'include/media/AudioRecord.h')
-rw-r--r--include/media/AudioRecord.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index 45134c4..3d839fc 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -486,12 +486,11 @@ private:
int mSessionId;
transfer_type mTransfer;
- audio_io_handle_t mInput; // returned by AudioSystem::getInput()
-
- // Next 3 fields may be changed if IAudioRecord is re-created, but always != 0
+ // Next 4 fields may be changed if IAudioRecord is re-created, but always != 0
sp<IAudioRecord> mAudioRecord;
sp<IMemory> mCblkMemory;
audio_track_cblk_t* mCblk; // re-load after mLock.unlock()
+ audio_io_handle_t mInput; // returned by AudioSystem::getInput()
int mPreviousPriority; // before start()
SchedPolicy mPreviousSchedulingGroup;