Camera2: Add thermal adapter
Thermal adapter is a singleton class to abstract a
thermal daemon client. The adapter would notify
camera HAL of thermal events.
Based on thermal threshold and level, we may adjust
camera/camcorder FPS accordingly.
Change-Id: Ib5192243f5b20ea151bd18cdf743a04e926aaab9
diff --git a/QCamera2/HAL/QCameraStateMachine.cpp b/QCamera2/HAL/QCameraStateMachine.cpp
index 82e9514..5773fcd 100644
--- a/QCamera2/HAL/QCameraStateMachine.cpp
+++ b/QCamera2/HAL/QCameraStateMachine.cpp
@@ -508,6 +508,7 @@
case QCAMERA_SM_EVT_EVT_NOTIFY:
case QCAMERA_SM_EVT_JPEG_EVT_NOTIFY:
case QCAMERA_SM_EVT_SNAPSHOT_DONE:
+ case QCAMERA_SM_EVT_THERMAL_NOTIFY:
default:
ALOGE("%s: cannot handle evt(%d) in state(%d)", __func__, evt, m_state);
break;
@@ -742,6 +743,7 @@
case QCAMERA_SM_EVT_EVT_NOTIFY:
case QCAMERA_SM_EVT_JPEG_EVT_NOTIFY:
case QCAMERA_SM_EVT_SNAPSHOT_DONE:
+ case QCAMERA_SM_EVT_THERMAL_NOTIFY:
default:
ALOGE("%s: cannot handle evt(%d) in state(%d)", __func__, evt, m_state);
break;
@@ -1028,6 +1030,9 @@
}
}
break;
+ case QCAMERA_SM_EVT_THERMAL_NOTIFY:
+ //TODO: Adjust FPS.
+ break;
case QCAMERA_SM_EVT_JPEG_EVT_NOTIFY:
case QCAMERA_SM_EVT_SNAPSHOT_DONE:
default:
@@ -1292,6 +1297,7 @@
m_state = QCAMERA_SM_STATE_PREVIEW_STOPPED;
}
break;
+ case QCAMERA_SM_EVT_THERMAL_NOTIFY:
default:
ALOGE("%s: cannot handle evt(%d) in state(%d)", __func__, evt, m_state);
break;
@@ -1567,6 +1573,9 @@
}
}
break;
+ case QCAMERA_SM_EVT_THERMAL_NOTIFY:
+ //TODO: Adjust FPS
+ break;
case QCAMERA_SM_EVT_JPEG_EVT_NOTIFY:
case QCAMERA_SM_EVT_SNAPSHOT_DONE:
default:
@@ -1845,6 +1854,9 @@
m_state = QCAMERA_SM_STATE_RECORDING;
}
break;
+ case QCAMERA_SM_EVT_THERMAL_NOTIFY:
+ //TODO: Adjust FPS.
+ break;
default:
ALOGE("%s: cannot handle evt(%d) in state(%d)", __func__, evt, m_state);
break;
@@ -2128,6 +2140,9 @@
m_state = QCAMERA_SM_STATE_PREVIEWING;
}
break;
+ case QCAMERA_SM_EVT_THERMAL_NOTIFY:
+ //TODO: Adjust FPS
+ break;
default:
ALOGE("%s: cannot handle evt(%d) in state(%d)", __func__, evt, m_state);
break;