summaryrefslogtreecommitdiffstats
path: root/media/libmedia
Commit message (Collapse)AuthorAgeFilesLines
* Fix 64 bit compiler warnings in AudioTrackSharedAndy Hung2014-12-221-3/+3
| | | | | | | Comparisons between size_t and int64_t variables show warnings for 64 bit compilation, fix with casting. Change-Id: I3c1b12ea6eca01e49696c724a1cf1cc6b88df7aa
* am af318e28: am 0b87c0d9: am bd08223c: Merge "Fix double close."Marco Nelissen2014-12-221-0/+1
|\ | | | | | | | | * commit 'af318e2882e0b8b1a594f079eb3d10b2daa3ff7e': Fix double close.
| * am 0b87c0d9: am bd08223c: Merge "Fix double close."Marco Nelissen2014-12-221-0/+1
| |\ | | | | | | | | | | | | * commit '0b87c0d9e074384d05e6563c1b1cf5dbd5246436': Fix double close.
| | * Merge "Fix double close."Marco Nelissen2014-12-221-0/+1
| | |\
| | | * Fix double close.Bao Haojun2014-05-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch will fix the double close issue in SoundPool::doLoad(): status = MediaPlayer::decode(mFd, mOffset, mLength, &sampleRate, &numChannels, &format, mHeap, &mSize); ALOGV("close(%d)", mFd); ::close(mFd); mFd = -1; In MediaPlayerService::decode() which is called directly by MediaPlayer::decode(), the fd will be closed, and after it return, the mFd will be closed again. When the system is idle, the second close will fail with EBADFD, but if the system is busy, the mFd will be reused with another open/socket/pipe system call, and the second close will cause errors. Change-Id: If709515392cd490fea569658202524c51f8df785 Signed-off-by: Bao Haojun <baohaojun@gmail.com> Signed-off-by: Wang Liang <wangliang@smartisan.cn>
| | * | Merge "Prevent ANR when AudioTrack is paused or re-routed"Glenn Kasten2014-12-091-0/+2
| | |\ \
| | | * | Prevent ANR when AudioTrack is paused or re-routedzunkyu.lee2014-12-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If ClientProxy was interrupted by AudioTrack::pause() just before futex syscall() in obtainBuffer() was called, It will not call releaseBuffer to wake up AudioTrackThread. It puts the AudioTrackThread to sleep and then a deadlock occurs. In this case, CBLK_INTERRUPT flags can't prevent a deadlock, so this patch set mFutex to FUTEX_WAKE during interrupt() to avoid deadlock. A similar problem could occur due to re-route or recovery after mediaserver death. Bug: 18641665 Change-Id: I66fcae43af9a91eb55f6cdb52c644ee6c0999772
* | | | | Merge "Remove explicit instantiation of SingleStateQueue"Andy Hung2014-12-223-145/+0
|\ \ \ \ \
| * | | | | Remove explicit instantiation of SingleStateQueueAndy Hung2014-12-193-145/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring now possible due to changes in the Android atomic include. Change-Id: Ia0094d322d9ad3d8c186307306821376ca8002c4
* | | | | | Replace MidiFile player with a Midi extractorMarco Nelissen2014-12-181-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gets rids of a bunch of special midi handling and replaces it with an extractor that works with NuPlayer and MediaMetadataRetriever. Change-Id: I8d0f5bbdde2ca24267cf4d62ab26afe9630e0217
* | | | | | am 85aca658: am d33712d7: am 145cf5d8: Merge "audioflinger: implement ↵Eric Laurent2014-12-171-0/+5
|\ \ \ \ \ \ | | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | pause/resume for direct outputs" into lmp-mr1-dev * commit '85aca658ac7d20584b0647427256df50a5f243ef': audioflinger: implement pause/resume for direct outputs
| * | | | | am d33712d7: am 145cf5d8: Merge "audioflinger: implement pause/resume for ↵Eric Laurent2014-12-171-0/+5
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | direct outputs" into lmp-mr1-dev * commit 'd33712d7ec5dcf427cc0be9b7d2ca1c99823c8e6': audioflinger: implement pause/resume for direct outputs
| | * | | | | audioflinger: implement pause/resume for direct outputsEric Laurent2014-12-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend pause/resume support to direct output threads (was only for offload threads). If the HAL implements pause/resume, track pause/resume is forwarded to the HAL. Pause, flush, resume sequence is respected by executing the HAL calls in the playback thread (same as offload). Make sure the track flags on client side are consistent with the flags on server side. Bug: 17883772. Change-Id: I89b360d69818f7a9204bd36e3ec63a79e106ecf1
* | | | | | | Use callbacks for Midi I/OMarco Nelissen2014-12-163-21/+82
| |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having the Sonivox engine directly open the file and use stdio to read from it, use caller-provided callbacks. Change-Id: I4d775c8458c48c591a15794c4517e006dcf034e1
* | | | | | am 66b17e9d: Merge commit \'f5a968a0\' into mmGlenn Kasten2014-12-102-1/+59
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | * commit '66b17e9dfe114ae968bfb2f8ad8325527e373c65': audio policy: binder calls for dynamic audio policy mixes
| * | | | | Merge commit 'f5a968a0' into mmGlenn Kasten2014-12-102-1/+59
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | Change-Id: Ifd30546c11def40ad483f27c9d7baa4008fcbac3
| | * | | | audio policy: binder calls for dynamic audio policy mixesEric Laurent2014-12-092-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add binder calls to register and unregister dynamic mixes to AudioPolicyManager. Bug: 16009464. Change-Id: I4ef38166d0cfc88c984970969380d0cd6eb083ac
* | | | | | am b279f5ad: am c49d9cda: am 2dda40d6: Merge "audio policy: add support for ↵Eric Laurent2014-12-103-1/+125
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | custom mixes" into lmp-mr1-dev * commit 'b279f5adfa2fd6f22c87b3a7106fbb62a0b9a5d2': audio policy: add support for custom mixes
| * | | | | am c49d9cda: am 2dda40d6: Merge "audio policy: add support for custom mixes" ↵Eric Laurent2014-12-103-1/+125
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into lmp-mr1-dev * commit 'c49d9cda49dab8b7dd0376cf56476b3e1895d5c6': audio policy: add support for custom mixes
| | * | | | audio policy: add support for custom mixesEric Laurent2014-12-093-1/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for custom mixes in AudioPolicyManager. Two methods are added to register or unregister a list of custom mixes with their attributes and format. getOutputForAttr() and getInputForAttr() first look for a match in registered mixes before defaulting to normal output/input selection Remote submix device connection disconnection now takes address into account to identify the correspnoding custom mix. Bug: 16009464. Change-Id: I3f1c2a485a0fb71b1f984ed0adc9b68aa971e408
* | | | | | Remove filename based writer constructorsMarco Nelissen2014-12-102-44/+0
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MediaPlayerService can't open files (it needs an already opened file descriptor), so these were just wasting space. Change-Id: I323044a6c1814a7bff952ed71b5c7792df2abf03
* | | | | am c1b0d49c: am 82a69ea8: Prevent ANR when AudioTrack is paused or re-routedzunkyu.lee2014-12-091-0/+2
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | * commit 'c1b0d49cacde26c2420528169d157d2c778a9b0d': Prevent ANR when AudioTrack is paused or re-routed
| * | | | Prevent ANR when AudioTrack is paused or re-routedzunkyu.lee2014-12-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If ClientProxy was interrupted by AudioTrack::pause() just before futex syscall() in obtainBuffer() was called, It will not call releaseBuffer to wake up AudioTrackThread. It puts the AudioTrackThread to sleep and then a deadlock occurs. In this case, CBLK_INTERRUPT flags can't prevent a deadlock, so this patch set mFutex to FUTEX_WAKE during interrupt() to avoid deadlock. A similar problem could occur due to re-route or recovery after mediaserver death. Bug: 18641665 Change-Id: I66fcae43af9a91eb55f6cdb52c644ee6c0999772
| * | | | Track volume should be maintained even if track is restoredseunghak.han2014-12-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If track is restored when it set its volume to a non-unity value (such as mute), the volume was forced to unity again. Now, the previous volume is restored. Bug: 18570664 Change-Id: I79f34c6c7d6f535baba813fd3b8ba8e55cac8ad7
* | | | | am bde85d05: am 5458756a: Merge "Track volume should be maintained even if ↵Glenn Kasten2014-12-021-1/+5
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | track is restored" * commit 'bde85d05414cdd3888071635dd05e9ff78679d5e': Track volume should be maintained even if track is restored
| * | | | Track volume should be maintained even if track is restoredseunghak.han2014-12-011-1/+5
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | If track is restored when it set its volume to a non-unity value (such as mute), the volume was forced to unity again. Now, the previous volume is restored. Bug: 18570664 Change-Id: I79f34c6c7d6f535baba813fd3b8ba8e55cac8ad7
* | | | am 390ef843: am f20c4356: Merge "AudioRecord: use audio attributes instead ↵Eric Laurent2014-11-274-39/+75
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | of audio source." into lmp-mr1-dev * commit '390ef84373b7edd1397381f780ca235326357094': AudioRecord: use audio attributes instead of audio source.
| * | | 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
* | | | am bf14c62e: am 72bf901c: Merge "audio policy: new getOutputForAttr() ↵Eric Laurent2014-11-264-223/+128
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | prototype." into lmp-mr1-dev * commit 'bf14c62e7973ed793a3b00c2c67beca4484c1c7a': audio policy: new getOutputForAttr() prototype.
| * | | 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
* | | | | am 1e18795a: am d325005e: Merge "Fix AudioTrack loop mode to play audio from ↵Andy Hung2014-11-262-4/+9
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | buffer start" into lmp-mr1-dev * commit '1e18795a4847e9368baa7ecee146d3901b283cd0': Fix AudioTrack loop mode to play audio from buffer start
| * | | | 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
* | | | | am 1a475921: am 223fd5c9: audio: new routing strategies and stream typesEric Laurent2014-11-261-1/+1
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | * commit '1a475921c0577a4650d1bbe40a85b732d1766939': audio: new routing strategies and stream types
| * | | | 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
* | | | am f8c2d166: am a7cf01da: Merge "Fix missing loop count for static tracks." ↵Glenn Kasten2014-11-211-22/+38
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | into lmp-mr1-dev * commit 'f8c2d1665393d8e0620a7129ef3865f34489e6ef': Fix missing loop count for static tracks.
| * | | 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
* | | | | am 568689b1: am 3a2a32b5: Merge "AudioSystem: fix cross deadlock" into ↵Eric Laurent2014-11-211-43/+58
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | lmp-mr1-dev * commit '568689b169d8b0ae2cc252b88602db5e5acaa604': AudioSystem: fix cross deadlock
| * | | | 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
* | | | | am cd370c79: am de14fae7: Merge "Use standard syntax to initialize fields."Glenn Kasten2014-11-191-712/+712
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | * commit 'cd370c790a9017560874a2588da46d4538087cad': Use standard syntax to initialize fields.
| * | | | Merge "Use standard syntax to initialize fields."Glenn Kasten2014-11-191-712/+712
| |\ \ \ \
| | * | | | Use standard syntax to initialize fields.Chih-Hung Hsieh2014-11-141-712/+712
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang compiler gives warning to old gnu syntax. BUG: 18193625 Change-Id: I1b5237d60866fc357fc808f6a6955ab20418a7d8
* | | | | | am 4fd641be: am bbda5ce4: Merge "AudioSystem: Add mutex for output cache" ↵Eric Laurent2014-11-191-37/+47
|\ \ \ \ \ \ | | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | into lmp-mr1-dev * commit '4fd641be9fed70743ca4fe823b69e74c258ce275': AudioSystem: Add mutex for output cache
| * | | | | 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
* | | | | | | am bfa77b5c: am 8cd37d67: Merge "audio policy: do not prevent routing to ↵Eric Laurent2014-11-181-0/+5
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A2DP when suspended." into lmp-mr1-dev * commit 'bfa77b5c687f217e26267693306aaa6cc8a63672': audio policy: do not prevent routing to A2DP when suspended.
| * | | | | | 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
* | | | | | am 26d92768: am 34c55e3e: Merge "No need to #include atomic-inline.h if you ↵Elliott Hughes2014-11-171-1/+0
|\ \ \ \ \ \ | | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | have atomic.h." * commit '26d92768d6dac505903c96e842673ee9a57a0989': No need to #include atomic-inline.h if you have atomic.h.