diff options
author | Glenn Kasten <gkasten@google.com> | 2014-05-07 08:43:45 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2014-05-07 15:14:20 -0700 |
commit | b880f5e5fc07397ddd09a94ba18bdf4fa62aae00 (patch) | |
tree | d90a68a7e3684a24909bbe85f57378656e043d01 /services/audioflinger/Threads.h | |
parent | 0dd3c9cb0ed66888c224a97d817701df6c3b2655 (diff) | |
download | frameworks_av-b880f5e5fc07397ddd09a94ba18bdf4fa62aae00.zip frameworks_av-b880f5e5fc07397ddd09a94ba18bdf4fa62aae00.tar.gz frameworks_av-b880f5e5fc07397ddd09a94ba18bdf4fa62aae00.tar.bz2 |
Add a per-thread heap that is read-only to clients
Change-Id: I401263566ca20fbfb565689c8fa99458d3b283b2
Diffstat (limited to 'services/audioflinger/Threads.h')
-rw-r--r-- | services/audioflinger/Threads.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h index 5617c0c..8ea8683 100644 --- a/services/audioflinger/Threads.h +++ b/services/audioflinger/Threads.h @@ -226,6 +226,13 @@ public: virtual status_t setSyncEvent(const sp<SyncEvent>& event) = 0; virtual bool isValidSyncEvent(const sp<SyncEvent>& event) const = 0; + // Return a reference to a per-thread heap which can be used to allocate IMemory + // objects that will be read-only to client processes, read/write to mediaserver, + // and shared by all client processes of the thread. + // The heap is per-thread rather than common across all threads, because + // clients can't be trusted not to modify the offset of the IMemory they receive. + // If a thread does not have such a heap, this method returns 0. + virtual sp<MemoryDealer> readOnlyHeap() const { return 0; } mutable Mutex mLock; @@ -947,6 +954,8 @@ public: virtual status_t initCheck() const { return (mInput == NULL) ? NO_INIT : NO_ERROR; } + virtual sp<MemoryDealer> readOnlyHeap() const { return mReadOnlyHeap; } + sp<AudioFlinger::RecordThread::RecordTrack> createRecordTrack_l( const sp<AudioFlinger::Client>& client, uint32_t sampleRate, @@ -1021,4 +1030,6 @@ private: // For dumpsys const sp<NBAIO_Sink> mTeeSink; + + const sp<MemoryDealer> mReadOnlyHeap; }; |