• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 *     * Redistributions of source code must retain the above copyright
7 *       notice, this list of conditions and the following disclaimer.
8 *     * Redistributions in binary form must reproduce the above
9 *       copyright notice, this list of conditions and the following
10 *       disclaimer in the documentation and/or other materials provided
11 *       with the distribution.
12 *     * Neither the name of The Linux Foundation nor the names of its
13 *       contributors may be used to endorse or promote products derived
14 *       from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 */
29 
30 #ifndef __QCAMERA3HARDWAREINTERFACE_H__
31 #define __QCAMERA3HARDWAREINTERFACE_H__
32 
33 // System dependencies
34 #include <camera/CameraMetadata.h>
35 #include <pthread.h>
36 #include <utils/KeyedVector.h>
37 #include <utils/List.h>
38 
39 // Camera dependencies
40 #include "camera3.h"
41 #include "QCamera3Channel.h"
42 #include "QCamera3CropRegionMapper.h"
43 #include "QCamera3HALHeader.h"
44 #include "QCamera3Mem.h"
45 #include "QCameraPerf.h"
46 #include "QCameraCommon.h"
47 
48 extern "C" {
49 #include "mm_camera_interface.h"
50 #include "mm_jpeg_interface.h"
51 }
52 
53 using namespace android;
54 
55 namespace qcamera {
56 
57 #ifndef TRUE
58 #define TRUE 1
59 #endif
60 
61 #ifndef FALSE
62 #define FALSE 0
63 #endif
64 
65 /* Time related macros */
66 typedef int64_t nsecs_t;
67 #define NSEC_PER_SEC 1000000000LLU
68 #define NSEC_PER_USEC 1000LLU
69 #define NSEC_PER_33MSEC 33000000LLU
70 
71 typedef enum {
72     SET_ENABLE,
73     SET_CONTROLENABLE,
74     SET_RELOAD_CHROMATIX,
75     SET_STATUS,
76 } optype_t;
77 
78 #define MODULE_ALL 0
79 
80 extern volatile uint32_t gCamHal3LogLevel;
81 
82 class QCamera3MetadataChannel;
83 class QCamera3PicChannel;
84 class QCamera3HeapMemory;
85 class QCamera3Exif;
86 
87 typedef struct {
88     camera3_stream_t *stream;
89     camera3_stream_buffer_set_t buffer_set;
90     stream_status_t status;
91     int registered;
92     QCamera3ProcessingChannel *channel;
93 } stream_info_t;
94 
95 typedef struct {
96     // Stream handle
97     camera3_stream_t *stream;
98     // Buffer handle
99     buffer_handle_t *buffer;
100     // Buffer status
101     camera3_buffer_status_t bufStatus = CAMERA3_BUFFER_STATUS_OK;
102 } PendingBufferInfo;
103 
104 typedef struct {
105     // Frame number corresponding to request
106     uint32_t frame_number;
107     // Time when request queued into system
108     nsecs_t timestamp;
109     List<PendingBufferInfo> mPendingBufferList;
110 } PendingBuffersInRequest;
111 
112 class PendingBuffersMap {
113 public:
114     // Number of outstanding buffers at flush
115     uint32_t numPendingBufsAtFlush;
116     // List of pending buffers per request
117     List<PendingBuffersInRequest> mPendingBuffersInRequest;
118     uint32_t get_num_overall_buffers();
119     void removeBuf(buffer_handle_t *buffer);
120     int32_t getBufErrStatus(buffer_handle_t *buffer);
121 };
122 
123 
124 class QCamera3HardwareInterface {
125 public:
126     /* static variable and functions accessed by camera service */
127     static camera3_device_ops_t mCameraOps;
128     //Id of each session in bundle/link
129     static uint32_t sessionId[MM_CAMERA_MAX_NUM_SENSORS];
130     static int initialize(const struct camera3_device *,
131                 const camera3_callback_ops_t *callback_ops);
132     static int configure_streams(const struct camera3_device *,
133                 camera3_stream_configuration_t *stream_list);
134     static const camera_metadata_t* construct_default_request_settings(
135                                 const struct camera3_device *, int type);
136     static int process_capture_request(const struct camera3_device *,
137                                 camera3_capture_request_t *request);
138 
139     static void dump(const struct camera3_device *, int fd);
140     static int flush(const struct camera3_device *);
141     static int close_camera_device(struct hw_device_t* device);
142 
143 public:
144     QCamera3HardwareInterface(uint32_t cameraId,
145             const camera_module_callbacks_t *callbacks);
146     virtual ~QCamera3HardwareInterface();
147     static void camEvtHandle(uint32_t camera_handle, mm_camera_event_t *evt,
148                                           void *user_data);
149     int openCamera(struct hw_device_t **hw_device);
150     camera_metadata_t* translateCapabilityToMetadata(int type);
151 
152     static int getCamInfo(uint32_t cameraId, struct camera_info *info);
153     static int initCapabilities(uint32_t cameraId);
154     static int initStaticMetadata(uint32_t cameraId);
155     static void makeTable(cam_dimension_t *dimTable, size_t size,
156             size_t max_size, int32_t *sizeTable);
157     static void makeFPSTable(cam_fps_range_t *fpsTable, size_t size,
158             size_t max_size, int32_t *fpsRangesTable);
159     static void makeOverridesList(cam_scene_mode_overrides_t *overridesTable,
160             size_t size, size_t max_size, uint8_t *overridesList,
161             uint8_t *supported_indexes, uint32_t camera_id);
162     static size_t filterJpegSizes(int32_t *jpegSizes, int32_t *processedSizes,
163             size_t processedSizesCnt, size_t maxCount, cam_rect_t active_array_size,
164             uint8_t downscale_factor);
165     static void convertToRegions(cam_rect_t rect, int32_t* region, int weight);
166     static void convertFromRegions(cam_area_t &roi, const camera_metadata_t *settings,
167                                    uint32_t tag);
168     static bool resetIfNeededROI(cam_area_t* roi, const cam_crop_region_t* scalerCropRegion);
169     static void convertLandmarks(cam_face_landmarks_info_t face, int32_t* landmarks);
170     static int32_t getSensorSensitivity(int32_t iso_mode);
171 
172     double computeNoiseModelEntryS(int32_t sensitivity);
173     double computeNoiseModelEntryO(int32_t sensitivity);
174 
175     static void captureResultCb(mm_camera_super_buf_t *metadata,
176                 camera3_stream_buffer_t *buffer, uint32_t frame_number,
177                 bool isInputBuffer, void *userdata);
178 
179     int initialize(const camera3_callback_ops_t *callback_ops);
180     int configureStreams(camera3_stream_configuration_t *stream_list);
181     int configureStreamsPerfLocked(camera3_stream_configuration_t *stream_list);
182     int processCaptureRequest(camera3_capture_request_t *request);
183     void dump(int fd);
184     int flushPerf();
185 
186     int setFrameParameters(camera3_capture_request_t *request,
187             cam_stream_ID_t streamID, int blob_request, uint32_t snapshotStreamId);
188     int32_t setReprocParameters(camera3_capture_request_t *request,
189             metadata_buffer_t *reprocParam, uint32_t snapshotStreamId);
190     int translateToHalMetadata(const camera3_capture_request_t *request,
191             metadata_buffer_t *parm, uint32_t snapshotStreamId);
192     camera_metadata_t* translateCbUrgentMetadataToResultMetadata (
193                              metadata_buffer_t *metadata);
194     camera_metadata_t* translateFromHalMetadata(metadata_buffer_t *metadata,
195                             nsecs_t timestamp, int32_t request_id,
196                             const CameraMetadata& jpegMetadata, uint8_t pipeline_depth,
197                             uint8_t capture_intent, uint8_t hybrid_ae_enable,
198                             /* DevCamDebug metadata translateFromHalMetadata augment .h */
199                             uint8_t DevCamDebug_meta_enable,
200                             /* DevCamDebug metadata end */
201                             bool pprocDone, uint8_t fwk_cacMode,
202                             bool firstMetadataInBatch);
203     camera_metadata_t* saveRequestSettings(const CameraMetadata& jpegMetadata,
204                             camera3_capture_request_t *request);
205     int initParameters();
206     void deinitParameters();
207     QCamera3ReprocessChannel *addOfflineReprocChannel(const reprocess_config_t &config,
208             QCamera3ProcessingChannel *inputChHandle);
209     bool needRotationReprocess();
210     bool needJpegExifRotation();
211     bool needReprocess(cam_feature_mask_t postprocess_mask);
212     bool needJpegRotation();
213     cam_denoise_process_type_t getWaveletDenoiseProcessPlate();
214     cam_denoise_process_type_t getTemporalDenoiseProcessPlate();
215 
216     void captureResultCb(mm_camera_super_buf_t *metadata,
217                 camera3_stream_buffer_t *buffer, uint32_t frame_number,
218                 bool isInputBuffer);
219     cam_dimension_t calcMaxJpegDim();
220     bool needOnlineRotation();
221     uint32_t getJpegQuality();
222     QCamera3Exif *getExifData();
223     mm_jpeg_exif_params_t get3AExifParams();
224     uint8_t getMobicatMask();
225     static void getFlashInfo(const int cameraId,
226             bool& hasFlash,
227             char (&flashNode)[QCAMERA_MAX_FILEPATH_LENGTH]);
228     const char *getEepromVersionInfo();
229     const uint32_t *getLdafCalib();
230     void get3AVersion(cam_q3a_version_t &swVersion);
231     static void setBufferErrorStatus(QCamera3Channel*, uint32_t frameNumber,
232             camera3_buffer_status_t err, void *userdata);
233     void setBufferErrorStatus(QCamera3Channel*, uint32_t frameNumber,
234             camera3_buffer_status_t err);
235     bool is60HzZone();
236 
237     template <typename fwkType, typename halType> struct QCameraMap {
238         fwkType fwk_name;
239         halType hal_name;
240     };
241 
242     typedef struct {
243         const char *const desc;
244         cam_cds_mode_type_t val;
245     } QCameraPropMap;
246 
247 private:
248 
249     // State transition conditions:
250     // "\" means not applicable
251     // "x" means not valid
252     // +------------+----------+----------+-------------+------------+---------+-------+--------+
253     // |            |  CLOSED  |  OPENED  | INITIALIZED | CONFIGURED | STARTED | ERROR | DEINIT |
254     // +------------+----------+----------+-------------+------------+---------+-------+--------+
255     // |  CLOSED    |    \     |   open   |     x       |    x       |    x    |   x   |   x    |
256     // +------------+----------+----------+-------------+------------+---------+-------+--------+
257     // |  OPENED    |  close   |    \     | initialize  |    x       |    x    | error |   x    |
258     // +------------+----------+----------+-------------+------------+---------+-------+--------+
259     // |INITIALIZED |  close   |    x     |     \       | configure  |   x     | error |   x    |
260     // +------------+----------+----------+-------------+------------+---------+-------+--------+
261     // | CONFIGURED |  close   |    x     |     x       | configure  | request | error |   x    |
262     // +------------+----------+----------+-------------+------------+---------+-------+--------+
263     // |  STARTED   |  close   |    x     |     x       | configure  |    \    | error |   x    |
264     // +------------+----------+----------+-------------+------------+---------+-------+--------+
265     // |   ERROR    |  close   |    x     |     x       |     x      |    x    |   \   |  any   |
266     // +------------+----------+----------+-------------+------------+---------+-------+--------+
267     // |   DEINIT   |  close   |    x     |     x       |     x      |    x    |   x   |   \    |
268     // +------------+----------+----------+-------------+------------+---------+-------+--------+
269 
270     typedef enum {
271         CLOSED,
272         OPENED,
273         INITIALIZED,
274         CONFIGURED,
275         STARTED,
276         ERROR,
277         DEINIT
278     } State;
279 
280     int openCamera();
281     int closeCamera();
282     int flush(bool restartChannels);
283     static size_t calcMaxJpegSize(uint32_t camera_id);
284     cam_dimension_t getMaxRawSize(uint32_t camera_id);
285     static void addStreamConfig(Vector<int32_t> &available_stream_configs,
286             int32_t scalar_format, const cam_dimension_t &dim,
287             int32_t config_type);
288 
289     int validateCaptureRequest(camera3_capture_request_t *request);
290     int validateStreamDimensions(camera3_stream_configuration_t *streamList);
291     int validateStreamRotations(camera3_stream_configuration_t *streamList);
292     void deriveMinFrameDuration();
293     void handleBuffersDuringFlushLock(camera3_stream_buffer_t *buffer);
294     int32_t handlePendingReprocResults(uint32_t frame_number);
295     int64_t getMinFrameDuration(const camera3_capture_request_t *request);
296     void handleMetadataWithLock(mm_camera_super_buf_t *metadata_buf,
297             bool free_and_bufdone_meta_buf,
298             bool firstMetadataInBatch);
299     void handleBatchMetadata(mm_camera_super_buf_t *metadata_buf,
300             bool free_and_bufdone_meta_buf);
301     void handleBufferWithLock(camera3_stream_buffer_t *buffer,
302             uint32_t frame_number);
303     void handleInputBufferWithLock(uint32_t frame_number);
304     void unblockRequestIfNecessary();
305     void dumpMetadataToFile(tuning_params_t &meta, uint32_t &dumpFrameCount,
306             bool enabled, const char *type, uint32_t frameNumber);
307     static void getLogLevel();
308 
309     void cleanAndSortStreamInfo();
310     void extractJpegMetadata(CameraMetadata& jpegMetadata,
311             const camera3_capture_request_t *request);
312 
313     bool isSupportChannelNeeded(camera3_stream_configuration_t *streamList,
314             cam_stream_size_info_t stream_config_info);
315     int32_t setMobicat();
316 
317     int32_t getSensorOutputSize(cam_dimension_t &sensor_dim);
318     int32_t setHalFpsRange(const CameraMetadata &settings,
319             metadata_buffer_t *hal_metadata);
320     int32_t extractSceneMode(const CameraMetadata &frame_settings, uint8_t metaMode,
321             metadata_buffer_t *hal_metadata);
322     int32_t numOfSizesOnEncoder(const camera3_stream_configuration_t *streamList,
323             const cam_dimension_t &maxViewfinderSize);
324 
325     void addToPPFeatureMask(int stream_format, uint32_t stream_idx);
326     void updateFpsInPreviewBuffer(metadata_buffer_t *metadata, uint32_t frame_number);
327     void updateTimeStampInPendingBuffers(uint32_t frameNumber, nsecs_t timestamp);
328 
329     void enablePowerHint();
330     void disablePowerHint();
331     int32_t dynamicUpdateMetaStreamInfo();
332     int32_t startAllChannels();
333     int32_t stopAllChannels();
334     int32_t notifyErrorForPendingRequests();
335     void notifyError(uint32_t frameNumber,
336             camera3_error_msg_code_t errorCode);
337     int32_t getReprocessibleOutputStreamId(uint32_t &id);
338     int32_t handleCameraDeviceError();
339 
340     bool isOnEncoder(const cam_dimension_t max_viewfinder_size,
341             uint32_t width, uint32_t height);
342     void hdrPlusPerfLock(mm_camera_super_buf_t *metadata_buf);
343 
344     static bool supportBurstCapture(uint32_t cameraId);
345     int32_t setBundleInfo();
346 
347     static void setPAAFSupport(cam_feature_mask_t& feature_mask,
348             cam_stream_type_t stream_type,
349             cam_color_filter_arrangement_t filter_arrangement);
350 
351     template <typename T>
352     static void adjustBlackLevelForCFA(T input[BLACK_LEVEL_PATTERN_CNT],
353             T output[BLACK_LEVEL_PATTERN_CNT],
354             cam_color_filter_arrangement_t color_arrangement);
355 
356     camera3_device_t   mCameraDevice;
357     uint32_t           mCameraId;
358     mm_camera_vtbl_t  *mCameraHandle;
359     bool               mCameraInitialized;
360     camera_metadata_t *mDefaultMetadata[CAMERA3_TEMPLATE_COUNT];
361     const camera3_callback_ops_t *mCallbackOps;
362 
363     QCamera3MetadataChannel *mMetadataChannel;
364     QCamera3PicChannel *mPictureChannel;
365     QCamera3RawChannel *mRawChannel;
366     QCamera3SupportChannel *mSupportChannel;
367     QCamera3SupportChannel *mAnalysisChannel;
368     QCamera3RawDumpChannel *mRawDumpChannel;
369     QCamera3RegularChannel *mDummyBatchChannel;
370     QCameraPerfLock m_perfLock;
371     QCameraCommon   mCommon;
372 
373     uint32_t mChannelHandle;
374 
375     void saveExifParams(metadata_buffer_t *metadata);
376     mm_jpeg_exif_params_t mExifParams;
377 
378      //First request yet to be processed after configureStreams
379     bool mFirstConfiguration;
380     bool mFlush;
381     bool mFlushPerf;
382     bool mEnableRawDump;
383     QCamera3HeapMemory *mParamHeap;
384     metadata_buffer_t* mParameters;
385     metadata_buffer_t* mPrevParameters;
386     CameraMetadata mCurJpegMeta;
387     bool m_bIsVideo;
388     bool m_bIs4KVideo;
389     bool m_bEisSupportedSize;
390     bool m_bEisEnable;
391     typedef struct {
392         cam_dimension_t dim;
393         int format;
394         uint32_t usage;
395     } InputStreamInfo;
396 
397     InputStreamInfo mInputStreamInfo;
398     uint8_t m_MobicatMask;
399     uint8_t m_bTnrEnabled;
400     int8_t  mSupportedFaceDetectMode;
401     uint8_t m_bTnrPreview;
402     uint8_t m_bTnrVideo;
403     uint8_t m_debug_avtimer;
404 
405     /* Data structure to store pending request */
406     typedef struct {
407         camera3_stream_t *stream;
408         camera3_stream_buffer_t *buffer;
409         // metadata needs to be consumed by the corresponding stream
410         // in order to generate the buffer.
411         bool need_metadata;
412     } RequestedBufferInfo;
413     typedef struct {
414         uint32_t frame_number;
415         uint32_t num_buffers;
416         int32_t request_id;
417         List<RequestedBufferInfo> buffers;
418         int blob_request;
419         uint8_t bUrgentReceived;
420         nsecs_t timestamp;
421         camera3_stream_buffer_t *input_buffer;
422         const camera_metadata_t *settings;
423         CameraMetadata jpegMetadata;
424         uint8_t pipeline_depth;
425         uint32_t partial_result_cnt;
426         uint8_t capture_intent;
427         uint8_t fwkCacMode;
428         bool shutter_notified;
429         uint8_t hybrid_ae_enable;
430         /* DevCamDebug metadata PendingRequestInfo */
431         uint8_t DevCamDebug_meta_enable;
432         /* DevCamDebug metadata end */
433     } PendingRequestInfo;
434     typedef struct {
435         uint32_t frame_number;
436         uint32_t stream_ID;
437     } PendingFrameDropInfo;
438 
439     typedef struct {
440         camera3_notify_msg_t notify_msg;
441         camera3_stream_buffer_t buffer;
442         uint32_t frame_number;
443     } PendingReprocessResult;
444 
445     typedef KeyedVector<uint32_t, Vector<PendingBufferInfo> > FlushMap;
446     typedef List<QCamera3HardwareInterface::PendingRequestInfo>::iterator
447             pendingRequestIterator;
448     typedef List<QCamera3HardwareInterface::RequestedBufferInfo>::iterator
449             pendingBufferIterator;
450 
451     List<PendingReprocessResult> mPendingReprocessResultList;
452     List<PendingRequestInfo> mPendingRequestsList;
453     List<PendingFrameDropInfo> mPendingFrameDropList;
454     /* Use last frame number of the batch as key and first frame number of the
455      * batch as value for that key */
456     KeyedVector<uint32_t, uint32_t> mPendingBatchMap;
457     cam_stream_ID_t mBatchedStreamsArray;
458 
459     PendingBuffersMap mPendingBuffersMap;
460     pthread_cond_t mRequestCond;
461     uint32_t mPendingLiveRequest;
462     bool mWokenUpByDaemon;
463     int32_t mCurrentRequestId;
464     cam_stream_size_info_t mStreamConfigInfo;
465 
466     //mutex for serialized access to camera3_device_ops_t functions
467     pthread_mutex_t mMutex;
468 
469     //condition used to signal flush after buffers have returned
470     pthread_cond_t mBuffersCond;
471 
472     List<stream_info_t*> mStreamInfo;
473 
474     int64_t mMinProcessedFrameDuration;
475     int64_t mMinJpegFrameDuration;
476     int64_t mMinRawFrameDuration;
477 
478     uint32_t mMetaFrameCount;
479     bool    mUpdateDebugLevel;
480     const camera_module_callbacks_t *mCallbacks;
481 
482     uint8_t mCaptureIntent;
483     uint8_t mCacMode;
484     uint8_t mHybridAeEnable;
485     // DevCamDebug metadata internal variable
486     uint8_t mDevCamDebugMetaEnable;
487     /* DevCamDebug metadata end */
488 
489     metadata_buffer_t mReprocMeta; //scratch meta buffer
490     /* 0: Not batch, non-zero: Number of image buffers in a batch */
491     uint8_t mBatchSize;
492     // Used only in batch mode
493     uint8_t mToBeQueuedVidBufs;
494     // Fixed video fps
495     float mHFRVideoFps;
496 public:
497     uint8_t mOpMode;
498 private:
499     uint32_t mFirstFrameNumberInBatch;
500     camera3_stream_t mDummyBatchStream;
501     bool mNeedSensorRestart;
502     uint32_t mMinInFlightRequests;
503     uint32_t mMaxInFlightRequests;
504 
505     /* sensor output size with current stream configuration */
506     QCamera3CropRegionMapper mCropRegionMapper;
507 
508     /* Ldaf calibration data */
509     bool mLdafCalibExist;
510     uint32_t mLdafCalib[2];
511     bool mPowerHintEnabled;
512     int32_t mLastCustIntentFrmNum;
513     CameraMetadata  mCachedMetadata;
514 
515     static const QCameraMap<camera_metadata_enum_android_control_effect_mode_t,
516             cam_effect_mode_type> EFFECT_MODES_MAP[];
517     static const QCameraMap<camera_metadata_enum_android_control_awb_mode_t,
518             cam_wb_mode_type> WHITE_BALANCE_MODES_MAP[];
519     static const QCameraMap<camera_metadata_enum_android_control_scene_mode_t,
520             cam_scene_mode_type> SCENE_MODES_MAP[];
521     static const QCameraMap<camera_metadata_enum_android_control_af_mode_t,
522             cam_focus_mode_type> FOCUS_MODES_MAP[];
523     static const QCameraMap<camera_metadata_enum_android_color_correction_aberration_mode_t,
524             cam_aberration_mode_t> COLOR_ABERRATION_MAP[];
525     static const QCameraMap<camera_metadata_enum_android_control_ae_antibanding_mode_t,
526             cam_antibanding_mode_type> ANTIBANDING_MODES_MAP[];
527     static const QCameraMap<camera_metadata_enum_android_lens_state_t,
528             cam_af_lens_state_t> LENS_STATE_MAP[];
529     static const QCameraMap<camera_metadata_enum_android_control_ae_mode_t,
530             cam_flash_mode_t> AE_FLASH_MODE_MAP[];
531     static const QCameraMap<camera_metadata_enum_android_flash_mode_t,
532             cam_flash_mode_t> FLASH_MODES_MAP[];
533     static const QCameraMap<camera_metadata_enum_android_statistics_face_detect_mode_t,
534             cam_face_detect_mode_t> FACEDETECT_MODES_MAP[];
535     static const QCameraMap<camera_metadata_enum_android_lens_info_focus_distance_calibration_t,
536             cam_focus_calibration_t> FOCUS_CALIBRATION_MAP[];
537     static const QCameraMap<camera_metadata_enum_android_sensor_test_pattern_mode_t,
538             cam_test_pattern_mode_t> TEST_PATTERN_MAP[];
539     static const QCameraMap<camera_metadata_enum_android_sensor_reference_illuminant1_t,
540             cam_illuminat_t> REFERENCE_ILLUMINANT_MAP[];
541     static const QCameraMap<int32_t,
542             cam_hfr_mode_t> HFR_MODE_MAP[];
543 
544     static const QCameraPropMap CDS_MAP[];
545 
546     pendingRequestIterator erasePendingRequest(pendingRequestIterator i);
547     //GPU library to read buffer padding details.
548     void *lib_surface_utils;
549     int (*LINK_get_surface_pixel_alignment)();
550     uint32_t mSurfaceStridePadding;
551 
552     State mState;
553     //Dual camera related params
554     bool mIsDeviceLinked;
555     bool mIsMainCamera;
556     uint8_t mLinkedCameraId;
557     QCamera3HeapMemory *m_pRelCamSyncHeap;
558     cam_sync_related_sensors_event_info_t *m_pRelCamSyncBuf;
559     cam_sync_related_sensors_event_info_t m_relCamSyncInfo;
560     bool m60HzZone;
561 
562 };
563 
564 }; // namespace qcamera
565 
566 #endif /* __QCAMERA2HARDWAREINTERFACE_H__ */
567