summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorKevin Rocard2018-08-17 19:13:35 -0500
committerandroid-build-merger2018-08-17 19:13:35 -0500
commit0005ac0e559a0913834c32c639215c497cbb4068 (patch)
tree48d9b9c3562ba95aabab0cf0a407d608fad10019 /audio
parent616d82ddc69df6877222c63c06eccecf30638ee4 (diff)
parent54c3572e99a78b811e9bbaabc0c386de703aeec1 (diff)
downloadplatform-hardware-interfaces-0005ac0e559a0913834c32c639215c497cbb4068.tar.gz
platform-hardware-interfaces-0005ac0e559a0913834c32c639215c497cbb4068.tar.xz
platform-hardware-interfaces-0005ac0e559a0913834c32c639215c497cbb4068.zip
Merge changes from topic "share-buffer"
am: 54c3572e99 Change-Id: I4a8bb74e3dee81cdd0fc478c49acd0771467f227
Diffstat (limited to 'audio')
-rw-r--r--audio/core/all-versions/default/include/core/all-versions/default/Stream.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/audio/core/all-versions/default/include/core/all-versions/default/Stream.h b/audio/core/all-versions/default/include/core/all-versions/default/Stream.h
index 375759dc..7cf12dd4 100644
--- a/audio/core/all-versions/default/include/core/all-versions/default/Stream.h
+++ b/audio/core/all-versions/default/include/core/all-versions/default/Stream.h
@@ -169,6 +169,8 @@ Return<void> StreamMmap<T>::createMmapBuffer(int32_t minSizeFrames, size_t frame
169 bool applicationShareable = 169 bool applicationShareable =
170 halInfo.flags & AUDIO_MMAP_APPLICATION_SHAREABLE || halInfo.buffer_size_frames < 0; 170 halInfo.flags & AUDIO_MMAP_APPLICATION_SHAREABLE || halInfo.buffer_size_frames < 0;
171 halInfo.buffer_size_frames = abs(halInfo.buffer_size_frames); 171 halInfo.buffer_size_frames = abs(halInfo.buffer_size_frames);
172 info.sharedMemory = // hidl_memory size must always be positive
173 hidl_memory("audio_buffer", hidlHandle, frameSize * halInfo.buffer_size_frames);
172#ifdef AUDIO_HAL_VERSION_2_0 174#ifdef AUDIO_HAL_VERSION_2_0
173 if (applicationShareable) { 175 if (applicationShareable) {
174 halInfo.buffer_size_frames *= -1; 176 halInfo.buffer_size_frames *= -1;
@@ -178,9 +180,6 @@ Return<void> StreamMmap<T>::createMmapBuffer(int32_t minSizeFrames, size_t frame
178 halInfo.flags | (applicationShareable ? MmapBufferFlag::APPLICATION_SHAREABLE 180 halInfo.flags | (applicationShareable ? MmapBufferFlag::APPLICATION_SHAREABLE
179 : MmapBufferFlag::NONE); 181 : MmapBufferFlag::NONE);
180#endif 182#endif
181
182 info.sharedMemory =
183 hidl_memory("audio_buffer", hidlHandle, frameSize * halInfo.buffer_size_frames);
184 info.bufferSizeFrames = halInfo.buffer_size_frames; 183 info.bufferSizeFrames = halInfo.buffer_size_frames;
185 info.burstSizeFrames = halInfo.burst_size_frames; 184 info.burstSizeFrames = halInfo.burst_size_frames;
186 } 185 }