diff options
author | Tyler Luu <tluu@ti.com> | 2012-06-01 22:46:58 -0500 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-11-26 18:22:46 +0200 |
commit | a57cfd9088378087009e4047b86f562065f62d85 (patch) | |
tree | e5ceda3161adf0104988b2edd92cc18d0c22a0a8 /camera/BufferSourceAdapter.cpp | |
parent | 7010ab636a1ab73307463ff63daf1ebb40a6ea62 (diff) | |
download | hardware_ti_omap4-a57cfd9088378087009e4047b86f562065f62d85.tar.gz hardware_ti_omap4-a57cfd9088378087009e4047b86f562065f62d85.tar.bz2 hardware_ti_omap4-a57cfd9088378087009e4047b86f562065f62d85.zip |
camera: Fill format field in BufferProviders
Fill format field in the BufferProviders (MemoryManager,
ANativeWindowAdapter, BufferSourceAdapter), so the format of the
buffer is known to the consumers.
Change-Id: I7b5fbb3e7da107735de98669d3d9889a4bff6097
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 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/camera/BufferSourceAdapter.cpp b/camera/BufferSourceAdapter.cpp index acb4653..0e4caeb 100644 --- a/camera/BufferSourceAdapter.cpp +++ b/camera/BufferSourceAdapter.cpp @@ -313,6 +313,7 @@ CameraBuffer* BufferSourceAdapter::allocateBufferList(int width, int height, con int pixFormat = getANWFormat(format); int usage = getUsageFromANW(pixFormat); + mPixelFormat = CameraHal::getPixelFormatConstant(format); // Set gralloc usage bits for window. err = mBufferSource->set_usage(mBufferSource, usage); @@ -385,6 +386,7 @@ CameraBuffer* BufferSourceAdapter::allocateBufferList(int width, int height, con CAMHAL_LOGDB("got handle %p", handle); mBuffers[i].opaque = (void *)handle; mBuffers[i].type = CAMERA_BUFFER_ANW; + mBuffers[i].format = mPixelFormat; mFramesWithCameraAdapterMap.add(handle, i); bytes = CameraHal::calculateBufferSize(format, width, height); @@ -422,7 +424,6 @@ CameraBuffer* BufferSourceAdapter::allocateBufferList(int width, int height, con mFramesWithCameraAdapterMap.removeItem((buffer_handle_t *) mBuffers[i].opaque); } - mPixelFormat = CameraHal::getPixelFormatConstant(format); mFrameWidth = width; mFrameHeight = height; mBufferSourceDirection = BUFFER_SOURCE_TAP_OUT; |