diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2012-08-28 14:01:26 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2012-08-28 14:22:53 -0700 |
commit | 2388a2dc91979364d96e49456b189f904f0267f3 (patch) | |
tree | 1bc5ab5323c5ad747670c94518970e4e1d44c277 /tests/camera2 | |
parent | b8b6439598ecc5faecfce8d43f3418b057714b4c (diff) | |
download | hardware_libhardware-2388a2dc91979364d96e49456b189f904f0267f3.zip hardware_libhardware-2388a2dc91979364d96e49456b189f904f0267f3.tar.gz hardware_libhardware-2388a2dc91979364d96e49456b189f904f0267f3.tar.bz2 |
Camera2: Use HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED
Align camera2's management of platform-opaque formats with rest of
framework. Instead of using CAMERA2_PIXEL_FORMAT_OPAQUE, use
HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED as the format for both the
camera HAL and for gralloc, and depend on the gralloc usage flags to
let the gralloc module select the appropriate real format for specific
stream endpoints.
Add a new gralloc usage for ZSL mode, where the camera service will
hold a streaming circular buffer of opaque full-resolution images
during camera preview. Since this is an opaque format that needs to be
optimized for 30fps operation, need gralloc to be aware of this use
case.
Bug: 6243944
Change-Id: If7f2516649381ce9bcffe4e319b63cbc068f643f
Diffstat (limited to 'tests/camera2')
-rw-r--r-- | tests/camera2/camera2.cpp | 2 | ||||
-rw-r--r-- | tests/camera2/camera2_utils.cpp | 9 | ||||
-rw-r--r-- | tests/camera2/camera2_utils.h | 2 |
3 files changed, 5 insertions, 8 deletions
diff --git a/tests/camera2/camera2.cpp b/tests/camera2/camera2.cpp index 29eef68..f43513e 100644 --- a/tests/camera2/camera2.cpp +++ b/tests/camera2/camera2.cpp @@ -240,7 +240,7 @@ class Camera2Test: public testing::Test { size_t *count) { ALOGV("Getting resolutions for format %x", format); status_t res; - if (format != CAMERA2_HAL_PIXEL_FORMAT_OPAQUE) { + if (format != HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) { camera_metadata_ro_entry_t availableFormats; res = find_camera_metadata_ro_entry(mStaticInfo, ANDROID_SCALER_AVAILABLE_FORMATS, diff --git a/tests/camera2/camera2_utils.cpp b/tests/camera2/camera2_utils.cpp index ba938d9..cefe29a 100644 --- a/tests/camera2/camera2_utils.cpp +++ b/tests/camera2/camera2_utils.cpp @@ -317,7 +317,7 @@ void NotifierListener::notify_callback_dispatch(int32_t msg_type, StreamAdapter::StreamAdapter(sp<ISurfaceTexture> consumer): mState(UNINITIALIZED), mDevice(NULL), mId(-1), - mWidth(0), mHeight(0), mFormatRequested(0) + mWidth(0), mHeight(0), mFormat(0) { mConsumerInterface = new SurfaceTextureClient(consumer); camera2_stream_ops::dequeue_buffer = dequeue_buffer; @@ -342,16 +342,16 @@ status_t StreamAdapter::connectToDevice(camera2_device_t *d, mWidth = width; mHeight = height; - mFormatRequested = format; + mFormat = format; // Allocate device-side stream interface uint32_t id; - uint32_t formatActual; + uint32_t formatActual; // ignored uint32_t usage; uint32_t maxBuffers = 2; res = d->ops->allocate_stream(d, - mWidth, mHeight, mFormatRequested, getStreamOps(), + mWidth, mHeight, mFormat, getStreamOps(), &id, &formatActual, &usage, &maxBuffers); if (res != OK) { ALOGE("%s: Device stream allocation failed: %s (%d)", @@ -362,7 +362,6 @@ status_t StreamAdapter::connectToDevice(camera2_device_t *d, mDevice = d; mId = id; - mFormat = formatActual; mUsage = usage; mMaxProducerBuffers = maxBuffers; diff --git a/tests/camera2/camera2_utils.h b/tests/camera2/camera2_utils.h index 2c9f801..7822f5b 100644 --- a/tests/camera2/camera2_utils.h +++ b/tests/camera2/camera2_utils.h @@ -194,8 +194,6 @@ class StreamAdapter: public camera2_stream_ops { uint32_t mMaxProducerBuffers; uint32_t mMaxConsumerBuffers; - int mFormatRequested; - const camera2_stream_ops *getStreamOps(); static ANativeWindow* toANW(const camera2_stream_ops_t *w); |