ExynosCamera2.h revision f3312f8b250f3d2774564123ca0d7802f5016df5
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#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//#define VDIS_ENABLE
38
39namespace android {
40
41struct ExynosCamera2Info
42{
43public:
44    int32_t     sensorW;
45    int32_t     sensorH;
46    int32_t     sensorRawW;
47    int32_t     sensorRawH;
48    int         numScalerResolution;
49    const int32_t     *scalerResolutions;
50    int         numJpegResolution;
51    const int32_t     *jpegResolutions;
52    float       minFocusDistance;
53    float       focalLength;
54    float       aperture;
55    float       fnumber;
56
57    /* FD information */
58    int32_t    maxFaceCount;
59};
60
61struct ExynosCamera2InfoS5K4E5 : public ExynosCamera2Info
62{
63public:
64    ExynosCamera2InfoS5K4E5();
65	~ExynosCamera2InfoS5K4E5();
66};
67
68struct ExynosCamera2InfoS5K6A3 : public ExynosCamera2Info
69{
70public:
71    ExynosCamera2InfoS5K6A3();
72	~ExynosCamera2InfoS5K6A3();
73};
74
75class ExynosCamera2 {
76public:
77    ExynosCamera2(int cameraId);
78    ~ExynosCamera2();
79
80    ExynosCamera2Info  *m_curCameraInfo;
81
82    int32_t getSensorW();
83    int32_t getSensorH();
84    int32_t getSensorRawW();
85    int32_t getSensorRawH();
86
87    bool isSupportedResolution(int width, int height);
88    bool isSupportedJpegResolution(int width, int height);
89
90    status_t constructStaticInfo(camera_metadata_t **info,
91        int cameraId, bool sizeRequest);
92
93    status_t constructDefaultRequest(int request_template,
94        camera_metadata_t **request, bool sizeRequest);
95    int     m_cameraId;
96};
97}
98