/libcamera/ExynosCamera.cpp
C++ | 1624 lines | 1250 code | 205 blank | 169 comment | 68 complexity | 5b37f0df44635e081cd1e41ba3f58967 MD5 | raw file
- /*
- * Copyright 2012, Samsung Electronics Co. LTD
- *
- * 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 toggle 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.
- */
- /*!
- * \file ExynosCamera.cpp
- * \brief source file for CAMERA HAL MODULE
- * \author thun.hwang(thun.hwang@samsung.com)
- * \date 2010/06/03
- *
- * <b>Revision History: </b>
- * - 2011/12/31 : thun.hwang(thun.hwang@samsung.com) \n
- * Initial version
- *
- * - 2012/01/18 : Sangwoo, Park(sw5771.park@samsung.com) \n
- * Adjust Doxygen Document
- *
- * - 2012/02/01 : Sangwoo, Park(sw5771.park@samsung.com) \n
- * Adjust libv4l2
- * Adjust struct ExynosCameraInfo
- * External ISP feature
- *
- * - 2012/03/14 : sangwoo.park(sw5771.park@samsung.com) \n
- * Change file, class name to ExynosXXX.
- *
- * - 2012/08/01 : Pilsun, Jang(pilsun.jang@samsung.com) \n
- * Adjust Camera2.0 Driver
- */
- //#define LOG_NDEBUG 0
- #define LOG_TAG "ExynosCamera"
- #include <cutils/log.h>
- #include "ExynosCamera.h"
- ExynosCameraInfo::ExynosCameraInfo()
- {
- previewW = 2560;
- previewH = 1920;
- previewColorFormat = V4L2_PIX_FMT_NV21;
- previewBufPlane = 3;
- videoW = 1920;
- videoH = 1080;
- videoColorFormat = V4L2_PIX_FMT_NV12M;
- videoBufPlane = 3;
- pictureW = 2560;
- pictureH = 1920;
- pictureColorFormat = V4L2_PIX_FMT_YUYV;
- pictureBufPlane = 2;
- thumbnailW = 512;
- thumbnailH = 384;
- antiBandingList =
- ExynosCamera::ANTIBANDING_AUTO
- | ExynosCamera::ANTIBANDING_50HZ
- | ExynosCamera::ANTIBANDING_60HZ
- | ExynosCamera::ANTIBANDING_OFF
- ;
- antiBanding = ExynosCamera::ANTIBANDING_AUTO;
- effectList =
- ExynosCamera::EFFECT_NONE
- | ExynosCamera::EFFECT_MONO
- | ExynosCamera::EFFECT_NEGATIVE
- | ExynosCamera::EFFECT_SOLARIZE
- | ExynosCamera::EFFECT_SEPIA
- | ExynosCamera::EFFECT_POSTERIZE
- | ExynosCamera::EFFECT_WHITEBOARD
- | ExynosCamera::EFFECT_BLACKBOARD
- | ExynosCamera::EFFECT_AQUA;
- effect = ExynosCamera::EFFECT_NONE;
- flashModeList =
- ExynosCamera::FLASH_MODE_OFF
- | ExynosCamera::FLASH_MODE_AUTO
- | ExynosCamera::FLASH_MODE_ON
- | ExynosCamera::FLASH_MODE_RED_EYE
- | ExynosCamera::FLASH_MODE_TORCH;
- flashMode = ExynosCamera::FLASH_MODE_OFF;
- flashPreMode = ExynosCamera::FLASH_MODE_OFF;
- focusModeList =
- ExynosCamera::FOCUS_MODE_AUTO
- | ExynosCamera::FOCUS_MODE_INFINITY
- | ExynosCamera::FOCUS_MODE_MACRO
- | ExynosCamera::FOCUS_MODE_FIXED
- | ExynosCamera::FOCUS_MODE_EDOF
- | ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
- | ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
- | ExynosCamera::FOCUS_MODE_TOUCH;
- focusMode = ExynosCamera::FOCUS_MODE_AUTO;
- sceneModeList =
- ExynosCamera::SCENE_MODE_AUTO
- | ExynosCamera::SCENE_MODE_ACTION
- | ExynosCamera::SCENE_MODE_PORTRAIT
- | ExynosCamera::SCENE_MODE_LANDSCAPE
- | ExynosCamera::SCENE_MODE_NIGHT
- | ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
- | ExynosCamera::SCENE_MODE_THEATRE
- | ExynosCamera::SCENE_MODE_BEACH
- | ExynosCamera::SCENE_MODE_SNOW
- | ExynosCamera::SCENE_MODE_SUNSET
- | ExynosCamera::SCENE_MODE_STEADYPHOTO
- | ExynosCamera::SCENE_MODE_FIREWORKS
- | ExynosCamera::SCENE_MODE_SPORTS
- | ExynosCamera::SCENE_MODE_PARTY
- | ExynosCamera::SCENE_MODE_CANDLELIGHT;
- sceneMode = ExynosCamera::SCENE_MODE_AUTO;
- whiteBalanceList =
- ExynosCamera::WHITE_BALANCE_AUTO
- | ExynosCamera::WHITE_BALANCE_INCANDESCENT
- | ExynosCamera::WHITE_BALANCE_FLUORESCENT
- | ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
- | ExynosCamera::WHITE_BALANCE_DAYLIGHT
- | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
- | ExynosCamera::WHITE_BALANCE_TWILIGHT
- | ExynosCamera::WHITE_BALANCE_SHADE;
- whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
- autoWhiteBalanceLockSupported = false;
- autoWhiteBalanceLock = false;
- rotation = 0;
- minExposure = -4;
- maxExposure = 4;
- exposure = 0;
- autoExposureLockSupported = false;
- autoExposureLock = false;
- fpsRange[0] = 1000;
- fpsRange[1] = 30000;
- fNumberNum = 12;
- fNumberDen = 10;
- focalLengthNum = 343;
- focalLengthDen = 100;
- apertureNum = 27;
- apertureDen = 10;
- supportVideoStabilization = false;
- applyVideoStabilization = false;
- videoStabilization = false;
- maxNumMeteringAreas = 0;
- maxNumDetectedFaces = 0;
- maxNumFocusAreas = 0;
- maxZoom = 0;
- hwZoomSupported = false;
- zoom = 0;
- gpsAltitude = 0;
- gpsLatitude = 0;
- gpsLongitude = 0;
- gpsTimestamp = 0;
- // Additional API default Value.
- angle = 0;
- antiShake = false;
- brightness = 0;
- contrast = ExynosCamera::CONTRAST_DEFAULT;
- gamma = false;
- hue = 2; // 2 is default;
- iso = 0;
- metering = ExynosCamera::METERING_MODE_CENTER;
- objectTracking = false;
- objectTrackingStart = false;
- saturation = 0;
- sharpness = 0;
- slowAE = false;
- touchAfStart = false;
- tdnr = false;
- odc = false;
- vtMode = 0;
- intelligentMode = 0;
- #ifdef SCALABLE_SENSOR
- scalableSensorStart = false;
- #endif
- focalLengthIn35mmLength = 31;
- autoFocusMacroPosition = 0;
- }
- ExynosCameraInfoM5M0::ExynosCameraInfoM5M0()
- {
- previewW = 1280;
- previewH = 720;
- previewColorFormat = V4L2_PIX_FMT_YVU420M;
- previewBufPlane = 4;
- videoW = 1280;
- videoH = 720;
- videoColorFormat = V4L2_PIX_FMT_NV12M;
- videoBufPlane = 3;
- pictureW = 1280;
- pictureH = 720;
- pictureColorFormat = V4L2_PIX_FMT_YUYV;
- pictureBufPlane = 2;
- thumbnailW = 512;
- thumbnailH = 384;
- antiBandingList = ExynosCamera::ANTIBANDING_OFF;
- antiBanding = ExynosCamera::ANTIBANDING_OFF;
- effectList =
- ExynosCamera::EFFECT_NONE
- | ExynosCamera::EFFECT_MONO
- | ExynosCamera::EFFECT_NEGATIVE
- //| ExynosCamera::EFFECT_SOLARIZE
- | ExynosCamera::EFFECT_SEPIA
- //| ExynosCamera::EFFECT_POSTERIZE
- //| ExynosCamera::EFFECT_WHITEBOARD
- //| ExynosCamera::EFFECT_BLACKBOARD
- | ExynosCamera::EFFECT_AQUA;
- effect = ExynosCamera::EFFECT_NONE;
- flashModeList =
- ExynosCamera::FLASH_MODE_OFF
- | ExynosCamera::FLASH_MODE_AUTO
- | ExynosCamera::FLASH_MODE_ON
- | ExynosCamera::FLASH_MODE_RED_EYE
- | ExynosCamera::FLASH_MODE_TORCH;
- flashMode = ExynosCamera::FLASH_MODE_OFF;
- focusModeList =
- ExynosCamera::FOCUS_MODE_AUTO
- | ExynosCamera::FOCUS_MODE_INFINITY
- | ExynosCamera::FOCUS_MODE_MACRO
- //| ExynosCamera::FOCUS_MODE_FIXED
- //| ExynosCamera::FOCUS_MODE_EDOF
- //| ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
- //| ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
- //| ExynosCamera::FOCUS_MODE_TOUCH
- ;
- focusMode = ExynosCamera::FOCUS_MODE_AUTO;
- sceneModeList =
- ExynosCamera::SCENE_MODE_AUTO
- //| ExynosCamera::SCENE_MODE_ACTION
- | ExynosCamera::SCENE_MODE_PORTRAIT
- | ExynosCamera::SCENE_MODE_LANDSCAPE
- | ExynosCamera::SCENE_MODE_NIGHT
- //| ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
- //| ExynosCamera::SCENE_MODE_THEATRE
- | ExynosCamera::SCENE_MODE_BEACH
- | ExynosCamera::SCENE_MODE_SNOW
- | ExynosCamera::SCENE_MODE_SUNSET
- //| ExynosCamera::SCENE_MODE_STEADYPHOTO
- | ExynosCamera::SCENE_MODE_FIREWORKS
- | ExynosCamera::SCENE_MODE_SPORTS
- | ExynosCamera::SCENE_MODE_PARTY
- | ExynosCamera::SCENE_MODE_CANDLELIGHT;
- sceneMode = ExynosCamera::SCENE_MODE_AUTO;
- whiteBalanceList =
- ExynosCamera::WHITE_BALANCE_AUTO
- | ExynosCamera::WHITE_BALANCE_INCANDESCENT
- | ExynosCamera::WHITE_BALANCE_FLUORESCENT
- //| ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
- | ExynosCamera::WHITE_BALANCE_DAYLIGHT
- | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
- //| ExynosCamera::WHITE_BALANCE_TWILIGHT
- //| ExynosCamera::WHITE_BALANCE_SHADE
- ;
- whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
- autoWhiteBalanceLockSupported = false;
- autoWhiteBalanceLock = false;
- rotation = 0;
- minExposure = -4;
- maxExposure = 4;
- exposure = 0;
- autoExposureLockSupported = false;
- autoExposureLock = false;
- fpsRange[0] = 1000;
- fpsRange[1] = 30000;
- fNumberNum = 12;
- fNumberDen = 10;
- focalLengthNum = 343;
- focalLengthDen = 100;
- apertureNum = 27;
- apertureDen = 10;
- supportVideoStabilization = false;
- applyVideoStabilization = false;
- videoStabilization = false;
- maxNumMeteringAreas = 64;
- maxNumDetectedFaces = 16;
- maxNumFocusAreas = 2;
- maxZoom = ZOOM_LEVEL_MAX;
- hwZoomSupported = false;
- zoom = 0;
- gpsAltitude = 0;
- gpsLatitude = 0;
- gpsLongitude = 0;
- gpsTimestamp = 0;
- }
- ExynosCameraInfoS5K3H5::ExynosCameraInfoS5K3H5()
- {
- // previewW = 1920;
- // previewH = 1080;
- // previewW = 1920;
- // previewH = 1088;
- previewW = 1024;
- previewH = 768;
- // previewColorFormat = V4L2_PIX_FMT_YVU420M;
- previewColorFormat = V4L2_PIX_FMT_YUV420M;
- previewBufPlane = 4;
- // videoW = 1920;
- // videoH = 1080;
- // videoW = 1920;
- // videoH = 1088;
- videoW = 1024;
- videoH = 768;
- videoColorFormat = V4L2_PIX_FMT_NV12M;
- videoBufPlane = 3;
- pictureW = 3200;
- pictureH = 2400;
- pictureColorFormat = V4L2_PIX_FMT_YUYV;
- pictureBufPlane = 2;
- thumbnailW = 512;
- thumbnailH = 384;
- antiBandingList =
- ExynosCamera::ANTIBANDING_AUTO
- | ExynosCamera::ANTIBANDING_50HZ
- | ExynosCamera::ANTIBANDING_60HZ
- | ExynosCamera::ANTIBANDING_OFF
- ;
- antiBanding = ExynosCamera::ANTIBANDING_AUTO;
- effectList =
- ExynosCamera::EFFECT_NONE
- | ExynosCamera::EFFECT_MONO
- | ExynosCamera::EFFECT_NEGATIVE
- //| ExynosCamera::EFFECT_SOLARIZE
- | ExynosCamera::EFFECT_SEPIA
- //| ExynosCamera::EFFECT_POSTERIZE
- //| ExynosCamera::EFFECT_WHITEBOARD
- //| ExynosCamera::EFFECT_BLACKBOARD
- //| ExynosCamera::EFFECT_AQUA
- ;
- effect = ExynosCamera::EFFECT_NONE;
- flashModeList =
- ExynosCamera::FLASH_MODE_OFF
- | ExynosCamera::FLASH_MODE_AUTO
- | ExynosCamera::FLASH_MODE_ON
- //| ExynosCamera::FLASH_MODE_RED_EYE
- | ExynosCamera::FLASH_MODE_TORCH;
- flashMode = ExynosCamera::FLASH_MODE_OFF;
- focusModeList =
- ExynosCamera::FOCUS_MODE_AUTO
- | ExynosCamera::FOCUS_MODE_INFINITY
- | ExynosCamera::FOCUS_MODE_MACRO
- //| ExynosCamera::FOCUS_MODE_FIXED
- //| ExynosCamera::FOCUS_MODE_EDOF
- | ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
- | ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
- | ExynosCamera::FOCUS_MODE_TOUCH
- ;
- focusMode = ExynosCamera::FOCUS_MODE_AUTO;
- sceneModeList =
- ExynosCamera::SCENE_MODE_AUTO
- //| ExynosCamera::SCENE_MODE_ACTION
- | ExynosCamera::SCENE_MODE_PORTRAIT
- | ExynosCamera::SCENE_MODE_LANDSCAPE
- | ExynosCamera::SCENE_MODE_NIGHT
- //| ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
- //| ExynosCamera::SCENE_MODE_THEATRE
- | ExynosCamera::SCENE_MODE_BEACH
- | ExynosCamera::SCENE_MODE_SNOW
- | ExynosCamera::SCENE_MODE_SUNSET
- | ExynosCamera::SCENE_MODE_STEADYPHOTO
- | ExynosCamera::SCENE_MODE_FIREWORKS
- | ExynosCamera::SCENE_MODE_SPORTS
- | ExynosCamera::SCENE_MODE_PARTY
- | ExynosCamera::SCENE_MODE_CANDLELIGHT;
- sceneMode = ExynosCamera::SCENE_MODE_AUTO;
- whiteBalanceList =
- ExynosCamera::WHITE_BALANCE_AUTO
- | ExynosCamera::WHITE_BALANCE_INCANDESCENT
- | ExynosCamera::WHITE_BALANCE_FLUORESCENT
- //| ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
- | ExynosCamera::WHITE_BALANCE_DAYLIGHT
- | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
- //| ExynosCamera::WHITE_BALANCE_TWILIGHT
- //| ExynosCamera::WHITE_BALANCE_SHADE
- ;
- whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
- autoWhiteBalanceLockSupported = true;
- autoWhiteBalanceLock = false;
- rotation = 0;
- minExposure = -4;
- maxExposure = 4;
- exposure = 0;
- autoExposureLockSupported = true;
- autoExposureLock = false;
- fpsRange[0] = 1000;
- fpsRange[1] = 30000;
- fNumberNum = 26;
- fNumberDen = 10;
- focalLengthNum = 9;
- focalLengthDen = 10;
- apertureNum = 27;
- apertureDen = 10;
- supportVideoStabilization = true;
- applyVideoStabilization = false;
- videoStabilization = false;
- maxNumMeteringAreas = 64;
- maxNumDetectedFaces = 16;
- maxNumFocusAreas = 2;
- maxZoom = ZOOM_LEVEL_MAX;
- hwZoomSupported = false;
- zoom = 0;
- gpsAltitude = 0;
- gpsLatitude = 0;
- gpsLongitude = 0;
- gpsTimestamp = 0;
- }
- ExynosCameraInfoS5K3H7::ExynosCameraInfoS5K3H7()
- {
- previewW = 1920;
- previewH = 1080;
- previewColorFormat = V4L2_PIX_FMT_YVU420M;
- previewBufPlane = 4;
- videoW = 1920;
- videoH = 1080;
- videoColorFormat = V4L2_PIX_FMT_NV12M;
- videoBufPlane = 3;
- pictureW = 3200;
- pictureH = 2400;
- pictureColorFormat = V4L2_PIX_FMT_YUYV;
- pictureBufPlane = 2;
- thumbnailW = 512;
- thumbnailH = 384;
- antiBandingList =
- ExynosCamera::ANTIBANDING_AUTO
- | ExynosCamera::ANTIBANDING_50HZ
- | ExynosCamera::ANTIBANDING_60HZ
- | ExynosCamera::ANTIBANDING_OFF
- ;
- antiBanding = ExynosCamera::ANTIBANDING_AUTO;
- effectList =
- ExynosCamera::EFFECT_NONE
- | ExynosCamera::EFFECT_MONO
- | ExynosCamera::EFFECT_NEGATIVE
- //| ExynosCamera::EFFECT_SOLARIZE
- | ExynosCamera::EFFECT_SEPIA
- //| ExynosCamera::EFFECT_POSTERIZE
- //| ExynosCamera::EFFECT_WHITEBOARD
- //| ExynosCamera::EFFECT_BLACKBOARD
- //| ExynosCamera::EFFECT_AQUA
- ;
- effect = ExynosCamera::EFFECT_NONE;
- flashModeList =
- ExynosCamera::FLASH_MODE_OFF
- | ExynosCamera::FLASH_MODE_AUTO
- | ExynosCamera::FLASH_MODE_ON
- //| ExynosCamera::FLASH_MODE_RED_EYE
- | ExynosCamera::FLASH_MODE_TORCH;
- flashMode = ExynosCamera::FLASH_MODE_OFF;
- focusModeList =
- ExynosCamera::FOCUS_MODE_AUTO
- | ExynosCamera::FOCUS_MODE_INFINITY
- | ExynosCamera::FOCUS_MODE_MACRO
- //| ExynosCamera::FOCUS_MODE_FIXED
- //| ExynosCamera::FOCUS_MODE_EDOF
- | ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
- | ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
- | ExynosCamera::FOCUS_MODE_TOUCH
- ;
- focusMode = ExynosCamera::FOCUS_MODE_AUTO;
- sceneModeList =
- ExynosCamera::SCENE_MODE_AUTO
- //| ExynosCamera::SCENE_MODE_ACTION
- | ExynosCamera::SCENE_MODE_PORTRAIT
- | ExynosCamera::SCENE_MODE_LANDSCAPE
- | ExynosCamera::SCENE_MODE_NIGHT
- //| ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
- //| ExynosCamera::SCENE_MODE_THEATRE
- | ExynosCamera::SCENE_MODE_BEACH
- | ExynosCamera::SCENE_MODE_SNOW
- | ExynosCamera::SCENE_MODE_SUNSET
- | ExynosCamera::SCENE_MODE_STEADYPHOTO
- | ExynosCamera::SCENE_MODE_FIREWORKS
- | ExynosCamera::SCENE_MODE_SPORTS
- | ExynosCamera::SCENE_MODE_PARTY
- | ExynosCamera::SCENE_MODE_CANDLELIGHT;
- sceneMode = ExynosCamera::SCENE_MODE_AUTO;
- whiteBalanceList =
- ExynosCamera::WHITE_BALANCE_AUTO
- | ExynosCamera::WHITE_BALANCE_INCANDESCENT
- | ExynosCamera::WHITE_BALANCE_FLUORESCENT
- //| ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
- | ExynosCamera::WHITE_BALANCE_DAYLIGHT
- | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
- //| ExynosCamera::WHITE_BALANCE_TWILIGHT
- //| ExynosCamera::WHITE_BALANCE_SHADE
- ;
- whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
- autoWhiteBalanceLockSupported = true;
- autoWhiteBalanceLock = false;
- rotation = 0;
- minExposure = -4;
- maxExposure = 4;
- exposure = 0;
- autoExposureLockSupported = true;
- autoExposureLock = false;
- fpsRange[0] = 1000;
- fpsRange[1] = 30000;
- fNumberNum = 26;
- fNumberDen = 10;
- focalLengthNum = 9;
- focalLengthDen = 10;
- apertureNum = 27;
- apertureDen = 10;
- supportVideoStabilization = true;
- applyVideoStabilization = false;
- videoStabilization = false;
- maxNumMeteringAreas = 64;
- maxNumDetectedFaces = 16;
- maxNumFocusAreas = 2;
- maxZoom = ZOOM_LEVEL_MAX;
- hwZoomSupported = false;
- zoom = 0;
- gpsAltitude = 0;
- gpsLatitude = 0;
- gpsLongitude = 0;
- gpsTimestamp = 0;
- }
- ExynosCameraInfoS5K6A3::ExynosCameraInfoS5K6A3()
- {
- previewW = 1280;
- previewH = 960;
- previewColorFormat = V4L2_PIX_FMT_YVU420M;
- previewBufPlane = 4;
- videoW = 1280;
- videoH = 720;
- videoColorFormat = V4L2_PIX_FMT_NV12M;
- videoBufPlane = 3;
- pictureW = 1392;
- pictureH = 1392;
- pictureColorFormat = V4L2_PIX_FMT_YUYV;
- pictureBufPlane = 2;
- thumbnailW = 512;
- thumbnailH = 384;
- antiBandingList =
- ExynosCamera::ANTIBANDING_AUTO
- | ExynosCamera::ANTIBANDING_50HZ
- | ExynosCamera::ANTIBANDING_60HZ
- | ExynosCamera::ANTIBANDING_OFF
- ;
- antiBanding = ExynosCamera::ANTIBANDING_AUTO;
- effectList =
- ExynosCamera::EFFECT_NONE
- | ExynosCamera::EFFECT_MONO
- | ExynosCamera::EFFECT_NEGATIVE
- | ExynosCamera::EFFECT_SOLARIZE
- | ExynosCamera::EFFECT_SEPIA
- | ExynosCamera::EFFECT_POSTERIZE
- | ExynosCamera::EFFECT_WHITEBOARD
- | ExynosCamera::EFFECT_BLACKBOARD
- | ExynosCamera::EFFECT_AQUA
- ;
- effect = ExynosCamera::EFFECT_NONE;
- flashModeList =
- ExynosCamera::FLASH_MODE_OFF
- //| ExynosCamera::FLASH_MODE_AUTO
- //| ExynosCamera::FLASH_MODE_ON
- //| ExynosCamera::FLASH_MODE_RED_EYE
- //| ExynosCamera::FLASH_MODE_TORCH
- ;
- flashMode = ExynosCamera::FLASH_MODE_OFF;
- focusModeList =
- // ExynosCamera::FOCUS_MODE_AUTO
- ExynosCamera::FOCUS_MODE_INFINITY
- //| ExynosCamera::FOCUS_MODE_MACRO
- //| ExynosCamera::FOCUS_MODE_FIXED
- //| ExynosCamera::FOCUS_MODE_EDOF
- //| ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
- //| ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
- //| ExynosCamera::FOCUS_MODE_TOUCH
- ;
- focusMode = ExynosCamera::FOCUS_MODE_INFINITY;
- sceneModeList =
- ExynosCamera::SCENE_MODE_AUTO
- | ExynosCamera::SCENE_MODE_ACTION
- | ExynosCamera::SCENE_MODE_PORTRAIT
- | ExynosCamera::SCENE_MODE_LANDSCAPE
- | ExynosCamera::SCENE_MODE_NIGHT
- | ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
- | ExynosCamera::SCENE_MODE_THEATRE
- | ExynosCamera::SCENE_MODE_BEACH
- | ExynosCamera::SCENE_MODE_SNOW
- | ExynosCamera::SCENE_MODE_SUNSET
- | ExynosCamera::SCENE_MODE_STEADYPHOTO
- | ExynosCamera::SCENE_MODE_FIREWORKS
- | ExynosCamera::SCENE_MODE_SPORTS
- | ExynosCamera::SCENE_MODE_PARTY
- | ExynosCamera::SCENE_MODE_CANDLELIGHT;
- sceneMode = ExynosCamera::SCENE_MODE_AUTO;
- whiteBalanceList =
- ExynosCamera::WHITE_BALANCE_AUTO
- | ExynosCamera::WHITE_BALANCE_INCANDESCENT
- | ExynosCamera::WHITE_BALANCE_FLUORESCENT
- //| ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
- | ExynosCamera::WHITE_BALANCE_DAYLIGHT
- | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
- //| ExynosCamera::WHITE_BALANCE_TWILIGHT
- //| ExynosCamera::WHITE_BALANCE_SHADE
- ;
- whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
- autoWhiteBalanceLockSupported = true;
- autoWhiteBalanceLock = false;
- rotation = 0;
- minExposure = -4;
- maxExposure = 4;
- exposure = 0;
- autoExposureLockSupported = true;
- autoExposureLock = false;
- fpsRange[0] = 1000;
- fpsRange[1] = 30000;
- fNumberNum = 245;
- fNumberDen = 100;
- focalLengthNum = 185;
- focalLengthDen = 100;
- apertureNum = 75;
- apertureDen = 100;
- supportVideoStabilization = false;
- applyVideoStabilization = false;
- videoStabilization = false;
- maxNumMeteringAreas = 64;
- maxNumDetectedFaces = 16;
- maxNumFocusAreas = 0;
- maxZoom = ZOOM_LEVEL_MAX;
- hwZoomSupported = false;
- zoom = 0;
- gpsAltitude = 0;
- gpsLatitude = 0;
- gpsLongitude = 0;
- gpsTimestamp = 0;
- }
- ExynosCameraInfoS5K6B2::ExynosCameraInfoS5K6B2()
- {
- previewW = 1920;
- previewH = 1080;
- previewColorFormat = V4L2_PIX_FMT_NV21M;
- previewBufPlane = 3;
- videoW = 1920;
- videoH = 1080;
- videoColorFormat = V4L2_PIX_FMT_NV12M;
- videoBufPlane = 3;
- pictureW = 1920;
- pictureH = 1080;
- pictureColorFormat = V4L2_PIX_FMT_YUYV;
- pictureBufPlane = 2;
- ispW = 1920;
- ispH = 1080;
- thumbnailW = 512;
- thumbnailH = 384;
- antiBandingList =
- ExynosCamera::ANTIBANDING_AUTO
- | ExynosCamera::ANTIBANDING_50HZ
- | ExynosCamera::ANTIBANDING_60HZ
- | ExynosCamera::ANTIBANDING_OFF
- ;
- antiBanding = ExynosCamera::ANTIBANDING_AUTO;
- effectList =
- ExynosCamera::EFFECT_NONE
- | ExynosCamera::EFFECT_MONO
- | ExynosCamera::EFFECT_NEGATIVE
- //| ExynosCamera::EFFECT_SOLARIZE
- | ExynosCamera::EFFECT_SEPIA
- | ExynosCamera::EFFECT_POSTERIZE
- //| ExynosCamera::EFFECT_WHITEBOARD
- //| ExynosCamera::EFFECT_BLACKBOARD
- | ExynosCamera::EFFECT_AQUA
- ;
- effect = ExynosCamera::EFFECT_NONE;
- flashModeList =
- ExynosCamera::FLASH_MODE_OFF
- //| ExynosCamera::FLASH_MODE_AUTO
- //| ExynosCamera::FLASH_MODE_ON
- //| ExynosCamera::FLASH_MODE_RED_EYE
- //| ExynosCamera::FLASH_MODE_TORCH
- ;
- flashMode = ExynosCamera::FLASH_MODE_OFF;
- focusModeList =
- // ExynosCamera::FOCUS_MODE_AUTO
- ExynosCamera::FOCUS_MODE_INFINITY
- //| ExynosCamera::FOCUS_MODE_MACRO
- //| ExynosCamera::FOCUS_MODE_FIXED
- //| ExynosCamera::FOCUS_MODE_EDOF
- //| ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
- //| ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
- //| ExynosCamera::FOCUS_MODE_TOUCH
- ;
- focusMode = ExynosCamera::FOCUS_MODE_INFINITY;
- sceneModeList =
- ExynosCamera::SCENE_MODE_AUTO
- | ExynosCamera::SCENE_MODE_ACTION
- | ExynosCamera::SCENE_MODE_PORTRAIT
- | ExynosCamera::SCENE_MODE_LANDSCAPE
- | ExynosCamera::SCENE_MODE_NIGHT
- | ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
- | ExynosCamera::SCENE_MODE_THEATRE
- | ExynosCamera::SCENE_MODE_BEACH
- | ExynosCamera::SCENE_MODE_SNOW
- | ExynosCamera::SCENE_MODE_SUNSET
- | ExynosCamera::SCENE_MODE_STEADYPHOTO
- | ExynosCamera::SCENE_MODE_FIREWORKS
- | ExynosCamera::SCENE_MODE_SPORTS
- | ExynosCamera::SCENE_MODE_PARTY
- | ExynosCamera::SCENE_MODE_CANDLELIGHT
- ;
- sceneMode = ExynosCamera::SCENE_MODE_AUTO;
- whiteBalanceList =
- ExynosCamera::WHITE_BALANCE_AUTO
- | ExynosCamera::WHITE_BALANCE_INCANDESCENT
- | ExynosCamera::WHITE_BALANCE_FLUORESCENT
- //| ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
- | ExynosCamera::WHITE_BALANCE_DAYLIGHT
- | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
- //| ExynosCamera::WHITE_BALANCE_TWILIGHT
- //| ExynosCamera::WHITE_BALANCE_SHADE
- ;
- whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
- autoWhiteBalanceLockSupported = true;
- autoWhiteBalanceLock = false;
- rotation = 0;
- minExposure = -4;
- maxExposure = 4;
- exposure = 0;
- autoExposureLockSupported = true;
- autoExposureLock = false;
- fpsRange[0] = 4000;
- fpsRange[1] = 30000;
- fNumberNum = 245;
- fNumberDen = 100;
- focalLengthNum = 185;
- focalLengthDen = 100;
- apertureNum = 245;
- apertureDen = 100;
- supportVideoStabilization = false;
- applyVideoStabilization = false;
- videoStabilization = false;
- maxNumMeteringAreas = 32;
- maxNumDetectedFaces = 16;
- maxNumFocusAreas = 0;
- maxZoom = ZOOM_LEVEL_MAX;
- hwZoomSupported = false;
- zoom = 0;
- gpsAltitude = 0;
- gpsLatitude = 0;
- gpsLongitude = 0;
- gpsTimestamp = 0;
- /* Additional API default Value. */
- metering = ExynosCamera::METERING_MODE_CENTER;
- focalLengthIn35mmLength = 27;
- }
- ExynosCameraInfoS5K4E5::ExynosCameraInfoS5K4E5()
- {
- previewW = 1920;
- previewH = 1080;
- previewColorFormat = V4L2_PIX_FMT_NV21M;
- previewBufPlane = 3;
- videoW = 1920;
- videoH = 1080;
- videoColorFormat = V4L2_PIX_FMT_NV12M;
- videoBufPlane = 3;
- pictureW = 2560;
- pictureH = 1920;
- pictureColorFormat = V4L2_PIX_FMT_YUYV;
- pictureBufPlane = 2;
- thumbnailW = 512;
- thumbnailH = 384;
- ispW = 1920;
- ispH = 1440;
- antiBandingList =
- ExynosCamera::ANTIBANDING_AUTO
- | ExynosCamera::ANTIBANDING_50HZ
- | ExynosCamera::ANTIBANDING_60HZ
- | ExynosCamera::ANTIBANDING_OFF
- ;
- antiBanding = ExynosCamera::ANTIBANDING_AUTO;
- effectList =
- ExynosCamera::EFFECT_NONE
- | ExynosCamera::EFFECT_MONO
- | ExynosCamera::EFFECT_NEGATIVE
- //| ExynosCamera::EFFECT_SOLARIZE
- | ExynosCamera::EFFECT_SEPIA
- //| ExynosCamera::EFFECT_POSTERIZE
- //| ExynosCamera::EFFECT_WHITEBOARD
- //| ExynosCamera::EFFECT_BLACKBOARD
- //| ExynosCamera::EFFECT_AQUA
- ;
- effect = ExynosCamera::EFFECT_NONE;
- flashModeList =
- ExynosCamera::FLASH_MODE_OFF
- | ExynosCamera::FLASH_MODE_AUTO
- | ExynosCamera::FLASH_MODE_ON
- //| ExynosCamera::FLASH_MODE_RED_EYE
- | ExynosCamera::FLASH_MODE_TORCH;
- flashMode = ExynosCamera::FLASH_MODE_OFF;
- focusModeList =
- ExynosCamera::FOCUS_MODE_AUTO
- | ExynosCamera::FOCUS_MODE_INFINITY
- | ExynosCamera::FOCUS_MODE_MACRO
- //| ExynosCamera::FOCUS_MODE_FIXED
- //| ExynosCamera::FOCUS_MODE_EDOF
- | ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
- | ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
- | ExynosCamera::FOCUS_MODE_TOUCH
- | ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE_MACRO
- ;
- focusMode = ExynosCamera::FOCUS_MODE_AUTO;
- sceneModeList =
- ExynosCamera::SCENE_MODE_AUTO
- //| ExynosCamera::SCENE_MODE_ACTION
- | ExynosCamera::SCENE_MODE_PORTRAIT
- | ExynosCamera::SCENE_MODE_LANDSCAPE
- | ExynosCamera::SCENE_MODE_NIGHT
- //| ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
- //| ExynosCamera::SCENE_MODE_THEATRE
- | ExynosCamera::SCENE_MODE_BEACH
- | ExynosCamera::SCENE_MODE_SNOW
- | ExynosCamera::SCENE_MODE_SUNSET
- | ExynosCamera::SCENE_MODE_STEADYPHOTO
- | ExynosCamera::SCENE_MODE_FIREWORKS
- | ExynosCamera::SCENE_MODE_SPORTS
- | ExynosCamera::SCENE_MODE_PARTY
- | ExynosCamera::SCENE_MODE_CANDLELIGHT;
- sceneMode = ExynosCamera::SCENE_MODE_AUTO;
- whiteBalanceList =
- ExynosCamera::WHITE_BALANCE_AUTO
- | ExynosCamera::WHITE_BALANCE_INCANDESCENT
- | ExynosCamera::WHITE_BALANCE_FLUORESCENT
- //| ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
- | ExynosCamera::WHITE_BALANCE_DAYLIGHT
- | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
- //| ExynosCamera::WHITE_BALANCE_TWILIGHT
- //| ExynosCamera::WHITE_BALANCE_SHADE
- ;
- whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
- autoWhiteBalanceLockSupported = true;
- autoWhiteBalanceLock = false;
- rotation = 0;
- minExposure = -4;
- maxExposure = 4;
- exposure = 0;
- autoExposureLockSupported = true;
- autoExposureLock = false;
- fpsRange[0] = 1000;
- fpsRange[1] = 30000;
- fNumberNum = 12;
- fNumberDen = 10;
- focalLengthNum = 343;
- focalLengthDen = 100;
- apertureNum = 27;
- apertureDen = 10;
- supportVideoStabilization = true;
- applyVideoStabilization = false;
- videoStabilization = false;
- maxNumMeteringAreas = 64;
- maxNumDetectedFaces = 16;
- maxNumFocusAreas = 2;
- maxZoom = ZOOM_LEVEL_MAX;
- hwZoomSupported = false;
- zoom = 0;
- gpsAltitude = 0;
- gpsLatitude = 0;
- gpsLongitude = 0;
- gpsTimestamp = 0;
- }
- ExynosCameraInfoIMX135::ExynosCameraInfoIMX135()
- {
- previewW = 1920;
- previewH = 1080;
- previewColorFormat = V4L2_PIX_FMT_NV21M;
- previewBufPlane = 3;
- videoW = 1920;
- videoH = 1080;
- ispW = 1920;
- ispH = 1080;
- videoColorFormat = V4L2_PIX_FMT_NV12M;
- videoBufPlane = 3;
- pictureW = 4128;
- pictureH = 3096;
- pictureColorFormat = V4L2_PIX_FMT_YUYV;
- pictureBufPlane = 2;
- thumbnailW = 512;
- thumbnailH = 384;
- antiBandingList =
- ExynosCamera::ANTIBANDING_AUTO
- | ExynosCamera::ANTIBANDING_50HZ
- | ExynosCamera::ANTIBANDING_60HZ
- | ExynosCamera::ANTIBANDING_OFF
- ;
- antiBanding = ExynosCamera::ANTIBANDING_AUTO;
- effectList =
- ExynosCamera::EFFECT_NONE
- | ExynosCamera::EFFECT_MONO
- | ExynosCamera::EFFECT_NEGATIVE
- //| ExynosCamera::EFFECT_SOLARIZE
- | ExynosCamera::EFFECT_SEPIA
- | ExynosCamera::EFFECT_POSTERIZE
- //| ExynosCamera::EFFECT_WHITEBOARD
- //| ExynosCamera::EFFECT_BLACKBOARD
- | ExynosCamera::EFFECT_AQUA
- ;
- effect = ExynosCamera::EFFECT_NONE;
- flashModeList =
- ExynosCamera::FLASH_MODE_OFF
- | ExynosCamera::FLASH_MODE_AUTO
- | ExynosCamera::FLASH_MODE_ON
- //| ExynosCamera::FLASH_MODE_RED_EYE
- | ExynosCamera::FLASH_MODE_TORCH;
- flashMode = ExynosCamera::FLASH_MODE_OFF;
- focusModeList =
- ExynosCamera::FOCUS_MODE_AUTO
- //| ExynosCamera::FOCUS_MODE_INFINITY
- | ExynosCamera::FOCUS_MODE_MACRO
- //| ExynosCamera::FOCUS_MODE_FIXED
- //| ExynosCamera::FOCUS_MODE_EDOF
- | ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
- | ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
- | ExynosCamera::FOCUS_MODE_TOUCH
- ;
- focusMode = ExynosCamera::FOCUS_MODE_AUTO;
- sceneModeList =
- ExynosCamera::SCENE_MODE_AUTO
- | ExynosCamera::SCENE_MODE_ACTION
- | ExynosCamera::SCENE_MODE_PORTRAIT
- | ExynosCamera::SCENE_MODE_LANDSCAPE
- | ExynosCamera::SCENE_MODE_NIGHT
- | ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
- | ExynosCamera::SCENE_MODE_THEATRE
- | ExynosCamera::SCENE_MODE_BEACH
- | ExynosCamera::SCENE_MODE_SNOW
- | ExynosCamera::SCENE_MODE_SUNSET
- | ExynosCamera::SCENE_MODE_STEADYPHOTO
- | ExynosCamera::SCENE_MODE_FIREWORKS
- | ExynosCamera::SCENE_MODE_SPORTS
- | ExynosCamera::SCENE_MODE_PARTY
- | ExynosCamera::SCENE_MODE_CANDLELIGHT;
- sceneMode = ExynosCamera::SCENE_MODE_AUTO;
- whiteBalanceList =
- ExynosCamera::WHITE_BALANCE_AUTO
- | ExynosCamera::WHITE_BALANCE_INCANDESCENT
- | ExynosCamera::WHITE_BALANCE_FLUORESCENT
- //| ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
- | ExynosCamera::WHITE_BALANCE_DAYLIGHT
- | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
- //| ExynosCamera::WHITE_BALANCE_TWILIGHT
- //| ExynosCamera::WHITE_BALANCE_SHADE
- ;
- whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
- autoWhiteBalanceLockSupported = true;
- autoWhiteBalanceLock = false;
- rotation = 0;
- minExposure = -4;
- maxExposure = 4;
- exposure = 0;
- autoExposureLockSupported = true;
- autoExposureLock = false;
- fpsRange[0] = 7000;
- fpsRange[1] = 30000;
- fNumberNum = 22;
- fNumberDen = 10;
- focalLengthNum = 420;
- focalLengthDen = 100;
- apertureNum = 227;
- apertureDen = 100;
- supportVideoStabilization = true;
- applyVideoStabilization = false;
- videoStabilization = false;
- maxNumMeteringAreas = 32;
- maxNumDetectedFaces = 16;
- maxNumFocusAreas = 2;
- maxZoom = ZOOM_LEVEL_MAX;
- hwZoomSupported = false;
- zoom = 0;
- gpsAltitude = 0;
- gpsLatitude = 0;
- gpsLongitude = 0;
- gpsTimestamp = 0;
- /* Additional API default Value. */
- metering = ExynosCamera::METERING_MODE_CENTER;
- focalLengthIn35mmLength = 31;
- }
- ExynosCameraInfoIMX135Fake::ExynosCameraInfoIMX135Fake()
- {
- previewW = 1920;
- previewH = 1080;
- previewColorFormat = V4L2_PIX_FMT_NV21M;
- videoW = 1920;
- videoH = 1080;
- pictureW = 4128;
- pictureH = 3096;
- videoColorFormat = V4L2_PIX_FMT_NV12M;
- ispW = 4128;
- ispH = 3096;
- pictureColorFormat = V4L2_PIX_FMT_YUYV;
- thumbnailW = 512;
- thumbnailH = 384;
- }
- ExynosCameraInfoS5K6B2Fake::ExynosCameraInfoS5K6B2Fake()
- {
- previewW = 1280;
- previewH = 960;
- previewColorFormat = V4L2_PIX_FMT_NV21M;
- videoW = 1920;
- videoH = 1080;
- videoColorFormat = V4L2_PIX_FMT_NV12M;
- pictureW = 1920;
- pictureH = 1080;
- pictureColorFormat = V4L2_PIX_FMT_YUYV;
- thumbnailW = 512;
- thumbnailH = 384;
- }
- ExynosCameraInfoS5K4E5Fake::ExynosCameraInfoS5K4E5Fake()
- {
- previewW = 1920;
- previewH = 1080;
- // previewColorFormat = V4L2_PIX_FMT_YVU420M;
- previewColorFormat = V4L2_PIX_FMT_NV21M;
- videoW = 1920;
- videoH = 1080;
- videoColorFormat = V4L2_PIX_FMT_NV12M;
- ispW = 2560;
- ispH = 1920;
- pictureW = 2560;
- pictureH = 1920;
- pictureColorFormat = V4L2_PIX_FMT_YUYV;
- thumbnailW = 512;
- thumbnailH = 384;
- }
- //////////////////////////////////////////////////
- #define PFX_NODE "/dev/video"
- #define M5MOLS_ENTITY_NAME "M5MOLS 5-001f"
- #define PFX_SUBDEV_ENTITY_MIPI_CSIS "s5p-mipi-csis"
- #define PFX_SUBDEV_ENTITY_FLITE "flite-subdev"
- #define PFX_SUBDEV_ENTITY_GSC_CAP "gsc-cap-subdev"
- #define PFX_VIDEODEV_ENTITY_FLITE "exynos-fimc-lite"
- #define PFX_VIDEODEV_ENTITY_GSC_CAP "exynos-gsc"
- #define MEDIA_DEV_INTERNAL_ISP "/dev/media2"
- #define MEDIA_DEV_EXTERNAL_ISP "/dev/media1"
- #define ISP_VD_NODE_OFFSET (40) //INTERNAL_ISP
- #define FLITE_VD_NODE_OFFSET (36) //External ISP
- #define VIDEO_NODE_PREVIEW_ID (3)
- #define VIDEO_NODE_RECODING_ID (2)
- #define VIDEO_NODE_SNAPSHOT_ID (1)
- #define ISP_SENSOR_MAX_ENTITIES 1
- #define ISP_SENSOR_PAD_SOURCE_FRONT 0
- #define ISP_SENSOR_PADS_NUM 1
- #define ISP_FRONT_MAX_ENTITIES 1
- #define ISP_FRONT_PAD_SINK 0
- #define ISP_FRONT_PAD_SOURCE_BACK 1
- #define ISP_FRONT_PAD_SOURCE_BAYER 2
- #define ISP_FRONT_PAD_SOURCE_SCALERC 3
- #define ISP_FRONT_PADS_NUM 4
- #define ISP_BACK_MAX_ENTITIES 1
- #define ISP_BACK_PAD_SINK 0
- #define ISP_BACK_PAD_SOURCE_3DNR 1
- #define ISP_BACK_PAD_SOURCE_SCALERP 2
- #define ISP_BACK_PADS_NUM 3
- #define ISP_MODULE_NAME "exynos5-fimc-is"
- #define ISP_SENSOR_ENTITY_NAME "exynos5-fimc-is-sensor"
- #define ISP_FRONT_ENTITY_NAME "exynos5-fimc-is-front"
- #define ISP_BACK_ENTITY_NAME "exynos5-fimc-is-back"
- #define ISP_VIDEO_BAYER_NAME "exynos5-fimc-is-bayer"
- #define ISP_VIDEO_SCALERC_NAME "exynos5-fimc-is-scalerc"
- #define ISP_VIDEO_3DNR_NAME "exynos5-fimc-is-3dnr"
- #define ISP_VIDEO_SCALERP_NAME "exynos5-fimc-is-scalerp"
- #define MIPI_NUM 1
- #define FLITE_NUM 1
- #define GSC_NUM 0
- #define PFX_SUBDEV_NODE "/dev/v4l-subdev"
- #define V4L2_CAMERA_MEMORY_TYPE V4L2_MEMORY_DMABUF /* V4L2_MEMORY_USERPTR */
- /*
- * V 4 L 2 F I M C E X T E N S I O N S
- *
- */
- #define V4L2_CID_ROTATION (V4L2_CID_PRIVATE_BASE + 0)
- #define V4L2_CID_PADDR_Y (V4L2_CID_PRIVATE_BASE + 1)
- #define V4L2_CID_PADDR_CB (V4L2_CID_PRIVATE_BASE + 2)
- #define V4L2_CID_PADDR_CR (V4L2_CID_PRIVATE_BASE + 3)
- #define V4L2_CID_PADDR_CBCR (V4L2_CID_PRIVATE_BASE + 4)
- #define V4L2_CID_STREAM_PAUSE (V4L2_CID_PRIVATE_BASE + 53)
- #define V4L2_CID_CAM_JPEG_MAIN_SIZE (V4L2_CID_PRIVATE_BASE + 32)
- #define V4L2_CID_CAM_JPEG_MAIN_OFFSET (V4L2_CID_PRIVATE_BASE + 33)
- #define V4L2_CID_CAM_JPEG_THUMB_SIZE (V4L2_CID_PRIVATE_BASE + 34)
- #define V4L2_CID_CAM_JPEG_THUMB_OFFSET (V4L2_CID_PRIVATE_BASE + 35)
- #define V4L2_CID_CAM_JPEG_POSTVIEW_OFFSET (V4L2_CID_PRIVATE_BASE + 36)
- #define V4L2_CID_CAM_JPEG_QUALITY (V4L2_CID_PRIVATE_BASE + 37)
- #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U')
- /* FOURCC for FIMC specific */
- #define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y')
- #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6')
- #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1')
- #define V4L2_PIX_FMT_NV12T v4l2_fourcc('T', 'V', '1', '2')
- ///////////////////////////////////////////////////
- // Google Official API : Camera.Parameters
- // http://developer.android.com/reference/android/hardware/Camera.Parameters.html
- ///////////////////////////////////////////////////
- /* For v4l2_ioctls interfaces */
- int ExynosCamera::get_pixel_depth(uint32_t fmt)
- {
- int depth = 0;
- switch (fmt) {
- case V4L2_PIX_FMT_JPEG:
- depth = 8;
- break;
- case V4L2_PIX_FMT_NV12:
- case V4L2_PIX_FMT_NV21:
- case V4L2_PIX_FMT_YUV420:
- case V4L2_PIX_FMT_YVU420M:
- case V4L2_PIX_FMT_YUV420M:
- case V4L2_PIX_FMT_NV12M:
- case V4L2_PIX_FMT_NV12MT:
- depth = 12;
- break;
- case V4L2_PIX_FMT_RGB565:
- case V4L2_PIX_FMT_YUYV:
- case V4L2_PIX_FMT_YVYU:
- case V4L2_PIX_FMT_UYVY:
- case V4L2_PIX_FMT_VYUY:
- case V4L2_PIX_FMT_NV16:
- case V4L2_PIX_FMT_NV61:
- case V4L2_PIX_FMT_YUV422P:
- case V4L2_PIX_FMT_SBGGR10:
- case V4L2_PIX_FMT_SBGGR12:
- case V4L2_PIX_FMT_SBGGR16:
- depth = 16;
- break;
- case V4L2_PIX_FMT_RGB32:
- depth = 32;
- break;
- default:
- CLOGE("ERR(%s):Get depth failed(format : %d)", __func__, fmt);
- break;
- }
- return depth;
- }
- int ExynosCamera::cam_int_s_fmt(node_info_t *node)
- {
- struct v4l2_format v4l2_fmt;
- if (node->planes <= 0) {
- CLOGE("ERR(%s):S_FMT, Out of bound : Number of element plane(%d)", __func__, node->planes);
- return -1;
- }
- CLOGD("[%s] (%d) type %d, %d x %d, format %d", __func__, __LINE__, node->type, node->width, node->height, node->format);
- memset(&v4l2_fmt, 0, sizeof(struct v4l2_format));
- v4l2_fmt.type = node->type;
- v4l2_fmt.fmt.pix_mp.width = node->width;
- v4l2_fmt.fmt.pix_mp.height = node->height;
- v4l2_fmt.fmt.pix_mp.pixelformat = node->format;
- v4l2_fmt.fmt.pix_mp.field = V4L2_FIELD_ANY;
- if (exynos_v4l2_s_fmt(node->fd, &v4l2_fmt) < 0) {
- CLOGE("ERR(%s):exynos_v4l2_s_fmt fail", __func__);
- return -1;
- }
- return 0;
- }
- int ExynosCamera::cam_int_reqbufs(node_info_t *node)
- {
- struct v4l2_requestbuffers req;
- int ret;
- req.count = node->buffers;
- req.type = node->type;
- req.memory = node->memory;
- CLOGD("[%s] (%d) fd %d, count %d, type %d, memory %d", __func__, __LINE__, node->fd, req.count, req.type, req.memory);
- ret = exynos_v4l2_reqbufs(node->fd, &req);
- if (ret < 0) {
- CLOGE("ERR(%s):VIDIOC_REQBUFS (fd:%d) failed (%d)", __func__,node->fd, ret);
- return -1;
- }
- return req.count;
- }
- int ExynosCamera::cam_int_clrbufs(node_info_t * node)
- {
- struct v4l2_requestbuffers req;
- int ret;
- req.count = 0;
- req.type = node->type;
- req.memory = node->memory;
- CLOGD("[%s] (%d) fd %d, count %d, type %d, memory %d", __func__, __LINE__, node->fd, req.count, req.type, req.memory);
- ret = exynos_v4l2_reqbufs(node->fd, &req);
- if (ret < 0) {
- CLOGE("ERR(%s):VIDIOC_REQBUFS(0) (fd:%d) failed (%d)", __func__,node->fd, ret);
- return -1;
- }
- return req.count;
- }
- int ExynosCamera::cam_int_qbuf(node_info_t *node, int index)
- {
- struct v4l2_buffer v4l2_buf;
- struct v4l2_plane planes[VIDEO_MAX_PLANES];
- int i;
- int ret = 0;
- v4l2_buf.m.planes = planes;
- v4l2_buf.type = node->type;
- v4l2_buf.memory = node->memory;
- v4l2_buf.index = index;
- v4l2_buf.length = node->planes;
- for(i = 0; i < node->planes; i++){
- if (node->memory == V4L2_MEMORY_DMABUF)
- v4l2_buf.m.planes[i].m.fd = (int)(node->buffer[index].fd.extFd[i]);
- else if (node->memory == V4L2_MEMORY_USERPTR)
- v4l2_buf.m.planes[i].m.userptr = (unsigned long)(node->buffer[index].virt.extP[i]);
- else {
- CLOGE("ERR(%s):invalid node->memory(%d)", __func__, node->memory);
- return -1;
- }
- v4l2_buf.m.planes[i].length = (unsigned long)(node->buffer[index].size.extS[i]);
- }
- ret = exynos_v4l2_qbuf(node->fd, &v4l2_buf);
- if (ret < 0) {
- CLOGE("ERR(%s):exynos_v4l2_qbuf failed (index:%d)(ret:%d)", __func__, index, ret);
- return -1;
- }
- return ret;
- }
- int ExynosCamera::cam_int_m2m_qbuf(node_info_t *srcNode, int srcIndex, node_info_t *ctlNode, int ctlIndex)
- {
- struct v4l2_buffer v4l2_buf;
- struct v4l2_plane planes[VIDEO_MAX_PLANES];
- int i;
- int ret = 0;
- v4l2_buf.m.planes = planes;
- v4l2_buf.type = ctlNode->type;
- v4l2_buf.memory = srcNode->memory;
- v4l2_buf.index = ctlIndex;
- v4l2_buf.length = srcNode->planes;
- for(i = 0; i < srcNode->planes; i++){
- if (srcNode->memory == V4L2_MEMORY_DMABUF) {
- v4l2_buf.m.planes[i].m.fd = (int)(srcNode->buffer[srcIndex].fd.extFd[i]);
- } else if (srcNode->memory == V4L2_MEMORY_USERPTR) {
- v4l2_buf.m.planes[i].m.userptr = (unsigned long)(srcNode->buffer[srcIndex].virt.extP[i]);
- } else {
- CLOGE("ERR(%s):invalid node->memory(%d)", __func__, srcNode->memory);
- return -1;
- }
- v4l2_buf.m.planes[i].length = (unsigned long)(srcNode->buffer[srcIndex].size.extS[i]);
- }
- ret = exynos_v4l2_qbuf(ctlNode->fd, &v4l2_buf);
- if (ret < 0) {
- CLOGE("ERR(%s):exynos_v4l2_qbuf failed (srcIndex:%d)(ret:%d)", __func__, srcIndex, ret);
- return -1;
- }
- return ret;
- }
- int ExynosCamera::cam_int_m2m_qbuf_for_3a0(node_info_t *srcNode, int srcIndex, node_info_t *ctlNode, int ctlIndex, ExynosBuffer tempMeta)
- {
- struct v4l2_buffer v4l2_buf;
- struct v4l2_plane planes[VIDEO_MAX_PLANES];
- int i;
- int ret = 0;
- v4l2_buf.m.planes = planes;
- v4l2_buf.type = ctlNode->type;
- v4l2_buf.memory = srcNode->memory;
- v4l2_buf.index = ctlIndex;
- v4l2_buf.length = srcNode->planes;
- for (i = 0; i < srcNode->planes; i++) {
- if (srcNode->memory == V4L2_MEMORY_DMABUF) {
- v4l2_buf.m.planes[i].m.fd = (int)(srcNode->buffer[srcIndex].fd.extFd[i]);
- } else if (srcNode->memory == V4L2_MEMORY_USERPTR) {
- v4l2_buf.m.planes[i].m.userptr = (unsigned long)(srcNode->buffer[srcIndex].virt.extP[i]);
- } else {
- CLOGE("ERR(%s):invalid node->memory(%d)", __func__, srcNode->memory);
- return -1;
- }
- v4l2_buf.m.planes[i].length = (unsigned long)(srcNode->buffer[srcIndex].size.extS[i]);
- }
- if (srcNode->memory == V4L2_MEMORY_DMABUF) {
- v4l2_buf.m.planes[v4l2_buf.length - 1].m.fd = (int)(tempMeta.fd.extFd[v4l2_buf.length - 1]);
- } else if (srcNode->memory == V4L2_MEMORY_USERPTR) {
- v4l2_buf.m.planes[v4l2_buf.length - 1].m.userptr = (unsigned long)(tempMeta.virt.extP[v4l2_buf.length - 1]);
- } else {
- CLOGE("ERR(%s):invalid meta(%d)", __func__, srcNode->memory);
- return -1;
- }
- ret = exynos_v4l2_qbuf(ctlNode->fd, &v4l2_buf);
- if (ret < 0) {
- CLOGE("ERR(%s):exynos_v4l2_qbuf failed (srcIndex:%d)(ret:%d)", __func__, srcIndex, ret);
- return -1;
- }
- return ret;
- }
- int ExynosCamera::cam_int_m2m_qbuf_for_3a1(node_info_t *srcNode, int srcIndex, node_info_t *ctlNode, int ctlIndex, ExynosBuffer tempMeta)
- {
- struct v4l2_buffer v4l2_buf;
- struct v4l2_plane planes[VIDEO_MAX_PLANES];
- int i;
- int ret = 0;
- v4l2_buf.m.planes = planes;
- v4l2_buf.type = ctlNode->type;
- v4l2_buf.memory = srcNode->memory;
- v4l2_buf.index = ctlIndex;
- v4l2_buf.length = srcNode->planes;
- for (i = 0; i < srcNode->planes; i++) {
- if (srcNode->memory == V4L2_MEMORY_DMABUF) {
- v4l2_buf.m.planes[i].m.fd = (int)(srcNode->buffer[srcIndex].fd.extFd[i]);
- } else if (srcNode->memory == V4L2_MEMORY_USERPTR) {
- v4l2_buf.m.planes[i].m.userptr = (unsigned long)(srcNode->buffer[srcIndex].virt.extP[i]);
- } else {
- CLOGE("ERR(%s):invalid node->memory(%d)", __func__, srcNode->memory);
- return -1;
- }
- v4l2_buf.m.planes[i].length = (unsigned long)(srcNode->buffer[srcIndex].size.extS[i]);
- }
- if (srcNode->memory == V4L2_MEMORY_DMABUF) {
- v4l2_buf.m.planes[v4l2_buf.length - 1].m.fd = (int)(tempMeta.fd.extFd[v4l2_buf.length - 1]);
- } else if (srcNode->memory == V4L2_MEMORY_USERPTR) {
- v4l2_buf.m.planes[v4l2_buf.length - 1].m.userptr = (unsigned long)(tempMeta.virt.extP[v4l2_buf.length - 1]);
- } else {
- CLOGE("ERR(%s):invalid meta(%d)", __func__, srcNode->memory);
- return -1;
- }
- ret = exynos_v4l2_qbuf(ctlNode->fd, &v4l2_buf);
- if (ret < 0) {
- CLOGE("ERR(%s):exynos_v4l2_qbuf failed (srcIndex:%d)(ret:%d)", __func__, srcIndex, ret);
- return -1;
- }
- return ret;
- }
- int ExynosCamera::cam_int_streamon(node_info_t *node)
- {
- enum v4l2_buf_type type = node->type;
- int ret;
- CLOGD("[%s] (%d) fd %d, type %d", __func__, __LINE__, node->fd, (int)type);
- ret = exynos_v4l2_streamon(node->fd, type);
- if (ret < 0) {
- CLOGE("ERR(%s):VIDIOC_STREAMON failed (%d)", __func__, ret);
- return -1;
- }
- return ret;
- }
- int ExynosCamera::cam_int_streamoff(node_info_t *node)
- {
- enum v4l2_buf_type type = node->type;
- int ret;
- CLOGD("[%s] (%d) fd %d, type %d", __func__, __LINE__, node->fd, (int)type);
- ret = exynos_v4l2_streamoff(node->fd, type);
- if (ret < 0) {
- CLOGE("ERR(%s):VIDIOC_STREAMOFF failed (%d)", __func__, ret);
- return -1;
- }
- return ret;
- }
- #ifdef USE_CAMERA_ESD_RESET
- #define CLEAR(x) memset(&(x), 0, sizeof(x))
- int ExynosCamera::polling(int node_fd)
- {
- struct pollfd events;
- /* 50 msec * 100 = 5sec */
- int cnt = 100;
- long sec = 50; /* 50 msec */
- int ret = 0;
- int pollRet = 0;
- events.fd = node_fd;
- events.events = POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM | POLLERR;
- events.revents = 0;
- while (cnt--) {
- pollRet = poll(&events, 1, sec);
- if (pollRet < 0) {
- ret = -1;
- break;
- } else if (0 < pollRet) {
- if (events.revents & POLLIN) {
- break;
- } else if (events.revents & POLLERR) {
- ret = -1;
- break;
- }
- }
- }
- if (ret < 0 || cnt <= 0) {
- CLOGE("ERR(%s):[esdreset] poll[%d], pollRet(%d) event(0x%x), cnt(%d)",
- __func__, node_fd, pollRet, events.revents, cnt);
- if (cnt <= 0)
- ret = -1;
- }
- return ret;
- }
- #endif
- int ExynosCamera::cam_int_dqbuf(node_info_t *node)
- {
- struct v4l2_buffer v4l2_buf;
- struct v4l2_plane planes[VIDEO_MAX_PLANES];
- int ret;
- v4l2_buf.type = node->type;
- v4l2_buf.memory = node->memory;
- v4l2_buf.m.planes = planes;
- v4l2_buf.length = node->planes;
- ret = exynos_v4l2_dqbuf(node->fd, &v4l2_buf);
- if (ret < 0) {
- if (ret != -EAGAIN)
- CLOGE("ERR(%s):VIDIOC_DQBUF failed (%d)", __func__, ret);
- return ret;
- }
- #ifdef USE_FOR_DTP
- if (v4l2_buf.flags & V4L2_BUF_FLAG_ERROR) {
- CLOGE("ERR(%s):VIDIOC_DQBUF returned with error (%d)", __func__, V4L2_BUF_FLAG_ERROR);
- return -1;
- }
- #endif
- return v4l2_buf.index;
- }
- int ExynosCamera::cam_int_s_input(node_info_t *node, int index)
- {
- int ret;
- CLOGD("[%s] (%d) fd %d, index %d", __func__, __LINE__, node->fd, index);
- ret = exynos_v4l2_s_input(node->fd, index);
- if (ret < 0)
- CLOGE("ERR(%s):VIDIOC_S_INPUT failed (%d)", __func__, ret);
- return ret;
- }
- int ExynosCamera::cam_int_querybuf(node_info_t *stream)
- {
- struct v4l2_buffer v4l2_buf;
- struct v4l2_plane planes[VIDEO_MAX_PLANES];
- int i, plane_index, ret;
- for(i = 0; i < stream->buffers; i++) {
- v4l2_buf.type = stream->type;
- v4l2_buf.memory = stream->memory;
- v4l2_buf.index = i;
- v4l2_buf.m.planes = planes;
- v4l2_buf.length = stream->planes; // this is for multi-planar
- ret = ioctl(stream->fd, VIDIOC_QUERYBUF, &v4l2_buf);
- if (ret < 0)
- CLOGE("ERR(%s):VIDIOC_QUERYBUF failed (%d)", __func__, ret);
- /*
- for (plane_index = 0; plane_index < stream->planes; plane_index++) {
- // remember for munmap()
- stream->buffer[i].length[plane_index] = v4l2_buf.m.planes[plane_index].length;
-