summaryrefslogtreecommitdiffstats
path: root/include/media/SoundPool.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-09-24 09:53:27 -0700
committerEric Laurent <elaurent@google.com>2013-09-24 11:59:59 -0700
commit3d00aa6de95fb46e36f2bab4e3facdf0b96acf06 (patch)
tree1ad12df4c11ca37280cbe6850eed9bff1e0a2f35 /include/media/SoundPool.h
parent402dfba6dcd68f5fd8d8921f9751f3e47eb1449d (diff)
downloadframeworks_av-3d00aa6de95fb46e36f2bab4e3facdf0b96acf06.zip
frameworks_av-3d00aa6de95fb46e36f2bab4e3facdf0b96acf06.tar.gz
frameworks_av-3d00aa6de95fb46e36f2bab4e3facdf0b96acf06.tar.bz2
soundpool: allocate shared memory heap by client
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
Diffstat (limited to 'include/media/SoundPool.h')
-rw-r--r--include/media/SoundPool.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/media/SoundPool.h b/include/media/SoundPool.h
index 9e5654f..2dd78cc 100644
--- a/include/media/SoundPool.h
+++ b/include/media/SoundPool.h
@@ -22,6 +22,8 @@
#include <utils/Vector.h>
#include <utils/KeyedVector.h>
#include <media/AudioTrack.h>
+#include <binder/MemoryHeapBase.h>
+#include <binder/MemoryBase.h>
namespace android {
@@ -85,6 +87,7 @@ private:
int64_t mLength;
char* mUrl;
sp<IMemory> mData;
+ sp<MemoryHeapBase> mHeap;
};
// stores pending events for stolen channels