summaryrefslogtreecommitdiffstats
path: root/include/media/AudioTrack.h
Commit message (Collapse)AuthorAgeFilesLines
* nuplayer: Enable PCM offload for any sourceSteve Kondik2015-12-291-1/+1
| | | | | | | | | * Use the raw PCM format to perform the early open of the audio sink. This ensures that the renderer will do the same. * Fill in stubs for timestamp and position calculation. This fixes underruns and other issues. Change-Id: I8d761e523194cc12f387b4b2aa1594536e56da01
* AudioTrack: Handle timestamp queries for Track OffloadAlexy Joseph2015-11-151-0/+1
| | | | | | | | Handle timestamp queries for Track offload session cleanly Change-Id: I93759c0e186e4286037837787057960ee52875d7 CRs-Fixed: 933740
* libmedia : audio: handle set playback rate when direct pcm usedvivek mehta2015-10-241-0/+1
| | | | | | | | | - In direct PCM usecase if setplayback rate is called then invalidate the common block and send empty offload structure below to use default path. CRs-Fixed: 916660 Change-Id: I6df7c10b7115c77a19564e2f9fabc511d76a2410
* AVCustomizations: Enable 16 and 24 bit PCM offload.Preetam Singh Ranawat2015-10-061-0/+1
| | | | | | | | | | | | -create extended decoder and renderer -add change to pass bit width and format info to renderer. -add change for PCM conversions -add changes for time calucation Conflicts: media/libmediaplayerservice/nuplayer/NuPlayer.cpp Change-Id: I3363140fad441a7746884076c40b46e777f2e06e
* Stagefright: Make classes customizable and add AV extensionsPraveen Chavan2015-10-061-0/+2
| | | | | | | | | | | Change access modifiers and qualify methods with virtual, to allow extensions. Add facility for loading customizations (Extended classes) dynamically. Conflicts: media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp Change-Id: Icc8965754fb1c73175a13a9ad24c19665ad60988
* Return DEAD_OBJECT if getTimestamp cannot restore trackAndy Hung2015-06-181-0/+6
| | | | | Bug: 21699132 Change-Id: I90443f8674ed949e2546048b231be75cd6fe6615
* Fix AudioTrack comments relating to use of restoreTrack_l()Andy Hung2015-06-181-0/+6
| | | | | Bug: 21699132 Change-Id: Ib0d029a5e28676aeffbbbafc88c52a17367a413c
* Improve AudioTrack offload timestamp startup glitch detectorAndy Hung2015-06-041-0/+1
| | | | | | | | | | | | | New or existing glitch behavior for Nexus 5 offload audio: we receive several 0 timestamps, then we get a stale timestamp (very large), then a few ms later we get a correct nonzero timestamp. We attempt to hide the glitch because the retrograde timestamp correction makes the glitch "sticky". Bug: 21633313 Change-Id: I39153af718c151f9435e7d315651a811f72743da
* Compute sleep time when AudioTrack client callback returns no PCM dataAndy Hung2015-06-031-6/+14
| | | | | | | | | | | | Callbacks can go into a sleep-wait cycle if the client/app is unable to deliver data. This can happen if the buffer is large, or if the client/app cannot keep the buffer filled, or upon a stream end condition. We improve the sleep time computation for AudioTrack PCM callbacks. This minimizes the number of callbacks to NuPlayerRenderer. Bug: 21198655 Change-Id: I4247798a6638def2f0d8f1b46f60323482065cb2
* Merge "Store server latency, sample rate, framecount information in ↵Andy Hung2015-06-021-0/+7
|\ | | | | | | AudioTrack" into mnc-dev
| * Store server latency, sample rate, framecount information in AudioTrackAndy Hung2015-06-011-0/+7
| | | | | | | | | | Bug: 21198655 Change-Id: I24590196642a97ea5d61bc6356f0aff782bd37d3
* | Remove EVENT_NEW_TIMESTAMP symbol until fully implementedGlenn Kasten2015-06-011-0/+2
|/ | | | Change-Id: I8e5dda004580ee97258d8d82721edee24ec2b929
* libmediaplayerservice: try to open audio sink in offload mode in error.Ronghua Wu2015-05-221-3/+12
| | | | | | Bug: 19061432 Bug: 21370108 Change-Id: Iaa757555ef37fd1ac87b6e2d5a9969bb58cc5ebc
* Implement audio device callbackEric Laurent2015-05-061-1/+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
* AudioTrack: reduce retrograde motion spewPhil Burk2015-05-011-0/+1
| | | | | Change-Id: I96aced52b136ceea924aa3d9ef56374dd4c49784 Signed-off-by: Phil Burk <philburk@google.com>
* stagefright: support setting/getting playback/sync config in MediaSyncLajos Molnar2015-04-301-0/+6
| | | | | | | Bug: 18249558 Bug: 19666434 Bug: 20057497 Change-Id: I5868b17423d7c20cfaf4a399f3eb67bfba440605
* AudioTrack: fix spurious retrograde messagesPhil Burk2015-04-291-0/+3
| | | | | | | | | | | The retrograde motion was confused by some positions coming from the DSP on offloaded tracks. So the retrograde check was moved up into AudioTrack.cpp. This allows us to take advantage of the checks for invalid positions based on timing. Bug: 2047891 Change-Id: Ifcad2349201443a7f1711347c203297100449536 Signed-off-by: Phil Burk <philburk@google.com>
* Explicit routing in AudioRecordPaul McLean2015-04-281-1/+1
| | | | Change-Id: I9cc5d54883a3e5c75d553fabb619fc8e49f4f9e5
* 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