19426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin/*
29426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * Copyright 2008, The Android Open Source Project
39426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * Copyright 2010, Samsung Electronics Co. LTD
49426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *
59426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * Licensed under the Apache License, Version 2.0 (the "License");
69426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * you may not use this file except in compliance with the License.
79426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * You may obtain a copy of the License at
89426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *
99426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *      http://www.apache.org/licenses/LICENSE-2.0
109426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *
119426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * Unless required by applicable law or agreed to in writing, software
129426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * distributed under the License is distributed toggle an "AS IS" BASIS,
139426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * See the License for the specific language governing permissions and
159426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * limitations under the License.
169426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin */
179426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
189426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin/*!
199426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * \file      ExynosCamera.cpp
209426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * \brief     source file for CAMERA HAL MODULE
219426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * \author    thun.hwang(thun.hwang@samsung.com)
229426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * \date      2010/06/03
239426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *
249426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * <b>Revision History: </b>
259426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * - 2011/12/31 : thun.hwang(thun.hwang@samsung.com) \n
269426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *   Initial version
279426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *
289426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * - 2012/01/18 : Sangwoo, Park(sw5771.park@samsung.com) \n
299426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *   Adjust Doxygen Document
309426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *
319426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * - 2012/02/01 : Sangwoo, Park(sw5771.park@samsung.com) \n
329426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *   Adjust libv4l2
339426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *   Adjust struct ExynosCameraInfo
349426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *   External ISP feature
359426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *
369426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * - 2012/03/14 : sangwoo.park(sw5771.park@samsung.com) \n
379426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *   Change file, class name to ExynosXXX.
389426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin */
399426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
409426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin/**
419426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * @page ExynosCamera
429426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *
439426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * @section Introduction
449426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * ExynosCamera is for camera preview,takePicture and recording.
459426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * (Currently libseccamera is included in Android Camera HAL(libcamera.so).
469426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *
479426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * @section Copyright
489426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *  Copyright (c) 2008-2011 Samsung Electronics Co., Ltd.All rights reserved. \n
499426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *  Proprietary and Confidential
509426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *
519426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * @image html samsung.png
529426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin */
539426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
549426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin//#define LOG_NDEBUG 0
559426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define LOG_TAG "ExynosCamera"
569426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
579426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin/* FIXME: This define will be removed when functions are stable */
589426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin//#define USE_DIS
599426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin//#define USE_3DNR
609426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin//#define USE_ODC
619426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
629426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#include <utils/Log.h>
639426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
649426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#include "ExynosCamera.h"
659426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#include "exynos_format.h"
669426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
679426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shinusing namespace android;
689426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
699426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shinnamespace android {
709426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
719426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung ShinExynosCameraInfo::ExynosCameraInfo()
729426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin{
739426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewW = 2560;
749426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewH = 1920;
759426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewColorFormat = V4L2_PIX_FMT_NV21;
769426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoW = 1920;
779426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoH = 1080;
789426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    prefVideoPreviewW = 640;
799426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    prefVideoPreviewH = 360;
809426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoColorFormat = V4L2_PIX_FMT_NV12M;
819426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureW = 2560;
829426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureH = 1920;
839426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureColorFormat = V4L2_PIX_FMT_YUYV;
849426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    thumbnailW = 320;
859426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    thumbnailH = 240;
869426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
879426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    antiBandingList =
889426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::ANTIBANDING_OFF
899426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::ANTIBANDING_50HZ
909426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::ANTIBANDING_60HZ
919426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::ANTIBANDING_OFF;
929426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    antiBanding = ExynosCamera::ANTIBANDING_OFF;
939426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
949426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    effectList =
959426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::EFFECT_NONE
969426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_MONO
979426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_NEGATIVE
989426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_SOLARIZE
999426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_SEPIA
1009426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_POSTERIZE
1019426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_WHITEBOARD
1029426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_BLACKBOARD
1039426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_AQUA;
1049426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    effect = ExynosCamera::EFFECT_NONE;
1059426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
1069426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    flashModeList =
1079426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::FLASH_MODE_OFF
1089426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FLASH_MODE_AUTO
1099426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FLASH_MODE_ON
1109426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FLASH_MODE_RED_EYE
1119426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FLASH_MODE_TORCH;
1129426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    flashMode = ExynosCamera::FLASH_MODE_OFF;
1139426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
1149426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focusModeList =
1159426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::FOCUS_MODE_AUTO
1169426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_INFINITY
1179426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_MACRO
1189426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_FIXED
1199426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_EDOF
1209426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
1219426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
1229426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_TOUCH;
1239426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focusMode = ExynosCamera::FOCUS_MODE_AUTO;
1249426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
1259426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    sceneModeList =
1269426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::SCENE_MODE_AUTO
1279426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_ACTION
1289426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_PORTRAIT
1299426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_LANDSCAPE
1309426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_NIGHT
1319426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
1329426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_THEATRE
1339426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_BEACH
1349426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SNOW
1359426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SUNSET
1369426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_STEADYPHOTO
1379426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_FIREWORKS
1389426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SPORTS
1399426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_PARTY
1409426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_CANDLELIGHT;
1419426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    sceneMode = ExynosCamera::SCENE_MODE_AUTO;
1429426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
1439426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    whiteBalanceList =
1449426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::WHITE_BALANCE_AUTO
1459426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_INCANDESCENT
1469426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_FLUORESCENT
1479426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
1489426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_DAYLIGHT
1499426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
1509426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_TWILIGHT
1519426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_SHADE;
1529426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
1539426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
1549426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoWhiteBalanceLockSupported = false;
1559426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoWhiteBalanceLock = false;
1569426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
1579426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    rotation = 0;
1589426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    minExposure = -2;
1599426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxExposure = 2;
1609426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    exposure = 0;
1619426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
1629426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoExposureLockSupported = false;
1639426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoExposureLock = false;
1649426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
1659426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    fps = 30;
1669426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focalLengthNum = 9;
1679426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focalLengthDen = 10;
1689426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    supportVideoStabilization = false;
1699426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    applyVideoStabilization = false;
1709426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoStabilization = false;
1719426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumMeteringAreas = 0;
1729426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumDetectedFaces = 0;
1739426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumFocusAreas = 0;
1749426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxZoom = ZOOM_LEVEL_MAX;
1759426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    hwZoomSupported = false;
1769426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    zoom = 0;
1779426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsAltitude = 0;
1789426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsLatitude = 0;
1799426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsLongitude = 0;
1809426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsTimestamp = 0;
1819426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
1829426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    // Additional API default Value.
1839426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    angle = 0;
1849426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    antiShake = false;
1859426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    beautyShot = false;
1869426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    brightness = 0;
1879426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    contrast = ExynosCamera::CONTRAST_DEFAULT;
1889426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gamma = false;
1899426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    hue = 2; // 2 is default;
1909426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    iso = 0;
1919426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    metering = ExynosCamera::METERING_MODE_CENTER;
1929426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    objectTracking = false;
1939426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    objectTrackingStart = false;
1949426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    saturation = 0;
1959426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    sharpness = 0;
1969426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    shotMode = ExynosCamera::SHOT_MODE_SINGLE;
1979426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    slowAE = false;
1989426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    smartAuto = false;
1999426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    touchAfStart = false;
2009426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    wdr = false;
2019426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    tdnr = false;
2029426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    odc = false;
2039426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin}
2049426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
2059426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung ShinExynosCameraInfoM5M0::ExynosCameraInfoM5M0()
2069426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin{
2079426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewW = 1280;
2089426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewH = 720;
2099426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewColorFormat = V4L2_PIX_FMT_YVU420M;
2109426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoW = 1280;
2119426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoH = 720;
2129426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    prefVideoPreviewW = 640;
2139426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    prefVideoPreviewH = 360;
2149426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoColorFormat = V4L2_PIX_FMT_NV12M;
2159426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureW = 1280;
2169426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureH = 720;
2179426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureColorFormat = V4L2_PIX_FMT_YUYV;
2189426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    thumbnailW = 320;
2199426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    thumbnailH = 240;
2209426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
2219426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    antiBandingList = ExynosCamera::ANTIBANDING_OFF;
2229426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    antiBanding = ExynosCamera::ANTIBANDING_OFF;
2239426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
2249426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    effectList =
2259426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::EFFECT_NONE
2269426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_MONO
2279426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_NEGATIVE
2289426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_SOLARIZE
2299426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_SEPIA
2309426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_POSTERIZE
2319426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_WHITEBOARD
2329426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_BLACKBOARD
2339426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_AQUA;
2349426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    effect = ExynosCamera::EFFECT_NONE;
2359426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
2369426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    flashModeList =
2379426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::FLASH_MODE_OFF
2389426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FLASH_MODE_AUTO
2399426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FLASH_MODE_ON
2409426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FLASH_MODE_RED_EYE
2419426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FLASH_MODE_TORCH;
2429426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    flashMode = ExynosCamera::FLASH_MODE_OFF;
2439426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
2449426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focusModeList =
2459426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::FOCUS_MODE_AUTO
2469426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_INFINITY
2479426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_MACRO
2489426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_FIXED
2499426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_EDOF
2509426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
2519426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
2529426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_TOUCH
2539426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        ;
2549426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focusMode = ExynosCamera::FOCUS_MODE_AUTO;
2559426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
2569426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    sceneModeList =
2579426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::SCENE_MODE_AUTO
2589426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::SCENE_MODE_ACTION
2599426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_PORTRAIT
2609426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_LANDSCAPE
2619426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_NIGHT
2629426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
2639426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::SCENE_MODE_THEATRE
2649426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_BEACH
2659426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SNOW
2669426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SUNSET
2679426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::SCENE_MODE_STEADYPHOTO
2689426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_FIREWORKS
2699426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SPORTS
2709426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_PARTY
2719426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_CANDLELIGHT;
2729426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    sceneMode = ExynosCamera::SCENE_MODE_AUTO;
2739426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
2749426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    whiteBalanceList =
2759426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::WHITE_BALANCE_AUTO
2769426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_INCANDESCENT
2779426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_FLUORESCENT
2789426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
2799426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_DAYLIGHT
2809426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
2819426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::WHITE_BALANCE_TWILIGHT
2829426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::WHITE_BALANCE_SHADE
2839426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        ;
2849426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
2859426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
2869426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoWhiteBalanceLockSupported = false;
2879426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoWhiteBalanceLock = false;
2889426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
2899426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    rotation = 0;
2909426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    minExposure = -2;
2919426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxExposure = 2;
2929426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    exposure = 0;
2939426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
2949426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoExposureLockSupported = false;
2959426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoExposureLock = false;
2969426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
2979426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    fps = 30;
2989426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focalLengthNum = 343;
2999426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focalLengthDen = 100;
3009426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    supportVideoStabilization = false;
3019426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    applyVideoStabilization = false;
3029426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoStabilization = false;
3039426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumMeteringAreas = 64;
3049426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumDetectedFaces = 16;
3059426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumFocusAreas = 2;
3069426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxZoom = ZOOM_LEVEL_MAX;
3079426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    hwZoomSupported = false;
3089426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    zoom = 0;
3099426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsAltitude = 0;
3109426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsLatitude = 0;
3119426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsLongitude = 0;
3129426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsTimestamp = 0;
3139426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin}
3149426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
3159426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung ShinExynosCameraInfoS5K6A3::ExynosCameraInfoS5K6A3()
3169426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin{
3179426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewW = 1280;
3189426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewH =  720;
3199426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewColorFormat = V4L2_PIX_FMT_YVU420M;
3209426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoW = 1280;
3219426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoH =  720;
3229426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    prefVideoPreviewW = 640;
3239426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    prefVideoPreviewH = 360;
3249426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoColorFormat = V4L2_PIX_FMT_NV12M;
3259426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureW = 1280;
3269426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureH =  720;
3279426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureColorFormat = V4L2_PIX_FMT_YUYV;
3289426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    thumbnailW = 320;
3299426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    thumbnailH = 240;
3309426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
3319426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    antiBandingList =
3329426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::ANTIBANDING_OFF
3339426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::ANTIBANDING_50HZ
3349426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::ANTIBANDING_60HZ
3359426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::ANTIBANDING_OFF;
3369426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    antiBanding = ExynosCamera::ANTIBANDING_OFF;
3379426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
3389426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    effectList =
3399426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::EFFECT_NONE
3409426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_MONO
3419426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_NEGATIVE
3429426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_SOLARIZE
3439426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_SEPIA
3449426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_POSTERIZE
3459426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_WHITEBOARD
3469426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_BLACKBOARD
3479426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_AQUA
3489426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        ;
3499426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    effect = ExynosCamera::EFFECT_NONE;
3509426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
3519426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    flashModeList =
3529426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::FLASH_MODE_OFF
3539426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FLASH_MODE_AUTO
3549426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FLASH_MODE_ON
3559426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FLASH_MODE_RED_EYE
3569426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FLASH_MODE_TORCH
3579426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        ;
3589426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    flashMode = ExynosCamera::FLASH_MODE_OFF;
3599426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
3609426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focusModeList =
3619426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //  ExynosCamera::FOCUS_MODE_AUTO
3629426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_INFINITY
3639426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_MACRO
3649426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //|
3659426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        ExynosCamera::FOCUS_MODE_FIXED
3669426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_EDOF
3679426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
3689426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
3699426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_TOUCH
3709426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        ;
3719426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focusMode = ExynosCamera::FOCUS_MODE_FIXED;
3729426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
3739426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    sceneModeList =
3749426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::SCENE_MODE_AUTO
3759426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::SCENE_MODE_ACTION
3769426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_PORTRAIT
3779426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_LANDSCAPE
3789426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_NIGHT
3799426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
3809426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::SCENE_MODE_THEATRE
3819426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_BEACH
3829426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SNOW
3839426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SUNSET
3849426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_STEADYPHOTO
3859426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_FIREWORKS
3869426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SPORTS
3879426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_PARTY
3889426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_CANDLELIGHT;
3899426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    sceneMode = ExynosCamera::SCENE_MODE_AUTO;
3909426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
3919426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    whiteBalanceList =
3929426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::WHITE_BALANCE_AUTO
3939426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_INCANDESCENT
3949426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_FLUORESCENT
3959426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
3969426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_DAYLIGHT
3979426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
3989426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::WHITE_BALANCE_TWILIGHT
3999426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::WHITE_BALANCE_SHADE
4009426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        ;
4019426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
4029426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
4039426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoWhiteBalanceLockSupported = true;
4049426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoWhiteBalanceLock = false;
4059426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
4069426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    rotation = 0;
4079426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    minExposure = -2;
4089426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxExposure = 2;
4099426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    exposure = 0;
4109426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
4119426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoExposureLockSupported = true;
4129426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoExposureLock = false;
4139426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
4149426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    fps = 30;
4159426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focalLengthNum = 9;
4169426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focalLengthDen = 10;
4179426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    supportVideoStabilization = false;
4189426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    applyVideoStabilization = false;
4199426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoStabilization = false;
4209426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumMeteringAreas = 64;
4219426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumDetectedFaces = 16;
4229426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumFocusAreas = 0;
4239426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxZoom = ZOOM_LEVEL_MAX;
4249426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    hwZoomSupported = false;
4259426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    zoom = 0;
4269426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsAltitude = 0;
4279426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsLatitude = 0;
4289426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsLongitude = 0;
4299426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsTimestamp = 0;
4309426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin}
4319426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
4329426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung ShinExynosCameraInfoS5K4E5::ExynosCameraInfoS5K4E5()
4339426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin{
4349426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewW = 1920;
4359426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewH = 1080;
4369426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    previewColorFormat = V4L2_PIX_FMT_YVU420M;
4379426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoW = 1920;
4389426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoH = 1080;
4399426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    prefVideoPreviewW = 640;
4409426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    prefVideoPreviewH = 360;
4419426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoColorFormat = V4L2_PIX_FMT_NV12M;
4429426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureW = 2560;
4439426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureH = 1920;
4449426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    pictureColorFormat = V4L2_PIX_FMT_YUYV;
4459426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    thumbnailW = 320;
4469426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    thumbnailH = 240;
4479426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
4489426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    antiBandingList =
4499426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::ANTIBANDING_OFF
4509426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::ANTIBANDING_50HZ
4519426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::ANTIBANDING_60HZ
4529426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::ANTIBANDING_OFF;
4539426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    antiBanding = ExynosCamera::ANTIBANDING_OFF;
4549426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
4559426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    effectList =
4569426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::EFFECT_NONE
4579426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_MONO
4589426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_NEGATIVE
4599426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_SOLARIZE
4609426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::EFFECT_SEPIA
4619426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_POSTERIZE
4629426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_WHITEBOARD
4639426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_BLACKBOARD
4649426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::EFFECT_AQUA
4659426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        ;
4669426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    effect = ExynosCamera::EFFECT_NONE;
4679426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
4689426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    flashModeList =
4699426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::FLASH_MODE_OFF
4709426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FLASH_MODE_AUTO
4719426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FLASH_MODE_ON
4729426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FLASH_MODE_RED_EYE
4739426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FLASH_MODE_TORCH;
4749426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    flashMode = ExynosCamera::FLASH_MODE_OFF;
4759426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
4769426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focusModeList =
4779426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::FOCUS_MODE_AUTO
4789426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_INFINITY
4799426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_MACRO
4809426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_FIXED
4819426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::FOCUS_MODE_EDOF
4829426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_CONTINUOUS_VIDEO
48388cc230929f380e97a664d83299a7cf7deb45ac7Dima Zavin    //    | ExynosCamera::FOCUS_MODE_CONTINUOUS_PICTURE
4849426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::FOCUS_MODE_TOUCH
4859426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        ;
4869426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focusMode = ExynosCamera::FOCUS_MODE_AUTO;
4879426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
4889426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    sceneModeList =
4899426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::SCENE_MODE_AUTO
4909426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::SCENE_MODE_ACTION
4919426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_PORTRAIT
4929426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_LANDSCAPE
4939426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_NIGHT
4949426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::SCENE_MODE_NIGHT_PORTRAIT
4959426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::SCENE_MODE_THEATRE
4969426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_BEACH
4979426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SNOW
4989426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SUNSET
4999426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_STEADYPHOTO
5009426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_FIREWORKS
5019426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_SPORTS
5029426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_PARTY
5039426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::SCENE_MODE_CANDLELIGHT;
5049426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    sceneMode = ExynosCamera::SCENE_MODE_AUTO;
5059426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5069426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    whiteBalanceList =
5079426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin          ExynosCamera::WHITE_BALANCE_AUTO
5089426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_INCANDESCENT
5099426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_FLUORESCENT
5109426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::WHITE_BALANCE_WARM_FLUORESCENT
5119426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_DAYLIGHT
5129426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        | ExynosCamera::WHITE_BALANCE_CLOUDY_DAYLIGHT
5139426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::WHITE_BALANCE_TWILIGHT
5149426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //| ExynosCamera::WHITE_BALANCE_SHADE
5159426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        ;
5169426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    whiteBalance = ExynosCamera::WHITE_BALANCE_AUTO;
5179426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5189426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoWhiteBalanceLockSupported = true;
5199426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoWhiteBalanceLock = false;
5209426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5219426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    rotation = 0;
5229426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    minExposure = -2;
5239426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxExposure = 2;
5249426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    exposure = 0;
5259426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5269426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoExposureLockSupported = true;
5279426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    autoExposureLock = false;
5289426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5299426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    fps = 30;
5309426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focalLengthNum = 9;
5319426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    focalLengthDen = 10;
5329426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    supportVideoStabilization = true;
5339426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    applyVideoStabilization = false;
5349426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    videoStabilization = false;
5359426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumMeteringAreas = 64;
5369426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumDetectedFaces = 16;
5379426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxNumFocusAreas = 2;
5389426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    maxZoom = ZOOM_LEVEL_MAX;
5399426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    hwZoomSupported = false;
5409426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    zoom = 0;
5419426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsAltitude = 0;
5429426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsLatitude = 0;
5439426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsLongitude = 0;
5449426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    gpsTimestamp = 0;
5459426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin}
5469426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5479426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin//////////////////////////////////////////////////
5489426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5499426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define PFX_NODE                            "/dev/video"
5509426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5519426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define M5MOLS_ENTITY_NAME                  "M5MOLS 5-001f"
5529426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define PFX_SUBDEV_ENTITY_MIPI_CSIS         "s5p-mipi-csis"
5539426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define PFX_SUBDEV_ENTITY_FLITE             "flite-subdev"
5549426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define PFX_SUBDEV_ENTITY_GSC_CAP           "gsc-cap-subdev"
5559426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define PFX_VIDEODEV_ENTITY_FLITE           "exynos-fimc-lite"
5569426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define PFX_VIDEODEV_ENTITY_GSC_CAP         "exynos-gsc"
5579426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5589426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define MEDIA_DEV_INTERNAL_ISP              "/dev/media2"
5599426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define MEDIA_DEV_EXTERNAL_ISP              "/dev/media1"
5609426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_VD_NODE_OFFSET                  (40)              //INTERNAL_ISP
5619426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define FLITE_VD_NODE_OFFSET                (36)              //External ISP
5629426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5639426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define VIDEO_NODE_PREVIEW_ID               (3)
5649426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define VIDEO_NODE_RECODING_ID              (2)
5659426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define VIDEO_NODE_SNAPSHOT_ID              (1)
5669426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5679426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_SENSOR_MAX_ENTITIES             1
5689426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_SENSOR_PAD_SOURCE_FRONT         0
5699426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_SENSOR_PADS_NUM                 1
5709426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5719426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_FRONT_MAX_ENTITIES              1
5729426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_FRONT_PAD_SINK                  0
5739426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_FRONT_PAD_SOURCE_BACK           1
5749426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_FRONT_PAD_SOURCE_BAYER          2
5759426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_FRONT_PAD_SOURCE_SCALERC        3
5769426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_FRONT_PADS_NUM                  4
5779426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5789426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_BACK_MAX_ENTITIES               1
5799426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_BACK_PAD_SINK                   0
5809426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_BACK_PAD_SOURCE_3DNR            1
5819426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_BACK_PAD_SOURCE_SCALERP         2
5829426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_BACK_PADS_NUM                   3
5839426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5849426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_MODULE_NAME                     "exynos5-fimc-is"
5859426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_SENSOR_ENTITY_NAME              "exynos5-fimc-is-sensor"
5869426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_FRONT_ENTITY_NAME               "exynos5-fimc-is-front"
5879426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_BACK_ENTITY_NAME                "exynos5-fimc-is-back"
5889426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_VIDEO_BAYER_NAME                "exynos5-fimc-is-bayer"
5899426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_VIDEO_SCALERC_NAME              "exynos5-fimc-is-scalerc"
5909426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_VIDEO_3DNR_NAME                 "exynos5-fimc-is-3dnr"
5919426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define ISP_VIDEO_SCALERP_NAME              "exynos5-fimc-is-scalerp"
5929426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5939426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define MIPI_NUM                            1
5949426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define FLITE_NUM                           1
5959426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define GSC_NUM                             0
5969426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5979426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define PFX_SUBDEV_NODE                     "/dev/v4l-subdev"
5989426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
5999426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin/*
6009426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin * V 4 L 2   F I M C   E X T E N S I O N S
6019426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin *
6029426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin */
6039426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_ROTATION                   (V4L2_CID_PRIVATE_BASE + 0)
6049426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_PADDR_Y                    (V4L2_CID_PRIVATE_BASE + 1)
6059426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_PADDR_CB                   (V4L2_CID_PRIVATE_BASE + 2)
6069426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_PADDR_CR                   (V4L2_CID_PRIVATE_BASE + 3)
6079426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_PADDR_CBCR                 (V4L2_CID_PRIVATE_BASE + 4)
6089426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_STREAM_PAUSE               (V4L2_CID_PRIVATE_BASE + 53)
6099426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6109426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_CAM_JPEG_MAIN_SIZE         (V4L2_CID_PRIVATE_BASE + 32)
6119426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_CAM_JPEG_MAIN_OFFSET       (V4L2_CID_PRIVATE_BASE + 33)
6129426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_CAM_JPEG_THUMB_SIZE        (V4L2_CID_PRIVATE_BASE + 34)
6139426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_CAM_JPEG_THUMB_OFFSET      (V4L2_CID_PRIVATE_BASE + 35)
6149426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_CAM_JPEG_POSTVIEW_OFFSET   (V4L2_CID_PRIVATE_BASE + 36)
6159426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_CID_CAM_JPEG_QUALITY           (V4L2_CID_PRIVATE_BASE + 37)
6169426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6179426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_PIX_FMT_YVYU           v4l2_fourcc('Y', 'V', 'Y', 'U')
6189426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6199426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin/* FOURCC for FIMC specific */
6209426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_PIX_FMT_VYUY           v4l2_fourcc('V', 'Y', 'U', 'Y')
6219426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_PIX_FMT_NV16           v4l2_fourcc('N', 'V', '1', '6')
6229426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_PIX_FMT_NV61           v4l2_fourcc('N', 'V', '6', '1')
6239426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin#define V4L2_PIX_FMT_NV12T          v4l2_fourcc('T', 'V', '1', '2')
6249426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6259426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin///////////////////////////////////////////////////
6269426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin// Google Official API : Camera.Parameters
6279426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin// http://developer.android.com/reference/android/hardware/Camera.Parameters.html
6289426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin///////////////////////////////////////////////////
6299426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6309426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung ShinExynosCamera::ExynosCamera() :
6319426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_flagCreate(false),
6329426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_cameraId(CAMERA_ID_BACK),
6339426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_defaultCameraInfo(NULL),
6349426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_curCameraInfo(NULL),
6359426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_jpegQuality(100),
6369426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_jpegThumbnailQuality(100),
6379426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_currentZoom(-1)
6389426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin{
6399426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    memset(&m_sensorDev, 0, sizeof(struct devInfo));
6409426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    memset(&m_mipiDev, 0, sizeof(struct devInfo));
6419426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    memset(&m_fliteDev, 0, sizeof(struct devInfo));
6429426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    memset(&m_gscPreviewDev, 0, sizeof(struct devInfo));
6439426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    memset(&m_gscVideoDev, 0, sizeof(struct devInfo));
6449426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    memset(&m_gscPictureDev, 0, sizeof(struct devInfo));
6459426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6469426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_previewDev = NULL;
6479426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_videoDev   = NULL;
6489426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_pictureDev = NULL;
6499426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6509426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_tryPreviewStop = true;
6519426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_tryVideoStop   = true;
6529426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_tryPictureStop = true;
6539426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6549426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_flagStartFaceDetection = false;
6559426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_flagAutoFocusRunning = false;
6569426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6579426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_sensorEntity = NULL;
6589426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_mipiEntity = NULL;
6599426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_fliteSdEntity = NULL;
6609426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_fliteVdEntity = NULL;
6619426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_gscSdEntity = NULL;
6629426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_gscVdEntity = NULL;
6639426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_ispSensorEntity = NULL;
6649426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_ispFrontEntity = NULL;
6659426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_ispBackEntity = NULL;
6669426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_ispScalercEntity = NULL;
6679426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_ispScalerpEntity = NULL;
6689426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_isp3dnrEntity = NULL;
6699426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6709426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6719426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    for (int i = 0; i < VIDEO_MAX_FRAME; i++) {
6729426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_validPreviewBuf[i] = false;
6739426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_validVideoBuf  [i] = false;
6749426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_validPictureBuf[i] = false;
6759426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    }
6769426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6779426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    memset((void *)m_cameraName, 0, 32);
6789426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6799426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_internalISP = true;
6809426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_media = NULL;
6819426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6829426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    memset(&mExifInfo, 0, sizeof(mExifInfo));
6839426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin}
6849426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6859426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung ShinExynosCamera::~ExynosCamera()
6869426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin{
6879426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    if (m_flagCreate == true)
6889426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        destroy();
6899426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin}
6909426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6919426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shinbool ExynosCamera::create(int cameraId)
6929426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin{
6939426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    int ret = 0;
6949426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    unsigned int i;
6959426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    int devNum;
6969426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    char node[30];
6979426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
6989426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    struct media_link   *links = NULL;
6999426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7009426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    if (m_flagCreate == true) {
701f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGE("ERR(%s):Already created", __func__);
7029426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        return false;
7039426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    }
7049426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7059426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_cameraId = cameraId;
7069426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7079426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    ExynosBuffer nullBuf;
7089426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7099426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    for (int i = 0; i < VIDEO_MAX_FRAME; i++) {
7109426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_validPreviewBuf[i] = false;
7119426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_validVideoBuf  [i] = false;
7129426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_validPictureBuf[i] = false;
7139426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7149426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_previewBuf[i] = nullBuf;
7159426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_videoBuf[i]   = nullBuf;
7169426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_pictureBuf[i] = nullBuf;
7179426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    }
7189426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7199426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    if (m_cameraId == CAMERA_ID_BACK)
7209426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_internalISP = true;
7219426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // m_internalISP = false; // external ISP.
7229426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    else
7239426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_internalISP = true;
7249426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7259426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    if (m_internalISP == true) {
7269426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////////////////
7279426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //  internal ISP
7289426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////////////////
7299426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // media device open
7309426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_media = exynos_media_open(MEDIA_DEV_INTERNAL_ISP);
7319426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        if (m_media == NULL) {
732f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGE("ERR(%s):Cannot open media device (error : %s)", __func__, strerror(errno));
7339426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            goto err;
7349426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
7359426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7369426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////
7379426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // GET ENTITIES
7389426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////
7399426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // ISP sensor subdev
7409426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        memset(&node, 0x00, sizeof(node));
7419426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        strcpy(node, ISP_SENSOR_ENTITY_NAME);
7429426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_ispSensorEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
7439426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7449426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // ISP front subdev
7459426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        memset(&node, 0x00, sizeof(node));
7469426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        strcpy(node, ISP_FRONT_ENTITY_NAME);
7479426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_ispFrontEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
7489426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7499426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // ISP back subdev
7509426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        memset(&node, 0x00, sizeof(node));
7519426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        strcpy(node, ISP_BACK_ENTITY_NAME);
7529426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_ispBackEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
7539426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7549426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // ISP ScalerC video node
7559426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        memset(&node, 0x00, sizeof(node));
7569426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        strcpy(node, ISP_VIDEO_SCALERC_NAME);
7579426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_ispScalercEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
7589426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7599426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // ISP ScalerP video node
7609426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        memset(&node, 0x00, sizeof(node));
7619426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        strcpy(node, ISP_VIDEO_SCALERP_NAME);
7629426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_ispScalerpEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
7639426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7649426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // ISP 3DNR video node
7659426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        memset(&node, 0x00, sizeof(node));
7669426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        strcpy(node, ISP_VIDEO_3DNR_NAME);
7679426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_isp3dnrEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
7689426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
769f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_ispSensorEntity  : numlink : %d", __func__, m_ispSensorEntity->num_links);
770f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_ispFrontEntity   : numlink : %d", __func__, m_ispFrontEntity->num_links);
771f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_ispBackEntity    : numlink : %d", __func__, m_ispBackEntity->num_links);
772f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_ispScalercEntity : numlink : %d", __func__, m_ispScalercEntity->num_links);
773f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_ispScalerpEntity : numlink : %d", __func__, m_ispScalerpEntity->num_links);
774f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_isp3dnrEntity    : numlink : %d", __func__, m_isp3dnrEntity->num_links);
7759426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7769426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////
7779426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // SETUP LINKS
7789426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////
7799426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // SENSOR TO FRONT
7809426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        links = m_ispSensorEntity->links;
7819426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        if (links == NULL ||
7829426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            links->source->entity != m_ispSensorEntity ||
7839426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            links->sink->entity != m_ispFrontEntity) {
784f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGE("ERR(%s):Can not make link isp_sensor to isp_front", __func__);
7859426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            goto err;
7869426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        } else if (exynos_media_setup_link(m_media, links->source, links->sink, MEDIA_LNK_FL_ENABLED) < 0) {
787f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGE("ERR(%s):Can not make setup isp_sensor to isp_front", __func__);
7889426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            goto err;
7899426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
790f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):[LINK SUCCESS] Sensor to front", __func__);
7919426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
7929426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // FRONT TO BACK
7939426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        for (i = 0; i < m_ispFrontEntity->num_links; i++) {
7949426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            links = &m_ispFrontEntity->links[i];
7959426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            if (links == NULL ||
7969426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->source->entity != m_ispFrontEntity ||
7979426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->sink->entity != m_ispBackEntity) {
798f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin                ALOGV("DEBUG(%s):i=%d: links->source->entity : %p, m_ispFrontEntity : %p", __func__, i,
7999426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                    links->source->entity, m_ispFrontEntity);
800f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin                ALOGV("DEBUG(%s):i=%d: links->sink->entity : %p, m_ispBackEntity : %p", __func__, i,
8019426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                    links->sink->entity, m_ispBackEntity);
8029426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                continue;
8039426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            } else if (exynos_media_setup_link(m_media, links->source, links->sink, MEDIA_LNK_FL_ENABLED) < 0) {
804f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin                ALOGE("ERR(%s):Can not make setup isp_front to isp_back", __func__);
8059426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                goto err;
8069426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            }
8079426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
808f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):[LINK SUCCESS] front to back", __func__);
8099426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
8109426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // BACK TO ScalerP Video
8119426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        for (i = 0; i < m_ispBackEntity->num_links; i++) {
8129426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            links = &m_ispBackEntity->links[i];
8139426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            if (links == NULL ||
8149426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->source->entity != m_ispBackEntity ||
8159426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->sink->entity != m_ispScalerpEntity) {
816f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin                ALOGV("DEBUG(%s):i=%d: links->source->entity : %p, m_ispBackEntity : %p", __func__, i,
8179426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                    links->source->entity, m_ispBackEntity);
818f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin                ALOGV("DEBUG(%s):i=%d: links->sink->entity : %p, m_ispScalerpEntity : %p", __func__, i,
8199426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                    links->sink->entity, m_ispScalerpEntity);
8209426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                continue;
8219426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            } else if (exynos_media_setup_link(m_media, links->source, links->sink, MEDIA_LNK_FL_ENABLED) < 0) {
822f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin                ALOGE("ERR(%s):Can not make setup isp_back to scalerP", __func__);
8239426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                goto err;
8249426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            }
8259426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
826f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):[LINK SUCCESS] back to scalerP", __func__);
8279426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
8289426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        sprintf(node, "%s%d", PFX_NODE, (ISP_VD_NODE_OFFSET + VIDEO_NODE_PREVIEW_ID));
8299426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_gscPreviewDev.fd = exynos_v4l2_open(node, O_RDWR, 0);
8309426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        if (m_gscPreviewDev.fd <= 0) {
831f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGE("ERR(%s):exynos_v4l2_open(%s) fail (error : %s)", __func__, node, strerror(errno));
8329426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            goto err;
8339426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
8349426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_previewDev = &m_gscPreviewDev;
8359426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
8369426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        sprintf(node, "%s%d", PFX_NODE, (ISP_VD_NODE_OFFSET + VIDEO_NODE_RECODING_ID));
8379426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_gscVideoDev.fd = exynos_v4l2_open(node, O_RDWR, 0);
8389426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        if (m_gscVideoDev.fd <= 0) {
839f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGE("ERR(%s):exynos_v4l2_open(%s) fail (error : %s)", __func__, node, strerror(errno));
8409426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            goto err;
8419426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
8429426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_videoDev = &m_gscVideoDev;
8439426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
8449426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        sprintf(node, "%s%d", PFX_NODE, (ISP_VD_NODE_OFFSET + VIDEO_NODE_SNAPSHOT_ID));
8459426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_gscPictureDev.fd = exynos_v4l2_open(node, O_RDWR, 0);
8469426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        if (m_gscPictureDev.fd <= 0) {
847f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGE("ERR(%s):exynos_v4l2_open(%s) fail (error : %s)", __func__, node, strerror(errno));
8489426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            goto err;
8499426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
8509426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_pictureDev = &m_gscPictureDev;
8519426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
8529426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    } else {
8539426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////////////////
8549426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //  external ISP
8559426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////////////////
8569426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // media device open
8579426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_media = exynos_media_open(MEDIA_DEV_EXTERNAL_ISP);
8589426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        if (m_media == NULL) {
859f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGE("ERR(%s):Cannot open media device (error : %s)", __func__, strerror(errno));
8609426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            goto err;
8619426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
8629426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
8639426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////
8649426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // GET ENTITIES
8659426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////
8669426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // camera subdev
8679426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        strcpy(node, M5MOLS_ENTITY_NAME);
868f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):node : %s", __func__, node);
8699426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_sensorEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
870f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_sensorEntity : 0x%p", __func__, m_sensorEntity);
8719426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
8729426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // mipi subdev
8739426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        sprintf(node, "%s.%d", PFX_SUBDEV_ENTITY_MIPI_CSIS, MIPI_NUM);
874f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):node : %s", __func__, node);
8759426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_mipiEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
876f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_mipiEntity : 0x%p", __func__, m_mipiEntity);
8779426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
8789426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // fimc-lite subdev
8799426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        sprintf(node, "%s.%d", PFX_SUBDEV_ENTITY_FLITE, FLITE_NUM);
880f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):node : %s", __func__, node);
8819426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_fliteSdEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
882f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_fliteSdEntity : 0x%p", __func__, m_fliteSdEntity);
8839426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
8849426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // fimc-lite videodev
8859426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        sprintf(node, "%s.%d", PFX_VIDEODEV_ENTITY_FLITE, FLITE_NUM);
886f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):node : %s", __func__, node);
8879426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_fliteVdEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
888f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_fliteVdEntity : 0x%p", __func__, m_fliteVdEntity);
8899426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
8909426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // gscaler subdev
8919426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        sprintf(node, "%s.%d", PFX_SUBDEV_ENTITY_GSC_CAP, GSC_NUM);
892f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):node : %s", __func__, node);
8939426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_gscSdEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
894f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_gscSdEntity : 0x%p", __func__, m_gscSdEntity);
8959426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
8969426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // gscaler videodev
8979426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        sprintf(node, "%s.%d", PFX_VIDEODEV_ENTITY_GSC_CAP, GSC_NUM);
898f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):node : %s", __func__, node);
8999426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_gscVdEntity = exynos_media_get_entity_by_name(m_media, node, strlen(node));
900f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):m_gscVdEntity : 0x%p", __func__, m_gscVdEntity);
9019426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
902f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):sensor_sd : numlink : %d", __func__, m_sensorEntity->num_links);
903f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):mipi_sd   : numlink : %d", __func__, m_mipiEntity->num_links);
904f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):flite_sd  : numlink : %d", __func__, m_fliteSdEntity->num_links);
905f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):flite_vd  : numlink : %d", __func__, m_fliteVdEntity->num_links);
906f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):gsc_sd    : numlink : %d", __func__, m_gscSdEntity->num_links);
907f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):gsc_vd    : numlink : %d", __func__, m_gscVdEntity->num_links);
9089426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
9099426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////
9109426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // SETUP LINKS
9119426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        //////////////////
9129426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // sensor subdev to mipi subdev
9139426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        links = m_sensorEntity->links;
9149426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        if (links == NULL ||
9159426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            links->source->entity != m_sensorEntity ||
9169426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            links->sink->entity != m_mipiEntity) {
917f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGE("ERR(%s):Cannot make link camera sensor to mipi", __func__);
9189426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            goto err;
9199426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
9209426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
9219426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        if (exynos_media_setup_link(m_media,  links->source,  links->sink, MEDIA_LNK_FL_ENABLED) < 0) {
922f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGE("ERR(%s):Cannot make setup camera sensor to mipi", __func__);
9239426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            goto err;
9249426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
925f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):[LINK SUCCESS] sensor subdev to mipi subdev", __func__);
9269426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
9279426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // mipi subdev to fimc-lite subdev
9289426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        for (i = 0; i < m_mipiEntity->num_links; i++) {
9299426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            links = &m_mipiEntity->links[i];
930f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGV("DEBUG(%s):i=%d: links->source->entity : %p, m_mipiEntity : %p", __func__, i,
9319426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                    links->source->entity, m_mipiEntity);
932f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGV("DEBUG(%s):i=%d: links->sink->entity : %p, m_fliteSdEntity : %p", __func__, i,
9339426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                    links->sink->entity, m_fliteSdEntity);
9349426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            if (links == NULL ||
9359426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->source->entity != m_mipiEntity ||
9369426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->sink->entity != m_fliteSdEntity) {
9379426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                continue;
9389426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            } else if (exynos_media_setup_link(m_media,  links->source,  links->sink, MEDIA_LNK_FL_ENABLED) < 0) {
939f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin                ALOGE("ERR(%s):Cannot make setup mipi subdev to fimc-lite subdev", __func__);
9409426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                goto err;
9419426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            }
9429426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
943f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):[LINK SUCCESS] mipi subdev to fimc-lite subdev", __func__);
9449426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
9459426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // fimc-lite subdev TO fimc-lite video dev
9469426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        for (i = 0; i < m_fliteSdEntity->num_links; i++) {
9479426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            links = &m_fliteSdEntity->links[i];
948f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGV("DEBUG(%s):i=%d: links->source->entity : %p, m_fliteSdEntity : %p", __func__, i,
9499426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->source->entity, m_fliteSdEntity);
950f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGV("DEBUG(%s):i=%d: links->sink->entity : %p, m_fliteVdEntity : %p", __func__, i,
9519426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->sink->entity, m_fliteVdEntity);
9529426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            if (links == NULL ||
9539426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->source->entity != m_fliteSdEntity ||
9549426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->sink->entity != m_fliteVdEntity) {
9559426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                continue;
9569426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            } else if (exynos_media_setup_link(m_media,  links->source,  links->sink, MEDIA_LNK_FL_ENABLED) < 0) {
957f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin                ALOGE("ERR(%s):Cannot make setup fimc-lite subdev to fimc-lite video dev", __func__);
9589426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                goto err;
9599426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            }
9609426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
961f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):[LINK SUCCESS] fimc-lite subdev to fimc-lite video dev", __func__);
9629426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
9639426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // fimc-lite subdev to gscaler subdev
9649426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        for (i = 0; i < m_gscSdEntity->num_links; i++) {
9659426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            links = &m_gscSdEntity->links[i];
966f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGV("DEBUG(%s):i=%d: links->source->entity : %p, m_fliteSdEntity : %p", __func__, i,
9679426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                    links->source->entity, m_fliteSdEntity);
968f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGV("DEBUG(%s):i=%d: links->sink->entity : %p, m_gscSdEntity : %p", __func__, i,
9699426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                    links->sink->entity, m_gscSdEntity);
9709426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            if (links == NULL ||
9719426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->source->entity != m_fliteSdEntity ||
9729426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->sink->entity != m_gscSdEntity) {
9739426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                continue;
9749426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            } else if (exynos_media_setup_link(m_media, links->source, links->sink, MEDIA_LNK_FL_ENABLED) < 0) {
975f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin                ALOGE("ERR(%s):Cannot make setup fimc-lite subdev to gscaler subdev", __func__);
9769426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                goto err;
9779426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            }
9789426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
979f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):[LINK SUCCESS] fimc-lite subdev to gscaler subdev", __func__);
9809426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
9819426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        // gscaler subdev to gscaler video dev
9829426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        for (i = 0; i < m_gscVdEntity->num_links; i++) {
9839426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            links = &m_gscVdEntity->links[i];
984f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGV("DEBUG(%s):i=%d: links->source->entity : %p, m_gscSdEntity : %p", __func__, i,
9859426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                    links->source->entity, m_gscSdEntity);
986f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGV("DEBUG(%s):i=%d: links->sink->entity : %p, m_gscVdEntity : %p", __func__, i,
9879426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                    links->sink->entity, m_gscVdEntity);
9889426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            if (links == NULL ||
9899426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->source->entity != m_gscSdEntity ||
9909426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                links->sink->entity != m_gscVdEntity) {
9919426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                continue;
9929426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            } else if (exynos_media_setup_link(m_media, links->source, links->sink, MEDIA_LNK_FL_ENABLED) < 0) {
993f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin                ALOGE("ERR(%s):Cannot make setup gscaler subdev to gscaler video dev", __func__);
9949426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin                goto err;
9959426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            }
9969426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
997f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGV("DEBUG(%s):[LINK SUCCESS] gscaler subdev to gscaler video dev", __func__);
9989426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
9999426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        sprintf(node, "%s%d", PFX_NODE, (FLITE_VD_NODE_OFFSET + VIDEO_NODE_PREVIEW_ID));
10009426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_fliteDev.fd = exynos_v4l2_open(node, O_RDWR, 0);
10019426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        if (m_fliteDev.fd <= 0) {
1002f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin            ALOGE("ERR(%s):exynos_v4l2_open(%s) fail (error : %s)", __func__, node, strerror(errno));
10039426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin            goto err;
10049426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        }
10059426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_previewDev = &m_fliteDev;
10069426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_videoDev   = &m_fliteDev;
10079426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_pictureDev = &m_fliteDev;
10089426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    }
10099426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
10109426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_previewDev->flagStart = false;
10119426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_videoDev->flagStart   = false;
10129426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_pictureDev->flagStart = false;
10139426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
10149426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_tryPreviewStop = true;
10159426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_tryVideoStop   = true;
10169426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_tryPictureStop = true;
10179426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
10189426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_flagStartFaceDetection = false;
10199426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_flagAutoFocusRunning = false;
10209426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
10219426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    if (exynos_v4l2_enuminput(m_previewDev->fd, m_cameraId, m_cameraName) == false) {
1022f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGE("ERR(%s):exynos_v4l2_enuminput(%d, %s) fail", __func__, m_cameraId, m_cameraName);
10239426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        goto err;
10249426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    }
10259426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
10269426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    // HACK
10279426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    if (m_cameraId == CAMERA_ID_BACK)
10289426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        strcpy(m_cameraName, "S5K4E5");
10299426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    else
10309426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        strcpy(m_cameraName, "S5K6A3");
10319426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
10329426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    if (exynos_v4l2_s_input(m_previewDev->fd, m_cameraId) < 0) {
1033f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGE("ERR(%s):exynos_v4l2_s_input() fail", __func__);
10349426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        goto err;
10359426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    }
10369426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
10379426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    if (strcmp((const char*)m_cameraName, "S5K4E5") == 0) {
10389426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_defaultCameraInfo  = new ExynosCameraInfoS5K4E5;
10399426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_curCameraInfo      = new ExynosCameraInfoS5K4E5;
10409426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    } else if (strcmp((const char*)m_cameraName, "S5K6A3") == 0) {
10419426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_defaultCameraInfo  = new ExynosCameraInfoS5K6A3;
10429426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_curCameraInfo      = new ExynosCameraInfoS5K6A3;
10439426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    } else if (strcmp((const char*)m_cameraName, "M5M0") == 0) {
10449426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_defaultCameraInfo  = new ExynosCameraInfoM5M0;
10459426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        m_curCameraInfo      = new ExynosCameraInfoM5M0;
10469426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    } else {
1047f4979f5067ab25d0e385b791ba3770eb156e0e94Dima Zavin        ALOGE("ERR(%s):invalid camera Name (%s) fail", __func__, m_cameraName);
10489426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin        goto err;
10499426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    }
10509426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
10519426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_setExifFixedAttribute();
10529426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
10539426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    m_flagCreate = true;
10549426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin    return true;
10559426c428f0ffede2ee24d397912f7db84c56c3f7Jiyoung Shin
1056