• 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, bool lastUrgentMetadataInBatch);
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 lastMetadataInBatch);
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     int validateUsageFlags(const camera3_stream_configuration_t *streamList);
293     int validateUsageFlagsForEis(const camera3_stream_configuration_t *streamList);
294     void deriveMinFrameDuration();
295     void handleBuffersDuringFlushLock(camera3_stream_buffer_t *buffer);
296     int32_t handlePendingReprocResults(uint32_t frame_number);
297     int64_t getMinFrameDuration(const camera3_capture_request_t *request);
298     void handleMetadataWithLock(mm_camera_super_buf_t *metadata_buf,
299             bool free_and_bufdone_meta_buf,
300             bool lastUrgentMetadataInBatch,
301             bool lastMetadataInBatch);
302     void handleBatchMetadata(mm_camera_super_buf_t *metadata_buf,
303             bool free_and_bufdone_meta_buf);
304     void handleBufferWithLock(camera3_stream_buffer_t *buffer,
305             uint32_t frame_number);
306     void handleInputBufferWithLock(uint32_t frame_number);
307     void unblockRequestIfNecessary();
308     void dumpMetadataToFile(tuning_params_t &meta, uint32_t &dumpFrameCount,
309             bool enabled, const char *type, uint32_t frameNumber);
310     static void getLogLevel();
311 
312     void cleanAndSortStreamInfo();
313     void extractJpegMetadata(CameraMetadata& jpegMetadata,
314             const camera3_capture_request_t *request);
315 
316     bool isSupportChannelNeeded(camera3_stream_configuration_t *streamList,
317             cam_stream_size_info_t stream_config_info);
318     int32_t setMobicat();
319 
320     int32_t getSensorOutputSize(cam_dimension_t &sensor_dim);
321     int32_t setHalFpsRange(const CameraMetadata &settings,
322             metadata_buffer_t *hal_metadata);
323     int32_t extractSceneMode(const CameraMetadata &frame_settings, uint8_t metaMode,
324             metadata_buffer_t *hal_metadata);
325     int32_t numOfSizesOnEncoder(const camera3_stream_configuration_t *streamList,
326             const cam_dimension_t &maxViewfinderSize);
327 
328     void addToPPFeatureMask(int stream_format, uint32_t stream_idx);
329     void updateFpsInPreviewBuffer(metadata_buffer_t *metadata, uint32_t frame_number);
330     void updateTimeStampInPendingBuffers(uint32_t frameNumber, nsecs_t timestamp);
331 
332     void enablePowerHint();
333     void disablePowerHint();
334     int32_t dynamicUpdateMetaStreamInfo();
335     int32_t startAllChannels();
336     int32_t stopAllChannels();
337     int32_t notifyErrorForPendingRequests();
338     void notifyError(uint32_t frameNumber,
339             camera3_error_msg_code_t errorCode);
340     int32_t getReprocessibleOutputStreamId(uint32_t &id);
341     int32_t handleCameraDeviceError();
342 
343     bool isOnEncoder(const cam_dimension_t max_viewfinder_size,
344             uint32_t width, uint32_t height);
345     void hdrPlusPerfLock(mm_camera_super_buf_t *metadata_buf);
346 
347     static bool supportBurstCapture(uint32_t cameraId);
348     int32_t setBundleInfo();
349 
350     static void setPAAFSupport(cam_feature_mask_t& feature_mask,
351             cam_stream_type_t stream_type,
352             cam_color_filter_arrangement_t filter_arrangement);
353 
354     template <typename T>
355     static void adjustBlackLevelForCFA(T input[BLACK_LEVEL_PATTERN_CNT],
356             T output[BLACK_LEVEL_PATTERN_CNT],
357             cam_color_filter_arrangement_t color_arrangement);
358 
359     camera3_device_t   mCameraDevice;
360     uint32_t           mCameraId;
361     mm_camera_vtbl_t  *mCameraHandle;
362     bool               mCameraInitialized;
363     camera_metadata_t *mDefaultMetadata[CAMERA3_TEMPLATE_COUNT];
364     const camera3_callback_ops_t *mCallbackOps;
365 
366     QCamera3MetadataChannel *mMetadataChannel;
367     QCamera3PicChannel *mPictureChannel;
368     QCamera3RawChannel *mRawChannel;
369     QCamera3SupportChannel *mSupportChannel;
370     QCamera3SupportChannel *mAnalysisChannel;
371     QCamera3RawDumpChannel *mRawDumpChannel;
372     QCamera3RegularChannel *mDummyBatchChannel;
373     QCameraPerfLock m_perfLock;
374     QCameraCommon   mCommon;
375 
376     uint32_t mChannelHandle;
377 
378     void saveExifParams(metadata_buffer_t *metadata);
379     mm_jpeg_exif_params_t mExifParams;
380 
381      //First request yet to be processed after configureStreams
382     bool mFirstConfiguration;
383     bool mFlush;
384     bool mFlushPerf;
385     bool mEnableRawDump;
386     QCamera3HeapMemory *mParamHeap;
387     metadata_buffer_t* mParameters;
388     metadata_buffer_t* mPrevParameters;
389     CameraMetadata mCurJpegMeta;
390     bool m_bIsVideo;
391     bool m_bIs4KVideo;
392     bool m_bEisSupportedSize;
393     bool m_bEisEnable;
394     typedef struct {
395         cam_dimension_t dim;
396         int format;
397         uint32_t usage;
398     } InputStreamInfo;
399 
400     InputStreamInfo mInputStreamInfo;
401     uint8_t m_MobicatMask;
402     uint8_t m_bTnrEnabled;
403     int8_t  mSupportedFaceDetectMode;
404     uint8_t m_bTnrPreview;
405     uint8_t m_bTnrVideo;
406     uint8_t m_debug_avtimer;
407 
408     /* Data structure to store pending request */
409     typedef struct {
410         camera3_stream_t *stream;
411         camera3_stream_buffer_t *buffer;
412         // metadata needs to be consumed by the corresponding stream
413         // in order to generate the buffer.
414         bool need_metadata;
415     } RequestedBufferInfo;
416     typedef struct {
417         uint32_t frame_number;
418         uint32_t num_buffers;
419         int32_t request_id;
420         List<RequestedBufferInfo> buffers;
421         int blob_request;
422         uint8_t bUrgentReceived;
423         nsecs_t timestamp;
424         camera3_stream_buffer_t *input_buffer;
425         const camera_metadata_t *settings;
426         CameraMetadata jpegMetadata;
427         uint8_t pipeline_depth;
428         uint32_t partial_result_cnt;
429         uint8_t capture_intent;
430         uint8_t fwkCacMode;
431         bool shutter_notified;
432         uint8_t hybrid_ae_enable;
433         /* DevCamDebug metadata PendingRequestInfo */
434         uint8_t DevCamDebug_meta_enable;
435         /* DevCamDebug metadata end */
436     } PendingRequestInfo;
437     typedef struct {
438         uint32_t frame_number;
439         uint32_t stream_ID;
440     } PendingFrameDropInfo;
441 
442     typedef struct {
443         camera3_notify_msg_t notify_msg;
444         camera3_stream_buffer_t buffer;
445         uint32_t frame_number;
446     } PendingReprocessResult;
447 
448     typedef KeyedVector<uint32_t, Vector<PendingBufferInfo> > FlushMap;
449     typedef List<QCamera3HardwareInterface::PendingRequestInfo>::iterator
450             pendingRequestIterator;
451     typedef List<QCamera3HardwareInterface::RequestedBufferInfo>::iterator
452             pendingBufferIterator;
453 
454     List<PendingReprocessResult> mPendingReprocessResultList;
455     List<PendingRequestInfo> mPendingRequestsList;
456     List<PendingFrameDropInfo> mPendingFrameDropList;
457     /* Use last frame number of the batch as key and first frame number of the
458      * batch as value for that key */
459     KeyedVector<uint32_t, uint32_t> mPendingBatchMap;
460     cam_stream_ID_t mBatchedStreamsArray;
461 
462     PendingBuffersMap mPendingBuffersMap;
463     pthread_cond_t mRequestCond;
464     uint32_t mPendingLiveRequest;
465     bool mWokenUpByDaemon;
466     int32_t mCurrentRequestId;
467     cam_stream_size_info_t mStreamConfigInfo;
468 
469     //mutex for serialized access to camera3_device_ops_t functions
470     pthread_mutex_t mMutex;
471 
472     //condition used to signal flush after buffers have returned
473     pthread_cond_t mBuffersCond;
474 
475     List<stream_info_t*> mStreamInfo;
476 
477     int64_t mMinProcessedFrameDuration;
478     int64_t mMinJpegFrameDuration;
479     int64_t mMinRawFrameDuration;
480 
481     uint32_t mMetaFrameCount;
482     bool    mUpdateDebugLevel;
483     const camera_module_callbacks_t *mCallbacks;
484 
485     uint8_t mCaptureIntent;
486     uint8_t mCacMode;
487     uint8_t mHybridAeEnable;
488     // DevCamDebug metadata internal variable
489     uint8_t mDevCamDebugMetaEnable;
490     /* DevCamDebug metadata end */
491 
492     metadata_buffer_t mReprocMeta; //scratch meta buffer
493     /* 0: Not batch, non-zero: Number of image buffers in a batch */
494     uint8_t mBatchSize;
495     // Used only in batch mode
496     uint8_t mToBeQueuedVidBufs;
497     // Fixed video fps
498     float mHFRVideoFps;
499 public:
500     uint8_t mOpMode;
501 private:
502     uint32_t mFirstFrameNumberInBatch;
503     camera3_stream_t mDummyBatchStream;
504     bool mNeedSensorRestart;
505     uint32_t mMinInFlightRequests;
506     uint32_t mMaxInFlightRequests;
507 
508     /* sensor output size with current stream configuration */
509     QCamera3CropRegionMapper mCropRegionMapper;
510 
511     /* Ldaf calibration data */
512     bool mLdafCalibExist;
513     uint32_t mLdafCalib[2];
514     bool mPowerHintEnabled;
515     int32_t mLastCustIntentFrmNum;
516 
517     static const QCameraMap<camera_metadata_enum_android_control_effect_mode_t,
518             cam_effect_mode_type> EFFECT_MODES_MAP[];
519     static const QCameraMap<camera_metadata_enum_android_control_awb_mode_t,
520             cam_wb_mode_type> WHITE_BALANCE_MODES_MAP[];
521     static const QCameraMap<camera_metadata_enum_android_control_scene_mode_t,
522             cam_scene_mode_type> SCENE_MODES_MAP[];
523     static const QCameraMap<camera_metadata_enum_android_control_af_mode_t,
524             cam_focus_mode_type> FOCUS_MODES_MAP[];
525     static const QCameraMap<camera_metadata_enum_android_color_correction_aberration_mode_t,
526             cam_aberration_mode_t> COLOR_ABERRATION_MAP[];
527     static const QCameraMap<camera_metadata_enum_android_control_ae_antibanding_mode_t,
528             cam_antibanding_mode_type> ANTIBANDING_MODES_MAP[];
529     static const QCameraMap<camera_metadata_enum_android_lens_state_t,
530             cam_af_lens_state_t> LENS_STATE_MAP[];
531     static const QCameraMap<camera_metadata_enum_android_control_ae_mode_t,
532             cam_flash_mode_t> AE_FLASH_MODE_MAP[];
533     static const QCameraMap<camera_metadata_enum_android_flash_mode_t,
534             cam_flash_mode_t> FLASH_MODES_MAP[];
535     static const QCameraMap<camera_metadata_enum_android_statistics_face_detect_mode_t,
536             cam_face_detect_mode_t> FACEDETECT_MODES_MAP[];
537     static const QCameraMap<camera_metadata_enum_android_lens_info_focus_distance_calibration_t,
538             cam_focus_calibration_t> FOCUS_CALIBRATION_MAP[];
539     static const QCameraMap<camera_metadata_enum_android_sensor_test_pattern_mode_t,
540             cam_test_pattern_mode_t> TEST_PATTERN_MAP[];
541     static const QCameraMap<camera_metadata_enum_android_sensor_reference_illuminant1_t,
542             cam_illuminat_t> REFERENCE_ILLUMINANT_MAP[];
543     static const QCameraMap<int32_t,
544             cam_hfr_mode_t> HFR_MODE_MAP[];
545 
546     static const QCameraPropMap CDS_MAP[];
547 
548     pendingRequestIterator erasePendingRequest(pendingRequestIterator i);
549     //GPU library to read buffer padding details.
550     void *lib_surface_utils;
551     int (*LINK_get_surface_pixel_alignment)();
552     uint32_t mSurfaceStridePadding;
553 
554     State mState;
555     //Dual camera related params
556     bool mIsDeviceLinked;
557     bool mIsMainCamera;
558     uint8_t mLinkedCameraId;
559     QCamera3HeapMemory *m_pRelCamSyncHeap;
560     cam_sync_related_sensors_event_info_t *m_pRelCamSyncBuf;
561     cam_sync_related_sensors_event_info_t m_relCamSyncInfo;
562     bool m60HzZone;
563 
564 };
565 
566 }; // namespace qcamera
567 
568 #endif /* __QCAMERA2HARDWAREINTERFACE_H__ */
569