OMXCameraAdapter.h revision 85c859b69b3c003b8db810371e24fe41599fc7de
1c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/*
2c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * Copyright (C) Texas Instruments - http://www.ti.com/
3c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
4c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * Licensed under the Apache License, Version 2.0 (the "License");
5c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * you may not use this file except in compliance with the License.
6c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * You may obtain a copy of the License at
7c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
8c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *      http://www.apache.org/licenses/LICENSE-2.0
9c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
10c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * Unless required by applicable law or agreed to in writing, software
11c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * distributed under the License is distributed on an "AS IS" BASIS,
12c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * See the License for the specific language governing permissions and
14c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * limitations under the License.
15c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
16c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
17c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
18c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
19c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#ifndef OMX_CAMERA_ADAPTER_H
20c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_ADAPTER_H
21c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
22c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "CameraHal.h"
23c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "OMX_Types.h"
24c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "OMX_Core.h"
25c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "OMX_CoreExt.h"
26c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "OMX_IVCommon.h"
27c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "OMX_Component.h"
28c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "OMX_Index.h"
29c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "OMX_IndexExt.h"
30c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "OMX_TI_Index.h"
31c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "OMX_TI_IVCommon.h"
32c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "OMX_TI_Common.h"
33c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "OMX_TI_Image.h"
34c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "General3A_Settings.h"
35c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
36c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "BaseCameraAdapter.h"
37c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "DebugUtils.h"
38c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
39c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
40c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevextern "C"
41c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
42c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "timm_osal_error.h"
43c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "timm_osal_events.h"
44c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "timm_osal_trace.h"
45c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include "timm_osal_semaphores.h"
46c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev}
47c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
48c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevnamespace android {
49c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
50c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define Q16_OFFSET                  16
51c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
52c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CMD_TIMEOUT             3000000  //3 sec.
53c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define AF_CALLBACK_TIMEOUT         10000000 //10 seconds timeout
54c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAPTURE_TIMEOUT         5000000  //5 sec.
55c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
56c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define FOCUS_THRESHOLD             5 //[s.]
57c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
58c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define MIN_JPEG_QUALITY            1
59c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define MAX_JPEG_QUALITY            100
60c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define EXP_BRACKET_RANGE           10
61c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
62c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define FOCUS_DIST_SIZE             100
63c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define FOCUS_DIST_BUFFER_SIZE      500
64c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
65c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define TOUCH_DATA_SIZE             200
66c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define DEFAULT_THUMB_WIDTH         160
67c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define DEFAULT_THUMB_HEIGHT        120
68c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define FRAME_RATE_FULL_HD          27
69c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define ZOOM_STAGES                 61
70c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
71c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define FACE_DETECTION_BUFFER_SIZE  0x1000
72c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
73c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define EXIF_MODEL_SIZE             100
74c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define EXIF_MAKE_SIZE              100
75c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define EXIF_DATE_TIME_SIZE         20
76c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
77c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define GPS_TIMESTAMP_SIZE          6
78c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define GPS_DATESTAMP_SIZE          11
79c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define GPS_REF_SIZE                2
80c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define GPS_MAPDATUM_SIZE           100
81c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define GPS_PROCESSING_SIZE         100
82c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define GPS_VERSION_SIZE            4
83c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define GPS_NORTH_REF               "N"
84c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define GPS_SOUTH_REF               "S"
85c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define GPS_EAST_REF                "E"
86c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define GPS_WEST_REF                "W"
87c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
88c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/* Default portstartnumber of Camera component */
89c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_DEFAULT_START_PORT_NUM 0
90c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
91c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/* Define number of ports for differt domains */
92c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_OTHER_NUM 1
93c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_VIDEO_NUM 4
94c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_IMAGE_NUM 1
95c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_AUDIO_NUM 0
96c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_NUM_PORTS (OMX_CAMERA_PORT_OTHER_NUM + OMX_CAMERA_PORT_VIDEO_NUM + OMX_CAMERA_PORT_IMAGE_NUM + OMX_CAMERA_PORT_AUDIO_NUM)
97c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
98c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/* Define start port number for differt domains */
99c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_OTHER_START OMX_CAMERA_DEFAULT_START_PORT_NUM
100c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_VIDEO_START (OMX_CAMERA_PORT_OTHER_START + OMX_CAMERA_PORT_OTHER_NUM)
101c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_IMAGE_START (OMX_CAMERA_PORT_VIDEO_START + OMX_CAMERA_PORT_VIDEO_NUM)
102c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_AUDIO_START (OMX_CAMERA_PORT_IMAGE_START + OMX_CAMERA_PORT_IMAGE_NUM)
103c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
104c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/* Port index for camera component */
105c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_OTHER_IN (OMX_CAMERA_PORT_OTHER_START + 0)
106c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_VIDEO_IN_VIDEO (OMX_CAMERA_PORT_VIDEO_START + 0)
107c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_VIDEO_OUT_PREVIEW (OMX_CAMERA_PORT_VIDEO_START + 1)
108c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_VIDEO_OUT_VIDEO (OMX_CAMERA_PORT_VIDEO_START + 2)
109c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_VIDEO_OUT_MEASUREMENT (OMX_CAMERA_PORT_VIDEO_START + 3)
110c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_CAMERA_PORT_IMAGE_OUT_IMAGE (OMX_CAMERA_PORT_IMAGE_START + 0)
111c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
112c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
113c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_INIT_STRUCT(_s_, _name_)	\
114c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    memset(&(_s_), 0x0, sizeof(_name_));	\
115c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    (_s_).nSize = sizeof(_name_);		\
116c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    (_s_).nVersion.s.nVersionMajor = 0x1;	\
117c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    (_s_).nVersion.s.nVersionMinor = 0x1;	\
118c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    (_s_).nVersion.s.nRevision = 0x0;		\
119c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    (_s_).nVersion.s.nStep = 0x0
120c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
121c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_INIT_STRUCT_PTR(_s_, _name_)   \
122c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    memset((_s_), 0x0, sizeof(_name_));         \
123c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    (_s_)->nSize = sizeof(_name_);              \
124c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    (_s_)->nVersion.s.nVersionMajor = 0x1;      \
125c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    (_s_)->nVersion.s.nVersionMinor = 0x1;      \
126c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    (_s_)->nVersion.s.nRevision = 0x0;          \
127c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    (_s_)->nVersion.s.nStep = 0x0
128c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
129c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define GOTO_EXIT_IF(_CONDITION,_ERROR) {                                       \
130c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    if ((_CONDITION)) {                                                         \
131c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        eError = (_ERROR);                                                      \
132c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        goto EXIT;                                                              \
133c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    }                                                                           \
134c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev}
135c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
136c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev///OMX Specific Functions
137c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevstatic OMX_ERRORTYPE OMXCameraAdapterEventHandler(OMX_IN OMX_HANDLETYPE hComponent,
138c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                        OMX_IN OMX_PTR pAppData,
139c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                        OMX_IN OMX_EVENTTYPE eEvent,
140c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                        OMX_IN OMX_U32 nData1,
141c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                        OMX_IN OMX_U32 nData2,
142c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                        OMX_IN OMX_PTR pEventData);
143c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
144c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevstatic OMX_ERRORTYPE OMXCameraAdapterEmptyBufferDone(OMX_IN OMX_HANDLETYPE hComponent,
145c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                        OMX_IN OMX_PTR pAppData,
146c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                        OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
147c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
148c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevstatic OMX_ERRORTYPE OMXCameraAdapterFillBufferDone(OMX_IN OMX_HANDLETYPE hComponent,
149c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                        OMX_IN OMX_PTR pAppData,
150c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                        OMX_IN OMX_BUFFERHEADERTYPE* pBuffHeader);
151c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
152c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevstruct CapResolution {
153c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    size_t width, height;
154c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    const char *param;
155c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev};
156c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
157c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevstruct CapPixelformat {
158c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_COLOR_FORMATTYPE pixelformat;
159c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    const char *param;
160c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev};
161c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
162c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevstruct CapU32 {
163c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 num;
164c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    const char *param;
165c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev};
166c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
167c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevstruct CapS32 {
168c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_S32 num;
169c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    const char *param;
170c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev};
171c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
172c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef CapU32 CapFramerate;
173c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef CapU32 CapISO;
174c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef CapU32 CapSensorName;
175c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef CapS32 CapZoom;
176c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef CapS32 CapEVComp;
177c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
178c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/**
179c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  * Class which completely abstracts the camera hardware interaction from camera hal
180c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  * TODO: Need to list down here, all the message types that will be supported by this class
181c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                Need to implement BufferProvider interface to use AllocateBuffer of OMX if needed
182c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  */
183c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevclass OMXCameraAdapter : public BaseCameraAdapter
184c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
185c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevpublic:
186c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
187c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    /*--------------------Constant declarations----------------------------------------*/
188c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const int32_t MAX_NO_BUFFERS = 20;
189c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
190c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ///@remarks OMX Camera has six ports - buffer input, time input, preview, image, video, and meta data
191c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const int MAX_NO_PORTS = 6;
192c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
193c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ///Five second timeout
194c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const int CAMERA_ADAPTER_TIMEOUT = 5000*1000;
195c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
196c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //EXIF ASCII prefix
197c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char EXIFASCIIPrefix[];
198c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
199c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    enum OMXCameraEvents
200c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        {
201c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        CAMERA_PORT_ENABLE  = 0x1,
202c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        CAMERA_PORT_FLUSH   = 0x2,
203c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        CAMERA_PORT_DISABLE = 0x4,
204c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        };
205c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
206c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    enum CaptureMode
207c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        {
208c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        HIGH_SPEED = 1,
209c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        HIGH_QUALITY = 2,
210c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        VIDEO_MODE = 3,
211c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        HIGH_QUALITY_ZSL = 4,
212c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        };
213c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
214c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    enum IPPMode
215c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        {
216c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        IPP_NONE = 0,
217c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        IPP_NSF,
218c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        IPP_LDC,
219c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        IPP_LDCNSF,
220c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        };
221c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
222c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    enum CodingMode
223c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        {
224c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        CodingNone = 0,
225c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        CodingJPS,
226c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        CodingMPO,
227c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        CodingRAWJPEG,
228c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        CodingRAWMPO,
229c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        };
230c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
231c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    enum Algorithm3A
232c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        {
233c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        WHITE_BALANCE_ALGO = 0x1,
234c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        EXPOSURE_ALGO = 0x2,
235c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        FOCUS_ALGO = 0x4,
236c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        };
237c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
238c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    enum AlgoPriority
239c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        {
240c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        FACE_PRIORITY = 0,
241c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        REGION_PRIORITY,
242c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        };
243c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
244c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    enum BrightnessMode
245c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        {
246c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        BRIGHTNESS_OFF = 0,
247c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        BRIGHTNESS_ON,
248c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        BRIGHTNESS_AUTO,
249c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        };
250c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
251c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    class GPSData
252c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    {
253c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        public:
254c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                int mLongDeg, mLongMin, mLongSec;
255c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                char mLongRef[GPS_REF_SIZE];
256c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                bool mLongValid;
257c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                int mLatDeg, mLatMin, mLatSec;
258c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                char mLatRef[GPS_REF_SIZE];
259c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                bool mLatValid;
260c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                int mAltitude;
261c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                unsigned char mAltitudeRef;
262c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                bool mAltitudeValid;
263c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                char mMapDatum[GPS_MAPDATUM_SIZE];
264c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                bool mMapDatumValid;
265c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                char mVersionId[GPS_VERSION_SIZE];
266c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                bool mVersionIdValid;
267c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                char mProcMethod[GPS_PROCESSING_SIZE];
268c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                bool mProcMethodValid;
269c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                char mDatestamp[GPS_DATESTAMP_SIZE];
270c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                bool mDatestampValid;
271c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                uint32_t mTimeStampHour;
272c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                uint32_t mTimeStampMin;
273c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                uint32_t mTimeStampSec;
274c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                bool mTimeStampValid;
275c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    };
276c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
277c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    class EXIFData
278c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    {
279c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        public:
280c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            GPSData mGPSData;
281c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            bool mMakeValid;
282c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            bool mModelValid;
283c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    };
284c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
285c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ///Parameters specific to any port of the OMX Camera component
286c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    class OMXCameraPortParameters
287c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    {
288c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        public:
289c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                         mHostBufaddr[MAX_NO_BUFFERS];
290c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_BUFFERHEADERTYPE           *mBufferHeader[MAX_NO_BUFFERS];
291c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                         mWidth;
292c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                         mHeight;
293c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                         mStride;
294c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U8                          mNumBufs;
295c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
296c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            // defines maximum number of buffers our of mNumBufs
297c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            // queueable at given moment
298c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U8                          mMaxQueueable;
299c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
300c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                         mBufSize;
301c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_COLOR_FORMATTYPE            mColorFormat;
302c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_PARAM_VIDEONOISEFILTERTYPE  mVNFMode;
303c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_PARAM_VIDEOYUVRANGETYPE     mYUVRange;
304c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_CONFIG_BOOLEANTYPE          mVidStabParam;
305c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_CONFIG_FRAMESTABTYPE        mVidStabConfig;
306c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                         mCapFrame;
307c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                         mFrameRate;
308c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_S32                         mMinFrameRate;
309c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_S32                         mMaxFrameRate;
310c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            CameraFrame::FrameType mImageType;
311c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    };
312c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
313c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ///Context of the OMX Camera component
314c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    class OMXCameraAdapterComponentContext
315c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    {
316c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        public:
317c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_HANDLETYPE              mHandleComp;
318c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                     mNumPorts;
319c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_STATETYPE               mState ;
320c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                     mVideoPortIndex;
321c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                     mPrevPortIndex;
322c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                     mImagePortIndex;
323c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMX_U32                     mMeasurementPortIndex;
324c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMXCameraPortParameters     mCameraPortParams[MAX_NO_PORTS];
325c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    };
326c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
327c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevpublic:
328c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
329c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMXCameraAdapter();
330c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ~OMXCameraAdapter();
331c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
332c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ///Initialzes the camera adapter creates any resources required
333c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t initialize(CameraProperties::Properties*, int sensor_index=0);
334c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
335c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //APIs to configure Camera adapter and get the current parameter set
336c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t setParameters(const CameraParameters& params);
337c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual void getParameters(CameraParameters& params);
338c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
339c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    // API
340c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t UseBuffersPreview(void* bufArr, int num);
341c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
342c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //API to flush the buffers for preview
343c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t flushBuffers();
344c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
345c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    // API
346c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t setFormat(OMX_U32 port, OMXCameraPortParameters &cap);
347c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
348c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    // Function to get and populate caps from handle
349c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t getCaps(CameraProperties::Properties* props, OMX_HANDLETYPE handle);
350c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char* getLUTvalue_OMXtoHAL(int OMXValue, LUTtype LUT);
351c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static int getLUTvalue_HALtoOMX(const char * HalValue, LUTtype LUT);
352c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
353c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev OMX_ERRORTYPE OMXCameraAdapterEventHandler(OMX_IN OMX_HANDLETYPE hComponent,
354c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                    OMX_IN OMX_EVENTTYPE eEvent,
355c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                    OMX_IN OMX_U32 nData1,
356c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                    OMX_IN OMX_U32 nData2,
357c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                    OMX_IN OMX_PTR pEventData);
358c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
359c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev OMX_ERRORTYPE OMXCameraAdapterEmptyBufferDone(OMX_IN OMX_HANDLETYPE hComponent,
360c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                    OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
361c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
362c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev OMX_ERRORTYPE OMXCameraAdapterFillBufferDone(OMX_IN OMX_HANDLETYPE hComponent,
363c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                    OMX_IN OMX_BUFFERHEADERTYPE* pBuffHeader);
364c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevprotected:
365c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
366c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Parent class method implementation
367c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t takePicture();
368c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t stopImageCapture();
369c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t startBracketing(int range);
370c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t stopBracketing();
371c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t autoFocus();
372c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t cancelAutoFocus();
373c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t startSmoothZoom(int targetIdx);
374c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t stopSmoothZoom();
375c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t startVideoCapture();
376c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t stopVideoCapture();
377c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t startPreview();
378c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t stopPreview();
379c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t useBuffers(CameraMode mode, void* bufArr, int num, size_t length, unsigned int queueable);
380c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t fillThisBuffer(void* frameBuf, CameraFrame::FrameType frameType);
381c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t getFrameSize(size_t &width, size_t &height);
382c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t getPictureBufferSize(size_t &length, size_t bufferCount);
383c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t getFrameDataSize(size_t &dataFrameSize, size_t bufferCount);
384c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t startFaceDetection();
385c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual status_t stopFaceDetection();
386c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    virtual void onOrientationEvent(uint32_t orientation, uint32_t tilt);
387c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
388c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevprivate:
389c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
390c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t switchToLoaded();
391c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
392c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMXCameraPortParameters *getPortParams(CameraFrame::FrameType frameType);
393c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
394c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_ERRORTYPE SignalEvent(OMX_IN OMX_HANDLETYPE hComponent,
395c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                                  OMX_IN OMX_EVENTTYPE eEvent,
396c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                                  OMX_IN OMX_U32 nData1,
397c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                                  OMX_IN OMX_U32 nData2,
398c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                                  OMX_IN OMX_PTR pEventData);
399c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
400c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t RegisterForEvent(OMX_IN OMX_HANDLETYPE hComponent,
401c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                          OMX_IN OMX_EVENTTYPE eEvent,
402c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                          OMX_IN OMX_U32 nData1,
403c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                          OMX_IN OMX_U32 nData2,
404c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                          OMX_IN Semaphore &semaphore);
405c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
406c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setPictureRotation(unsigned int degree);
407c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setSensorOrientation(unsigned int degree);
408c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setImageQuality(unsigned int quality);
409c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setThumbnailParams(unsigned int width, unsigned int height, unsigned int quality);
410c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
411c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //EXIF
412c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setParametersEXIF(const CameraParameters &params,
413c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                               BaseCameraAdapter::AdapterState state);
414c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t convertGPSCoord(double coord, int *deg, int *min, int *sec);
415c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setupEXIF();
416c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
417c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Focus functionality
418c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t doAutoFocus();
419c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t stopAutoFocus();
420c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t checkFocus(OMX_PARAM_FOCUSSTATUSTYPE *eFocusStatus);
421c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t returnFocusStatus(bool timeoutReached);
42285c859b69b3c003b8db810371e24fe41599fc7deSundar Raman    status_t getFocusMode(OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE &focusMode);
42385c859b69b3c003b8db810371e24fe41599fc7deSundar Raman
424c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
425c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Focus distances
426c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setParametersFocus(const CameraParameters &params,
427c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                BaseCameraAdapter::AdapterState state);
428c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t addFocusDistances(OMX_U32 &near,
429c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                               OMX_U32 &optimal,
430c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                               OMX_U32 &far,
431c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                               CameraParameters& params);
432c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t encodeFocusDistance(OMX_U32 dist, char *buffer, size_t length);
433c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t getFocusDistances(OMX_U32 &near,OMX_U32 &optimal, OMX_U32 &far);
434c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
435c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //VSTAB and VNF Functionality
436c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t enableVideoNoiseFilter(bool enable);
437c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t enableVideoStabilization(bool enable);
438c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
439c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Digital zoom
440c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setParametersZoom(const CameraParameters &params,
441c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                               BaseCameraAdapter::AdapterState state);
442c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t doZoom(int index);
443c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t advanceZoom();
444c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
445c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //3A related parameters
446c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setParameters3A(const CameraParameters &params,
447c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                             BaseCameraAdapter::AdapterState state);
448c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setScene(Gen3A_settings& Gen3A);
449c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
450c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Flash modes
451c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setFlashMode(Gen3A_settings& Gen3A);
452c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setFocusMode(Gen3A_settings& Gen3A);
453c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
454c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Exposure Modes
455c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setExposureMode(Gen3A_settings& Gen3A);
456c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setEVCompensation(Gen3A_settings& Gen3A);
457c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setWBMode(Gen3A_settings& Gen3A);
458c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setFlicker(Gen3A_settings& Gen3A);
459c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setBrightness(Gen3A_settings& Gen3A);
460c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setContrast(Gen3A_settings& Gen3A);
461c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setSharpness(Gen3A_settings& Gen3A);
462c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setSaturation(Gen3A_settings& Gen3A);
463c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setISO(Gen3A_settings& Gen3A);
464c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setEffect(Gen3A_settings& Gen3A);
465c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
466c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setExposureLock(Gen3A_settings& Gen3A);
467c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setWhiteBalanceLock(Gen3A_settings& Gen3A);
46880c50ac56bfa97be0cf04332ec1d314637c8770fSundar Raman    status_t set3ALock(OMX_BOOL toggle);
469c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
470c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //API to set FrameRate using VFR interface
471c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setVFramerate(OMX_U32 minFrameRate,OMX_U32 maxFrameRate);
472c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
473c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setParametersAlgo(const CameraParameters &params,
474c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                               BaseCameraAdapter::AdapterState state);
475c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
476c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Noise filtering
477c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setNSF(OMXCameraAdapter::IPPMode mode);
478c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
479c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //LDC
480c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setLDC(OMXCameraAdapter::IPPMode mode);
481c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
482c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //GLBCE
483c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setGLBCE(OMXCameraAdapter::BrightnessMode mode);
484c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
485c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //GBCE
486c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setGBCE(OMXCameraAdapter::BrightnessMode mode);
487c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
488c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t printComponentVersion(OMX_HANDLETYPE handle);
489c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
490c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Touch AF
491c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setTouchFocus(size_t posX,
492c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                           size_t posY,
493c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                           size_t posWidth,
494c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                           size_t posHeight,
495c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                           size_t previewWidth,
496c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                           size_t previewHeight);
497c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
498c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Face detection
499c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setParametersFD(const CameraParameters &params,
500c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                             BaseCameraAdapter::AdapterState state);
501c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t updateFocusDistances(CameraParameters &params);
502c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setFaceDetection(bool enable, OMX_U32 orientation);
503c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t detectFaces(OMX_BUFFERHEADERTYPE* pBuffHeader,
504c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                         sp<CameraFDResult> &result,
505c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                         size_t previewWidth,
506c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                         size_t previewHeight);
507c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t encodeFaceCoordinates(const OMX_FACEDETECTIONTYPE *faceData,
508c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                   camera_frame_metadata_t **pFaces,
509c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                   size_t previewWidth,
510c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                   size_t previewHeight);
511aa6e62e279cb54ae76c55ba9f8d02da230ce34e7Tyler Luu    void pauseFaceDetection(bool pause);
512c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
513c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //3A Algorithms priority configuration
514c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setAlgoPriority(AlgoPriority priority, Algorithm3A algo, bool enable);
515c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
516c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Sensor overclocking
517c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setSensorOverclock(bool enable);
518c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
519c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    // Utility methods for OMX Capabilities
520c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertCapabilities(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
521c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t encodeSizeCap(OMX_TI_CAPRESTYPE&, const CapResolution *, size_t, char *, size_t);
522c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t encodeISOCap(OMX_U32, const CapISO*, size_t, char*, size_t);
523c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static size_t encodeZoomCap(OMX_S32, const CapZoom*, size_t, char*, size_t);
524c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t encodeFramerateCap(OMX_U32, OMX_U32, const CapFramerate*, size_t, char*, size_t);
525c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t encodeVFramerateCap(OMX_TI_CAPTYPE&, char*, char*, size_t);
526c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t encodePixelformatCap(OMX_COLOR_FORMATTYPE,
527c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                         const CapPixelformat*,
528c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                         size_t,
529c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                         char*,
530c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                         size_t);
531c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertImageSizes(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
532c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertPreviewSizes(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
533c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertThumbSizes(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
534c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertZoomStages(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
535c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertImageFormats(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
536c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertPreviewFormats(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
537c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertFramerates(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
538c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertVFramerates(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
539c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertEVs(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
540c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertISOModes(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
541c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertIPPModes(CameraProperties::Properties*, OMX_TI_CAPTYPE &);
542c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertWBModes(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
543c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertEffects(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
544c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertExpModes(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
545c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertSceneModes(CameraProperties::Properties*, OMX_TI_CAPTYPE &);
546c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertFocusModes(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
547c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertFlickerModes(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
548c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertFlashModes(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
549c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertSenMount(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
550c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertDefaults(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
551c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static status_t insertLocks(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
552c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
553c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setParametersCapture(const CameraParameters &params,
554c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                  BaseCameraAdapter::AdapterState state);
555c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
556c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Exposure Bracketing
557c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setExposureBracketing(int *evValues, size_t evCount, size_t frameCount);
558c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t parseExpRange(const char *rangeStr, int * expRange, size_t count, size_t &validEntries);
559c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
560c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Temporal Bracketing
561c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t doBracketing(OMX_BUFFERHEADERTYPE *pBuffHeader, CameraFrame::FrameType typeOfFrame);
562c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t sendBracketFrames();
563c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
564c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    // Image Capture Service
565c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t startImageCapture();
566c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
567c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Shutter callback notifications
568c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setShutterCallback(bool enabled);
569c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
570c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Sets eithter HQ or HS mode and the frame count
571c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setCaptureMode(OMXCameraAdapter::CaptureMode mode);
572c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t UseBuffersCapture(void* bufArr, int num);
573c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t UseBuffersPreviewData(void* bufArr, int num);
574c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
575c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Used for calculation of the average frame rate during preview
576c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t recalculateFPS();
577c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
578c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Helper method for initializing a CameFrame object
579c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t initCameraFrame(CameraFrame &frame, OMX_IN OMX_BUFFERHEADERTYPE *pBuffHeader, int typeOfFrame, OMXCameraPortParameters *port);
580c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
581c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Sends the incoming OMX buffer header to subscribers
582c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t sendFrame(CameraFrame &frame);
583c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
584c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t apply3Asettings( Gen3A_settings& Gen3A );
585c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
586c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    // AutoConvergence
587c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setAutoConvergence(OMX_TI_AUTOCONVERGENCEMODETYPE pACMode, OMX_S32 pManualConverence);
588c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t getAutoConvergence(OMX_TI_AUTOCONVERGENCEMODETYPE *pACMode, OMX_S32 *pManualConverence);
589c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
590c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    class CommandHandler : public Thread {
591c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        public:
592c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            CommandHandler(OMXCameraAdapter* ca)
593782a084e5fec691d3985b31c3ab7be1584d879b3Iliyan Malchev                : Thread(false), mCameraAdapter(ca) { }
594c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
595c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            virtual bool threadLoop() {
596c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                bool ret;
597c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                ret = Handler();
598c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                return ret;
599c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            }
600c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
601c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            status_t put(TIUTILS::Message* msg){
602c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                return mCommandMsgQ.put(msg);
603c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            }
604c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
605c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            enum {
606c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                COMMAND_EXIT = -1,
607c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                CAMERA_START_IMAGE_CAPTURE = 0,
608c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                CAMERA_PERFORM_AUTOFOCUS
609c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            };
610c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
611c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        private:
612c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            bool Handler();
613c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            TIUTILS::MessageQueue mCommandMsgQ;
614c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            OMXCameraAdapter* mCameraAdapter;
615c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    };
616c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    sp<CommandHandler> mCommandHandler;
617c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
618c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevpublic:
619c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
620c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    class OMXCallbackHandler : public Thread {
621c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        public:
622c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMXCallbackHandler(OMXCameraAdapter* ca)
623c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            : Thread(false), mCameraAdapter(ca) { }
624c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
625c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        virtual bool threadLoop() {
626c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            bool ret;
627c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            ret = Handler();
628c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            return ret;
629c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        }
630c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
631c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        status_t put(TIUTILS::Message* msg){
632c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            return mCommandMsgQ.put(msg);
633c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        }
634c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
635c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        enum {
636c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            COMMAND_EXIT = -1,
637c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            CAMERA_FILL_BUFFER_DONE,
638c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        };
639c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
640c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    private:
641c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        bool Handler();
642c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        TIUTILS::MessageQueue mCommandMsgQ;
643c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMXCameraAdapter* mCameraAdapter;
644c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    };
645c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
646c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    sp<OMXCallbackHandler> mOMXCallbackHandler;
647c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
648c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevprivate:
649c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
650c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //AF callback
651c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    status_t setFocusCallback(bool enabled);
652c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
653c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //OMX Capabilities data
654c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const CapResolution mImageCapRes [];
655c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const CapResolution mPreviewRes [];
656c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const CapResolution mThumbRes [];
657c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const CapPixelformat mPixelformats [];
658c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const CapFramerate mFramerates [];
659c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const CapU32 mSensorNames[] ;
660c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const CapZoom mZoomStages [];
661c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const CapEVComp mEVCompRanges [];
662c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const CapISO mISOStages [];
663c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
664c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    // OMX Camera defaults
665c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_ANTIBANDING[];
666c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_BRIGHTNESS[];
667c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_CONTRAST[];
668c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_EFFECT[];
669c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_EV_COMPENSATION[];
670c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_EV_STEP[];
671c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_EXPOSURE_MODE[];
672c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_FLASH_MODE[];
673c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_FOCUS_MODE[];
674c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_FRAMERATE_RANGE[];
675c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_IPP[];
676c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_ISO_MODE[];
677c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_JPEG_QUALITY[];
678c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_THUMBNAIL_QUALITY[];
679c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_THUMBNAIL_SIZE[];
680c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_PICTURE_FORMAT[];
681c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_PICTURE_SIZE[];
682c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_PREVIEW_FORMAT[];
683c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_FRAMERATE[];
684c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_PREVIEW_SIZE[];
685c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_NUM_PREV_BUFS[];
686c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_NUM_PIC_BUFS[];
687c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_MAX_FOCUS_AREAS[];
688c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_SATURATION[];
689c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_SCENE_MODE[];
690c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_SHARPNESS[];
691c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_VSTAB[];
692c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_WB[];
693c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_ZOOM[];
694c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_MAX_FD_HW_FACES[];
695c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_MAX_FD_SW_FACES[];
696c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_AE_LOCK[];
697c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_AWB_LOCK[];
698c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_MAX_NUM_METERING_AREAS[];
699c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_LOCK_SUPPORTED[];
700c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const char DEFAULT_LOCK_UNSUPPORTED[];
7014b85b17296d877e53a5197b2c0c8306c63839a12Sundar Raman    static const char DEFAULT_FOCAL_LENGTH[];
7024b85b17296d877e53a5197b2c0c8306c63839a12Sundar Raman    static const char DEFAULT_HOR_ANGLE[];
7034b85b17296d877e53a5197b2c0c8306c63839a12Sundar Raman    static const char DEFAULT_VER_ANGLE[];
7049e5cb561cc54d061fe9f3d05eae78f6efb70f2c2Tyler Luu    static const size_t MAX_FOCUS_AREAS;
705c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
706c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_VERSIONTYPE mCompRevision;
707c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
708c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //OMX Component UUID
709c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_UUIDTYPE mCompUUID;
710c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
711c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Current Focus distances
712c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    char mFocusDistNear[FOCUS_DIST_SIZE];
713c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    char mFocusDistOptimal[FOCUS_DIST_SIZE];
714c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    char mFocusDistFar[FOCUS_DIST_SIZE];
715c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    char mFocusDistBuffer[FOCUS_DIST_BUFFER_SIZE];
716c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
717c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    // Current Focus areas
718c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Vector< sp<CameraArea> > mFocusAreas;
719c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
720c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    CaptureMode mCapMode;
721c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    size_t mBurstFrames;
722c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    size_t mCapturedFrames;
723c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
724c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mMeasurementEnabled;
725c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
726c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Exposure Bracketing
727c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    int mExposureBracketingValues[EXP_BRACKET_RANGE];
728c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    size_t mExposureBracketingValidEntries;
729c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
730c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    mutable Mutex mFaceDetectionLock;
731c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Face detection status
732c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mFaceDetectionRunning;
733aa6e62e279cb54ae76c55ba9f8d02da230ce34e7Tyler Luu    bool mFaceDetectionPaused;
734c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
735c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Geo-tagging
736c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    EXIFData mEXIFData;
737c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
738c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Image post-processing
739c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    IPPMode mIPP;
740c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
741c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //jpeg Picture Quality
742c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    unsigned int mPictureQuality;
743c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
744c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //thumbnail resolution
745c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    unsigned int mThumbWidth, mThumbHeight;
746c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
747c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //thumbnail quality
748c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    unsigned int mThumbQuality;
749c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
750c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //variables holding the estimated framerate
751c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    float mFPS, mLastFPS;
752c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
753c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //automatically disable AF after a given amount of frames
754c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    unsigned int mFocusThreshold;
755c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
756c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //This is needed for the CTS tests. They falsely assume, that during
757c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //smooth zoom the current zoom stage will not change within the
758c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //zoom callback scope, which in a real world situation is not always the
759c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //case. This variable will "simulate" the expected behavior
760c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    unsigned int mZoomParameterIdx;
761c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
762c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //current zoom
763c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Mutex mZoomLock;
764c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    unsigned int mCurrentZoomIdx, mTargetZoomIdx;
765c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    int mZoomInc;
766c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mReturnZoomStatus;
767c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    static const int32_t ZOOM_STEPS [];
768c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
769c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev     //local copy
770c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_VERSIONTYPE mLocalVersionParam;
771c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
772c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    unsigned int mPending3Asettings;
773c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Gen3A_settings mParameters3A;
774c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
77500479a8f1d791824870513b8b0b9edd67d2560ffSundar Raman    OMX_TI_CONFIG_3A_FACE_PRIORITY mFacePriority;
77600479a8f1d791824870513b8b0b9edd67d2560ffSundar Raman    OMX_TI_CONFIG_3A_REGION_PRIORITY mRegionPriority;
77700479a8f1d791824870513b8b0b9edd67d2560ffSundar Raman
778c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    CameraParameters mParams;
779c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    CameraProperties::Properties* mCapabilities;
780c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    unsigned int mPictureRotation;
781c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mWaitingForSnapshot;
782c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    int mSnapshotCount;
783c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mCaptureConfigured;
784c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
785c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Temporal bracketing management data
786c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    mutable Mutex mBracketingLock;
787c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool *mBracketingBuffersQueued;
788c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    int mBracketingBuffersQueuedCount;
789c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    int mLastBracetingBufferIdx;
790c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mBracketingEnabled;
791c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    int mBracketingRange;
792c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
793c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    CameraParameters mParameters;
794c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMXCameraAdapterComponentContext mCameraAdapterParameters;
795c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mFirstTimeInit;
796c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
797c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ///Semaphores used internally
798c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mDoAFSem;
799c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mInitSem;
800c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mFlushSem;
801c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mUsePreviewDataSem;
802c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mUsePreviewSem;
803c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mUseCaptureSem;
804c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mStartPreviewSem;
805c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mStopPreviewSem;
806c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mStartCaptureSem;
807c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mStopCaptureSem;
808c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mSwitchToLoadedSem;
809c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
810c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Vector<struct TIUTILS::Message *> mEventSignalQ;
811c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Mutex mEventLock;
812c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
813c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_STATETYPE mComponentState;
814c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
815c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mVnfEnabled;
816c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mVstabEnabled;
817c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
818c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    int mSensorOrientation;
819c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    int mDeviceOrientation;
820c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mSensorOverclock;
821c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
822c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //Indicates if we should leave
823c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //OMX_Executing state during
824c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    //stop-/startPreview
825c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mOMXStateSwitch;
826c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
827c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    int mFrameCount;
828c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    int mLastFrameCount;
829c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    unsigned int mIter;
830c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    nsecs_t mLastFPSTime;
831c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
832c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    int mSensorIndex;
833c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    CodingMode mCodingMode;
834c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
835c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    // Time source delta of ducati & system time
836c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_TICKS mTimeSourceDelta;
837c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool onlyOnce;
838c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
839c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    Semaphore mCaptureSem;
840c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    bool mCaptureSignalled;
841c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
842c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev};
843c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev}; //// namespace
844c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#endif //OMX_CAMERA_ADAPTER_H
845c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
846