diff options
author | Tyler Luu <tluu@ti.com> | 2012-06-21 11:26:44 -0500 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-11-26 20:06:57 +0200 |
commit | 8f5df432bc2159337cd595daa0609213a36e0a21 (patch) | |
tree | 4824ba8ef4e5b1a03359390b2b24377906a0bbbe /camera/BufferSourceAdapter.cpp | |
parent | b189bb4e422ccb57c1a6465531ff39bafc985e16 (diff) | |
download | hardware_ti_omap4-8f5df432bc2159337cd595daa0609213a36e0a21.tar.gz hardware_ti_omap4-8f5df432bc2159337cd595daa0609213a36e0a21.tar.bz2 hardware_ti_omap4-8f5df432bc2159337cd595daa0609213a36e0a21.zip |
CameraHal: Allocate buffers when source is set
- Allocate the buffers for a particular surface when it is
set. This allows applications to set multiple surfaces
before capturing or reprocessing, so they don't have to
take the penalty of buffer allocation during.
- Partialy revert change I0c1b8854.
Depends on hardware/libhardware change I01831e05:
http://review.omapzoom.org/#/c/28152/
Change-Id: I13aa2b19387e2a21f8ca08203b132154c14d481b
Signed-off-by: Tyler Luu <tluu@ti.com>
Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
Diffstat (limited to 'camera/BufferSourceAdapter.cpp')
-rw-r--r-- | camera/BufferSourceAdapter.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/camera/BufferSourceAdapter.cpp b/camera/BufferSourceAdapter.cpp index f71f0c1..7d05c24 100644 --- a/camera/BufferSourceAdapter.cpp +++ b/camera/BufferSourceAdapter.cpp @@ -141,6 +141,8 @@ BufferSourceAdapter::~BufferSourceAdapter() { LOG_FUNCTION_NAME; + freeBufferList(mBuffers); + android::AutoMutex lock(mLock); destroy(); @@ -162,12 +164,6 @@ BufferSourceAdapter::~BufferSourceAdapter() mReturnFrame.clear(); } - if( mBuffers != NULL) - { - delete [] mBuffers; - mBuffers = NULL; - } - LOG_FUNCTION_NAME_EXIT; } @@ -618,7 +614,8 @@ int BufferSourceAdapter::getBufferCount() { int count = -1; android::Mutex::Autolock lock(mLock); - return NO_BUFFERS_IMAGE_CAPTURE_SYSTEM_HEAP; + if (mBufferSource) extendedOps()->get_buffer_count(mBufferSource, &count); + return count; } CameraBuffer* BufferSourceAdapter::getBufferList(int *num) { |