diff --git a/camera_parameters/Android.bp b/camera_parameters/Android.bp deleted file mode 100644 index 59c775639261893e51055157649b759c11fc1f0f..0000000000000000000000000000000000000000 --- a/camera_parameters/Android.bp +++ /dev/null @@ -1,9 +0,0 @@ -cc_library_static { - name: "libcamera_parameters_mtk", - srcs: ["CameraParameters.cpp", - "MtkCameraParameters.cpp", - ], - local_include_dirs: [ - ".", - ] -} diff --git a/camera_parameters/CameraParameters.cpp b/camera_parameters/CameraParameters.cpp deleted file mode 100644 index 1273dbb327e90d46ac01a9c879849662b434ad75..0000000000000000000000000000000000000000 --- a/camera_parameters/CameraParameters.cpp +++ /dev/null @@ -1,540 +0,0 @@ -/* -** -** Copyright 2008, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - -#define LOG_TAG "CameraParams" -#include - -#include -#include -#include "CameraParameters.h" -#include - -namespace android { -// Parameter keys to communicate between camera application and driver. -const char CameraParameters::KEY_PREVIEW_SIZE[] = "preview-size"; -const char CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES[] = "preview-size-values"; -const char CameraParameters::KEY_PREVIEW_FORMAT[] = "preview-format"; -const char CameraParameters::KEY_SUPPORTED_PREVIEW_FORMATS[] = "preview-format-values"; -const char CameraParameters::KEY_PREVIEW_FRAME_RATE[] = "preview-frame-rate"; -const char CameraParameters::KEY_SUPPORTED_PREVIEW_FRAME_RATES[] = "preview-frame-rate-values"; -const char CameraParameters::KEY_PREVIEW_FPS_RANGE[] = "preview-fps-range"; -const char CameraParameters::KEY_SUPPORTED_PREVIEW_FPS_RANGE[] = "preview-fps-range-values"; -const char CameraParameters::KEY_PICTURE_SIZE[] = "picture-size"; -const char CameraParameters::KEY_SUPPORTED_PICTURE_SIZES[] = "picture-size-values"; -const char CameraParameters::KEY_PICTURE_FORMAT[] = "picture-format"; -const char CameraParameters::KEY_SUPPORTED_PICTURE_FORMATS[] = "picture-format-values"; -const char CameraParameters::KEY_JPEG_THUMBNAIL_WIDTH[] = "jpeg-thumbnail-width"; -const char CameraParameters::KEY_JPEG_THUMBNAIL_HEIGHT[] = "jpeg-thumbnail-height"; -const char CameraParameters::KEY_SUPPORTED_JPEG_THUMBNAIL_SIZES[] = "jpeg-thumbnail-size-values"; -const char CameraParameters::KEY_JPEG_THUMBNAIL_QUALITY[] = "jpeg-thumbnail-quality"; -const char CameraParameters::KEY_JPEG_QUALITY[] = "jpeg-quality"; -const char CameraParameters::KEY_ROTATION[] = "rotation"; -const char CameraParameters::KEY_GPS_LATITUDE[] = "gps-latitude"; -const char CameraParameters::KEY_GPS_LONGITUDE[] = "gps-longitude"; -const char CameraParameters::KEY_GPS_ALTITUDE[] = "gps-altitude"; -const char CameraParameters::KEY_GPS_TIMESTAMP[] = "gps-timestamp"; -const char CameraParameters::KEY_GPS_PROCESSING_METHOD[] = "gps-processing-method"; -const char CameraParameters::KEY_WHITE_BALANCE[] = "whitebalance"; -const char CameraParameters::KEY_SUPPORTED_WHITE_BALANCE[] = "whitebalance-values"; -const char CameraParameters::KEY_EFFECT[] = "effect"; -const char CameraParameters::KEY_SUPPORTED_EFFECTS[] = "effect-values"; -const char CameraParameters::KEY_ANTIBANDING[] = "antibanding"; -const char CameraParameters::KEY_SUPPORTED_ANTIBANDING[] = "antibanding-values"; -const char CameraParameters::KEY_SCENE_MODE[] = "scene-mode"; -const char CameraParameters::KEY_SUPPORTED_SCENE_MODES[] = "scene-mode-values"; -const char CameraParameters::KEY_FLASH_MODE[] = "flash-mode"; -const char CameraParameters::KEY_SUPPORTED_FLASH_MODES[] = "flash-mode-values"; -const char CameraParameters::KEY_FOCUS_MODE[] = "focus-mode"; -const char CameraParameters::KEY_SUPPORTED_FOCUS_MODES[] = "focus-mode-values"; -const char CameraParameters::KEY_MAX_NUM_FOCUS_AREAS[] = "max-num-focus-areas"; -const char CameraParameters::KEY_FOCUS_AREAS[] = "focus-areas"; -const char CameraParameters::KEY_FOCAL_LENGTH[] = "focal-length"; -const char CameraParameters::KEY_HORIZONTAL_VIEW_ANGLE[] = "horizontal-view-angle"; -const char CameraParameters::KEY_VERTICAL_VIEW_ANGLE[] = "vertical-view-angle"; -const char CameraParameters::KEY_EXPOSURE_COMPENSATION[] = "exposure-compensation"; -const char CameraParameters::KEY_MAX_EXPOSURE_COMPENSATION[] = "max-exposure-compensation"; -const char CameraParameters::KEY_MIN_EXPOSURE_COMPENSATION[] = "min-exposure-compensation"; -const char CameraParameters::KEY_EXPOSURE_COMPENSATION_STEP[] = "exposure-compensation-step"; -const char CameraParameters::KEY_AUTO_EXPOSURE_LOCK[] = "auto-exposure-lock"; -const char CameraParameters::KEY_AUTO_EXPOSURE_LOCK_SUPPORTED[] = "auto-exposure-lock-supported"; -const char CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK[] = "auto-whitebalance-lock"; -const char CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK_SUPPORTED[] = "auto-whitebalance-lock-supported"; -const char CameraParameters::KEY_MAX_NUM_METERING_AREAS[] = "max-num-metering-areas"; -const char CameraParameters::KEY_METERING_AREAS[] = "metering-areas"; -const char CameraParameters::KEY_ZOOM[] = "zoom"; -const char CameraParameters::KEY_MAX_ZOOM[] = "max-zoom"; -const char CameraParameters::KEY_ZOOM_RATIOS[] = "zoom-ratios"; -const char CameraParameters::KEY_ZOOM_SUPPORTED[] = "zoom-supported"; -const char CameraParameters::KEY_SMOOTH_ZOOM_SUPPORTED[] = "smooth-zoom-supported"; -const char CameraParameters::KEY_FOCUS_DISTANCES[] = "focus-distances"; -const char CameraParameters::KEY_VIDEO_FRAME_FORMAT[] = "video-frame-format"; -const char CameraParameters::KEY_VIDEO_SIZE[] = "video-size"; -const char CameraParameters::KEY_SUPPORTED_VIDEO_SIZES[] = "video-size-values"; -const char CameraParameters::KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO[] = "preferred-preview-size-for-video"; -const char CameraParameters::KEY_MAX_NUM_DETECTED_FACES_HW[] = "max-num-detected-faces-hw"; -const char CameraParameters::KEY_MAX_NUM_DETECTED_FACES_SW[] = "max-num-detected-faces-sw"; -const char CameraParameters::KEY_RECORDING_HINT[] = "recording-hint"; -const char CameraParameters::KEY_VIDEO_SNAPSHOT_SUPPORTED[] = "video-snapshot-supported"; -const char CameraParameters::KEY_VIDEO_STABILIZATION[] = "video-stabilization"; -const char CameraParameters::KEY_VIDEO_STABILIZATION_SUPPORTED[] = "video-stabilization-supported"; -const char CameraParameters::KEY_LIGHTFX[] = "light-fx"; - -const char CameraParameters::TRUE[] = "true"; -const char CameraParameters::FALSE[] = "false"; -const char CameraParameters::FOCUS_DISTANCE_INFINITY[] = "Infinity"; - -// Values for white balance settings. -const char CameraParameters::WHITE_BALANCE_AUTO[] = "auto"; -const char CameraParameters::WHITE_BALANCE_INCANDESCENT[] = "incandescent"; -const char CameraParameters::WHITE_BALANCE_FLUORESCENT[] = "fluorescent"; -const char CameraParameters::WHITE_BALANCE_WARM_FLUORESCENT[] = "warm-fluorescent"; -const char CameraParameters::WHITE_BALANCE_DAYLIGHT[] = "daylight"; -const char CameraParameters::WHITE_BALANCE_CLOUDY_DAYLIGHT[] = "cloudy-daylight"; -const char CameraParameters::WHITE_BALANCE_TWILIGHT[] = "twilight"; -const char CameraParameters::WHITE_BALANCE_SHADE[] = "shade"; - -// Values for effect settings. -const char CameraParameters::EFFECT_NONE[] = "none"; -const char CameraParameters::EFFECT_MONO[] = "mono"; -const char CameraParameters::EFFECT_NEGATIVE[] = "negative"; -const char CameraParameters::EFFECT_SOLARIZE[] = "solarize"; -const char CameraParameters::EFFECT_SEPIA[] = "sepia"; -const char CameraParameters::EFFECT_POSTERIZE[] = "posterize"; -const char CameraParameters::EFFECT_WHITEBOARD[] = "whiteboard"; -const char CameraParameters::EFFECT_BLACKBOARD[] = "blackboard"; -const char CameraParameters::EFFECT_AQUA[] = "aqua"; - -// Values for antibanding settings. -const char CameraParameters::ANTIBANDING_AUTO[] = "auto"; -const char CameraParameters::ANTIBANDING_50HZ[] = "50hz"; -const char CameraParameters::ANTIBANDING_60HZ[] = "60hz"; -const char CameraParameters::ANTIBANDING_OFF[] = "off"; - -// Values for flash mode settings. -const char CameraParameters::FLASH_MODE_OFF[] = "off"; -const char CameraParameters::FLASH_MODE_AUTO[] = "auto"; -const char CameraParameters::FLASH_MODE_ON[] = "on"; -const char CameraParameters::FLASH_MODE_RED_EYE[] = "red-eye"; -const char CameraParameters::FLASH_MODE_TORCH[] = "torch"; - -// Values for scene mode settings. -const char CameraParameters::SCENE_MODE_AUTO[] = "auto"; -const char CameraParameters::SCENE_MODE_ACTION[] = "action"; -const char CameraParameters::SCENE_MODE_PORTRAIT[] = "portrait"; -const char CameraParameters::SCENE_MODE_LANDSCAPE[] = "landscape"; -const char CameraParameters::SCENE_MODE_NIGHT[] = "night"; -const char CameraParameters::SCENE_MODE_NIGHT_PORTRAIT[] = "night-portrait"; -const char CameraParameters::SCENE_MODE_THEATRE[] = "theatre"; -const char CameraParameters::SCENE_MODE_BEACH[] = "beach"; -const char CameraParameters::SCENE_MODE_SNOW[] = "snow"; -const char CameraParameters::SCENE_MODE_SUNSET[] = "sunset"; -const char CameraParameters::SCENE_MODE_STEADYPHOTO[] = "steadyphoto"; -const char CameraParameters::SCENE_MODE_FIREWORKS[] = "fireworks"; -const char CameraParameters::SCENE_MODE_SPORTS[] = "sports"; -const char CameraParameters::SCENE_MODE_PARTY[] = "party"; -const char CameraParameters::SCENE_MODE_CANDLELIGHT[] = "candlelight"; -const char CameraParameters::SCENE_MODE_BARCODE[] = "barcode"; -const char CameraParameters::SCENE_MODE_HDR[] = "hdr"; - -const char CameraParameters::PIXEL_FORMAT_YUV422SP[] = "yuv422sp"; -const char CameraParameters::PIXEL_FORMAT_YUV420SP[] = "yuv420sp"; -const char CameraParameters::PIXEL_FORMAT_YUV422I[] = "yuv422i-yuyv"; -const char CameraParameters::PIXEL_FORMAT_YUV420P[] = "yuv420p"; -const char CameraParameters::PIXEL_FORMAT_RGB565[] = "rgb565"; -const char CameraParameters::PIXEL_FORMAT_RGBA8888[] = "rgba8888"; -const char CameraParameters::PIXEL_FORMAT_JPEG[] = "jpeg"; -const char CameraParameters::PIXEL_FORMAT_BAYER_RGGB[] = "bayer-rggb"; -const char CameraParameters::PIXEL_FORMAT_ANDROID_OPAQUE[] = "android-opaque"; - -// Values for focus mode settings. -const char CameraParameters::FOCUS_MODE_AUTO[] = "auto"; -const char CameraParameters::FOCUS_MODE_INFINITY[] = "infinity"; -const char CameraParameters::FOCUS_MODE_MACRO[] = "macro"; -const char CameraParameters::FOCUS_MODE_FIXED[] = "fixed"; -const char CameraParameters::FOCUS_MODE_EDOF[] = "edof"; -const char CameraParameters::FOCUS_MODE_CONTINUOUS_VIDEO[] = "continuous-video"; -const char CameraParameters::FOCUS_MODE_CONTINUOUS_PICTURE[] = "continuous-picture"; - -// Values for light fx settings -const char CameraParameters::LIGHTFX_LOWLIGHT[] = "low-light"; -const char CameraParameters::LIGHTFX_HDR[] = "high-dynamic-range"; - -CameraParameters::CameraParameters() - : mMap() -{ -} - -CameraParameters::~CameraParameters() -{ -} - -String8 CameraParameters::flatten() const -{ - String8 flattened(""); - size_t size = mMap.size(); - - for (size_t i = 0; i < size; i++) { - String8 k, v; - k = mMap.keyAt(i); - v = mMap.valueAt(i); - - flattened += k; - flattened += "="; - flattened += v; - if (i != size-1) - flattened += ";"; - } - - return flattened; -} - -void CameraParameters::unflatten(const String8 ¶ms) -{ - const char *a = params.string(); - const char *b; - - mMap.clear(); - - for (;;) { - // Find the bounds of the key name. - b = strchr(a, '='); - if (b == 0) - break; - - // Create the key string. - String8 k(a, (size_t)(b-a)); - - // Find the value. - a = b+1; - b = strchr(a, ';'); - if (b == 0) { - // If there's no semicolon, this is the last item. - String8 v(a); - mMap.add(k, v); - break; - } - - String8 v(a, (size_t)(b-a)); - mMap.add(k, v); - a = b+1; - } -} - - -void CameraParameters::set(const char *key, const char *value) -{ - if (key == NULL || value == NULL) - return; - - // XXX i think i can do this with strspn() - if (strchr(key, '=') || strchr(key, ';')) { - //XXX ALOGE("Key \"%s\"contains invalid character (= or ;)", key); - return; - } - - if (strchr(value, '=') || strchr(value, ';')) { - //XXX ALOGE("Value \"%s\"contains invalid character (= or ;)", value); - return; - } - - mMap.replaceValueFor(String8(key), String8(value)); -} - -void CameraParameters::set(const char *key, int value) -{ - char str[16]; - sprintf(str, "%d", value); - set(key, str); -} - -void CameraParameters::setFloat(const char *key, float value) -{ - char str[16]; // 14 should be enough. We overestimate to be safe. - snprintf(str, sizeof(str), "%g", value); - set(key, str); -} - -const char *CameraParameters::get(const char *key) const -{ - String8 v = mMap.valueFor(String8(key)); - if (v.length() == 0) - return 0; - return v.string(); -} - -int CameraParameters::getInt(const char *key) const -{ - const char *v = get(key); - if (v == 0) - return -1; - return strtol(v, 0, 0); -} - -float CameraParameters::getFloat(const char *key) const -{ - const char *v = get(key); - if (v == 0) return -1; - return strtof(v, 0); -} - -void CameraParameters::remove(const char *key) -{ - mMap.removeItem(String8(key)); -} - -// Parse string like "640x480" or "10000,20000" -static int parse_pair(const char *str, int *first, int *second, char delim, - char **endptr = NULL) -{ - // Find the first integer. - char *end; - int w = (int)strtol(str, &end, 10); - // If a delimeter does not immediately follow, give up. - if (*end != delim) { - ALOGE("Cannot find delimeter (%c) in str=%s", delim, str); - return -1; - } - - // Find the second integer, immediately after the delimeter. - int h = (int)strtol(end+1, &end, 10); - - *first = w; - *second = h; - - if (endptr) { - *endptr = end; - } - - return 0; -} - -static void parseSizesList(const char *sizesStr, Vector &sizes) -{ - if (sizesStr == 0) { - return; - } - - char *sizeStartPtr = (char *)sizesStr; - - while (true) { - int width, height; - int success = parse_pair(sizeStartPtr, &width, &height, 'x', - &sizeStartPtr); - if (success == -1 || (*sizeStartPtr != ',' && *sizeStartPtr != '\0')) { - ALOGE("Picture sizes string \"%s\" contains invalid character.", sizesStr); - return; - } - sizes.push(Size(width, height)); - - if (*sizeStartPtr == '\0') { - return; - } - sizeStartPtr++; - } -} - -void CameraParameters::setPreviewSize(int width, int height) -{ - char str[32]; - sprintf(str, "%dx%d", width, height); - set(KEY_PREVIEW_SIZE, str); -} - -void CameraParameters::getPreviewSize(int *width, int *height) const -{ - *width = *height = -1; - // Get the current string, if it doesn't exist, leave the -1x-1 - const char *p = get(KEY_PREVIEW_SIZE); - if (p == 0) return; - parse_pair(p, width, height, 'x'); -} - -void CameraParameters::getPreferredPreviewSizeForVideo(int *width, int *height) const -{ - *width = *height = -1; - const char *p = get(KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO); - if (p == 0) return; - parse_pair(p, width, height, 'x'); -} - -void CameraParameters::getSupportedPreviewSizes(Vector &sizes) const -{ - const char *previewSizesStr = get(KEY_SUPPORTED_PREVIEW_SIZES); - parseSizesList(previewSizesStr, sizes); -} - -void CameraParameters::setVideoSize(int width, int height) -{ - char str[32]; - sprintf(str, "%dx%d", width, height); - set(KEY_VIDEO_SIZE, str); -} - -void CameraParameters::getVideoSize(int *width, int *height) const -{ - *width = *height = -1; - const char *p = get(KEY_VIDEO_SIZE); - if (p == 0) return; - parse_pair(p, width, height, 'x'); -} - -void CameraParameters::getSupportedVideoSizes(Vector &sizes) const -{ - const char *videoSizesStr = get(KEY_SUPPORTED_VIDEO_SIZES); - parseSizesList(videoSizesStr, sizes); -} - -void CameraParameters::setPreviewFrameRate(int fps) -{ - set(KEY_PREVIEW_FRAME_RATE, fps); -} - -int CameraParameters::getPreviewFrameRate() const -{ - return getInt(KEY_PREVIEW_FRAME_RATE); -} - -void CameraParameters::getPreviewFpsRange(int *min_fps, int *max_fps) const -{ - *min_fps = *max_fps = -1; - const char *p = get(KEY_PREVIEW_FPS_RANGE); - if (p == 0) return; - parse_pair(p, min_fps, max_fps, ','); -} - -void CameraParameters::setPreviewFormat(const char *format) -{ - set(KEY_PREVIEW_FORMAT, format); -} - -const char *CameraParameters::getPreviewFormat() const -{ - return get(KEY_PREVIEW_FORMAT); -} - -void CameraParameters::setPictureSize(int width, int height) -{ - char str[32]; - sprintf(str, "%dx%d", width, height); - set(KEY_PICTURE_SIZE, str); -} - -void CameraParameters::getPictureSize(int *width, int *height) const -{ - *width = *height = -1; - // Get the current string, if it doesn't exist, leave the -1x-1 - const char *p = get(KEY_PICTURE_SIZE); - if (p == 0) return; - parse_pair(p, width, height, 'x'); -} - -void CameraParameters::getSupportedPictureSizes(Vector &sizes) const -{ - const char *pictureSizesStr = get(KEY_SUPPORTED_PICTURE_SIZES); - parseSizesList(pictureSizesStr, sizes); -} - -void CameraParameters::setPictureFormat(const char *format) -{ - set(KEY_PICTURE_FORMAT, format); -} - -const char *CameraParameters::getPictureFormat() const -{ - return get(KEY_PICTURE_FORMAT); -} - -void CameraParameters::dump() const -{ - ALOGD("dump: mMap.size = %zu", mMap.size()); - for (size_t i = 0; i < mMap.size(); i++) { - String8 k, v; - k = mMap.keyAt(i); - v = mMap.valueAt(i); - ALOGD("%s: %s\n", k.string(), v.string()); - } -} - -status_t CameraParameters::dump(int fd, const Vector& /*args*/) const -{ - const size_t SIZE = 256; - char buffer[SIZE]; - String8 result; - snprintf(buffer, 255, "CameraParameters::dump: mMap.size = %zu\n", mMap.size()); - result.append(buffer); - for (size_t i = 0; i < mMap.size(); i++) { - String8 k, v; - k = mMap.keyAt(i); - v = mMap.valueAt(i); - snprintf(buffer, 255, "\t%s: %s\n", k.string(), v.string()); - result.append(buffer); - } - write(fd, result.string(), result.size()); - return NO_ERROR; -} - -void CameraParameters::getSupportedPreviewFormats(Vector& formats) const { - const char* supportedPreviewFormats = - get(CameraParameters::KEY_SUPPORTED_PREVIEW_FORMATS); - - if (supportedPreviewFormats == NULL) { - ALOGW("%s: No supported preview formats.", __FUNCTION__); - return; - } - - String8 fmtStr(supportedPreviewFormats); - char* prevFmts = fmtStr.lockBuffer(fmtStr.size()); - - char* savePtr; - char* fmt = strtok_r(prevFmts, ",", &savePtr); - while (fmt) { - int actual = previewFormatToEnum(fmt); - if (actual != -1) { - formats.add(actual); - } - fmt = strtok_r(NULL, ",", &savePtr); - } - fmtStr.unlockBuffer(fmtStr.size()); -} - - -int CameraParameters::previewFormatToEnum(const char* format) { - return - !format ? - HAL_PIXEL_FORMAT_YCrCb_420_SP : - !strcmp(format, PIXEL_FORMAT_YUV422SP) ? - HAL_PIXEL_FORMAT_YCbCr_422_SP : // NV16 - !strcmp(format, PIXEL_FORMAT_YUV420SP) ? - HAL_PIXEL_FORMAT_YCrCb_420_SP : // NV21 - !strcmp(format, PIXEL_FORMAT_YUV422I) ? - HAL_PIXEL_FORMAT_YCbCr_422_I : // YUY2 - !strcmp(format, PIXEL_FORMAT_YUV420P) ? - HAL_PIXEL_FORMAT_YV12 : // YV12 - !strcmp(format, PIXEL_FORMAT_RGB565) ? - HAL_PIXEL_FORMAT_RGB_565 : // RGB565 - !strcmp(format, PIXEL_FORMAT_RGBA8888) ? - HAL_PIXEL_FORMAT_RGBA_8888 : // RGB8888 - !strcmp(format, PIXEL_FORMAT_BAYER_RGGB) ? - HAL_PIXEL_FORMAT_RAW16 : // Raw sensor data - -1; -} - -bool CameraParameters::isEmpty() const { - return mMap.isEmpty(); -} - -}; // namespace android diff --git a/camera_parameters/CameraParameters.h b/camera_parameters/CameraParameters.h deleted file mode 100644 index ba33ffe63b940bcd57d8a35f7edc77ed60e97c34..0000000000000000000000000000000000000000 --- a/camera_parameters/CameraParameters.h +++ /dev/null @@ -1,699 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ANDROID_HARDWARE_CAMERA_PARAMETERS_H -#define ANDROID_HARDWARE_CAMERA_PARAMETERS_H - -#include -#include - -namespace android { - -struct Size { - int width; - int height; - - Size() { - width = 0; - height = 0; - } - - Size(int w, int h) { - width = w; - height = h; - } -}; - -class CameraParameters -{ -public: - CameraParameters(); - CameraParameters(const String8 ¶ms) { unflatten(params); } - ~CameraParameters(); - - String8 flatten() const; - void unflatten(const String8 ¶ms); - - void set(const char *key, const char *value); - void set(const char *key, int value); - void setFloat(const char *key, float value); - const char *get(const char *key) const; - int getInt(const char *key) const; - float getFloat(const char *key) const; - - void remove(const char *key); - - void setPreviewSize(int width, int height); - void getPreviewSize(int *width, int *height) const; - void getSupportedPreviewSizes(Vector &sizes) const; - - // Set the dimensions in pixels to the given width and height - // for video frames. The given width and height must be one - // of the supported dimensions returned from - // getSupportedVideoSizes(). Must not be called if - // getSupportedVideoSizes() returns an empty Vector of Size. - void setVideoSize(int width, int height); - // Retrieve the current dimensions (width and height) - // in pixels for video frames, which must be one of the - // supported dimensions returned from getSupportedVideoSizes(). - // Must not be called if getSupportedVideoSizes() returns an - // empty Vector of Size. - void getVideoSize(int *width, int *height) const; - // Retrieve a Vector of supported dimensions (width and height) - // in pixels for video frames. If sizes returned from the method - // is empty, the camera does not support calls to setVideoSize() - // or getVideoSize(). In adddition, it also indicates that - // the camera only has a single output, and does not have - // separate output for video frames and preview frame. - void getSupportedVideoSizes(Vector &sizes) const; - // Retrieve the preferred preview size (width and height) in pixels - // for video recording. The given width and height must be one of - // supported preview sizes returned from getSupportedPreviewSizes(). - // Must not be called if getSupportedVideoSizes() returns an empty - // Vector of Size. If getSupportedVideoSizes() returns an empty - // Vector of Size, the width and height returned from this method - // is invalid, and is "-1x-1". - void getPreferredPreviewSizeForVideo(int *width, int *height) const; - - void setPreviewFrameRate(int fps); - int getPreviewFrameRate() const; - void getPreviewFpsRange(int *min_fps, int *max_fps) const; - void setPreviewFormat(const char *format); - const char *getPreviewFormat() const; - void setPictureSize(int width, int height); - void getPictureSize(int *width, int *height) const; - void getSupportedPictureSizes(Vector &sizes) const; - void setPictureFormat(const char *format); - const char *getPictureFormat() const; - - void dump() const; - status_t dump(int fd, const Vector& args) const; - - /** - * Returns a Vector containing the supported preview formats - * as enums given in graphics.h. - */ - void getSupportedPreviewFormats(Vector& formats) const; - - // Returns true if no keys are present - bool isEmpty() const; - - // Parameter keys to communicate between camera application and driver. - // The access (read/write, read only, or write only) is viewed from the - // perspective of applications, not driver. - - // Preview frame size in pixels (width x height). - // Example value: "480x320". Read/Write. - static const char KEY_PREVIEW_SIZE[]; - // Supported preview frame sizes in pixels. - // Example value: "800x600,480x320". Read only. - static const char KEY_SUPPORTED_PREVIEW_SIZES[]; - // The current minimum and maximum preview fps. This controls the rate of - // preview frames received (CAMERA_MSG_PREVIEW_FRAME). The minimum and - // maximum fps must be one of the elements from - // KEY_SUPPORTED_PREVIEW_FPS_RANGE parameter. - // Example value: "10500,26623" - static const char KEY_PREVIEW_FPS_RANGE[]; - // The supported preview fps (frame-per-second) ranges. Each range contains - // a minimum fps and maximum fps. If minimum fps equals to maximum fps, the - // camera outputs frames in fixed frame rate. If not, the camera outputs - // frames in auto frame rate. The actual frame rate fluctuates between the - // minimum and the maximum. The list has at least one element. The list is - // sorted from small to large (first by maximum fps and then minimum fps). - // Example value: "(10500,26623),(15000,26623),(30000,30000)" - static const char KEY_SUPPORTED_PREVIEW_FPS_RANGE[]; - // The image format for preview frames. See CAMERA_MSG_PREVIEW_FRAME in - // frameworks/av/include/camera/Camera.h. The default is - // PIXEL_FORMAT_YUV420SP. Example value: "yuv420sp" or PIXEL_FORMAT_XXX - // constants. Read/write. - static const char KEY_PREVIEW_FORMAT[]; - // Supported image formats for preview frames. - // Example value: "yuv420sp,yuv422i-yuyv". Read only. - static const char KEY_SUPPORTED_PREVIEW_FORMATS[]; - // Number of preview frames per second. This is the target frame rate. The - // actual frame rate depends on the driver. - // Example value: "15". Read/write. - static const char KEY_PREVIEW_FRAME_RATE[]; - // Supported number of preview frames per second. - // Example value: "24,15,10". Read. - static const char KEY_SUPPORTED_PREVIEW_FRAME_RATES[]; - // The dimensions for captured pictures in pixels (width x height). - // Example value: "1024x768". Read/write. - static const char KEY_PICTURE_SIZE[]; - // Supported dimensions for captured pictures in pixels. - // Example value: "2048x1536,1024x768". Read only. - static const char KEY_SUPPORTED_PICTURE_SIZES[]; - // The image format for captured pictures. See CAMERA_MSG_COMPRESSED_IMAGE - // in frameworks/base/include/camera/Camera.h. - // Example value: "jpeg" or PIXEL_FORMAT_XXX constants. Read/write. - static const char KEY_PICTURE_FORMAT[]; - // Supported image formats for captured pictures. - // Example value: "jpeg,rgb565". Read only. - static const char KEY_SUPPORTED_PICTURE_FORMATS[]; - // The width (in pixels) of EXIF thumbnail in Jpeg picture. - // Example value: "512". Read/write. - static const char KEY_JPEG_THUMBNAIL_WIDTH[]; - // The height (in pixels) of EXIF thumbnail in Jpeg picture. - // Example value: "384". Read/write. - static const char KEY_JPEG_THUMBNAIL_HEIGHT[]; - // Supported EXIF thumbnail sizes (width x height). 0x0 means not thumbnail - // in EXIF. - // Example value: "512x384,320x240,0x0". Read only. - static const char KEY_SUPPORTED_JPEG_THUMBNAIL_SIZES[]; - // The quality of the EXIF thumbnail in Jpeg picture. The range is 1 to 100, - // with 100 being the best. - // Example value: "90". Read/write. - static const char KEY_JPEG_THUMBNAIL_QUALITY[]; - // Jpeg quality of captured picture. The range is 1 to 100, with 100 being - // the best. - // Example value: "90". Read/write. - static const char KEY_JPEG_QUALITY[]; - // The rotation angle in degrees relative to the orientation of the camera. - // This affects the pictures returned from CAMERA_MSG_COMPRESSED_IMAGE. The - // camera driver may set orientation in the EXIF header without rotating the - // picture. Or the driver may rotate the picture and the EXIF thumbnail. If - // the Jpeg picture is rotated, the orientation in the EXIF header will be - // missing or 1 (row #0 is top and column #0 is left side). - // - // Note that the JPEG pictures of front-facing cameras are not mirrored - // as in preview display. - // - // For example, suppose the natural orientation of the device is portrait. - // The device is rotated 270 degrees clockwise, so the device orientation is - // 270. Suppose a back-facing camera sensor is mounted in landscape and the - // top side of the camera sensor is aligned with the right edge of the - // display in natural orientation. So the camera orientation is 90. The - // rotation should be set to 0 (270 + 90). - // - // Example value: "0" or "90" or "180" or "270". Write only. - static const char KEY_ROTATION[]; - // GPS latitude coordinate. GPSLatitude and GPSLatitudeRef will be stored in - // JPEG EXIF header. - // Example value: "25.032146" or "-33.462809". Write only. - static const char KEY_GPS_LATITUDE[]; - // GPS longitude coordinate. GPSLongitude and GPSLongitudeRef will be stored - // in JPEG EXIF header. - // Example value: "121.564448" or "-70.660286". Write only. - static const char KEY_GPS_LONGITUDE[]; - // GPS altitude. GPSAltitude and GPSAltitudeRef will be stored in JPEG EXIF - // header. - // Example value: "21.0" or "-5". Write only. - static const char KEY_GPS_ALTITUDE[]; - // GPS timestamp (UTC in seconds since January 1, 1970). This should be - // stored in JPEG EXIF header. - // Example value: "1251192757". Write only. - static const char KEY_GPS_TIMESTAMP[]; - // GPS Processing Method - // Example value: "GPS" or "NETWORK". Write only. - static const char KEY_GPS_PROCESSING_METHOD[]; - // Current white balance setting. - // Example value: "auto" or WHITE_BALANCE_XXX constants. Read/write. - static const char KEY_WHITE_BALANCE[]; - // Supported white balance settings. - // Example value: "auto,incandescent,daylight". Read only. - static const char KEY_SUPPORTED_WHITE_BALANCE[]; - // Current color effect setting. - // Example value: "none" or EFFECT_XXX constants. Read/write. - static const char KEY_EFFECT[]; - // Supported color effect settings. - // Example value: "none,mono,sepia". Read only. - static const char KEY_SUPPORTED_EFFECTS[]; - // Current antibanding setting. - // Example value: "auto" or ANTIBANDING_XXX constants. Read/write. - static const char KEY_ANTIBANDING[]; - // Supported antibanding settings. - // Example value: "auto,50hz,60hz,off". Read only. - static const char KEY_SUPPORTED_ANTIBANDING[]; - // Current scene mode. - // Example value: "auto" or SCENE_MODE_XXX constants. Read/write. - static const char KEY_SCENE_MODE[]; - // Supported scene mode settings. - // Example value: "auto,night,fireworks". Read only. - static const char KEY_SUPPORTED_SCENE_MODES[]; - // Current flash mode. - // Example value: "auto" or FLASH_MODE_XXX constants. Read/write. - static const char KEY_FLASH_MODE[]; - // Supported flash modes. - // Example value: "auto,on,off". Read only. - static const char KEY_SUPPORTED_FLASH_MODES[]; - // Current focus mode. This will not be empty. Applications should call - // CameraHardwareInterface.autoFocus to start the focus if focus mode is - // FOCUS_MODE_AUTO or FOCUS_MODE_MACRO. - // Example value: "auto" or FOCUS_MODE_XXX constants. Read/write. - static const char KEY_FOCUS_MODE[]; - // Supported focus modes. - // Example value: "auto,macro,fixed". Read only. - static const char KEY_SUPPORTED_FOCUS_MODES[]; - // The maximum number of focus areas supported. This is the maximum length - // of KEY_FOCUS_AREAS. - // Example value: "0" or "2". Read only. - static const char KEY_MAX_NUM_FOCUS_AREAS[]; - // Current focus areas. - // - // Before accessing this parameter, apps should check - // KEY_MAX_NUM_FOCUS_AREAS first to know the maximum number of focus areas - // first. If the value is 0, focus area is not supported. - // - // Each focus area is a five-element int array. The first four elements are - // the rectangle of the area (left, top, right, bottom). The direction is - // relative to the sensor orientation, that is, what the sensor sees. The - // direction is not affected by the rotation or mirroring of - // CAMERA_CMD_SET_DISPLAY_ORIENTATION. Coordinates range from -1000 to 1000. - // (-1000,-1000) is the upper left point. (1000, 1000) is the lower right - // point. The width and height of focus areas cannot be 0 or negative. - // - // The fifth element is the weight. Values for weight must range from 1 to - // 1000. The weight should be interpreted as a per-pixel weight - all - // pixels in the area have the specified weight. This means a small area - // with the same weight as a larger area will have less influence on the - // focusing than the larger area. Focus areas can partially overlap and the - // driver will add the weights in the overlap region. - // - // A special case of single focus area (0,0,0,0,0) means driver to decide - // the focus area. For example, the driver may use more signals to decide - // focus areas and change them dynamically. Apps can set (0,0,0,0,0) if they - // want the driver to decide focus areas. - // - // Focus areas are relative to the current field of view (KEY_ZOOM). No - // matter what the zoom level is, (-1000,-1000) represents the top of the - // currently visible camera frame. The focus area cannot be set to be - // outside the current field of view, even when using zoom. - // - // Focus area only has effect if the current focus mode is FOCUS_MODE_AUTO, - // FOCUS_MODE_MACRO, FOCUS_MODE_CONTINUOUS_VIDEO, or - // FOCUS_MODE_CONTINUOUS_PICTURE. - // Example value: "(-10,-10,0,0,300),(0,0,10,10,700)". Read/write. - static const char KEY_FOCUS_AREAS[]; - // Focal length in millimeter. - // Example value: "4.31". Read only. - static const char KEY_FOCAL_LENGTH[]; - // Horizontal angle of view in degrees. - // Example value: "54.8". Read only. - static const char KEY_HORIZONTAL_VIEW_ANGLE[]; - // Vertical angle of view in degrees. - // Example value: "42.5". Read only. - static const char KEY_VERTICAL_VIEW_ANGLE[]; - // Exposure compensation index. 0 means exposure is not adjusted. - // Example value: "-5" or "5". Read/write. - static const char KEY_EXPOSURE_COMPENSATION[]; - // The maximum exposure compensation index (>=0). - // Example value: "6". Read only. - static const char KEY_MAX_EXPOSURE_COMPENSATION[]; - // The minimum exposure compensation index (<=0). - // Example value: "-6". Read only. - static const char KEY_MIN_EXPOSURE_COMPENSATION[]; - // The exposure compensation step. Exposure compensation index multiply by - // step eqals to EV. Ex: if exposure compensation index is -6 and step is - // 0.3333, EV is -2. - // Example value: "0.333333333" or "0.5". Read only. - static const char KEY_EXPOSURE_COMPENSATION_STEP[]; - // The state of the auto-exposure lock. "true" means that - // auto-exposure is locked to its current value and will not - // change. "false" means the auto-exposure routine is free to - // change exposure values. If auto-exposure is already locked, - // setting this to true again has no effect (the driver will not - // recalculate exposure values). Changing exposure compensation - // settings will still affect the exposure settings while - // auto-exposure is locked. Stopping preview or taking a still - // image will not change the lock. In conjunction with - // exposure compensation, this allows for capturing multi-exposure - // brackets with known relative exposure values. Locking - // auto-exposure after open but before the first call to - // startPreview may result in severely over- or under-exposed - // images. The driver will not change the AE lock after - // auto-focus completes. - static const char KEY_AUTO_EXPOSURE_LOCK[]; - // Whether locking the auto-exposure is supported. "true" means it is, and - // "false" or this key not existing means it is not supported. - static const char KEY_AUTO_EXPOSURE_LOCK_SUPPORTED[]; - // The state of the auto-white balance lock. "true" means that - // auto-white balance is locked to its current value and will not - // change. "false" means the auto-white balance routine is free to - // change white balance values. If auto-white balance is already - // locked, setting this to true again has no effect (the driver - // will not recalculate white balance values). Stopping preview or - // taking a still image will not change the lock. In conjunction - // with exposure compensation, this allows for capturing - // multi-exposure brackets with fixed white balance. Locking - // auto-white balance after open but before the first call to - // startPreview may result in severely incorrect color. The - // driver will not change the AWB lock after auto-focus - // completes. - static const char KEY_AUTO_WHITEBALANCE_LOCK[]; - // Whether locking the auto-white balance is supported. "true" - // means it is, and "false" or this key not existing means it is - // not supported. - static const char KEY_AUTO_WHITEBALANCE_LOCK_SUPPORTED[]; - - // The maximum number of metering areas supported. This is the maximum - // length of KEY_METERING_AREAS. - // Example value: "0" or "2". Read only. - static const char KEY_MAX_NUM_METERING_AREAS[]; - // Current metering areas. Camera driver uses these areas to decide - // exposure. - // - // Before accessing this parameter, apps should check - // KEY_MAX_NUM_METERING_AREAS first to know the maximum number of metering - // areas first. If the value is 0, metering area is not supported. - // - // Each metering area is a rectangle with specified weight. The direction is - // relative to the sensor orientation, that is, what the sensor sees. The - // direction is not affected by the rotation or mirroring of - // CAMERA_CMD_SET_DISPLAY_ORIENTATION. Coordinates of the rectangle range - // from -1000 to 1000. (-1000, -1000) is the upper left point. (1000, 1000) - // is the lower right point. The width and height of metering areas cannot - // be 0 or negative. - // - // The fifth element is the weight. Values for weight must range from 1 to - // 1000. The weight should be interpreted as a per-pixel weight - all - // pixels in the area have the specified weight. This means a small area - // with the same weight as a larger area will have less influence on the - // metering than the larger area. Metering areas can partially overlap and - // the driver will add the weights in the overlap region. - // - // A special case of all-zero single metering area means driver to decide - // the metering area. For example, the driver may use more signals to decide - // metering areas and change them dynamically. Apps can set all-zero if they - // want the driver to decide metering areas. - // - // Metering areas are relative to the current field of view (KEY_ZOOM). - // No matter what the zoom level is, (-1000,-1000) represents the top of the - // currently visible camera frame. The metering area cannot be set to be - // outside the current field of view, even when using zoom. - // - // No matter what metering areas are, the final exposure are compensated - // by KEY_EXPOSURE_COMPENSATION. - // Example value: "(-10,-10,0,0,300),(0,0,10,10,700)". Read/write. - static const char KEY_METERING_AREAS[]; - // Current zoom value. - // Example value: "0" or "6". Read/write. - static const char KEY_ZOOM[]; - // Maximum zoom value. - // Example value: "6". Read only. - static const char KEY_MAX_ZOOM[]; - // The zoom ratios of all zoom values. The zoom ratio is in 1/100 - // increments. Ex: a zoom of 3.2x is returned as 320. The number of list - // elements is KEY_MAX_ZOOM + 1. The first element is always 100. The last - // element is the zoom ratio of zoom value KEY_MAX_ZOOM. - // Example value: "100,150,200,250,300,350,400". Read only. - static const char KEY_ZOOM_RATIOS[]; - // Whether zoom is supported. Zoom is supported if the value is "true". Zoom - // is not supported if the value is not "true" or the key does not exist. - // Example value: "true". Read only. - static const char KEY_ZOOM_SUPPORTED[]; - // Whether if smooth zoom is supported. Smooth zoom is supported if the - // value is "true". It is not supported if the value is not "true" or the - // key does not exist. - // See CAMERA_CMD_START_SMOOTH_ZOOM, CAMERA_CMD_STOP_SMOOTH_ZOOM, and - // CAMERA_MSG_ZOOM in frameworks/base/include/camera/Camera.h. - // Example value: "true". Read only. - static const char KEY_SMOOTH_ZOOM_SUPPORTED[]; - - // The distances (in meters) from the camera to where an object appears to - // be in focus. The object is sharpest at the optimal focus distance. The - // depth of field is the far focus distance minus near focus distance. - // - // Focus distances may change after starting auto focus, canceling auto - // focus, or starting the preview. Applications can read this anytime to get - // the latest focus distances. If the focus mode is FOCUS_MODE_CONTINUOUS, - // focus distances may change from time to time. - // - // This is intended to estimate the distance between the camera and the - // subject. After autofocus, the subject distance may be within near and far - // focus distance. However, the precision depends on the camera hardware, - // autofocus algorithm, the focus area, and the scene. The error can be - // large and it should be only used as a reference. - // - // Far focus distance > optimal focus distance > near focus distance. If - // the far focus distance is infinity, the value should be "Infinity" (case - // sensitive). The format is three float values separated by commas. The - // first is near focus distance. The second is optimal focus distance. The - // third is far focus distance. - // Example value: "0.95,1.9,Infinity" or "0.049,0.05,0.051". Read only. - static const char KEY_FOCUS_DISTANCES[]; - - // The current dimensions in pixels (width x height) for video frames. - // The width and height must be one of the supported sizes retrieved - // via KEY_SUPPORTED_VIDEO_SIZES. - // Example value: "1280x720". Read/write. - static const char KEY_VIDEO_SIZE[]; - // A list of the supported dimensions in pixels (width x height) - // for video frames. See CAMERA_MSG_VIDEO_FRAME for details in - // frameworks/base/include/camera/Camera.h. - // Example: "176x144,1280x720". Read only. - static const char KEY_SUPPORTED_VIDEO_SIZES[]; - - // The maximum number of detected faces supported by hardware face - // detection. If the value is 0, hardware face detection is not supported. - // Example: "5". Read only - static const char KEY_MAX_NUM_DETECTED_FACES_HW[]; - - // The maximum number of detected faces supported by software face - // detection. If the value is 0, software face detection is not supported. - // Example: "5". Read only - static const char KEY_MAX_NUM_DETECTED_FACES_SW[]; - - // Preferred preview frame size in pixels for video recording. - // The width and height must be one of the supported sizes retrieved - // via KEY_SUPPORTED_PREVIEW_SIZES. This key can be used only when - // getSupportedVideoSizes() does not return an empty Vector of Size. - // Camcorder applications are recommended to set the preview size - // to a value that is not larger than the preferred preview size. - // In other words, the product of the width and height of the - // preview size should not be larger than that of the preferred - // preview size. In addition, we recommend to choos a preview size - // that has the same aspect ratio as the resolution of video to be - // recorded. - // Example value: "800x600". Read only. - static const char KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO[]; - - // The image format for video frames. See CAMERA_MSG_VIDEO_FRAME in - // frameworks/base/include/camera/Camera.h. - // Example value: "yuv420sp" or PIXEL_FORMAT_XXX constants. Read only. - static const char KEY_VIDEO_FRAME_FORMAT[]; - - // Sets the hint of the recording mode. If this is true, MediaRecorder.start - // may be faster or has less glitches. This should be called before starting - // the preview for the best result. But it is allowed to change the hint - // while the preview is active. The default value is false. - // - // The apps can still call Camera.takePicture when the hint is true. The - // apps can call MediaRecorder.start when the hint is false. But the - // performance may be worse. - // Example value: "true" or "false". Read/write. - static const char KEY_RECORDING_HINT[]; - - // Returns true if video snapshot is supported. That is, applications - // can call Camera.takePicture during recording. Applications do not need to - // call Camera.startPreview after taking a picture. The preview will be - // still active. Other than that, taking a picture during recording is - // identical to taking a picture normally. All settings and methods related - // to takePicture work identically. Ex: KEY_PICTURE_SIZE, - // KEY_SUPPORTED_PICTURE_SIZES, KEY_JPEG_QUALITY, KEY_ROTATION, and etc. - // The picture will have an EXIF header. FLASH_MODE_AUTO and FLASH_MODE_ON - // also still work, but the video will record the flash. - // - // Applications can set shutter callback as null to avoid the shutter - // sound. It is also recommended to set raw picture and post view callbacks - // to null to avoid the interrupt of preview display. - // - // Field-of-view of the recorded video may be different from that of the - // captured pictures. - // Example value: "true" or "false". Read only. - static const char KEY_VIDEO_SNAPSHOT_SUPPORTED[]; - - // The state of the video stabilization. If set to true, both the - // preview stream and the recorded video stream are stabilized by - // the camera. Only valid to set if KEY_VIDEO_STABILIZATION_SUPPORTED is - // set to true. - // - // The value of this key can be changed any time the camera is - // open. If preview or recording is active, it is acceptable for - // there to be a slight video glitch when video stabilization is - // toggled on and off. - // - // This only stabilizes video streams (between-frames stabilization), and - // has no effect on still image capture. - static const char KEY_VIDEO_STABILIZATION[]; - - // Returns true if video stabilization is supported. That is, applications - // can set KEY_VIDEO_STABILIZATION to true and have a stabilized preview - // stream and record stabilized videos. - static const char KEY_VIDEO_STABILIZATION_SUPPORTED[]; - - // Supported modes for special effects with light. - // Example values: "lowlight,hdr". - static const char KEY_LIGHTFX[]; - - // Value for KEY_ZOOM_SUPPORTED or KEY_SMOOTH_ZOOM_SUPPORTED. - static const char TRUE[]; - static const char FALSE[]; - - // Value for KEY_FOCUS_DISTANCES. - static const char FOCUS_DISTANCE_INFINITY[]; - - // Values for white balance settings. - static const char WHITE_BALANCE_AUTO[]; - static const char WHITE_BALANCE_INCANDESCENT[]; - static const char WHITE_BALANCE_FLUORESCENT[]; - static const char WHITE_BALANCE_WARM_FLUORESCENT[]; - static const char WHITE_BALANCE_DAYLIGHT[]; - static const char WHITE_BALANCE_CLOUDY_DAYLIGHT[]; - static const char WHITE_BALANCE_TWILIGHT[]; - static const char WHITE_BALANCE_SHADE[]; - - // Values for effect settings. - static const char EFFECT_NONE[]; - static const char EFFECT_MONO[]; - static const char EFFECT_NEGATIVE[]; - static const char EFFECT_SOLARIZE[]; - static const char EFFECT_SEPIA[]; - static const char EFFECT_POSTERIZE[]; - static const char EFFECT_WHITEBOARD[]; - static const char EFFECT_BLACKBOARD[]; - static const char EFFECT_AQUA[]; - - // Values for antibanding settings. - static const char ANTIBANDING_AUTO[]; - static const char ANTIBANDING_50HZ[]; - static const char ANTIBANDING_60HZ[]; - static const char ANTIBANDING_OFF[]; - - // Values for flash mode settings. - // Flash will not be fired. - static const char FLASH_MODE_OFF[]; - // Flash will be fired automatically when required. The flash may be fired - // during preview, auto-focus, or snapshot depending on the driver. - static const char FLASH_MODE_AUTO[]; - // Flash will always be fired during snapshot. The flash may also be - // fired during preview or auto-focus depending on the driver. - static const char FLASH_MODE_ON[]; - // Flash will be fired in red-eye reduction mode. - static const char FLASH_MODE_RED_EYE[]; - // Constant emission of light during preview, auto-focus and snapshot. - // This can also be used for video recording. - static const char FLASH_MODE_TORCH[]; - - // Values for scene mode settings. - static const char SCENE_MODE_AUTO[]; - static const char SCENE_MODE_ACTION[]; - static const char SCENE_MODE_PORTRAIT[]; - static const char SCENE_MODE_LANDSCAPE[]; - static const char SCENE_MODE_NIGHT[]; - static const char SCENE_MODE_NIGHT_PORTRAIT[]; - static const char SCENE_MODE_THEATRE[]; - static const char SCENE_MODE_BEACH[]; - static const char SCENE_MODE_SNOW[]; - static const char SCENE_MODE_SUNSET[]; - static const char SCENE_MODE_STEADYPHOTO[]; - static const char SCENE_MODE_FIREWORKS[]; - static const char SCENE_MODE_SPORTS[]; - static const char SCENE_MODE_PARTY[]; - static const char SCENE_MODE_CANDLELIGHT[]; - // Applications are looking for a barcode. Camera driver will be optimized - // for barcode reading. - static const char SCENE_MODE_BARCODE[]; - // A high-dynamic range mode. In this mode, the HAL module will use a - // capture strategy that extends the dynamic range of the captured - // image in some fashion. Only the final image is returned. - static const char SCENE_MODE_HDR[]; - - // Pixel color formats for KEY_PREVIEW_FORMAT, KEY_PICTURE_FORMAT, - // and KEY_VIDEO_FRAME_FORMAT - static const char PIXEL_FORMAT_YUV422SP[]; - static const char PIXEL_FORMAT_YUV420SP[]; // NV21 - static const char PIXEL_FORMAT_YUV422I[]; // YUY2 - static const char PIXEL_FORMAT_YUV420P[]; // YV12 - static const char PIXEL_FORMAT_RGB565[]; - static const char PIXEL_FORMAT_RGBA8888[]; - static const char PIXEL_FORMAT_JPEG[]; - // Raw bayer format used for images, which is 10 bit precision samples - // stored in 16 bit words. The filter pattern is RGGB. - static const char PIXEL_FORMAT_BAYER_RGGB[]; - // Pixel format is not known to the framework - static const char PIXEL_FORMAT_ANDROID_OPAQUE[]; - - // Values for focus mode settings. - // Auto-focus mode. Applications should call - // CameraHardwareInterface.autoFocus to start the focus in this mode. - static const char FOCUS_MODE_AUTO[]; - // Focus is set at infinity. Applications should not call - // CameraHardwareInterface.autoFocus in this mode. - static const char FOCUS_MODE_INFINITY[]; - // Macro (close-up) focus mode. Applications should call - // CameraHardwareInterface.autoFocus to start the focus in this mode. - static const char FOCUS_MODE_MACRO[]; - // Focus is fixed. The camera is always in this mode if the focus is not - // adjustable. If the camera has auto-focus, this mode can fix the - // focus, which is usually at hyperfocal distance. Applications should - // not call CameraHardwareInterface.autoFocus in this mode. - static const char FOCUS_MODE_FIXED[]; - // Extended depth of field (EDOF). Focusing is done digitally and - // continuously. Applications should not call - // CameraHardwareInterface.autoFocus in this mode. - static const char FOCUS_MODE_EDOF[]; - // Continuous auto focus mode intended for video recording. The camera - // continuously tries to focus. This is the best choice for video - // recording because the focus changes smoothly . Applications still can - // call CameraHardwareInterface.takePicture in this mode but the subject may - // not be in focus. Auto focus starts when the parameter is set. - // - // Applications can call CameraHardwareInterface.autoFocus in this mode. The - // focus callback will immediately return with a boolean that indicates - // whether the focus is sharp or not. The focus position is locked after - // autoFocus call. If applications want to resume the continuous focus, - // cancelAutoFocus must be called. Restarting the preview will not resume - // the continuous autofocus. To stop continuous focus, applications should - // change the focus mode to other modes. - static const char FOCUS_MODE_CONTINUOUS_VIDEO[]; - // Continuous auto focus mode intended for taking pictures. The camera - // continuously tries to focus. The speed of focus change is more aggressive - // than FOCUS_MODE_CONTINUOUS_VIDEO. Auto focus starts when the parameter is - // set. - // - // Applications can call CameraHardwareInterface.autoFocus in this mode. If - // the autofocus is in the middle of scanning, the focus callback will - // return when it completes. If the autofocus is not scanning, focus - // callback will immediately return with a boolean that indicates whether - // the focus is sharp or not. The apps can then decide if they want to take - // a picture immediately or to change the focus mode to auto, and run a full - // autofocus cycle. The focus position is locked after autoFocus call. If - // applications want to resume the continuous focus, cancelAutoFocus must be - // called. Restarting the preview will not resume the continuous autofocus. - // To stop continuous focus, applications should change the focus mode to - // other modes. - static const char FOCUS_MODE_CONTINUOUS_PICTURE[]; - - // Values for light special effects - // Low-light enhancement mode - static const char LIGHTFX_LOWLIGHT[]; - // High-dynamic range mode - static const char LIGHTFX_HDR[]; - - /** - * Returns the the supported preview formats as an enum given in graphics.h - * corrsponding to the format given in the input string or -1 if no such - * conversion exists. - */ - static int previewFormatToEnum(const char* format); - -private: - DefaultKeyedVector mMap; -}; - -}; // namespace android - -#endif diff --git a/camera_parameters/MtkCameraParameters.cpp b/camera_parameters/MtkCameraParameters.cpp deleted file mode 100644 index 60c2c0b045071d2ba5b5fcf2e44612d1c27bd928..0000000000000000000000000000000000000000 --- a/camera_parameters/MtkCameraParameters.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* -** -** Copyright 2008, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - -#define LOG_TAG "MTKCameraParams" -#include - -#include -#include -#include "MtkCameraParameters.h" - -namespace android { - - -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// App Mode. -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -const char MtkCameraParameters::PROPERTY_KEY_CLIENT_APPMODE[] = "client.appmode"; -// -const char MtkCameraParameters::APP_MODE_NAME_DEFAULT[] = "Default"; -const char MtkCameraParameters::APP_MODE_NAME_MTK_ENG[] = "MtkEng"; -const char MtkCameraParameters::APP_MODE_NAME_MTK_ATV[] = "MtkAtv"; -const char MtkCameraParameters::APP_MODE_NAME_MTK_S3D[] = "MtkS3d"; -const char MtkCameraParameters::APP_MODE_NAME_MTK_VT[] = "MtkVt"; -const char MtkCameraParameters::APP_MODE_NAME_MTK_PHOTO[] = "MtkPhoto"; -const char MtkCameraParameters::APP_MODE_NAME_MTK_VIDEO[] = "MtkVideo"; -const char MtkCameraParameters::APP_MODE_NAME_MTK_ZSD[] = "MtkZsd"; - -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// Scene Mode -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -const char MtkCameraParameters::SCENE_MODE_NORMAL[] = "normal"; - -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// Face Beauty -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -const char MtkCameraParameters::KEY_FB_SMOOTH_LEVEL[] = "fb-smooth-level"; -const char MtkCameraParameters::KEY_FB_SMOOTH_LEVEL_MIN[] = "fb-smooth-level-min"; -const char MtkCameraParameters::KEY_FB_SMOOTH_LEVEL_MAX[] = "fb-smooth-level-max"; -// -const char MtkCameraParameters::KEY_FB_SKIN_COLOR[] = "fb-skin-color"; -const char MtkCameraParameters::KEY_FB_SKIN_COLOR_MIN[] = "fb-skin-color-min"; -const char MtkCameraParameters::KEY_FB_SKIN_COLOR_MAX[] = "fb-skin-color-max"; -// -const char MtkCameraParameters::KEY_FB_SHARP[] = "fb-sharp"; -const char MtkCameraParameters::KEY_FB_SHARP_MIN[] = "fb-sharp-min"; -const char MtkCameraParameters::KEY_FB_SHARP_MAX[] = "fb-sharp-max"; -// -const char MtkCameraParameters::KEY_FB_ENLARGE_EYE[] = "fb-enlarge-eye"; -const char MtkCameraParameters::KEY_FB_ENLARGE_EYE_MIN[] = "fb-enlarge-eye-min"; -const char MtkCameraParameters::KEY_FB_ENLARGE_EYE_MAX[] = "fb-enlarge-eye-max"; -// -const char MtkCameraParameters::KEY_FB_SLIM_FACE[] = "fb-slim-face"; -const char MtkCameraParameters::KEY_FB_SLIM_FACE_MIN[] = "fb-slim-face-min"; -const char MtkCameraParameters::KEY_FB_SLIM_FACE_MAX[] = "fb-slim-face-max"; -// -const char MtkCameraParameters::KEY_FB_EXTREME_BEAUTY[] = "fb-extreme-beauty"; -// -const char MtkCameraParameters::KEY_FACE_BEAUTY[] = "face-beauty"; - - -// -const char MtkCameraParameters::KEY_EXPOSURE[] = "exposure"; -const char MtkCameraParameters::KEY_EXPOSURE_METER[] = "exposure-meter"; -const char MtkCameraParameters::KEY_ISO_SPEED[] = "iso-speed"; -const char MtkCameraParameters::KEY_AE_MODE[] = "ae-mode"; -const char MtkCameraParameters::KEY_FOCUS_METER[] = "focus-meter"; -const char MtkCameraParameters::KEY_EDGE[] = "edge"; -const char MtkCameraParameters::KEY_HUE[] = "hue"; -const char MtkCameraParameters::KEY_SATURATION[] = "saturation"; -const char MtkCameraParameters::KEY_BRIGHTNESS[] = "brightness"; -const char MtkCameraParameters::KEY_CONTRAST[] = "contrast"; -const char MtkCameraParameters::KEY_AF_LAMP_MODE [] = "aflamp-mode"; -const char MtkCameraParameters::KEY_STEREO_3D_PREVIEW_SIZE[] = "stereo3d-preview-size"; -const char MtkCameraParameters::KEY_STEREO_3D_PICTURE_SIZE[] = "stereo3d-picture-size"; -const char MtkCameraParameters::KEY_STEREO_3D_TYPE [] = "stereo3d-type"; -const char MtkCameraParameters::KEY_STEREO_3D_MODE [] = "stereo3d-mode"; -const char MtkCameraParameters::KEY_STEREO_3D_IMAGE_FORMAT [] = "stereo3d-image-format"; - -// ZSD -const char MtkCameraParameters::KEY_ZSD_MODE[] = "zsd-mode"; -const char MtkCameraParameters::KEY_SUPPORTED_ZSD_MODE[] = "zsd-supported"; -// -const char MtkCameraParameters::KEY_FPS_MODE[] = "fps-mode"; -// -const char MtkCameraParameters::KEY_FOCUS_DRAW[] = "af-draw"; -// -const char MtkCameraParameters::KEY_CAPTURE_MODE[] = "cap-mode"; -const char MtkCameraParameters::KEY_SUPPORTED_CAPTURE_MODES[] = "cap-mode-values"; -const char MtkCameraParameters::KEY_CAPTURE_PATH[] = "capfname"; -const char MtkCameraParameters::KEY_BURST_SHOT_NUM[] = "burst-num"; -// -const char MtkCameraParameters::KEY_MATV_PREVIEW_DELAY[] = "tv-delay"; -const char MtkCameraParameters::KEY_PANORAMA_IDX[] = "pano-idx"; -const char MtkCameraParameters::KEY_PANORAMA_DIR[] = "pano-dir"; - -// Values for KEY_EXPOSURE -const char MtkCameraParameters::EXPOSURE_METER_SPOT[] = "spot"; -const char MtkCameraParameters::EXPOSURE_METER_CENTER[] = "center"; -const char MtkCameraParameters::EXPOSURE_METER_AVERAGE[] = "average"; - -// Valeus for KEY_ISO_SPEED -const char MtkCameraParameters::ISO_SPEED_AUTO[] = "auto"; -const char MtkCameraParameters::ISO_SPEED_100[] = "100"; -const char MtkCameraParameters::ISO_SPEED_200[] = "200"; -const char MtkCameraParameters::ISO_SPEED_400[] = "400"; -const char MtkCameraParameters::ISO_SPEED_800[] = "800"; -const char MtkCameraParameters::ISO_SPEED_1600[] = "1600"; - -// Values for KEY_AE_MODE = "ae-mode" - -// Values for KEY_FOCUS_METER -const char MtkCameraParameters::FOCUS_METER_SPOT[] = "spot"; -const char MtkCameraParameters::FOCUS_METER_MULTI[] = "multi"; - -// AWB2PASS -const char MtkCameraParameters::KEY_AWB2PASS[] = "awb-2pass"; - - -// -// Camera Mode -const char MtkCameraParameters::KEY_CAMERA_MODE[] = "mtk-cam-mode"; -// Values for KEY_CAMERA_MODE -const int MtkCameraParameters::CAMERA_MODE_NORMAL = 0; -const int MtkCameraParameters::CAMERA_MODE_MTK_PRV = 1; -const int MtkCameraParameters::CAMERA_MODE_MTK_VDO = 2; -const int MtkCameraParameters::CAMERA_MODE_MTK_VT = 3; - -// Values for KEY_FPS_MODE -const int MtkCameraParameters::FPS_MODE_NORMAL = 0; -const int MtkCameraParameters::FPS_MODE_FIX = 1; - -// Values for raw save mode - -// Values for KEY_FOCUS_DRAW - -// Values for capture mode -const char MtkCameraParameters::CAPTURE_MODE_PANORAMA_SHOT[] = "panoramashot"; -const char MtkCameraParameters::CAPTURE_MODE_BURST_SHOT[] = "burstshot"; -const char MtkCameraParameters::CAPTURE_MODE_NORMAL[] = "normal"; -const char MtkCameraParameters::CAPTURE_MODE_BEST_SHOT[] = "bestshot"; -const char MtkCameraParameters::CAPTURE_MODE_EV_BRACKET_SHOT[] = "evbracketshot"; -const char MtkCameraParameters::CAPTURE_MODE_SMILE_SHOT[] = "smileshot"; -const char MtkCameraParameters::CAPTURE_MODE_MAV_SHOT[] = "mav"; -const char MtkCameraParameters::CAPTURE_MODE_AUTO_PANORAMA_SHOT[] = "autorama"; -const char MtkCameraParameters::CAPTURE_MODE_MOTION_TRACK_SHOT[] = "motiontrack"; -const char MtkCameraParameters::CAPTURE_MODE_HDR_SHOT[] = "hdr"; -const char MtkCameraParameters::CAPTURE_MODE_ASD_SHOT[] = "asd"; -const char MtkCameraParameters::CAPTURE_MODE_ZSD_SHOT[] = "zsd"; -const char MtkCameraParameters::CAPTURE_MODE_PANO_3D[] = "pano_3d"; -const char MtkCameraParameters::CAPTURE_MODE_SINGLE_3D[] = "single_3d"; -const char MtkCameraParameters::CAPTURE_MODE_FACE_BEAUTY[] = "face_beauty"; -const char MtkCameraParameters::CAPTURE_MODE_CONTINUOUS_SHOT[] = "continuousshot"; -const char MtkCameraParameters::CAPTURE_MODE_MULTI_MOTION[] = "multi_motion"; -const char MtkCameraParameters::CAPTURE_MODE_GESTURE_SHOT[] = "gestureshot"; - -// Values for panorama direction settings -const char MtkCameraParameters::PANORAMA_DIR_RIGHT[] = "right"; -const char MtkCameraParameters::PANORAMA_DIR_LEFT[] = "left"; -const char MtkCameraParameters::PANORAMA_DIR_TOP[] = "top"; -const char MtkCameraParameters::PANORAMA_DIR_DOWN[] = "down"; - -// -const int MtkCameraParameters::ENABLE = 1; -const int MtkCameraParameters::DISABLE = 0; - -// Values for KEY_EDGE, KEY_HUE, KEY_SATURATION, KEY_BRIGHTNESS, KEY_CONTRAST -const char MtkCameraParameters::HIGH[] = "high"; -const char MtkCameraParameters::MIDDLE[] = "middle"; -const char MtkCameraParameters::LOW[] = "low"; - -// Preview Internal Format. -const char MtkCameraParameters::KEY_PREVIEW_INT_FORMAT[] = "prv-int-fmt"; - -// Pixel color formats for KEY_PREVIEW_FORMAT, KEY_PICTURE_FORMAT, -// and KEY_VIDEO_FRAME_FORMAT -const char MtkCameraParameters::PIXEL_FORMAT_YUV420I[] = "yuv420i-yyuvyy-3plane"; -const char MtkCameraParameters::PIXEL_FORMAT_YV12_GPU[] = "yv12-gpu"; -const char MtkCameraParameters::PIXEL_FORMAT_YUV422I_UYVY[] = "yuv422i-uyvy"; -const char MtkCameraParameters::PIXEL_FORMAT_YUV422I_VYUY[] = "yuv422i-vyuy"; -const char MtkCameraParameters::PIXEL_FORMAT_YUV422I_YVYU[] = "yuv422i-yvyu"; - -const char MtkCameraParameters::PIXEL_FORMAT_BAYER8[] = "bayer8"; -const char MtkCameraParameters::PIXEL_FORMAT_BAYER10[] = "bayer10"; - -const char MtkCameraParameters::KEY_BRIGHTNESS_VALUE[] = "brightness_value"; - -// ISP Operation mode for meta mode use -const char MtkCameraParameters::KEY_ISP_MODE[] = "isp-mode"; -// AF -const char MtkCameraParameters::KEY_AF_X[] = "af-x"; -const char MtkCameraParameters::KEY_AF_Y[] = "af-y"; -// Effect -const char MtkCameraParameters::EFFECT_SEPIA_BLUE[] = "sepiablue"; -const char MtkCameraParameters::EFFECT_SEPIA_GREEN[] = "sepiagreen"; - -// -// on/off => FIXME: should be replaced with TRUE[] -const char MtkCameraParameters::ON[] = "on"; -const char MtkCameraParameters::OFF[] = "off"; -// -const char MtkCameraParameters::WHITE_BALANCE_TUNGSTEN[] = "tungsten"; -// -const char MtkCameraParameters::ISO_SPEED_ENG[] = "iso-speed-eng"; -const char MtkCameraParameters::KEY_RAW_SAVE_MODE[] = "rawsave-mode"; -const char MtkCameraParameters::KEY_RAW_PATH[] = "rawfname"; - -const char MtkCameraParameters::KEY_FAST_CONTINUOUS_SHOT[] = "fast-continuous-shot"; - -const char MtkCameraParameters::KEY_CSHOT_INDICATOR[] = "cshot-indicator"; - -// AF EM MODE -const char MtkCameraParameters::KEY_FOCUS_ENG_MODE[] = "afeng-mode"; -const char MtkCameraParameters::KEY_FOCUS_ENG_STEP[] = "afeng-pos"; -const char MtkCameraParameters::KEY_FOCUS_ENG_MAX_STEP[] = "afeng-max-focus-step"; -const char MtkCameraParameters::KEY_FOCUS_ENG_MIN_STEP[] = "afeng-min-focus-step"; -const char MtkCameraParameters::KEY_FOCUS_ENG_BEST_STEP[] = "afeng-best-focus-step"; -const char MtkCameraParameters::KEY_RAW_DUMP_FLAG[] = "afeng_raw_dump_flag"; -const char MtkCameraParameters::KEY_PREVIEW_DUMP_RESOLUTION[] = "preview-dump-resolution"; -// Values for KEY_PREVIEW_DUMP_RESOLUTION -const int MtkCameraParameters::PREVIEW_DUMP_RESOLUTION_NORMAL = 0; -const int MtkCameraParameters::PREVIEW_DUMP_RESOLUTION_CROP = 1; -// -const char MtkCameraParameters::KEY_MAX_NUM_DETECTED_OBJECT[] = "max-num-ot"; -// -const char MtkCameraParameters::KEY_VIDEO_HDR[] = "video-hdr"; - -// KEY for [Engineer Mode] Add new camera paramters for new requirements -const char MtkCameraParameters::KEY_ENG_AE_ENABLE[] = "eng-ae-enable"; -const char MtkCameraParameters::KEY_ENG_PREVIEW_SHUTTER_SPEED[] = "eng-preview-shutter-speed"; -const char MtkCameraParameters::KEY_ENG_PREVIEW_SENSOR_GAIN[] = "eng-preview-sensor-gain"; -const char MtkCameraParameters::KEY_ENG_PREVIEW_ISP_GAIN[] = "eng-preview-isp-gain"; -const char MtkCameraParameters::KEY_ENG_PREVIEW_AE_INDEX[] = "eng-preview-ae-index"; -const char MtkCameraParameters::KEY_ENG_CAPTURE_SENSOR_GAIN[] = "eng-capture-sensor-gain"; -const char MtkCameraParameters::KEY_ENG_CAPTURE_ISP_GAIN[] = "eng-capture-isp-gain"; -const char MtkCameraParameters::KEY_ENG_CAPTURE_SHUTTER_SPEED[] = "eng-capture-shutter-speed"; -const char MtkCameraParameters::KEY_ENG_CAPTURE_ISO[] = "eng-capture-iso"; -const char MtkCameraParameters::KEY_ENG_FLASH_DUTY_VALUE[] = "eng-flash-duty-value"; -const char MtkCameraParameters::KEY_ENG_FLASH_DUTY_MIN[] = "eng-flash-duty-min"; -const char MtkCameraParameters::KEY_ENG_FLASH_DUTY_MAX[] = "eng-flash-duty-max"; -const char MtkCameraParameters::KEY_ENG_ZSD_ENABLE[] = "eng-zsd-enable"; -const char MtkCameraParameters::KEY_SENSOR_TYPE[] = "sensor-type"; -const char MtkCameraParameters::KEY_ENG_PREVIEW_FPS[] = "eng-preview-fps"; -const char MtkCameraParameters::KEY_ENG_MSG[] = "eng-msg"; -const int MtkCameraParameters::KEY_ENG_FLASH_DUTY_DEFAULT_VALUE = -1; -const int MtkCameraParameters::KEY_ENG_FLASH_STEP_DEFAULT_VALUE = -1; -const char MtkCameraParameters::KEY_ENG_FLASH_STEP_MIN[] = "eng-flash-step-min"; -const char MtkCameraParameters::KEY_ENG_FLASH_STEP_MAX[] = "eng-flash-step-max"; -const char MtkCameraParameters::KEY_ENG_FOCUS_FULLSCAN_FRAME_INTERVAL[] = "eng-focus-fullscan-frame-interval"; -const char MtkCameraParameters::KEY_ENG_FOCUS_FULLSCAN_FRAME_INTERVAL_MAX[] = "eng-focus-fullscan-frame-interval-max"; -const char MtkCameraParameters::KEY_ENG_FOCUS_FULLSCAN_FRAME_INTERVAL_MIN[] = "eng-focus-fullscan-frame-interval-min"; -const int MtkCameraParameters::KEY_ENG_FOCUS_FULLSCAN_FRAME_INTERVAL_MAX_DEFAULT = 65535; -const int MtkCameraParameters::KEY_ENG_FOCUS_FULLSCAN_FRAME_INTERVAL_MIN_DEFAULT = 0; -const char MtkCameraParameters::KEY_ENG_PREVIEW_FRAME_INTERVAL_IN_US[] = "eng-preview-frame-interval-in-us"; -const char MtkCameraParameters::KEY_ENG_PARAMETER1[] = "key-eng-parameter1"; -const char MtkCameraParameters::KEY_ENG_PARAMETER2[] = "key-eng-parameter2"; -const char MtkCameraParameters::KEY_ENG_PARAMETER3[] = "key-eng-parameter3"; - -const char MtkCameraParameters::KEY_ENG_SAVE_SHADING_TABLE[] = "eng-save-shading-table"; -const char MtkCameraParameters::KEY_ENG_SHADING_TABLE[] = "eng-shading-table"; -const int MtkCameraParameters::KEY_ENG_SHADING_TABLE_AUTO = 0; -const int MtkCameraParameters::KEY_ENG_SHADING_TABLE_LOW = 1; -const int MtkCameraParameters::KEY_ENG_SHADING_TABLE_MIDDLE = 2; -const int MtkCameraParameters::KEY_ENG_SHADING_TABLE_HIGH = 3; -const int MtkCameraParameters::KEY_ENG_SHADING_TABLE_TSF = 4; - -// KEY for [Engineer Mode] Add new camera paramters for ev calibration -const char MtkCameraParameters::KEY_ENG_EV_CALBRATION_OFFSET_VALUE[] = "eng-ev-cal-offset"; - -// High Speed Video Record -const char MtkCameraParameters::KEY_HSVR_PRV_SIZE[] = "hsvr-prv-size"; -const char MtkCameraParameters::KEY_SUPPORTED_HSVR_PRV_SIZE[] = "hsvr-prv-size-values"; -const char MtkCameraParameters::KEY_HSVR_PRV_FPS[] = "hsvr-prv-fps"; -const char MtkCameraParameters::KEY_SUPPORTED_HSVR_PRV_FPS[] = "hsvr-prv-fps-values"; -const char MtkCameraParameters::KEY_DXOEIS_ONOFF[] = "dxo-eis"; -const char MtkCameraParameters::KEY_FIX_EXPOSURE_TIME[] = "fix-exposure-time"; - -}; // namespace android - - diff --git a/camera_parameters/MtkCameraParameters.h b/camera_parameters/MtkCameraParameters.h deleted file mode 100644 index f28d8addfb78af2d84622837c6a2b5745a1f676d..0000000000000000000000000000000000000000 --- a/camera_parameters/MtkCameraParameters.h +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ANDROID_HARDWARE_MTK_CAMERA_PARAMETERS_H -#define ANDROID_HARDWARE_MTK_CAMERA_PARAMETERS_H - -#include - -namespace android { - - -/** - * @class MtkCameraParameters - * @brief MTK-proprietary camera parameters. - * @details This class is derived from CameraParameters and defines MTK-proprietary camera parameters. - */ -class MtkCameraParameters : public CameraParameters -{ -public: - MtkCameraParameters() : CameraParameters() {} - MtkCameraParameters(const String8 ¶ms) { unflatten(params); } - ~MtkCameraParameters() {} - - MtkCameraParameters& operator=(CameraParameters const& params) - { - unflatten(params.flatten()); - return (*this); - } - // -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// App Mode. -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - static const char PROPERTY_KEY_CLIENT_APPMODE[]; - // - static const char APP_MODE_NAME_DEFAULT[]; - static const char APP_MODE_NAME_MTK_ENG[]; - static const char APP_MODE_NAME_MTK_ATV[]; - static const char APP_MODE_NAME_MTK_S3D[]; - static const char APP_MODE_NAME_MTK_VT[]; - static const char APP_MODE_NAME_MTK_PHOTO[]; - static const char APP_MODE_NAME_MTK_VIDEO[]; - static const char APP_MODE_NAME_MTK_ZSD[]; - // -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// Scene Mode -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - static const char SCENE_MODE_NORMAL[]; - // -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// Face Beauty -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - static const char KEY_FB_SMOOTH_LEVEL[]; - static const char KEY_FB_SMOOTH_LEVEL_MIN[]; - static const char KEY_FB_SMOOTH_LEVEL_MAX[]; - // - static const char KEY_FB_SKIN_COLOR[]; - static const char KEY_FB_SKIN_COLOR_MIN[]; - static const char KEY_FB_SKIN_COLOR_MAX[]; - // - static const char KEY_FB_SHARP[]; - static const char KEY_FB_SHARP_MIN[]; - static const char KEY_FB_SHARP_MAX[]; - // - static const char KEY_FB_ENLARGE_EYE[]; - static const char KEY_FB_ENLARGE_EYE_MIN[]; - static const char KEY_FB_ENLARGE_EYE_MAX[]; - // - static const char KEY_FB_SLIM_FACE[]; - static const char KEY_FB_SLIM_FACE_MIN[]; - static const char KEY_FB_SLIM_FACE_MAX[]; - // - static const char KEY_FB_EXTREME_BEAUTY[]; - // - static const char KEY_FACE_BEAUTY[]; - // -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - static const char KEY_EXPOSURE[]; - static const char KEY_EXPOSURE_METER[]; - static const char KEY_ISO_SPEED[]; - static const char KEY_AE_MODE[]; - static const char KEY_FOCUS_METER[]; - static const char KEY_EDGE[]; - static const char KEY_HUE[]; - static const char KEY_SATURATION[]; - static const char KEY_BRIGHTNESS[]; - static const char KEY_CONTRAST[]; - static const char KEY_ZSD_MODE[]; - static const char KEY_SUPPORTED_ZSD_MODE[]; - static const char KEY_AWB2PASS[]; - static const char KEY_AF_LAMP_MODE []; - - static const char KEY_STEREO_3D_PREVIEW_SIZE[]; - static const char KEY_STEREO_3D_PICTURE_SIZE[]; - static const char KEY_STEREO_3D_TYPE []; - static const char KEY_STEREO_3D_MODE []; - static const char KEY_STEREO_3D_IMAGE_FORMAT []; - // - static const char KEY_FPS_MODE[]; // normal,fix - // - static const char KEY_FOCUS_DRAW[]; // 0,1 - // - static const char KEY_CAPTURE_MODE[]; // normal,bestshot,evbracketshot,burstshot,smileshot,panoramashot - static const char KEY_SUPPORTED_CAPTURE_MODES[]; - static const char KEY_CAPTURE_PATH[]; - static const char KEY_BURST_SHOT_NUM[]; - // - static const char KEY_MATV_PREVIEW_DELAY[]; - // - static const char KEY_PANORAMA_IDX[]; - static const char KEY_PANORAMA_DIR[]; // right,left,top,bottom - // - static const char KEY_SENSOR_DEV[]; // main,sub,atv - static const char KEY_SUPPORTED_SENSOR_DEVS[]; - - // Values for KEY_EXPOSURE - static const char EXPOSURE_METER_SPOT[]; - static const char EXPOSURE_METER_CENTER[]; - static const char EXPOSURE_METER_AVERAGE[]; - - // Valeus for KEY_ISO_SPEED - static const char ISO_SPEED_AUTO[]; - static const char ISO_SPEED_100[]; - static const char ISO_SPEED_200[]; - static const char ISO_SPEED_400[]; - static const char ISO_SPEED_800[]; - static const char ISO_SPEED_1600[]; - - // Values for KEY_FOCUS_METER - static const char FOCUS_METER_SPOT[]; - static const char FOCUS_METER_MULTI[]; - - static const char KEY_CAMERA_MODE[]; - // Values for KEY_CAMERA_MODE - static const int CAMERA_MODE_NORMAL; - static const int CAMERA_MODE_MTK_PRV; - static const int CAMERA_MODE_MTK_VDO; - static const int CAMERA_MODE_MTK_VT; - - // Values for KEY_FPS_MODE - static const int FPS_MODE_NORMAL; - static const int FPS_MODE_FIX; - - // Values for KEY_CAPTURE_MODE - static const char CAPTURE_MODE_PANORAMA_SHOT[]; - static const char CAPTURE_MODE_BURST_SHOT[]; - static const char CAPTURE_MODE_NORMAL[]; - static const char CAPTURE_MODE_BEST_SHOT[]; - static const char CAPTURE_MODE_EV_BRACKET_SHOT[]; - static const char CAPTURE_MODE_SMILE_SHOT[]; - static const char CAPTURE_MODE_AUTO_PANORAMA_SHOT[]; - static const char CAPTURE_MODE_MOTION_TRACK_SHOT[]; - static const char CAPTURE_MODE_MAV_SHOT[]; - static const char CAPTURE_MODE_HDR_SHOT[]; - static const char CAPTURE_MODE_ASD_SHOT[]; - static const char CAPTURE_MODE_ZSD_SHOT[]; - static const char CAPTURE_MODE_PANO_3D[]; - static const char CAPTURE_MODE_SINGLE_3D[]; - static const char CAPTURE_MODE_FACE_BEAUTY[]; - static const char CAPTURE_MODE_CONTINUOUS_SHOT[]; - static const char CAPTURE_MODE_MULTI_MOTION[]; - static const char CAPTURE_MODE_GESTURE_SHOT[]; - - // Values for KEY_PANORAMA_DIR - static const char PANORAMA_DIR_RIGHT[]; - static const char PANORAMA_DIR_LEFT[]; - static const char PANORAMA_DIR_TOP[]; - static const char PANORAMA_DIR_DOWN[]; - // - static const int ENABLE; - static const int DISABLE; - - // Values for KEY_EDGE, KEY_HUE, KEY_SATURATION, KEY_BRIGHTNESS, KEY_CONTRAST - static const char HIGH[]; - static const char MIDDLE[]; - static const char LOW[]; - - // Preview Internal Format. - static const char KEY_PREVIEW_INT_FORMAT[]; - - // Pixel color formats for KEY_PREVIEW_FORMAT, KEY_PICTURE_FORMAT, - // and KEY_VIDEO_FRAME_FORMAT - static const char PIXEL_FORMAT_YUV420I[]; // I420 - - /** - * @var PIXEL_FORMAT_YV12_GPU - * - * GPU YUV format: - * - * YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed - * by (W/2) x (H/2) Cr and Cb planes. - * - * This format assumes - * - an even width - * - an even height - * - a vertical stride equal to the height - * - a horizontal stride multiple of 32/16/16 pixels for y/cr/cb respectively - * i.e. - * y_stride = ALIGN(width, 32) - * c_stride = y_stride / 2 - * - * y_size = y_stride * height - * c_size = c_stride * height / 2 - * size = y_size + c_size * 2 - * cr_offset = y_size - * cb_offset = y_size + c_size - * - * for example: - * width/height = 176x144 - * y stride = 192x144 - * cr stride = 96x72 - * cb stride = 96x72 - * - */ - static const char PIXEL_FORMAT_YV12_GPU[]; - - /* - * YUV422 format, 1 plane (UYVY) - * - * Effective bits per pixel : 16 - * - * Y sample at every pixel, U and V sampled at every second pixel horizontally on each line. - * A macropixel contains 2 pixels in 1 uint32_t. - * - */ - static const char PIXEL_FORMAT_YUV422I_UYVY[]; - // - static const char PIXEL_FORMAT_YUV422I_VYUY[]; - static const char PIXEL_FORMAT_YUV422I_YVYU[]; - static const char PIXEL_FORMAT_BAYER8[]; - static const char PIXEL_FORMAT_BAYER10[]; - - /** - * @var KEY_BRIGHTNESS_VALUE - * - * This is a key string of brightness value, scaled by 10. - * - */ - static const char KEY_BRIGHTNESS_VALUE[]; - - // ISP Operation mode for meta mode use - static const char KEY_ISP_MODE[]; - // AF - static const char KEY_AF_X[]; - static const char KEY_AF_Y[]; - static const char KEY_FOCUS_ENG_MAX_STEP[]; - static const char KEY_FOCUS_ENG_MIN_STEP[]; - static const char KEY_FOCUS_ENG_BEST_STEP[]; - static const char KEY_RAW_DUMP_FLAG[]; - static const char KEY_PREVIEW_DUMP_RESOLUTION[]; - static const int PREVIEW_DUMP_RESOLUTION_NORMAL; - static const int PREVIEW_DUMP_RESOLUTION_CROP; - - // Values for effect - static const char EFFECT_SEPIA_BLUE[]; - static const char EFFECT_SEPIA_GREEN[]; - // Values for AWB - static const char WHITE_BALANCE_TUNGSTEN[]; - // Eng - static const char ISO_SPEED_ENG[]; - static const char KEY_FOCUS_ENG_MODE[]; // 0,1,2,3 (0: normal) - static const char KEY_FOCUS_ENG_STEP[]; - static const char KEY_RAW_SAVE_MODE[]; // on, off - static const char KEY_RAW_PATH[]; - - // KEY for Continuous shot speed - static const char KEY_FAST_CONTINUOUS_SHOT[]; - - static const char KEY_VIDEO_HDR[]; - - static const char KEY_MAX_NUM_DETECTED_OBJECT[]; - - // KEY for c_shot indicator - static const char KEY_CSHOT_INDICATOR[]; - - // KEY for [Engineer Mode] Add new camera paramters for new requirements - static const char KEY_ENG_AE_ENABLE[]; - static const char KEY_ENG_PREVIEW_SHUTTER_SPEED[]; - static const char KEY_ENG_PREVIEW_SENSOR_GAIN[]; - static const char KEY_ENG_PREVIEW_ISP_GAIN[]; - static const char KEY_ENG_PREVIEW_AE_INDEX[]; - static const char KEY_ENG_CAPTURE_SENSOR_GAIN[]; - static const char KEY_ENG_CAPTURE_ISP_GAIN[]; - static const char KEY_ENG_CAPTURE_SHUTTER_SPEED[]; - static const char KEY_ENG_CAPTURE_ISO[]; - static const char KEY_ENG_FLASH_DUTY_VALUE[]; - static const char KEY_ENG_FLASH_DUTY_MIN[]; - static const char KEY_ENG_FLASH_DUTY_MAX[]; - static const char KEY_ENG_ZSD_ENABLE[]; - static const char KEY_SENSOR_TYPE[]; - static const char KEY_ENG_PREVIEW_FPS[]; - static const char KEY_ENG_MSG[]; - static const int KEY_ENG_FLASH_DUTY_DEFAULT_VALUE; - static const int KEY_ENG_FLASH_STEP_DEFAULT_VALUE; - static const char KEY_ENG_FLASH_STEP_MIN[]; - static const char KEY_ENG_FLASH_STEP_MAX[]; - static const char KEY_ENG_FOCUS_FULLSCAN_FRAME_INTERVAL[]; - static const char KEY_ENG_FOCUS_FULLSCAN_FRAME_INTERVAL_MAX[]; - static const char KEY_ENG_FOCUS_FULLSCAN_FRAME_INTERVAL_MIN[]; - static const int KEY_ENG_FOCUS_FULLSCAN_FRAME_INTERVAL_MAX_DEFAULT; - static const int KEY_ENG_FOCUS_FULLSCAN_FRAME_INTERVAL_MIN_DEFAULT; - static const char KEY_ENG_PREVIEW_FRAME_INTERVAL_IN_US[]; - static const char KEY_ENG_PARAMETER1[]; - static const char KEY_ENG_PARAMETER2[]; - static const char KEY_ENG_PARAMETER3[]; - - static const char KEY_ENG_SAVE_SHADING_TABLE[]; - static const char KEY_ENG_SHADING_TABLE[]; - static const int KEY_ENG_SHADING_TABLE_AUTO; - static const int KEY_ENG_SHADING_TABLE_LOW; - static const int KEY_ENG_SHADING_TABLE_MIDDLE; - static const int KEY_ENG_SHADING_TABLE_HIGH; - static const int KEY_ENG_SHADING_TABLE_TSF; - - // KEY for [Engineer Mode] Add new camera paramters for ev calibration - static const char KEY_ENG_EV_CALBRATION_OFFSET_VALUE[]; - - // High Speed Video Record - static const char KEY_HSVR_PRV_SIZE[]; - static const char KEY_SUPPORTED_HSVR_PRV_SIZE[]; - static const char KEY_HSVR_PRV_FPS[]; - static const char KEY_SUPPORTED_HSVR_PRV_FPS[]; - - static const char KEY_DXOEIS_ONOFF[]; - static const char KEY_FIX_EXPOSURE_TIME[]; - // -public: //// on/off => FIXME: should be replaced with TRUE[] - static const char ON[]; - static const char OFF[]; -}; - -}; // namespace android - -#endif - -