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 (at) samsung.com) 23 * \date 2012/08/06 24 * 25 * <b>Revision History: </b> 26 * - 2012/08/06 : Sungjoong Kang(sj3.kang (at) samsung.com) \n 27 * Initial Release 28 * 29 */ 30 31 #include <hardware/camera2.h> 32 #include <camera/Camera.h> 33 #include <camera/CameraParameters.h> 34 #include "exynos_format.h" 35 #include "fimc-is-metadata.h" 36 37 namespace android { 38 39 struct ExynosCamera2Info 40 { 41 public: 42 int32_t sensorW; 43 int32_t sensorH; 44 int32_t sensorRawW; 45 int32_t sensorRawH; 46 int numScalerResolution; 47 const int32_t *scalerResolutions; 48 int numJpegResolution; 49 const int32_t *jpegResolutions; 50 float minFocusDistance; 51 float focalLength; 52 float aperture; 53 float fnumber; 54 const uint8_t *availableAfModes; 55 const uint8_t *sceneModeOverrides; 56 const uint8_t *availableAeModes; 57 int numAvailableAfModes; 58 int numSceneModeOverrides; 59 int numAvailableAeModes; 60 61 /* FD information */ 62 int32_t maxFaceCount; 63 }; 64 65 struct ExynosCamera2InfoS5K4E5 : public ExynosCamera2Info 66 { 67 public: 68 ExynosCamera2InfoS5K4E5(); 69 ~ExynosCamera2InfoS5K4E5(); 70 }; 71 72 struct ExynosCamera2InfoS5K6A3 : public ExynosCamera2Info 73 { 74 public: 75 ExynosCamera2InfoS5K6A3(); 76 ~ExynosCamera2InfoS5K6A3(); 77 }; 78 79 class ExynosCamera2 { 80 public: 81 ExynosCamera2(int cameraId); 82 ~ExynosCamera2(); 83 84 ExynosCamera2Info *m_curCameraInfo; 85 86 int32_t getSensorW(); 87 int32_t getSensorH(); 88 int32_t getSensorRawW(); 89 int32_t getSensorRawH(); 90 91 bool isSupportedResolution(int width, int height); 92 bool isSupportedJpegResolution(int width, int height); 93 94 status_t constructStaticInfo(camera_metadata_t **info, 95 int cameraId, bool sizeRequest); 96 97 status_t constructDefaultRequest(int request_template, 98 camera_metadata_t **request, bool sizeRequest); 99 int m_cameraId; 100 }; 101 } 102