diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-09-26 15:28:55 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2013-09-26 15:37:59 -0700 |
commit | 1da3b602130d71ac3bff1a1fdecdc5e0d7b9d701 (patch) | |
tree | 76bbec452f81cd29b844f856882c46d5b4e3ea6d /services/camera/libcameraservice/api2/CameraDeviceClient.cpp | |
parent | 6914de6dd1d74fcf74e3247c89f9293fbf7bafe5 (diff) | |
download | frameworks_av-1da3b602130d71ac3bff1a1fdecdc5e0d7b9d701.zip frameworks_av-1da3b602130d71ac3bff1a1fdecdc5e0d7b9d701.tar.gz frameworks_av-1da3b602130d71ac3bff1a1fdecdc5e0d7b9d701.tar.bz2 |
Camera2 API: Hack: Always use async mode with GLConsumer
Until a cleaner solution is implemented, force buffer queues to
consumers that set USAGE_HW_TEXTURE usage to be asynchronous.
Bug: 10949105
Change-Id: I69e6b02b773831396767c282ce8c5936c5d41f03
Diffstat (limited to 'services/camera/libcameraservice/api2/CameraDeviceClient.cpp')
-rw-r--r-- | services/camera/libcameraservice/api2/CameraDeviceClient.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp index 83466cb..76d44bf 100644 --- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp +++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp @@ -298,11 +298,28 @@ status_t CameraDeviceClient::createStream(int width, int height, int format, } } + // HACK b/10949105 + // Query consumer usage bits to set async operation mode for + // GLConsumer using controlledByApp parameter. + bool useAsync = false; + int32_t consumerUsage; + if ((res = bufferProducer->query(NATIVE_WINDOW_CONSUMER_USAGE_BITS, + &consumerUsage)) != OK) { + ALOGE("%s: Camera %d: Failed to query consumer usage", __FUNCTION__, + mCameraId); + return res; + } + if (consumerUsage & GraphicBuffer::USAGE_HW_TEXTURE) { + ALOGW("%s: Camera %d: Forcing asynchronous mode for stream", + __FUNCTION__, mCameraId); + useAsync = true; + } + sp<IBinder> binder; sp<ANativeWindow> anw; if (bufferProducer != 0) { binder = bufferProducer->asBinder(); - anw = new Surface(bufferProducer); + anw = new Surface(bufferProducer, useAsync); } // TODO: remove w,h,f since we are ignoring them |