1 /* 2 ** 3 ** Copyright 2008, The Android Open Source Project 4 ** Copyright 2012, Samsung Electronics Co. LTD 5 ** 6 ** Licensed under the Apache License, Version 2.0 (the "License"); 7 ** you may not use this file except in compliance with the License. 8 ** You may obtain a copy of the License at 9 ** 10 ** http://www.apache.org/licenses/LICENSE-2.0 11 ** 12 ** Unless required by applicable law or agreed to in writing, software 13 ** distributed under the License is distributed on an "AS IS" BASIS, 14 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 ** See the License for the specific language governing permissions and 16 ** limitations under the License. 17 */ 18 19 /*! 20 * \file ExynosCamera2.h 21 * \brief header file for static information of camera2 22 * \author Sungjoong Kang(sj3.kang@samsung.com) 23 * \date 2012/08/06 24 * 25 * <b>Revision History: </b> 26 * - 2012/08/06 : Sungjoong Kang(sj3.kang@samsung.com) \n 27 * Initial Release 28 * 29 */ 30 31 #ifndef EXYNOS_CAMERA_2_H 32 #define EXYNOS_CAMERA_2_H 33 34 #include <hardware/camera2.h> 35 #include <camera/Camera.h> 36 #include <camera/CameraParameters.h> 37 #include "exynos_format.h" 38 #include "fimc-is-metadata.h" 39 40 namespace android { 41 42 extern int32_t SUPPORT_THUMBNAIL_REAR_SIZE[3][2]; 43 extern int32_t SUPPORT_THUMBNAIL_FRONT_SIZE[4][2]; 44 45 struct ExynosCamera2Info 46 { 47 public: 48 int32_t sensorW; 49 int32_t sensorH; 50 int32_t sensorRawW; 51 int32_t sensorRawH; 52 int numScalerResolution; 53 const int32_t *scalerResolutions; 54 int numJpegResolution; 55 const int32_t *jpegResolutions; 56 float minFocusDistance; 57 float focalLength; 58 float aperture; 59 float fnumber; 60 const uint8_t *availableAfModes; 61 const uint8_t *sceneModeOverrides; 62 const uint8_t *availableAeModes; 63 int numAvailableAfModes; 64 int numSceneModeOverrides; 65 int numAvailableAeModes; 66 67 /* FD information */ 68 int32_t maxFaceCount; 69 }; 70 71 struct ExynosCamera2InfoS5K4E5 : public ExynosCamera2Info 72 { 73 public: 74 ExynosCamera2InfoS5K4E5(); 75 ~ExynosCamera2InfoS5K4E5(); 76 }; 77 78 struct ExynosCamera2InfoS5K6A3 : public ExynosCamera2Info 79 { 80 public: 81 ExynosCamera2InfoS5K6A3(); 82 ~ExynosCamera2InfoS5K6A3(); 83 }; 84 85 class ExynosCamera2 { 86 public: 87 ExynosCamera2(int cameraId); 88 ~ExynosCamera2(); 89 90 ExynosCamera2Info *m_curCameraInfo; 91 92 int32_t getSensorW(); 93 int32_t getSensorH(); 94 int32_t getSensorRawW(); 95 int32_t getSensorRawH(); 96 97 bool isSupportedResolution(int width, int height); 98 bool isSupportedJpegResolution(int width, int height); 99 100 status_t constructStaticInfo(camera_metadata_t **info, 101 int cameraId, bool sizeRequest); 102 103 status_t constructDefaultRequest(int request_template, 104 camera_metadata_t **request, bool sizeRequest); 105 int m_cameraId; 106 }; 107 } 108 109 #endif 110