summaryrefslogtreecommitdiffstats
path: root/media/libmedia/SoundPool.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix type of AudioTrack/AudioRecord parameter frameCountGlenn Kasten2014-02-281-1/+1
| | | | | | It's size_t consistently Change-Id: I29638ef59ac773218025f2403a3508a307b487e0
* Fix whitespaceGlenn Kasten2014-02-071-1/+2
| | | | Change-Id: I9add0872030a26933f6b6dad1be299154611cc56
* FINAL ATTEMPT: HTTP services are now provided from JAVA and made available ↵Andreas Huber2014-02-041-1/+9
| | | | | | to media code Change-Id: I9f74a86e70422187c9cf0ca1318a29019700192d
* Fix some (but not all) unused parameter warningsGlenn Kasten2013-12-191-2/+2
| | | | Change-Id: Ia99e23a0b46db3f3e6aa46f9018e63c14f4af369
* Clean up channel mask handlingGlenn Kasten2013-10-301-4/+3
| | | | | | | | | | | Use type audio_channel_mask_t instead of uint32_t. Use function audio_channel_out_mask_from_count() to convert from channel count to channel mask instead of hard-coded assumption. Rename 'channels' to 'channelMask' to avoid confusion with channel count. Change-Id: I21a85e668458b773d108f95c2381eef9c4816251
* SoundPool: handle new audio track eventEric Laurent2013-10-121-2/+7
| | | | | | | | | | | | If the AudioTrack is torn down, SoundPool will never receive the buffer end event and the track will stay active for ever. The fix consists in stopping the AudioTrack when a new audiotrack event is received. Bug: 11193583. Change-Id: I9876eb2a8f75c601368f669acd67b0accf6e2736
* soundpool: allocate shared memory heap by clientEric Laurent2013-09-241-18/+22
| | | | | | | | | | | | | | | | | | | | | | | Current SoundPool implementation allocates the shared memory heap containing decoded PCM samples in mediaserver process. When mediaserver process crashes, the shared memory heaps allocated by AudioCache cannot be mapped anymore in the new instance of mediaserver. This causes a silent failure to end playback of new sounds because AudioFlinger believes the new AudioTracks are opened in streaming mode and not static mode: it sees a NULL shared memory pointer when the track is created. The fix consists in allocating the memory heap in the client process. Thus the heap is not lost when mediaserver restarts. The global memory usage is the same as this is shared memory. Also added a way to detect that a shared memory is passed when the track is created but cannot be mapped on mediaserver side. Also fix a crash in SoundPool when ALOGV is enabled. Bug: 10894793. Change-Id: Ice6c66ec3b2a409d75dc903a508b6c6fbfb2e8a7
* Revert "Workaround slow AudioTrack destruction"Glenn Kasten2013-09-201-23/+0
| | | | | | This reverts commit 8bbbd7da02fac3de40139af19f7cf7a7cc3cc824. Change-Id: I269a6c445cbce33451b6a9e74223e36e6abbdbe0
* Workaround slow AudioTrack destructionGlenn Kasten2013-09-181-0/+23
| | | | | Bug: 10809586 Change-Id: I5f30d4deb1233e8ade8967568e40684ef680c395
* Partial fix for SoundPool not terminatingGlenn Kasten2013-09-181-2/+2
| | | | | | | | | | | SoundPool was waiting for EVENT_UNDERRUN only to indicate end of clip. In J, AudioTrack delivered both EVENT_UNDERRUN followed by EVENT_BUFFER_END. However, as of K, AudioTrack is only delivering EVENT_BUFFER_END (this lack of EVENT_UNDERRUN is another bug which still needs to be fixed). The workaround is to also respond to EVENT_BUFFER_END in SoundPool. Bug: 10787103 Change-Id: Id68a23bddd6dd9df6c49c55138197260d71ca468
* Fix SoundPool.play() loopingGlenn Kasten2013-09-111-2/+2
| | | | | | | | | | | | This is done by configuring SoundPool for shared memory and fast track. Previously SoundPool used a streaming track, and looping in streaming mode relied on the ability to loop the most recently enqueued data. That 'feature' was lost in the new implementation of streaming, so we're now switching from streaming mode to shared memory mode. Shared memory mode had always been desired, but was blocked by bug 2801375 which is fixed now. Bug: 10171337 Change-Id: I2a938e3ffafa2a74d5210b4198b50db20ad5da0e
* Include what is neededGlenn Kasten2013-07-021-6/+0
| | | | | | | Remove old includes. Header files only include other header files that they directly need themselves. Change-Id: Ic471386808d9f42ea19ccbd59cb50a5f83a89dd0
* Use sp<AudioTrack> instead of raw AudioTrack *Glenn Kasten2013-06-031-8/+6
| | | | | | | | | | | | | | | | | | | | | This change prepares for the new implementation of AudioTrack client, which will require clients to use only sp<AudioTrack>, not raw AudioTrack *. A raw delete will cause a race condition during AudioTrack destruction. AudioTrack was made a RefBase by commit b68a91a70bc8d0d18e7404e14443d4e4020b3635 on 2011/11/15, when it was needed by OpenSL ES (for the callback protector). At that time, the only other client that was also converted from AudioTrack * to sp<AudioTrack> was android.media.AudioTrack JNI in project frameworks/base (file android_media_AudioTrack.cpp). Details: * Use .clear() instead of delete followed by = NULL. * ALOG %p need .get(). * sp<> don't need to be listed in constructor initializer, if initially 0. * Use == 0 for sp<> vs == NULL for raw pointers. * Use if (sp != 0) instead of if (raw). Change-Id: Ic7cad25795d6e862e112abdc227b6d33afdfce17
* delete -> freeMarco Nelissen2012-11-191-1/+1
| | | | | | Strings duplicated with strdup() should be free()d, not deleted. Change-Id: I42bb3df9625bb8d35f80b02d15364b94c36496f8
* Use size_t for frame countsGlenn Kasten2012-11-151-1/+1
| | | | | | Also fix typo: bufferCount should be frameCount. Change-Id: Ibed539504db75ef99dc21c8ff1bf2987122063a5
* Use uint32_t for sample rateGlenn Kasten2012-11-141-1/+1
| | | | Change-Id: Ie240b48fb54b08359f69ecd4e5f8bda3d15cbe80
* Enable fast track for SoundPoolGlenn Kasten2012-05-011-1/+1
| | | | Change-Id: Ia80b3a7738e4c5dbe2bd5b0f55f0ca49943e2f64
* rename audio policy output flagsEric Laurent2012-04-181-2/+2
| | | | Change-Id: I27c46bd1d1b2b5f96b87af7d05b951fef18a1312
* AV Android make files changesJames Dong2012-03-281-1/+1
| | | | | | | o plus a few file relocation: ActivityManager.cpp/h, SoundPool.h, etc o remove some runtime dependencies to libandroid, libandroid_runtime, etc Change-Id: I047a47c5fb361dd5cf85cd98798c39f629a75d10
* reorganize SoundPool and JetPlayer code.Eric Laurent2012-03-261-0/+908
Reorganize SoundPool and JetPlayer code to be ready for the creation of libmedia_native. Split SoundPool between libsoundpool (JNI) and libmedia(sound pool implementation). Remove dependencies on nativehelper/jni.h from JetPlayer. Change-Id: I130c6014173b714329929dd82c5dfb70b757a610