hardware: samsung_slsi: libcamera2: change min fd score value for meta data
[GitHub/LineageOS/android_hardware_samsung_slsi_exynos5.git] / libcamera2 / ExynosCameraHWInterface2.h
index f66516d27704668ced047618152a23e22aecc7a0..c105e3faf363e4fdbec3c1e7acd4d8221bf2602a 100644 (file)
@@ -61,7 +61,7 @@ namespace android {
 #define NODE_PREFIX     "/dev/video"
 
 #define NUM_MAX_STREAM_THREAD       (5)
-#define NUM_MAX_REQUEST_MGR_ENTRY   (4)
+#define NUM_MAX_REQUEST_MGR_ENTRY   (5)
 #define NUM_MAX_CAMERA_BUFFERS      (16)
 #define NUM_BAYER_BUFFERS           (8)
 #define NUM_SCC_BUFFERS             (8)
@@ -230,6 +230,10 @@ typedef struct request_manager_entry {
 } request_manager_entry_t;
 
 // structure related to a specific function of camera
+typedef struct af_control_info {
+    int    m_afTriggerTimeOut;
+} ctl_af_info_t;
+
 typedef struct flash_control_info {
     // UI flash mode indicator
     enum aa_aemode    i_flashMode;
@@ -260,10 +264,17 @@ typedef struct ae_control_info {
     enum ae_state    aeStateNoti;
 } ctl_ae_info_t;
 
+typedef struct scene_control_info {
+    // pre-capture notification state
+    enum aa_scene_mode    prevSceneMode;
+} ctl_scene_info_t;
+
 typedef struct request_control_info {
     ctl_flash_info_t flash;
     ctl_awb_info_t awb;
     ctl_ae_info_t ae;
+    ctl_af_info_t af;
+    ctl_scene_info_t scene;
 } ctl_request_info_t;
 
 class RequestManager {
@@ -286,10 +297,10 @@ public:
     void    RegisterTimestamp(int frameCnt, nsecs_t *frameTime);
     nsecs_t  GetTimestampByFrameCnt(int frameCnt);
     nsecs_t  GetTimestamp(int index);
+    uint8_t  GetOutputStreamByFrameCnt(int frameCnt);
+    uint8_t  GetOutputStream(int index);
     int     FindFrameCnt(struct camera2_shot_ext * shot_ext);
-#ifdef VDIS_ENABLE
     bool    IsVdisEnable(void);
-#endif
     int     FindEntryIndexByFrameCnt(int frameCnt);
     void    Dump(void);
     int     GetNextIndex(int index);
@@ -325,9 +336,7 @@ private:
     int                             m_lastAaMode;
     int                             m_lastAwbMode;
     int                             m_lastAeComp;
-#ifdef VDIS_ENABLE
     bool                            m_vdisBubbleEn;
-#endif
     nsecs_t                         m_lastTimeStamp;
     List<int>                   m_sensorQ;
 };
@@ -467,16 +476,10 @@ class MainThread : public SignalDrivenThread {
     public:
         MainThread(ExynosCameraHWInterface2 *hw):
             SignalDrivenThread(),
-            mHardware(hw) {
-//            Start("MainThread", PRIORITY_DEFAULT, 0);
-        }
+            mHardware(hw) { }
         ~MainThread();
-        status_t readyToRunInternal()
-       {
-            return NO_ERROR;
-        }
         void threadFunctionInternal()
-       {
+           {
             mHardware->m_mainThreadFunc(this);
             return;
         }
@@ -488,13 +491,9 @@ class MainThread : public SignalDrivenThread {
         ExynosCameraHWInterface2 *mHardware;
     public:
         SensorThread(ExynosCameraHWInterface2 *hw):
-            SignalDrivenThread("SensorThread", PRIORITY_DEFAULT, 0),
+            SignalDrivenThread(),
             mHardware(hw) { }
         ~SensorThread();
-        status_t readyToRunInternal() {
-            mHardware->m_sensorThreadInitialize(this);
-            return NO_ERROR;
-        }
         void threadFunctionInternal() {
             mHardware->m_sensorThreadFunc(this);
             return;
@@ -508,13 +507,10 @@ class MainThread : public SignalDrivenThread {
         ExynosCameraHWInterface2 *mHardware;
     public:
         StreamThread(ExynosCameraHWInterface2 *hw, uint8_t new_index):
-            SignalDrivenThread("StreamThread", PRIORITY_DEFAULT, 0),
+            SignalDrivenThread(),
             mHardware(hw),
             m_index(new_index) { }
         ~StreamThread();
-        status_t readyToRunInternal() {
-            return NO_ERROR;
-        }
         void threadFunctionInternal() {
             mHardware->m_streamThreadFunc(this);
             return;
@@ -551,7 +547,6 @@ class MainThread : public SignalDrivenThread {
 
     void                m_mainThreadFunc(SignalDrivenThread * self);
     void                m_sensorThreadFunc(SignalDrivenThread * self);
-    void                m_sensorThreadInitialize(SignalDrivenThread * self);
     void                m_streamThreadFunc(SignalDrivenThread * self);
     void                m_streamThreadInitialize(SignalDrivenThread * self);
 
@@ -615,6 +610,9 @@ class MainThread : public SignalDrivenThread {
     void            m_preCaptureSetter(struct camera2_shot_ext * shot_ext);
     void            m_preCaptureListenerSensor(struct camera2_shot_ext * shot_ext);
     void            m_preCaptureListenerISP(struct camera2_shot_ext * shot_ext);
+    void            m_updateAfRegion(struct camera2_shot_ext * shot_ext);
+    void            m_afTrigger(struct camera2_shot_ext * shot_ext);
+    void            m_sceneModeFaceSetter(struct camera2_shot_ext * shot_ext, int mode);
     void               *m_exynosPictureCSC;
     void               *m_exynosVideoCSC;
 
@@ -638,14 +636,17 @@ class MainThread : public SignalDrivenThread {
     bool                                m_isIspStarted;
 
     int                                 m_need_streamoff;
-
+    ExynosBuffer                        m_sccLocalBuffer[NUM_MAX_CAMERA_BUFFERS];
+    bool                                m_sccLocalBufferValid;
 
     int                                 indexToQueue[3+1];
 
     bool                                m_scp_flushing;
     bool                                m_closing;
     ExynosBuffer                        m_resizeBuf;
+#ifndef ENABLE_FRAME_SYNC
     int                                 m_currentOutputStreams;
+#endif
     int                                 m_currentReprocessOutStreams;
     ExynosBuffer                        m_previewCbBuf;
     int                                            m_cameraId;
@@ -655,10 +656,8 @@ class MainThread : public SignalDrivenThread {
     uint32_t                            lastAfRegion[4];
     float                               m_zoomRatio;
 
-#ifdef VDIS_ENABLE
     int                                 m_vdisBubbleCnt;
     int                                 m_vdisDupFrame;
-#endif
 
     mutable Mutex                       m_qbufLock;