summaryrefslogtreecommitdiffstats
path: root/include/media/AudioRecord.h
Commit message (Collapse)AuthorAgeFilesLines
* IAudioFlinger::openRecord returns IMemory(s)Glenn Kasten2014-05-091-1/+3
| | | | | | | | openRecord() now explicitly returns the control block and data buffer as separate IMemory references. If the IMemory for data buffer is 0, this means it immediately follows the control block. Change-Id: Ic098f88f0e037f8fbe30006689e18cacacf09d06
* Fix type of AudioTrack/AudioRecord parameter frameCountGlenn Kasten2014-02-281-2/+2
| | | | | | It's size_t consistently Change-Id: I29638ef59ac773218025f2403a3508a307b487e0
* Fix type of AudioTrack/AudioRecord parameter notificationFramesGlenn Kasten2014-02-281-2/+2
| | | | | | It's uint32_t consistently Change-Id: If8298c7e9aeea2b951fe47b675adbdf48d104846
* Fix clang warnings in AudioFlingerGlenn Kasten2014-02-101-1/+1
| | | | Change-Id: I0fa61025c979709ad7d655bc717df5f194b6089e
* Add AudioRecord::mReqFrameCount similar to AudioTrackGlenn Kasten2014-02-051-1/+5
| | | | Change-Id: I62d6534a9581e84ae20c2422f7ad9aeda9b7c4df
* Refactor code related to I/O handles to reduce chance for leaksGlenn Kasten2014-01-241-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge "Use uint32_t sequence numbers for IAudioRecord"Glenn Kasten2014-01-171-1/+1
|\
| * Use uint32_t sequence numbers for IAudioRecordGlenn Kasten2014-01-161-1/+1
| | | | | | | | | | | | | | | | | | This makes it the same as for IAudioTrack. Previously we had a mix of int, int32_t and uint32_t, which could cause comparisons to fail. Change-Id: Ic72ef650ee81f65db11e42ed16d818fdf3e310f4
* | Merge "AudioRecord::getInputFramesLost() cleanup"Glenn Kasten2014-01-171-1/+3
|\ \
| * | AudioRecord::getInputFramesLost() cleanupGlenn Kasten2014-01-141-1/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug that if the binder call failed (for example if the IAudioFlinger binder is dead), then getInputFramesLost was returning garbage. Now it correctly returns zero, which is the error value for this method. The type declarations for getInputFramesLost were inconsistent: a mixture of unsigned int, size_t, and uint32_t. Now it returns uint32_t everywhere, which is what the underlying HAL API returns. Added a FIXME about the side effect behavior. This will need review for multi-client. Change-Id: Ifa2e117a87dbd0c1f2c892a31d1c3dd919bf1a0a
* | Merge "Unify comments between AudioTrack and AudioRecord"Glenn Kasten2014-01-171-10/+19
|\ \ | |/ |/|
| * Unify comments between AudioTrack and AudioRecordGlenn Kasten2014-01-141-10/+19
| | | | | | | | Change-Id: I00a1025e2891a1c96218b3c2187eaddda6614ebc
* | Merge "Use AUDIO_SESSION_ALLOCATE instead of 0"Glenn Kasten2014-01-151-2/+2
|\ \ | |/ |/|
| * Use AUDIO_SESSION_ALLOCATE instead of 0Glenn Kasten2013-12-201-2/+2
| | | | | | | | | | | | | | Also fix a couple of places where we were using AUDIO_SESSION_OUTPUT_MIX, which happens to also be equal to 0, but has a different meaning. Change-Id: I90e39be3b89f5021a96d9e3b8d10929013ca977f
* | Fix race condition in AudioRecord::pause followed by startGlenn Kasten2014-01-131-0/+1
| | | | | | | | | | Bug: 11148722 Change-Id: Ia1e14133d73ac301fe06a047e70a573911822630
* | Fix some (but not all) unused parameter warningsGlenn Kasten2013-12-191-1/+1
|/ | | | Change-Id: Ia99e23a0b46db3f3e6aa46f9018e63c14f4af369
* am f2c643c8: am 3b3cfcfa: Merge "Fix slow AudioTrack and AudioRecord ↵Glenn Kasten2013-09-201-4/+6
|\ | | | | | | | | | | | | destruction" into klp-dev * commit 'f2c643c89e405b57c7ce42067b876fb80031e5fa': Fix slow AudioTrack and AudioRecord destruction
| * Fix slow AudioTrack and AudioRecord destructionGlenn Kasten2013-09-201-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two causes for the slowness: When thread was paused, it used nanosleep and sleep. These usually run to completion (except for POSIX signal, which we avoid because it is low-level). Instead, replace the nanosleep and sleep by condition timed wait, as that can be made to return early by a condition signal. Another advantage of condition timed wait is that a condition wait was already being used at top of thread loop, so it is a simpler change. The AudioRecord destructor was missing a proxy interrupt that was correct in AudioTrack. This proxy interrupt is needed in case another thread is blocked in proxy obtainBuffer. Does not address the 1 second polling for NS_WHENEVER. Bug: 10822765 Change-Id: Id665994551e87e4d7da9c7b015f424fd7a0b5560
* | CommentsGlenn Kasten2013-08-131-1/+2
| | | | | | | | Change-Id: I56f82904cb3855bad6f33ad1ff4ddf66a61c5720
* | am 82278b2c: am fe9611bd: Merge "Fix potential leak of audio input handle." ↵Jeff Brown2013-08-121-8/+1
|\ \ | |/ | | | | | | | | | | into klp-dev * commit '82278b2ceeebbcf345ed81413eeffa82fa82e05b': Fix potential leak of audio input handle.
| * Fix potential leak of audio input handle.Jeff Brown2013-08-091-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The audio input handle is ultimately owned by the audio recorder object but it could be dropped on the floor if an error occurred before that object was fully initialized. Rearranged some of the argument validation and merged getInput_l with openRecord_l to simplify the code and prevent such a leak from occurring. Bug: 10265163 Change-Id: I124dce344b1d11c2dd66ca5e2c9aec0c52c230e2
* | Merge "Line length 100"Glenn Kasten2013-08-091-1/+1
|\ \ | |/ |/|
| * Line length 100Glenn Kasten2013-08-061-1/+1
| | | | | | | | Change-Id: I8ad58a961cefd0b0c2b041e04fd78669917453d1
* | Merge "Cleanup comments for the new control block implementation"Glenn Kasten2013-08-071-2/+1
|\ \ | |/ |/|
| * Cleanup comments for the new control block implementationGlenn Kasten2013-08-021-2/+1
| | | | | | | | | | | | | | | | There was some obsolete and incomplete text left over after the new control block code was submitted. This cleans up all those comments to be accurate again. Change-Id: Ic52f5869cb723cde25d709514d6deea6aa6f20aa
* | Merge "AudioRecord notification frames"Glenn Kasten2013-08-061-1/+4
|\ \
| * | AudioRecord notification framesGlenn Kasten2013-08-021-1/+4
| | | | | | | | | | | | Change-Id: I76ec536d1504eb9a558178b62bf225aace4b40d1
* | | Merge "AudioRecord::openRecord_l now take flags"Glenn Kasten2013-08-061-0/+1
|\ \ \ | |/ /
| * | AudioRecord::openRecord_l now take flagsGlenn Kasten2013-08-021-0/+1
| | | | | | | | | | | | | | | | | | | | | The new parameter 'flags' of type audio_input_flags_t will be used for requesting a fast track, but is currently ignored. Change-Id: If68dfda8b2d4eaaca42927d721b4630c47f71f3b
* | | Merge "AudioRecord::set and constructor now take flags"Glenn Kasten2013-08-051-2/+6
|\ \ \ | |/ /
| * | AudioRecord::set and constructor now take flagsGlenn Kasten2013-08-021-2/+6
| | | | | | | | | | | | | | | | | | | | | The new optional parameter 'flags' of type audio_input_flags_t will be used for requesting a fast track. Change-Id: Ia7e070cb57c833e608352da354fb30dc26df6918
* | | Merge "Make AudioRecord and AudioTrack comments more similar"Glenn Kasten2013-08-051-2/+9
|\ \ \
| * | | Make AudioRecord and AudioTrack comments more similarGlenn Kasten2013-08-021-2/+9
| | |/ | |/| | | | | | | Change-Id: I122a7cf7bfc162090cb27f37c325db7a23985bc7
* | | Merge "AudioRecord callback thread waits for priority boost"Glenn Kasten2013-08-051-0/+1
|\ \ \ | | |/ | |/|
| * | AudioRecord callback thread waits for priority boostGlenn Kasten2013-08-021-0/+1
| |/ | | | | | | Change-Id: Iae38fa4ac20a45751566169213a08a15deb0a2f6
* | AudioRecord has no default sample rateGlenn Kasten2013-08-021-2/+0
|/ | | | Change-Id: I72feefdd6f3a623fd3669b80d4b264518fdc0929
* Remove default channel mask in AudioRecord constructor and set()Glenn Kasten2013-07-301-8/+8
| | | | Change-Id: I22ad4ba8777842bf6705e79c6ad796fdb9a4104c
* AudioRecord must be used as sp<> onlyGlenn Kasten2013-06-131-1/+3
| | | | | Bug: 9423855 Change-Id: I78ba8228c60dff11fb466156bb632c5dda45cdaf
* New control block for AudioTrack and AudioRecordGlenn Kasten2013-06-121-76/+175
| | | | | | | | Main differences between old and new control block: - removes the mutex, which was a potential source of priority inversion - circular indices into shared buffer, which is now always a power-of-2 size Change-Id: I4e9b7fa99858b488ac98a441fa70e31dbba1b865
* Start isolating control block accesses in a proxyGlenn Kasten2012-12-121-0/+3
| | | | | | | | | | | | | | | | | | | | | The proxy object will eventually be the only code that understands the details of the control block. This should make it easier to change the control block in the future. Initial set of control block fields that are isolated: - sample rate - send level - volume Prepare for streaming/static separation by adding a union to the control block for the new fields. Fix bug in handling of max sample rate on a track. It was only checking at re-configuration, not at each mix. Simplify OutputTrack::obtainBuffer. Change-Id: I2249f9d04f73a911a922ad1d7f6197292c74cd92
* Clean up channel count and channel maskGlenn Kasten2012-11-191-2/+1
| | | | | | | | Channel count is uint32_t. Remove redundant mask parameter to AudioTrack::createTrack_l() and AudioRecord::openRecord_l(). Change-Id: I5dc2b18eb609b2c0dc3091994cbaa4628062c17f
* Use size_t for frame countsGlenn Kasten2012-11-151-4/+4
| | | | | | Also fix typo: bufferCount should be frameCount. Change-Id: Ibed539504db75ef99dc21c8ff1bf2987122063a5
* Move frame size out of the control blockGlenn Kasten2012-11-121-1/+2
| | | | | | This is part of a series to clean up the control block. Change-Id: Ifab1c42ac0f8be704e571b292713cd2250d12a3f
* Move buffers pointer out of the control blockGlenn Kasten2012-11-081-0/+1
| | | | | | This is part of a series to clean up the control block. Change-Id: Ie474557db7cb360f2d9a0f11600a68f5a3d46f07
* Removed unused fields in AudioRecord::BufferGlenn Kasten2012-11-061-7/+0
| | | | Change-Id: I89fc6d8f695b48516d956b0a9a4a43d408f369f9
* AudioRecord commentsGlenn Kasten2012-11-021-30/+45
| | | | Change-Id: Ibec910608948d778dc655d900255a80384e9b06f
* AudioRecord lockingGlenn Kasten2012-07-171-2/+2
| | | | | | | | | | | | | | | | Fix race conditions for EVENT_MARKER and EVENT_NEW_POS callbacks. Marker and new position update fields are protected by lock. getSampleRate() doesn't need a lock because it reads from shared memory control block. Enforce that the parameter passed with EVENT_MARKER and EVENT_NEW_POS cannot not be changed by the callback handler, and will not change during the call by another thread. Session ID should never change; log if it does. Change-Id: Ia2c63cf1a71b10bb06c37981bd76437f83fffa91
* AudioRecord::stop() return voidGlenn Kasten2012-07-131-1/+1
| | | | | | like AudioTrack::stop() Change-Id: Iab62f4665151345f1ad5874c97a21d1a331f0154
* AudioRecord client threading cleanupGlenn Kasten2012-07-131-8/+19
| | | | | | | | | | | | | | | | | | | Rename ClientRecordThread to AudioRecordThread to be more similar to AudioTrack naming. Only create the thread once, and use resume() and pause() for start() and stop(). This will allow us to have a known client callback thread tid that we can pass to AudioFlinger before start(). mActive: Made mActive a bool not int. mActive is protected by mLock; volatile is meaningless. Fixed a few places where mActive was accessed without a lock: - stopped() - processAudioBuffer() These aren't used internally, so no need for _l() versions. Change-Id: I4b8a5c90f3a22d3894b344564cb1c5aef4f1fda2
* Remove dead code in libmediaGlenn Kasten2012-07-121-7/+0
| | | | Change-Id: I7d8201590cda29c9fa99662a4fdba222091febfe