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