From 22c0238bf11a15f1ccfd1ed209356c905b9db806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Aedla?= Date: Thu, 1 May 2014 15:37:12 +0300 Subject: [PATCH] Android camera qcom HAL doesn't like it when no consumer usage bits are set. Set a usage bit for preview BufferQueue. --- modules/androidcamera/camera_wrapper/camera_wrapper.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/androidcamera/camera_wrapper/camera_wrapper.cpp b/modules/androidcamera/camera_wrapper/camera_wrapper.cpp index 66678c558f..351a6fe3d4 100644 --- a/modules/androidcamera/camera_wrapper/camera_wrapper.cpp +++ b/modules/androidcamera/camera_wrapper/camera_wrapper.cpp @@ -25,6 +25,7 @@ #elif defined(ANDROID_r4_3_0) || defined(ANDROID_r4_4_0) # include # include +# include #else # include #endif @@ -683,6 +684,7 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback, # elif defined(ANDROID_r4_4_0) void* buffer_queue_obj = operator new(sizeof(BufferQueue) + MAGIC_TAIL); handler->queue = new(buffer_queue_obj) BufferQueue(); + handler->queue->setConsumerUsageBits(GraphicBuffer::USAGE_HW_TEXTURE); void* consumer_listener_obj = operator new(sizeof(ConsumerListenerStub) + MAGIC_TAIL); handler->listener = new(consumer_listener_obj) ConsumerListenerStub(); handler->queue->consumerConnect(handler->listener, true); @@ -1087,6 +1089,7 @@ void CameraHandler::applyProperties(CameraHandler** ppcameraHandler) # elif defined(ANDROID_r4_4_0) void* buffer_queue_obj = operator new(sizeof(BufferQueue) + MAGIC_TAIL); handler->queue = new(buffer_queue_obj) BufferQueue(); + handler->queue->setConsumerUsageBits(GraphicBuffer::USAGE_HW_TEXTURE); handler->queue->consumerConnect(handler->listener, true); bufferStatus = handler->camera->setPreviewTarget(handler->queue); if (bufferStatus != 0)