summaryrefslogtreecommitdiffstats
path: root/include/media/AudioTrack.h
Commit message (Collapse)AuthorAgeFilesLines
* Use AudioPlaybackRate to hold TimestretchBufferProvider parametersRicardo Garcia2015-04-221-4/+4
| | | | | | | | Use this struct to handle the parameters for TimestretchBufferProvider all across the system. Add stretch mode and fallback mode to TimestretchBuffer Provider. Change-Id: I19099924a7003c62e48bb6ead56c785cb129fba2
* Add playback rate to AudioTrackAndy Hung2015-04-091-0/+20
| | | | | Bug: 19196501 Change-Id: I6411e1d3ce652b711a71a6d9df020cb5f60d4714
* Adding explicit routing API to AudioTrackPaul McLean2015-04-081-0/+24
| | | | Change-Id: I40c048c7644c46f4e4f7103875206c0785c4b1dc
* Remove deprecation FIXMEs for TRANSFER_OBTAIN modeGlenn Kasten2015-03-251-8/+2
| | | | Change-Id: I7f43aabdb092e1465d79cd0eea5944fff18b93db
* set() in AudioRecord and AudioTracks needs no lockGlenn Kasten2015-03-231-0/+1
| | | | Change-Id: I9d61b3d117e9b21fbbfad772d8981a5abb8fafae
* Update AudioTrack constructor and set() commentsGlenn Kasten2015-03-231-5/+12
| | | | | | Comments were missing for recently added parameters. Change-Id: I414594fed56317112be5f3b415871d77e7f7e282
* Update AudioTrack comments to match AudioRecordGlenn Kasten2015-03-231-1/+1
| | | | Change-Id: I176a4830513a0b37c38f86815fe637093b9ad52f
* AudioTrack::dump() commentGlenn Kasten2015-03-231-0/+1
| | | | Change-Id: Id3b5210293a77404189555a0c797fb099e3c6c04
* Remove dead AudioTrack::setAttributesFromStreamType()Glenn Kasten2015-03-231-2/+0
| | | | Change-Id: I34feb3f9df49458f8a81ddcced4dd769fdaca945
* Deprecate AudioRecord::getInput() and AudioTrack::getOutput()Glenn Kasten2015-03-231-0/+2
| | | | | | | Does not completely fix the bug, but is a step in the right direction. Bug: 12593118 Change-Id: Id591cd700ab58fd927ae44c71c81dac55b5cac2d
* Move AudioTrack::isOffloaded() and isDirect() variantsGlenn Kasten2015-03-231-4/+4
| | | | | | to be near each other. Change-Id: Ic26681716ea48886f0bfed23803240466db5d8fa
* WhitespaceGlenn Kasten2015-03-231-1/+1
| | | | Change-Id: I4640be948ad3caff0eb7525991398a1353e4bfe6
* Add FIXME to deprecate AudioTrack::getMinFrameCount()Glenn Kasten2015-03-231-0/+1
| | | | | | Continuation of previous change, for all APIs that assume a route Change-Id: Ia1315032cf6366f428db342b16b2e1c3b574f407
* Fix typosGlenn Kasten2015-03-231-2/+2
| | | | | | | | Fix typos in comments Add formal parameter name to declaration where it was missing Fix out of order comments Change-Id: I1de81ae82af5ca507864e4c7b959111bac898b98
* AudioTrack::obtainBuffer() now returns number of non-contiguous framesGlenn Kasten2015-03-091-3/+13
| | | | Change-Id: I1f61d7e3d057c3254babe456b4aa0f6a1809da55
* AudioTrack::releaseBuffer parameter is const *Glenn Kasten2015-03-091-1/+1
| | | | Change-Id: I31ac20863107de05b83cd7f8cd7dd61bed98e456
* AudioTrack obtain/release buffer commentsGlenn Kasten2015-03-091-12/+28
| | | | Change-Id: I0eb178d1ab4eea7f72f4c55852c19b216ca55f5f
* Allow AUDIO_FORMAT_PCM_8_BIT AudioTrack buffersAndy Hung2015-01-141-11/+5
| | | | | | | | Previously conversion to AUDIO_FORMAT_PCM_16_BIT was required. Client shared memory for static tracks and AudioFlinger track creation and buffer delivery now use native 8 bit PCM data. Change-Id: I485c07a4971fde9a25442bd43fed95019d39abcc
* Event driven wake for AudioTrackThread notification changesAndy Hung2015-01-061-1/+4
| | | | | | Used for setMarkerPosition and setPositionUpdatePeriod. Change-Id: I0d94b929438a5cd94b295d7c1884f876fae8b5e7
* Improve AudioTrack EVENT_LOOP_END and EVENT_BUFFER_END accuracyAndy Hung2015-01-061-0/+4
| | | | | | | | Fix timing computation to consider current position. Fix EVENT_LOOP_END count accuracy (some could be dropped before) for non-infinite loop static AudioTracks. Change-Id: I255f692915b55ab6f08ccd6a2365fee3f5d0a4fe
* Fix loop and position restoration in static AudioTracksAndy Hung2015-01-061-2/+5
| | | | | | | | Allow restoration of loop and position. Make position and loop synchronously readable. Bug: 17964637 Change-Id: I8cfb5036e665f55fdff5c67d27e1363ce9a8665d
* Line length 100Glenn Kasten2014-12-301-1/+1
| | | | Change-Id: I6c8fe626a3825fa9e139319656d682a57b887c97
* audio policy: new getOutputForAttr() prototype.Eric Laurent2014-11-251-5/+6
| | | | | | | | | | | | | | | | | | | | | | | Update getOutputForAttr() prototype and group all logic dealing with audio attributes to stream type conversion in audio policy manager. getOutputForAttr(): - specifies the audio session (for future use) - returns a status code - receives either stream type (for legacy) or audio attributes - returns an updated streamtype Remove logic dealing with legacy stream types to attributes conversion from AudioTrack. Use correct type for audio sessions in other APIs (startOutput() ...). releaseOutput() specifies the audio session (for future use). Bug: 18067208. Change-Id: I1bfbe9626c04c7955d77f8a70aecfad2cb204817
* Fix AudioTrack offloaded timestamp handling.Andy Hung2014-09-171-1/+10
| | | | | | | | | | getTimestamp for offloaded tracks now returns WOULD_BLOCK for situations where the timestamp is unavailable due to the previous track still flushing or the timestamp is stale. It is fixed for normal playback conditions. Bug: 14659809 Bug: 17428188 Change-Id: Ic9ec07ccabc604236979769db5c4ea2dec252660
* Clean up AudioTrack position and timestamp handlingGlenn Kasten2014-09-111-2/+18
| | | | | | | | | | | | | | | | | | | Replace epoch concept by observing and accumulating server delta positions. The advantage of using server deltas instead of absolute values is that they (1) are not sensitive to 32-bit wraparound, (2) are not sensitive to server behavior for stop(), and (3) prepare for future 64-bit client positions without requiring 64-bit positions on server. Add comments to AudioTrack::getTimestamp() and friends that the timestamp output parameter is undefined on error. Don't allow getTimestamp to return a negative frame position after stop(). Accumulate the client released frames, which may be useful for a future API. Bug: 11815245 Change-Id: I652940fa2db2f34a78c012a3ead0d9204fa29c6e
* Support for audio attributes on audio output of media playerJean-Michel Trivi2014-07-011-3/+5
| | | | Change-Id: Iae4995c98e64add1ab9e6c8ae6501515032755f5
* AudioTrack: add support for compressed audioEric Laurent2014-06-191-0/+9
| | | | | | | | | Add support for compressed audio playback by use of an AudioTrack attached to a direct output thread. Bug: 9428304. Change-Id: I4a61be9cf0e31003ca85935d6e0ee38ca8192e03
* AudioTrack construction with audio attributesJean-Michel Trivi2014-06-171-1/+8
| | | | | | | | | | | | Store audio attributes in AudioTrack class. When an AudioTrack is "set" with non null audio attributes, derive a stream type that reflects the attributes. When an AudioTrack is "set" without attributes, and only has a stream type, derive default audio attributes. Change-Id: I322b91fa9a7e193118960c5e78cdddd85d66f9ad
* Add client side support for more AUDIO_FORMAT_PCM_*Glenn Kasten2014-05-071-2/+3
| | | | | | | As much as possible, the checks for specific formats are done on server side. The only exception is 8-bit, which needs a client side workaround. Change-Id: I52fe086c039460c8dac009de03b67eb54c56a836
* Merge "Use symbol AUDIO_IO_HANDLE_NONE from <system/audio.h>"Glenn Kasten2014-03-261-1/+2
|\
| * Use symbol AUDIO_IO_HANDLE_NONE from <system/audio.h>Glenn Kasten2014-03-261-1/+2
| | | | | | | | Change-Id: Id6b1aa17558eb73e17f22b8eab6cd02e00a96dff
* | Update commentsGlenn Kasten2014-03-261-10/+2
|/ | | | Change-Id: I5776313b9b49072cd666d28880f0d07cc73f827b
* Use symbolic constants from <system/audio.h>Glenn Kasten2014-03-251-5/+0
| | | | | | | | AUDIO_INTERLEAVE_* AUDIO_STREAM_MIN AUDIO_SESSION_ALLOCATE Change-Id: I31dd6f327204685e50716079ce21c4ba206dff11
* Remove name output parameter from createTrackGlenn Kasten2014-03-141-1/+0
| | | | | | | It was only used for one log. A better solution will be a per-track unique ID. Change-Id: Ia440e02ae4a5a4019a9a2d08970e1ee93ac4c3a3
* Merge "AudioTrack non-blocking write"Jean-Michel Trivi2014-03-111-1/+4
|\
| * AudioTrack non-blocking writeJean-Michel Trivi2014-03-031-1/+4
| | | | | | | | | | | | Bug 7531968 Change-Id: I6d0e79fa8cab5b6eb36bcc34977f4cf0d7eec8ea
* | AudioTrack: When paused, return cached playback positionHaynes Mathew George2014-03-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | An offload output can be re-used between two audio tracks having the same configuration. A timestamp query for a paused track while the other is running would return an incorrect time. To fix this, cache the playback position on a pause() and return this time when requested until the track is resumed. Bug: 12826612. Change-Id: I324112ea9827e52fff53ef44cd8513c8d85a0bc4
* | Fix type of AudioTrack/AudioRecord parameter frameCountGlenn Kasten2014-02-281-3/+3
| | | | | | | | | | | | It's size_t consistently Change-Id: I29638ef59ac773218025f2403a3508a307b487e0
* | Fix type of AudioTrack/AudioRecord parameter notificationFramesGlenn Kasten2014-02-281-3/+3
|/ | | | | | It's uint32_t consistently Change-Id: If8298c7e9aeea2b951fe47b675adbdf48d104846
* Track pid for each sessionMarco Nelissen2014-02-111-3/+7
| | | | | | so they can be properly freed. Change-Id: I6f389035bc29e74e7c367c1c6d0252b180f666b3
* Fix clang warnings in AudioFlingerGlenn Kasten2014-02-101-1/+1
| | | | Change-Id: I0fa61025c979709ad7d655bc717df5f194b6089e
* Remove the redundant parameters from createTrack_l()Glenn Kasten2014-01-241-7/+1
| | | | | | | | | | AudioRecord::openRecord_l() code was refactored earlier to remove the redundant parameters: > Change-Id: I124dce344b1d11c2dd66ca5e2c9aec0c52c230e2 This changelist refactors AudioTrack similarly. Change-Id: Iefd2bd662870ea81d04eff7b7c26f9c8b0dadd26
* Refactor code related to I/O handles to reduce chance for leaksGlenn Kasten2014-01-241-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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 "Make copy of audio_offload_info_t for future use"Glenn Kasten2014-01-171-0/+3
|\
| * Make copy of audio_offload_info_t for future useGlenn Kasten2014-01-161-0/+3
| | | | | | | | Change-Id: I515970aa0660418d5d1640fb1bf477e112c89bdd
* | Merge "Move up initialization of mFormat, mStreamType, and mSharedBuffer ↵Glenn Kasten2014-01-171-1/+1
|\ \ | |/ | | | | earlier"
| * Move up initialization of mFormat, mStreamType, and mSharedBuffer earlierGlenn Kasten2014-01-161-1/+1
| | | | | | | | | | | | | | | | | | This will allow removal of most of the parameter list to createTrack_l. Also check for valid stream type at client so we can log a better error message. Change-Id: Ia7176896d47fbb49106119fca26d9de8e7efe859
* | Merge "Unify comments between AudioTrack and AudioRecord"Glenn Kasten2014-01-171-3/+4
|\ \ | |/ |/|
| * Unify comments between AudioTrack and AudioRecordGlenn Kasten2014-01-141-6/+8
| | | | | | | | Change-Id: I00a1025e2891a1c96218b3c2187eaddda6614ebc
* | Merge "Document AudioTrack mFrameCount and mReqFrameCount better"Glenn Kasten2014-01-151-3/+4
|\ \