summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-05-08 15:40:09 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-08 15:40:09 +0000
commiteee8fc78703dd77244407250402fe7464fe50fd3 (patch)
tree05ce4a680a40cdf961de44a3b366e0898d7c4511 /services/audioflinger/Threads.cpp
parentcdedf74e34117f9834055973880ee728f11d97cd (diff)
parentb880f5e5fc07397ddd09a94ba18bdf4fa62aae00 (diff)
downloadframeworks_av-eee8fc78703dd77244407250402fe7464fe50fd3.zip
frameworks_av-eee8fc78703dd77244407250402fe7464fe50fd3.tar.gz
frameworks_av-eee8fc78703dd77244407250402fe7464fe50fd3.tar.bz2
Merge "Add a per-thread heap that is read-only to clients"
Diffstat (limited to 'services/audioflinger/Threads.cpp')
-rw-r--r--services/audioflinger/Threads.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index a916b32..2c5a0eb 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -143,6 +143,12 @@ static const int kPriorityFastMixer = 3;
// See the client's minBufCount and mNotificationFramesAct calculations for details.
static const int kFastTrackMultiplier = 2;
+// See Thread::readOnlyHeap().
+// Initially this heap is used to allocate client buffers for "fast" AudioRecord.
+// Eventually it will be the single buffer that FastCapture writes into via HAL read(),
+// and that all "fast" AudioRecord clients read from. In either case, the size can be small.
+static const size_t kRecordThreadReadOnlyHeapSize = 0x1000;
+
// ----------------------------------------------------------------------------
#ifdef ADD_BATTERY_DATA
@@ -4635,6 +4641,8 @@ AudioFlinger::RecordThread::RecordThread(const sp<AudioFlinger>& audioFlinger,
#ifdef TEE_SINK
, mTeeSink(teeSink)
#endif
+ , mReadOnlyHeap(new MemoryDealer(kRecordThreadReadOnlyHeapSize,
+ "RecordThreadRO", MemoryHeapBase::READ_ONLY))
{
snprintf(mName, kNameLength, "AudioIn_%X", id);
mNBLogWriter = audioFlinger->newWriter_l(kLogSize, mName);