summaryrefslogtreecommitdiffstats
path: root/include/media/AudioRecord.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Implement audio device callback" into mnc-devEric Laurent2015-05-061-0/+34
|\
| * Implement audio device callbackEric Laurent2015-05-061-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add class AudioSystem::AudioDeviceCallback notifying AudioSystem clients upon device selection change on a given input or output thread. Maintain a list of installed callback per I/O handle in AudioSystem and call registered callbacks when an OPEN of CONFIG_CHANGED event is received on IAudioFlingerClient::ioConfigChanged(). Add methods to AudioTrack and AudioRecord to add and remove device change callbacks. Add methods to AudioTrack and AudioRecord to query currently selected device. ioConfigChanged() events now convey the audio patch describing the input or output thread routing. Fix AudioRecord failure to start when invalidation is handled by start(). Change-Id: I9e938adf025fa712337c63b1e02a8c18f2a20d39
* | AudioRecord keeps track of UIDJean-Michel Trivi2015-05-051-0/+6
|/ | | | | | Bug 20832981 Change-Id: If5f3c61fae02d86b9d6fdf411711f854fd56c77d
* Respect the record audio app op - mediaSvet Ganov2015-04-291-2/+10
| | | | Change-Id: I3a97977b6e9a09355e2008f780d22d480fb7308b
* Explicit routing in AudioRecordPaul McLean2015-04-281-0/+14
| | | | Change-Id: I9cc5d54883a3e5c75d553fabb619fc8e49f4f9e5
* AudioRecord::obtainBuffer() can return nonContig like AudioTrackGlenn Kasten2015-04-131-2/+13
| | | | | | And fix error handling in both AudioRecord and AudioTrack. Change-Id: I4853d736cc6d2c05de5b18b0eac62716edfa62ec
* Remove deprecation FIXMEs for TRANSFER_OBTAIN modeGlenn Kasten2015-03-251-7/+2
| | | | Change-Id: I7f43aabdb092e1465d79cd0eea5944fff18b93db
* Merge "AudioRecord::read() can be non-blocking to match AudioTrack"Glenn Kasten2015-03-241-1/+4
|\
| * AudioRecord::read() can be non-blocking to match AudioTrackGlenn Kasten2015-03-231-1/+4
| | | | | | | | Change-Id: I23b9466b81ab6037d0bccd5e6f5974b7bd4aeacb
* | Merge "set() in AudioRecord and AudioTracks needs no lock"Glenn Kasten2015-03-241-0/+1
|\ \
| * | set() in AudioRecord and AudioTracks needs no lockGlenn Kasten2015-03-231-0/+1
| |/ | | | | | | Change-Id: I9d61b3d117e9b21fbbfad772d8981a5abb8fafae
* | Remove AudioRecord::notificationFrames()Glenn Kasten2015-03-231-5/+0
|/ | | | | | This API was unused, and is not present in AudioTrack Change-Id: I66a1eedc149af085269c0f438c3c8d4e226a0e5b
* Update AudioRecord comments to match AudioTrackGlenn Kasten2015-03-231-2/+8
| | | | Change-Id: I02cb51af058277991ad0b1b5dce45744b8e8c129
* Update AudioTrack constructor and set() commentsGlenn Kasten2015-03-231-1/+1
| | | | | | Comments were missing for recently added parameters. Change-Id: I414594fed56317112be5f3b415871d77e7f7e282
* AudioRecord::releaseBuffer() buffer is const *, like AudioTrackGlenn Kasten2015-03-231-1/+1
| | | | Change-Id: If09689a8411392281ad06fcf781f3198941c642d
* Deprecate AudioRecord::getInput() and AudioTrack::getOutput()Glenn Kasten2015-03-231-1/+6
| | | | | | | Does not completely fix the bug, but is a step in the right direction. Bug: 12593118 Change-Id: Id591cd700ab58fd927ae44c71c81dac55b5cac2d
* WhitespaceGlenn Kasten2015-03-231-4/+4
| | | | Change-Id: I4640be948ad3caff0eb7525991398a1353e4bfe6
* Update AudioRecord comments to match AudioTrackGlenn Kasten2015-03-231-13/+21
| | | | Change-Id: I6c3620c60c0ba159e4688b42de4ec8b91920e048
* Fix typosGlenn Kasten2015-03-231-1/+1
| | | | | | | | Fix typos in comments Add formal parameter name to declaration where it was missing Fix out of order comments Change-Id: I1de81ae82af5ca507864e4c7b959111bac898b98
* Event driven wake for AudioRecordThread notification changesAndy Hung2015-03-181-1/+4
| | | | | | Used for setMarkerPosition and setPositionUpdatePeriod. Change-Id: Iedd1be8725dea32bdba6908b78c5166780a66fec
* Merge "Add FIXME to deprecate all APIs that assume a route"Glenn Kasten2015-03-161-0/+1
|\
| * Add FIXME to deprecate all APIs that assume a routeGlenn Kasten2015-03-131-0/+1
| | | | | | | | Change-Id: I84e160e3945004338c808edd86b5dbbca1e12874
* | Update commentsGlenn Kasten2015-03-131-2/+2
|/ | | | Change-Id: I37d3c4ce22b74fe8581a886fe5a7f9fef8266dad
* AudioRecord: use audio attributes instead of audio source.Eric Laurent2014-11-251-4/+7
| | | | | | | | | | | | | | | | Added AudioRecord constructor with audio attributes. Replaced AudioPolicymanager::getInput() by getInputForAttr(). No new functionality for now. Also: - Fixed warnings in AudioPolicyManager - Allocate audio session ID before calling getOutputForAttr() in AudioTrack. Bug: 16006090. Change-Id: I15df21e4411db688e3096dd801cf579d76d81711
* Move AudioRecord frame count calculations to serverGlenn Kasten2014-07-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Buffer frame count and notification frame count are now calculated by server instead of by client. The server has more information and can do a better job. Also fix a few bugs: - If a fast track was re-created, even with same pipe depth, it would fail. Now it can correctly re-create a fast track provided the pipe depth is same. - Notification frame count for fast tracks was calculated by client as 1/2 of the total frame count, which is a large value due to the pipe. Now the notification frame count is set by server to the HAL frame count. This should reduce latency for fast tracks. - EVENT_OVERRUN were happening frequently when there was sample rate conversion, because the client didn't know about the sample rate conversion, and under-estimated the necessary buffer size. Now since server calculates the buffer sizes, EVENT_OVERRUN is unlikely. - RecordThread::createRecordTrack_l was checking for mono and stereo for fast tracks. This is not necessary, and now we can handle a multi-channel fast track. Bug: 7498763 Change-Id: I0c581618e8db33084d5ff9ed50a592990c9749e8
* Add new API AudioRecord::notificationFrames()Glenn Kasten2014-07-031-0/+5
| | | | Change-Id: I27fb888f01ed547242ffaa8d4626d38c7999ad53
* 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
|\ \ | |/ |/|