diff options
author | Zhijun He <zhijunhe@google.com> | 2014-08-08 12:00:47 -0700 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2014-08-11 04:32:14 +0000 |
commit | 28c9b6f298134624cb52b1af4ed8716dddb983d3 (patch) | |
tree | 4a9fb69c4b4f9783b8f1efe6369f5862633eddbb /services/camera/libcameraservice/device3 | |
parent | 2dfe8ea7c131a045067c123efc934ef6ccdb8821 (diff) | |
download | frameworks_av-28c9b6f298134624cb52b1af4ed8716dddb983d3.zip frameworks_av-28c9b6f298134624cb52b1af4ed8716dddb983d3.tar.gz frameworks_av-28c9b6f298134624cb52b1af4ed8716dddb983d3.tar.bz2 |
Camera2/3: Cleanup the jpeg buffer size calcaulation logic
- Only one place calculating the jpeg size-the device layer, Camera2Device and
Camera3Device.
- Remove size argument for CameraDeviceBase and cleanup related code.
Bug: 14327010
Change-Id: I45d2ab4859ee0cc9273e579254f0569108c748f1
Diffstat (limited to 'services/camera/libcameraservice/device3')
-rw-r--r-- | services/camera/libcameraservice/device3/Camera3Device.cpp | 11 | ||||
-rw-r--r-- | services/camera/libcameraservice/device3/Camera3Device.h | 14 |
2 files changed, 8 insertions, 17 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp index a6214cc..ed350c1 100644 --- a/services/camera/libcameraservice/device3/Camera3Device.cpp +++ b/services/camera/libcameraservice/device3/Camera3Device.cpp @@ -793,12 +793,12 @@ status_t Camera3Device::createZslStream( } status_t Camera3Device::createStream(sp<ANativeWindow> consumer, - uint32_t width, uint32_t height, int format, size_t size, int *id) { + uint32_t width, uint32_t height, int format, int *id) { ATRACE_CALL(); Mutex::Autolock il(mInterfaceLock); Mutex::Autolock l(mLock); - ALOGV("Camera %d: Creating new stream %d: %d x %d, format %d, size %zu", - mId, mNextStreamId, width, height, format, size); + ALOGV("Camera %d: Creating new stream %d: %d x %d, format %d", + mId, mNextStreamId, width, height, format); status_t res; bool wasActive = false; @@ -832,10 +832,7 @@ status_t Camera3Device::createStream(sp<ANativeWindow> consumer, sp<Camera3OutputStream> newStream; if (format == HAL_PIXEL_FORMAT_BLOB) { ssize_t jpegBufferSize = getJpegBufferSize(width, height); - if (jpegBufferSize > 0) { - ALOGV("%s: Overwrite Jpeg output buffer size from %zu to %zu", - __FUNCTION__, size, jpegBufferSize); - } else { + if (jpegBufferSize <= 0) { SET_ERR_L("Invalid jpeg buffer size %zd", jpegBufferSize); return BAD_VALUE; } diff --git a/services/camera/libcameraservice/device3/Camera3Device.h b/services/camera/libcameraservice/device3/Camera3Device.h index b1b0033..7656237 100644 --- a/services/camera/libcameraservice/device3/Camera3Device.h +++ b/services/camera/libcameraservice/device3/Camera3Device.h @@ -93,11 +93,9 @@ class Camera3Device : // Actual stream creation/deletion is delayed until first request is submitted // If adding streams while actively capturing, will pause device before adding - // stream, reconfiguring device, and unpausing. Note that, for JPEG stream, the - // buffer size may be overwritten by an more accurate value calculated by Camera3Device. + // stream, reconfiguring device, and unpausing. virtual status_t createStream(sp<ANativeWindow> consumer, - uint32_t width, uint32_t height, int format, size_t size, - int *id); + uint32_t width, uint32_t height, int format, int *id); virtual status_t createInputStream( uint32_t width, uint32_t height, int format, int *id); @@ -137,6 +135,8 @@ class Camera3Device : virtual uint32_t getDeviceVersion(); + virtual ssize_t getJpegBufferSize(uint32_t width, uint32_t height) const; + // Methods called by subclasses void notifyStatus(bool idle); // updates from StatusTracker @@ -316,12 +316,6 @@ class Camera3Device : */ Size getMaxJpegResolution() const; - /** - * Get Jpeg buffer size for a given jpeg resolution. - * Negative values are error codes. - */ - ssize_t getJpegBufferSize(uint32_t width, uint32_t height) const; - struct RequestTrigger { // Metadata tag number, e.g. android.control.aePrecaptureTrigger uint32_t metadataTag; |