hardware: samsung_slsi: libcamera2: Add log level for camera debug
[GitHub/LineageOS/android_hardware_samsung_slsi_exynos5.git] / libcamera2 / ExynosCameraHWInterface2.h
1 /*
2 **
3 ** Copyright 2008, The Android Open Source Project
4 ** Copyright 2012, Samsung Electronics Co. LTD
5 **
6 ** Licensed under the Apache License, Version 2.0 (the "License");
7 ** you may not use this file except in compliance with the License.
8 ** You may obtain a copy of the License at
9 **
10 ** http://www.apache.org/licenses/LICENSE-2.0
11 **
12 ** Unless required by applicable law or agreed to in writing, software
13 ** distributed under the License is distributed on an "AS IS" BASIS,
14 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 ** See the License for the specific language governing permissions and
16 ** limitations under the License.
17 */
18
19 /*!
20 * \file ExynosCameraHWInterface2.h
21 * \brief header file for Android Camera API 2.0 HAL
22 * \author Sungjoong Kang(sj3.kang@samsung.com)
23 * \date 2012/07/10
24 *
25 * <b>Revision History: </b>
26 * - 2012/05/31 : Sungjoong Kang(sj3.kang@samsung.com) \n
27 * Initial Release
28 *
29 * - 2012/07/10 : Sungjoong Kang(sj3.kang@samsung.com) \n
30 * 2nd Release
31 *
32 */
33
34 #ifndef EXYNOS_CAMERA_HW_INTERFACE_2_H
35 #define EXYNOS_CAMERA_HW_INTERFACE_2_H
36
37 #include <hardware/camera2.h>
38 #include <camera/Camera.h>
39 #include <camera/CameraParameters.h>
40 #include "SignalDrivenThread.h"
41 #include "MetadataConverter.h"
42 #include "exynos_v4l2.h"
43 #include "ExynosRect.h"
44 #include "ExynosBuffer.h"
45 #include "videodev2_exynos_camera.h"
46 #include "gralloc_priv.h"
47 #include "ExynosJpegEncoderForCamera.h"
48 #include <fcntl.h>
49 #include "fimc-is-metadata.h"
50 #include "ion.h"
51 #include "ExynosExif.h"
52 #include "csc.h"
53 #include "ExynosCamera2.h"
54 #include "cutils/properties.h"
55
56 namespace android {
57
58 //#define EXYNOS_CAMERA_LOG
59
60 //#define ENABLE_FRAME_SYNC
61 #define NODE_PREFIX "/dev/video"
62
63 #define NUM_MAX_STREAM_THREAD (5)
64 #define NUM_MAX_REQUEST_MGR_ENTRY (10)
65 #define NUM_MAX_DEQUEUED_REQUEST NUM_MAX_REQUEST_MGR_ENTRY
66 #define MAX_CAMERA_MEMORY_PLANE_NUM (4)
67 #define NUM_MAX_CAMERA_BUFFERS (16)
68 #define NUM_BAYER_BUFFERS (8)
69 #define NUM_SENSOR_QBUF (3)
70
71 #define PICTURE_GSC_NODE_NUM (2)
72 #define VIDEO_GSC_NODE_NUM (1)
73
74 #define STREAM_TYPE_DIRECT (0)
75 #define STREAM_TYPE_INDIRECT (1)
76
77 #define SIGNAL_MAIN_REQ_Q_NOT_EMPTY (SIGNAL_THREAD_COMMON_LAST<<1)
78 #define SIGNAL_MAIN_REPROCESS_Q_NOT_EMPTY (SIGNAL_THREAD_COMMON_LAST<<2)
79 #define SIGNAL_MAIN_STREAM_OUTPUT_DONE (SIGNAL_THREAD_COMMON_LAST<<3)
80 #define SIGNAL_SENSOR_START_REQ_PROCESSING (SIGNAL_THREAD_COMMON_LAST<<4)
81 #define SIGNAL_STREAM_GET_BUFFER (SIGNAL_THREAD_COMMON_LAST<<5)
82 #define SIGNAL_STREAM_PUT_BUFFER (SIGNAL_THREAD_COMMON_LAST<<6)
83 #define SIGNAL_STREAM_CHANGE_PARAMETER (SIGNAL_THREAD_COMMON_LAST<<7)
84 #define SIGNAL_THREAD_RELEASE (SIGNAL_THREAD_COMMON_LAST<<8)
85 #define SIGNAL_ISP_START_BAYER_INPUT (SIGNAL_THREAD_COMMON_LAST<<9)
86 #define SIGNAL_ISP_START_BAYER_DEQUEUE (SIGNAL_THREAD_COMMON_LAST<<10)
87
88 #define SIGNAL_STREAM_DATA_COMING (SIGNAL_THREAD_COMMON_LAST<<15)
89
90 #define NO_TRANSITION (0)
91 #define HAL_AFSTATE_INACTIVE (1)
92 #define HAL_AFSTATE_NEEDS_COMMAND (2)
93 #define HAL_AFSTATE_STARTED (3)
94 #define HAL_AFSTATE_SCANNING (4)
95 #define HAL_AFSTATE_LOCKED (5)
96 #define HAL_AFSTATE_FAILED (6)
97 #define HAL_AFSTATE_NEEDS_DETERMINATION (7)
98 #define HAL_AFSTATE_PASSIVE_FOCUSED (8)
99
100 #ifdef EXYNOS_CAMERA_LOG
101 #define CAM_LOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
102 #define CAM_LOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
103 #define CAM_LOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
104 #define CAM_LOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
105 #else
106 #define CAM_LOGV(...) ((void)0)
107 #define CAM_LOGD(...) ((void)0)
108 #define CAM_LOGW(...) ((void)0)
109 #define CAM_LOGE(...) ((void)0)
110 #endif
111
112 enum sensor_name {
113 SENSOR_NAME_S5K3H2 = 1,
114 SENSOR_NAME_S5K6A3 = 2,
115 SENSOR_NAME_S5K4E5 = 3,
116 SENSOR_NAME_S5K3H7 = 4,
117 SENSOR_NAME_CUSTOM = 5,
118 SENSOR_NAME_END
119 };
120
121 enum is_subscenario_id {
122 ISS_SUB_SCENARIO_STILL,
123 ISS_SUB_SCENARIO_VIDEO,
124 ISS_SUB_SCENARIO_SCENE1,
125 ISS_SUB_SCENARIO_SCENE2,
126 ISS_SUB_SCENARIO_SCENE3,
127 ISS_SUB_END
128 };
129
130 int SUPPORT_THUMBNAIL_REAR_SIZE[][2] =
131 {
132 {160, 120},
133 {160, 90},
134 {144, 96}
135 };
136
137 int SUPPORT_THUMBNAIL_FRONT_SIZE[][2] =
138 {
139 {160, 120},
140 {160, 160},
141 {160, 90},
142 {144, 96}
143 };
144
145 enum is_flash_scenario_state {
146 IS_FLASH_ON = 1,
147 IS_FLASH_ON_DONE = 2,
148 IS_FLASH_AE_AWB_LOCK_WAIT = 10,
149 IS_FLASH_AUTO_WAIT = 10,
150 IS_FLASH_CAPTURE,
151 IS_FLASH_CAPTURE_WAIT,
152 IS_FLASH_CAPTURE_JPEG,
153 IS_FLASH_CAPTURE_END,
154 IS_FLASH_MAX
155 };
156
157 enum is_af_flash_scenario_state {
158 IS_FLASH_AF_ON = 1,
159 IS_FLASH_AF_ON_START,
160 IS_FLASH_AF_ON_DONE,
161 IS_FLASH_AF_AUTO_AE_AWB_LOCK,
162 IS_FLASH_AF_AUTO_AE_AWB_LOCK_WAIT,
163 IS_FLASH_AF_AUTO_OFF_WAIT,
164 IS_FLASH_AF_AUTO_END,
165 IF_FLASH_AF_OFF,
166 IS_FLASH_AF_MAX
167 };
168
169 typedef struct node_info {
170 int fd;
171 int width;
172 int height;
173 int format;
174 int planes;
175 int buffers;
176 enum v4l2_memory memory;
177 enum v4l2_buf_type type;
178 ion_client ionClient;
179 ExynosBuffer buffer[NUM_MAX_CAMERA_BUFFERS];
180 int status;
181 } node_info_t;
182
183
184 typedef struct camera_hw_info {
185 int sensor_id;
186
187 node_info_t sensor;
188 node_info_t isp;
189 node_info_t capture;
190
191 /*shot*/ // temp
192 struct camera2_shot_ext dummy_shot;
193
194 } camera_hw_info_t;
195
196 typedef enum request_entry_status {
197 EMPTY,
198 REGISTERED,
199 REQUESTED,
200 CAPTURED
201 } request_entry_status_t;
202
203 typedef struct request_manager_entry {
204 request_entry_status_t status;
205 camera_metadata_t *original_request;
206 struct camera2_shot_ext internal_shot;
207 int output_stream_count;
208 bool dynamic_meta_vaild;
209 } request_manager_entry_t;
210
211 // structure related to a specific function of camera
212 typedef struct flash_control_info {
213 // UI flash mode indicator
214 enum aa_aemode i_flashMode;
215 // AF flash
216 bool m_afFlashDoneFlg;
217 bool m_afFlashEnableFlg;
218 int m_afFlashCnt;
219 // Capture flash
220 bool m_flashEnableFlg;
221 bool m_flashCaptured;
222 int m_flashFrameCount;
223 int m_flashCnt;
224 int m_flashTimeOut;
225 int m_flashWaitCnt;
226 // Flash decision
227 // At flash auto mode only : 1 -> flash is needed, 0 -> normal case
228 bool m_flashDecisionResult;
229 // torch indicator. this will be replaced by flashMode meta
230 bool m_flashTorchMode;
231 } ctl_flash_info_t;
232
233 typedef struct request_control_info {
234 ctl_flash_info_t flash;
235
236 } ctl_request_info_t;
237
238 class RequestManager {
239 public:
240 RequestManager(SignalDrivenThread* main_thread);
241 ~RequestManager();
242 int GetNumEntries();
243 bool IsRequestQueueFull();
244
245 void RegisterRequest(camera_metadata_t *new_request);
246 void DeregisterRequest(camera_metadata_t **deregistered_request);
247 bool PrepareFrame(size_t *num_entries, size_t *frame_size,
248 camera_metadata_t **prepared_frame, int afState);
249 int MarkProcessingRequest(ExynosBuffer * buf, int *afMode);
250 void NotifyStreamOutput(int frameCnt, int stream_id);
251 void DumpInfoWithIndex(int index);
252 void ApplyDynamicMetadata(struct camera2_shot_ext *shot_ext);
253 void CheckCompleted(int index);
254 void UpdateIspParameters(struct camera2_shot_ext *shot_ext, int frameCnt);
255 void RegisterTimestamp(int frameCnt, nsecs_t *frameTime);
256 uint64_t GetTimestamp(int frameCnt);
257 int FindFrameCnt(struct camera2_shot_ext * shot_ext);
258 int FindEntryIndexByFrameCnt(int frameCnt);
259 void Dump(void);
260 int GetNextIndex(int index);
261 void SetDefaultParameters(int cropX);
262 void SetInitialSkip(int count);
263 int GetSkipCnt();
264 void SetFrameIndex(int index);
265 int GetFrameIndex();
266 private:
267
268 MetadataConverter *m_metadataConverter;
269 SignalDrivenThread *m_mainThread;
270 int m_numOfEntries;
271 int m_entryInsertionIndex;
272 int m_entryProcessingIndex;
273 int m_entryFrameOutputIndex;
274 request_manager_entry_t entries[NUM_MAX_REQUEST_MGR_ENTRY];
275 int m_completedIndex;
276
277 Mutex m_requestMutex;
278
279 //TODO : alloc dynamically
280 char m_tempFrameMetadataBuf[2000];
281 camera_metadata_t *m_tempFrameMetadata;
282
283 int m_sensorPipelineSkipCnt;
284 int m_cropX;
285 int m_frameIndex;
286 int m_lastAeMode;
287 int m_lastAaMode;
288 int m_lastAwbMode;
289 int m_lastAeComp;
290 };
291
292
293 typedef struct bayer_buf_entry {
294 int status;
295 int reqFrameCnt;
296 nsecs_t timeStamp;
297 } bayer_buf_entry_t;
298
299
300 class BayerBufManager {
301 public:
302 BayerBufManager();
303 ~BayerBufManager();
304 int GetIndexForSensorEnqueue();
305 int MarkSensorEnqueue(int index);
306 int MarkSensorDequeue(int index, int reqFrameCnt, nsecs_t *timeStamp);
307 int GetIndexForIspEnqueue(int *reqFrameCnt);
308 int GetIndexForIspDequeue(int *reqFrameCnt);
309 int MarkIspEnqueue(int index);
310 int MarkIspDequeue(int index);
311 int GetNumOnSensor();
312 int GetNumOnHalFilled();
313 int GetNumOnIsp();
314
315 private:
316 int GetNextIndex(int index);
317
318 int sensorEnqueueHead;
319 int sensorDequeueHead;
320 int ispEnqueueHead;
321 int ispDequeueHead;
322 int numOnSensor;
323 int numOnIsp;
324 int numOnHalFilled;
325 int numOnHalEmpty;
326
327 bayer_buf_entry_t entries[NUM_BAYER_BUFFERS];
328 };
329
330
331 #define NOT_AVAILABLE (0)
332 #define REQUIRES_DQ_FROM_SVC (1)
333 #define ON_DRIVER (2)
334 #define ON_HAL (3)
335 #define ON_SERVICE (4)
336
337 #define BAYER_NOT_AVAILABLE (0)
338 #define BAYER_ON_SENSOR (1)
339 #define BAYER_ON_HAL_FILLED (2)
340 #define BAYER_ON_ISP (3)
341 #define BAYER_ON_SERVICE (4)
342 #define BAYER_ON_HAL_EMPTY (5)
343
344 typedef struct stream_parameters {
345 int streamType;
346 uint32_t outputWidth;
347 uint32_t outputHeight;
348 uint32_t nodeWidth;
349 uint32_t nodeHeight;
350 int outputFormat;
351 int nodeFormat;
352 const camera2_stream_ops_t* streamOps;
353 uint32_t usage;
354 int numHwBuffers;
355 int numSvcBuffers;
356 int numOwnSvcBuffers;
357 int fd;
358 int svcPlanes;
359 int nodePlanes;
360 int metaPlanes;
361 enum v4l2_memory memory;
362 enum v4l2_buf_type halBuftype;
363 int numSvcBufsInHal;
364 buffer_handle_t svcBufHandle[NUM_MAX_CAMERA_BUFFERS];
365 ExynosBuffer svcBuffers[NUM_MAX_CAMERA_BUFFERS];
366 ExynosBuffer metaBuffers[NUM_MAX_CAMERA_BUFFERS];
367 int svcBufStatus[NUM_MAX_CAMERA_BUFFERS];
368 int svcBufIndex;
369 ion_client ionClient;
370 node_info_t node;
371 } stream_parameters_t;
372
373 typedef struct record_parameters {
374 uint32_t outputWidth;
375 uint32_t outputHeight;
376 int outputFormat;
377 const camera2_stream_ops_t* streamOps;
378 uint32_t usage;
379 int numSvcBuffers;
380 int numOwnSvcBuffers;
381 int svcPlanes;
382 buffer_handle_t svcBufHandle[NUM_MAX_CAMERA_BUFFERS];
383 ExynosBuffer svcBuffers[NUM_MAX_CAMERA_BUFFERS];
384 int svcBufStatus[NUM_MAX_CAMERA_BUFFERS];
385 int svcBufIndex;
386 int numSvcBufsInHal;
387 } record_parameters_t;
388
389 typedef struct callback_parameters {
390 uint32_t outputWidth;
391 uint32_t outputHeight;
392 int outputFormat;
393 int internalFormat;
394 int internalPlanes;
395 const camera2_stream_ops_t* streamOps;
396 uint32_t usage;
397 int numSvcBuffers;
398 int numOwnSvcBuffers;
399 int svcPlanes;
400 buffer_handle_t svcBufHandle[NUM_MAX_CAMERA_BUFFERS];
401 ExynosBuffer svcBuffers[NUM_MAX_CAMERA_BUFFERS];
402 int svcBufStatus[NUM_MAX_CAMERA_BUFFERS];
403 int svcBufIndex;
404 int numSvcBufsInHal;
405 } callback_parameters_t;
406
407 class ExynosCameraHWInterface2 : public virtual RefBase {
408 public:
409 ExynosCameraHWInterface2(int cameraId, camera2_device_t *dev, ExynosCamera2 * camera, int *openInvalid);
410 virtual ~ExynosCameraHWInterface2();
411
412 virtual void release();
413
414 inline int getCameraId() const;
415
416 virtual int setRequestQueueSrcOps(const camera2_request_queue_src_ops_t *request_src_ops);
417 virtual int notifyRequestQueueNotEmpty();
418 virtual int setFrameQueueDstOps(const camera2_frame_queue_dst_ops_t *frame_dst_ops);
419 virtual int getInProgressCount();
420 virtual int flushCapturesInProgress();
421 virtual int constructDefaultRequest(int request_template, camera_metadata_t **request);
422 virtual int allocateStream(uint32_t width, uint32_t height,
423 int format, const camera2_stream_ops_t *stream_ops,
424 uint32_t *stream_id, uint32_t *format_actual, uint32_t *usage, uint32_t *max_buffers);
425 virtual int registerStreamBuffers(uint32_t stream_id, int num_buffers, buffer_handle_t *buffers);
426 virtual int releaseStream(uint32_t stream_id);
427 virtual int allocateReprocessStream(uint32_t width, uint32_t height,
428 uint32_t format, const camera2_stream_in_ops_t *reprocess_stream_ops,
429 uint32_t *stream_id, uint32_t *consumer_usage, uint32_t *max_buffers);
430 virtual int releaseReprocessStream(uint32_t stream_id);
431 virtual int triggerAction(uint32_t trigger_id, int ext1, int ext2);
432 virtual int setNotifyCallback(camera2_notify_callback notify_cb, void *user);
433 virtual int getMetadataVendorTagOps(vendor_tag_query_ops_t **ops);
434 virtual int dump(int fd);
435 private:
436 class MainThread : public SignalDrivenThread {
437 ExynosCameraHWInterface2 *mHardware;
438 public:
439 MainThread(ExynosCameraHWInterface2 *hw):
440 SignalDrivenThread(),
441 mHardware(hw) {
442 // Start("MainThread", PRIORITY_DEFAULT, 0);
443 }
444 ~MainThread();
445 status_t readyToRunInternal()
446 {
447 return NO_ERROR;
448 }
449 void threadFunctionInternal()
450 {
451 mHardware->m_mainThreadFunc(this);
452 return;
453 }
454 void release(void);
455 bool m_releasing;
456 };
457
458 class SensorThread : public SignalDrivenThread {
459 ExynosCameraHWInterface2 *mHardware;
460 public:
461 SensorThread(ExynosCameraHWInterface2 *hw):
462 SignalDrivenThread("SensorThread", PRIORITY_DEFAULT, 0),
463 mHardware(hw),
464 m_isBayerOutputEnabled(false) { }
465 ~SensorThread();
466 status_t readyToRunInternal() {
467 mHardware->m_sensorThreadInitialize(this);
468 return NO_ERROR;
469 }
470 void threadFunctionInternal() {
471 mHardware->m_sensorThreadFunc(this);
472 return;
473 }
474 void release(void);
475 //private:
476 bool m_isBayerOutputEnabled;
477 int m_sensorFd;
478 bool m_releasing;
479 };
480
481 class IspThread : public SignalDrivenThread {
482 ExynosCameraHWInterface2 *mHardware;
483 public:
484 IspThread(ExynosCameraHWInterface2 *hw):
485 SignalDrivenThread("IspThread", PRIORITY_DEFAULT, 0),
486 mHardware(hw) { }
487 ~IspThread();
488 status_t readyToRunInternal() {
489 mHardware->m_ispThreadInitialize(this);
490 return NO_ERROR;
491 }
492 void threadFunctionInternal() {
493 mHardware->m_ispThreadFunc(this);
494 return;
495 }
496 void release(void);
497 //private:
498 int m_ispFd;
499 bool m_releasing;
500 };
501
502 class StreamThread : public SignalDrivenThread {
503 ExynosCameraHWInterface2 *mHardware;
504 public:
505 StreamThread(ExynosCameraHWInterface2 *hw, uint8_t new_index):
506 SignalDrivenThread("StreamThread", PRIORITY_DEFAULT, 0),
507 mHardware(hw),
508 m_index(new_index) { }
509 ~StreamThread();
510 status_t readyToRunInternal() {
511 mHardware->m_streamThreadInitialize(this);
512 return NO_ERROR;
513 }
514 void threadFunctionInternal() {
515 mHardware->m_streamThreadFunc(this);
516 return;
517 }
518 void setRecordingParameter(record_parameters_t * recordParm);
519 void setCallbackParameter(callback_parameters_t * callbackParm);
520 void setParameter(stream_parameters_t * new_parameters);
521 void applyChange(void);
522 void release(void);
523 int findBufferIndex(void * bufAddr);
524
525
526 uint8_t m_index;
527 bool m_activated;
528 //private:
529 stream_parameters_t m_parameters;
530 stream_parameters_t *m_tempParameters;
531 record_parameters_t m_recordParameters;
532 callback_parameters_t m_previewCbParameters;
533 bool m_isBufferInit;
534 bool m_releasing;
535 };
536
537 sp<MainThread> m_mainThread;
538 sp<SensorThread> m_sensorThread;
539 sp<IspThread> m_ispThread;
540 sp<StreamThread> m_streamThreads[NUM_MAX_STREAM_THREAD];
541
542
543
544 RequestManager *m_requestManager;
545 BayerBufManager *m_BayerManager;
546 ExynosCamera2 *m_camera2;
547
548 void m_mainThreadFunc(SignalDrivenThread * self);
549 void m_sensorThreadFunc(SignalDrivenThread * self);
550 void m_sensorThreadInitialize(SignalDrivenThread * self);
551 void m_ispThreadFunc(SignalDrivenThread * self);
552 void m_ispThreadInitialize(SignalDrivenThread * self);
553 void m_streamThreadFunc(SignalDrivenThread * self);
554 void m_streamThreadInitialize(SignalDrivenThread * self);
555
556 void m_streamFunc0(SignalDrivenThread *self);
557 void m_streamFunc1(SignalDrivenThread *self);
558
559 void m_streamBufferInit(SignalDrivenThread *self);
560
561 void m_getAlignedYUVSize(int colorFormat, int w, int h,
562 ExynosBuffer *buf);
563 bool m_getRatioSize(int src_w, int src_h,
564 int dst_w, int dst_h,
565 int *crop_x, int *crop_y,
566 int *crop_w, int *crop_h,
567 int zoom);
568 int createIonClient(ion_client ionClient);
569 int deleteIonClient(ion_client ionClient);
570
571 int allocCameraMemory(ion_client ionClient, ExynosBuffer *buf, int iMemoryNum);
572 int allocCameraMemory(ion_client ionClient, ExynosBuffer *buf, int iMemoryNum, int cacheFlag);
573 void freeCameraMemory(ExynosBuffer *buf, int iMemoryNum);
574 void initCameraMemory(ExynosBuffer *buf, int iMemoryNum);
575
576 void DumpInfoWithShot(struct camera2_shot_ext * shot_ext);
577 bool m_checkThumbnailSize(int w, int h);
578 bool yuv2Jpeg(ExynosBuffer *yuvBuf,
579 ExynosBuffer *jpegBuf,
580 ExynosRect *rect);
581 int InitializeISPChain();
582 void StartISP();
583 int GetAfState();
584 void SetAfMode(enum aa_afmode afMode);
585 void OnAfTriggerStart(int id);
586 void OnAfTrigger(int id);
587 void OnAfTriggerAutoMacro(int id);
588 void OnAfTriggerCAFPicture(int id);
589 void OnAfTriggerCAFVideo(int id);
590 void OnAfCancel(int id);
591 void OnAfCancelAutoMacro(int id);
592 void OnAfCancelCAFPicture(int id);
593 void OnAfCancelCAFVideo(int id);
594 void OnAfNotification(enum aa_afstate noti);
595 void OnAfNotificationAutoMacro(enum aa_afstate noti);
596 void OnAfNotificationCAFPicture(enum aa_afstate noti);
597 void OnAfNotificationCAFVideo(enum aa_afstate noti);
598 void SetAfStateForService(int newState);
599 int GetAfStateForService();
600 exif_attribute_t mExifInfo;
601 void m_setExifFixedAttribute(void);
602 void m_setExifChangedAttribute(exif_attribute_t *exifInfo, ExynosRect *rect,
603 camera2_shot *currentEntry);
604 void flashSetter(struct camera2_shot_ext * shot_ext);
605 void flashListenerSensor(struct camera2_shot_ext * shot_ext);
606 void flashListenerISP(struct camera2_shot_ext * shot_ext);
607 void *m_exynosPictureCSC;
608 void *m_exynosVideoCSC;
609
610 int m_jpegEncodingFrameCnt;
611
612 camera2_request_queue_src_ops_t *m_requestQueueOps;
613 camera2_frame_queue_dst_ops_t *m_frameQueueOps;
614 camera2_notify_callback m_notifyCb;
615 void *m_callbackCookie;
616
617 int m_numOfRemainingReqInSvc;
618 bool m_isRequestQueuePending;
619 bool m_isRequestQueueNull;
620 camera2_device_t *m_halDevice;
621 static gralloc_module_t const* m_grallocHal;
622
623
624 camera_hw_info_t m_camera_info;
625
626 ion_client m_ionCameraClient;
627
628 bool m_isSensorThreadOn;
629 bool m_isSensorStarted;
630 bool m_isIspStarted;
631
632 int m_need_streamoff;
633
634 bool m_initFlag1;
635 bool m_initFlag2;
636
637 int indexToQueue[3+1];
638 int m_fd_scp;
639
640 bool m_scp_flushing;
641 bool m_closing;
642 ExynosBuffer m_resizeBuf;
643 bool m_recordingEnabled;
644 int m_previewOutput;
645 int m_recordOutput;
646 bool m_needsRecordBufferInit;
647 ExynosBuffer m_previewCbBuf;
648 int m_previewCbEnabled;
649 int m_previewCbOutput;
650 bool m_needsPreviewCbBufferInit;
651 int lastFrameCnt;
652 int m_cameraId;
653 bool m_scp_closing;
654 bool m_scp_closed;
655 bool m_wideAspect;
656 bool m_aspectChanged;
657 uint32_t lastAfRegion[4];
658 float m_zoomRatio;
659
660 mutable Mutex m_qbufLock;
661
662 int m_afState;
663 int m_afTriggerId;
664 enum aa_afmode m_afMode;
665 enum aa_afmode m_afMode2;
666 bool m_IsAfModeUpdateRequired;
667 bool m_IsAfTriggerRequired;
668 bool m_IsAfLockRequired;
669 int m_serviceAfState;
670 bool m_AfHwStateFailed;
671 int m_afPendingTriggerId;
672 int m_afModeWaitingCnt;
673 struct camera2_shot m_jpegMetadata;
674 int m_scpOutputSignalCnt;
675 int m_scpOutputImageCnt;
676 int m_nightCaptureCnt;
677 int m_nightCaptureFrameCnt;
678 int m_thumbNailW;
679 int m_thumbNailH;
680 ctl_request_info_t m_ctlInfo;
681 };
682
683 }; // namespace android
684
685 #endif