summaryrefslogtreecommitdiffstats
path: root/media/libmedia
Commit message (Collapse)AuthorAgeFilesLines
* AudioRecord: use audio attributes instead of audio source.Eric Laurent2014-11-254-39/+75
| | | | | | | | | | | | | | | | 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
* Merge "audio policy: new getOutputForAttr() prototype." into lmp-mr1-devEric Laurent2014-11-264-223/+128
|\
| * audio policy: new getOutputForAttr() prototype.Eric Laurent2014-11-254-223/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Fix AudioTrack loop mode to play audio from buffer start" into ↵Andy Hung2014-11-252-4/+9
|\ \ | |/ |/| | | lmp-mr1-dev
| * Fix AudioTrack loop mode to play audio from buffer startAndy Hung2014-11-242-4/+9
| | | | | | | | | | Bug: 18217633 Change-Id: Ica77acf0a32832d9b04eb657ef2f4f5329f8fbda
* | audio: new routing strategies and stream typesEric Laurent2014-11-211-1/+1
|/ | | | | | | | | | | | | Added new routing strategies and stream type for internal use by audio policy manager and audio flinger: - One for accessibility to allow different routing than media - One for re-routing (remote submix) in preparation of dynamic policies - Added stream type for "internal" audio flinger tracks used for audio patches and duplication. Bug: 18067208. Change-Id: I88f884b552e51e4a49c29125e5a1204cf58ff434
* Merge "Fix missing loop count for static tracks." into lmp-mr1-devGlenn Kasten2014-11-201-22/+38
|\
| * Fix missing loop count for static tracks.Andy Hung2014-11-181-22/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | StaticAudioTrackServerProxy::framesReady() previously returned only the contiguous frames, update to return the total available frames. This resolves short-count looping in SoundPool for FastTracks. Also (1) Removes the racy condition of reading two variables and (2) Fixes buffer->mNonContig to return the correct value and (3) Restores behavior that loop count of 1 goes back to loopStart once during playback. Bug: 11830751 Bug: 12070295 Bug: 17456842 Change-Id: I64906e6036bb00a1d7375b03efe6deb69d6478ca
* | AudioSystem: fix cross deadlockEric Laurent2014-11-201-43/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not hold gLockAPS when calling AudioPolicyService::registerClient() in get_audio_policy_service(). registerClient() will need to acquire the AudioPolicyService mutex and if at the same time a method called from AudioPolicyService (with mutex held) calls back into AudioSystem and get_audio_policy_service() a cross deadlock occurs. Same preventive fix for get_audio_flinger(). Use a separate mutex for notification client list in AudioPolicyService. This prevents deadlocking if registerClient() is called as a consequence of AudioFlinger calling back into AudioPolicyManager while executing a method with AudioPolicyService locked Bug: 18403952. Bug: 18450065. Change-Id: Ia832e41aede8bc6c843fc615508fbdd74e0863b5
* | Merge "AudioSystem: Add mutex for output cache" into lmp-mr1-devEric Laurent2014-11-191-37/+47
|\ \
| * | AudioSystem: Add mutex for output cacheEric Laurent2014-11-191-37/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix cross deadlock with AudioFlinger by adding a dedicated mutex to protect access to cached output list and parameters. Bug: 18410728. Change-Id: Ia31283b1972d8865a46e84e63695173c187eb781
* | | audio policy: do not prevent routing to A2DP when suspended.Eric Laurent2014-11-171-0/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow A2DP sink selection even if A2DP is suspended. It is not because use of A2DP is temporarily disabled by SCO selection that the policy rule routing a given use case to A2DP should be altered. The source will be routed to A2DP but it will remain silent until suspend condition is cleared which is the purpose of suspend mode. Also make sure that accessibility prompts are audible while in call by forcing stream type to STREAM_VOICE_CALL. Fix inconsistent logic between AudioTrack::setStreamTypeFromAttributes() and AudioPolicyManager::getStrategyForAttr() Bug: 18095151. Change-Id: I1c75dd8288ed3dd494eb942060eac9c9660dca50
* | remove AudioSystem::getOutputSamplingRateForAttr()Eric Laurent2014-11-122-28/+15
|/ | | | | | | | It is safer to query the output sampling rate once the output have been acquired by calling getOutputForAttr(). Bug: 16009464. Change-Id: Ib561facd19fba5359a6b837d75f1a1cd2dc51b29
* Merge "Improve AudioTrack recovery from mediaserver death" into lmp-mr1-devGlenn Kasten2014-11-072-19/+31
|\
| * Improve AudioTrack recovery from mediaserver deathGlenn Kasten2014-11-052-19/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Fix race condition in handling of binder death notifications. AudioSystem has a mixture of APIs for both ordinary app clients, and the AudioFlinger and AudioPolicy services within mediaserver. Due to this mix of uses, it is possible for there to be "surprising" sequences of calls on the call stack. Previously, we used a single mutex for all global variables, but this caused a deadlock. To avoid the deadlock, we unlocked the mutex during the critical sequence of calls. But this was a a crucial place where it should have stayed locked; see Change-Id I315c1c5066f62b05e1c13b04fae1272b5fbce977 Now we use separate mutexes for the AudioFlinger, AudioPolicy, and audio port related global variables. This allows us to correctly hold each mutex throughout the atomic region, even when AudioFlinger calls AudioPolicy via AudioSystem, or vice-versa. 2. AudioSystem::clearAudioConfigCache now clears the IAudioFlinger reference. 3. Make AudioSystem::get_audio_policy_service more like get_audio_flinger. Bug: 18242291 Change-Id: I9761443d8337df5bf66d4ca2316a9fd0bd11be94
* | Merge "AudioSystem: remove obsolete method." into lmp-mr1-devEric Laurent2014-11-071-15/+0
|\ \
| * | AudioSystem: remove obsolete method.Eric Laurent2014-11-061-15/+0
| | | | | | | | | | | | | | | Bug: 18067208. Change-Id: I9bbf9088485f5162c765ca504d9b784b956234c6
* | | Merge "Fix memory leak" into lmp-mr1-devGlenn Kasten2014-11-071-3/+3
|\ \ \ | |/ / |/| |
| * | Fix memory leakGlenn Kasten2014-11-061-3/+3
| | | | | | | | | | | | Change-Id: I3f4110a88679b7e7841f40c6acdbf5dcde40fb19
* | | Merge "Pass resolution to Crypto plugin on format change" into lmp-mr1-devJeff Tinker2014-11-061-1/+21
|\ \ \
| * | | Pass resolution to Crypto plugin on format changeJeff Tinker2014-11-031-1/+21
| | | | | | | | | | | | | | | | | | | | Change-Id: I56cd557ce3525fe625db8c312d2557d3c8b51101 related-to-bug: 16034599
* | | | Merge "Add missing secure stop methods" into lmp-mr1-devJeff Tinker2014-11-061-2/+41
|\ \ \ \ | |/ / / | | / / | |/ / |/| |
| * | Add missing secure stop methodsJeff Tinker2014-10-311-2/+41
| | | | | | | | | | | | | | | | | | | | | b/18053197 b/18076411 Change-Id: I923dc893d48c70bf17980007b32f0ac5dfd22896
* | | IAudioPolicyService: bound array size in queryDefaultPreProcessingEric Laurent2014-11-051-3/+6
| |/ |/| | | | | | | Bug: 18226810. Change-Id: Ib8e2bfe835a8681aac50bf23161db14e50c9a124
* | Merge "audio: fix talkback why alarm is playing" into lmp-mr1-devEric Laurent2014-11-041-4/+11
|\ \
| * | audio: fix talkback why alarm is playingEric Laurent2014-11-031-4/+11
| |/ | | | | | | | | | | | | | | | | Convert attributes usage "assistance accessibility" to a stream type guarantying that the prompt is audible and not muted by policy manager. Bug: 17994328. Change-Id: I89f53f2ce84b499b859336c0a1a3a0332ee670f5
* | Support speaker routing for FLAG_BEACONJean-Michel Trivi2014-10-311-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for routing audio stream to the speaker when audio attributes carry the FLAG_BEACON value: - associate streams with FLAG_BEACON to the up-to-now unused STREAM_TTS ("Transmitted Through Speaker"). The remapping happens in AudioTrack. - AudioPolicyManager: define new strategy for handling the Beacon behavior, that only goes to speaker. Define new volume curves for STREAM_TTS that are not silence only for the speaker device category. Keep ref count of other streams and never play Beacon streams when anything else is playing: either don't start playback if something else is playing, or unmute STREAM_TTS when it's allowed to play and mute when it's done. - Take into account muting latency when starting an output. Bug 15415971 Change-Id: I26539c7ec1a486accd85bbeb1623e9c7d3a1192f
* | AudioTrack::flush() will no longer flush later dataGlenn Kasten2014-10-301-5/+22
|/ | | | | Bug: 17832076 Change-Id: I4915d782acb8077923e419406b0dcea5b6aab961
* Merge "libmedia: ensure mCaptureThread exit within Visualizer destructor" ↵Glenn Kasten2014-10-281-7/+12
|\ | | | | | | into lmp-mr1-dev
| * libmedia: ensure mCaptureThread exit within Visualizer destructorHaynes Mathew George2014-10-281-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If mCaptureThread doesn't exit when Visualizer instance gets destroyed, recycled member variables with random value such as danger pointer will be accessed again and causes crash. Thread which is created within Visualizer instance lifecycle should be terminated before or within destructor. CRs-Fixed: 688546 authored-by: wjiang@codeaurora.org cherry-pick from CAF commit: 4823e3d6b8c60faa4d8fee5d58728eb70e56abf2 Bug: 18159501 Change-Id: Ie0b12ae8a3b9735b6ecbac0353781b8358cad644
* | Fix AudioTrack retrograde getPosition when restoring tracksAndy Hung2014-10-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | mReleased represents the number of frames written to the track, but was cleared on start() causing a mismatch if the client wrote to the track before starting. Moved the clearing to entering the STATE_STOPPED or STATE_FLUSHED state. Bug: 18017947 Bug: 18022276 Change-Id: I3788c98c4c3c4d9cc004378432797b3f3138e22e
* | AudioTrack: fix AudioTrackThread crash upon exitEric Laurent2014-10-071-0/+3
|/ | | | | | | | | | | In case of error during createTrack_l(), there is a possibility that a newly created AudioTrackThread is resumed by requestExit() just after entering the Thread class _threadLoop() but before entering the class threadLoop(). In this case, processAudioBuffer() is executed once with mCblk == 0 and we assert. Bug: 17894033. Change-Id: I93d0d0d4dbf14bcb88dad23e6ad49d2ecd47badd
* audio: fix stream type for accessibility usageEric Laurent2014-09-253-2/+36
| | | | | | | | | Make sure that accessibility prompts are heard when a ringtone is active by forcing stream type to AUDIO_STREAM_RING when phone state is AUDIO_MODE_RINGTONE. Bug: 17558149. Change-Id: Ia3bead8052fca5cbf282c267f7b9b06014fef628
* Reduce log spam from getTimestamp errorsGlenn Kasten2014-09-191-1/+1
| | | | | Bug: 17576481 Change-Id: I07d99e7c42b7d4f0994b5a6d9c9fe8eb29fbbe40
* Merge "AudioEffect acquires session" into lmp-devJean-Michel Trivi2014-09-181-3/+10
|\
| * AudioEffect acquires sessionJean-Michel Trivi2014-09-181-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, users of audio sessions, AudioTrack and AudioRecord, are acquiring and releasing audio sessions according to their life-cycle. AudioEffect instances were not counting as users of an audio session. This caused an effect used on a session to be purged by AudioFlinger::purgeStaleEffects_l() whenever the last user of that session went away. This CL makes AudioEffect acquire and release a session when created and destroyed. Bug 15432115 Change-Id: I922532150009988d43872f9b5928044a830ae0b3
* | Fix AudioTrack offloaded timestamp handling.Andy Hung2014-09-171-5/+93
|/ | | | | | | | | | 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-18/+73
| | | | | | | | | | | | | | | | | | | 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
* CamcorderProfile: Add QUALITY_HIGH_SPEED_2160PZhijun He2014-09-091-0/+1
| | | | | Bug: 17059255 Change-Id: Ic6b272e4ceec8fc852c9eb787370f4d366dad0ac
* Fix potential deadlock between AudioPolicyService and AudioSystemAndy Hung2014-09-081-1/+5
| | | | | Bug: 17109761 Change-Id: I315c1c5066f62b05e1c13b04fae1272b5fbce977
* Cache audio attributes when player not availableJean-Michel Trivi2014-09-051-2/+19
| | | | | | | | | | | Cache the audio attributes stored in a Parcel in the client-side MediaPlayer object if they are set through setParameter() before the server-side MediaPlayer is available. Apply them when the player is prepared. Bug 17280746 Change-Id: I72f1a7fc4e2b076fae8cbdede77a2f74e98b2a03
* Merge "Use CharacterEncodingDetector in metadataretriever" into lmp-devMarco Nelissen2014-09-035-183/+51
|\
| * Use CharacterEncodingDetector in metadataretrieverMarco Nelissen2014-09-025-183/+51
| | | | | | | | | | | | | | | | | | | | | | instead of media scanner. This way the java MediaMetadataRetriever API will give the same result as the media scanner. Also apply some tweaks to the encoding detector to improve handling of ISO-8859-1 tags. Bug: 16302581, 17205395 Change-Id: I1682a7a6a8bf04cffaa455044ba72dd7fd152d49
* | [AU]Sync libmedia/Android.mk modification from KLP-SproutHochi Huang2014-08-291-1/+1
|/ | | | | | Bug: 17322146 Change-Id: If29fbd87252710bd794f2e0bb270bc846380ef1d Signed-off-by: Hochi Huang <hochi.huang@mediatek.com>
* stagefright/media: add support for codec features with text valueLajos Molnar2014-08-141-0/+6
| | | | | Bug: 11990470 Change-Id: I7600d999c5f4b6821d825d25fa7e8a2bb5a80c46
* Merge "MediaCodecList: handle errors gracefully" into lmp-devLajos Molnar2014-08-121-0/+8
|\
| * MediaCodecList: handle errors gracefullyLajos Molnar2014-08-121-0/+8
| | | | | | | | | | | | | | | | | | Handle missing OMX codecs, and codecs that do not load. Fix NULL dereference when initializing codec with no type. Bug: 16907578 Bug: 16905025 Change-Id: I5d103db36ebb029d1aab03222bf6e9324beb1566
* | MediaCodecList: don't return referencesLajos Molnar2014-08-121-2/+2
|/ | | | Bug: 16905025 Change-Id: I5b42b294f0cc785b8e4dda0e82c8f8377a46f487
* Merge "Extend downsampling ratios greater than 2:1" into lmp-devAndy Hung2014-08-111-4/+4
|\
| * Extend downsampling ratios greater than 2:1Andy Hung2014-08-111-4/+4
| | | | | | | | | | | | | | | | | | Also improve robustness to choice of sampling rate or buffer size such that increasing either by 10x does not cause overflow. Bug: 12979141 Bug: 15933066 Change-Id: If7989bd745d1bee3bdf811b8b7c978543ccafb65