diff options
author | Tyler Luu <tluu@ti.com> | 2011-10-26 04:44:38 -0500 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-11-07 12:07:36 -0800 |
commit | 2b70c63841d4cc28852a3a2d81e3b5504661b156 (patch) | |
tree | 19297271d035a75012d67c815dab121d76463176 /camera/inc | |
parent | 0736cc574b6289b5ac31a96279d6df720ea3cff3 (diff) | |
download | hardware_ti_omap4-2b70c63841d4cc28852a3a2d81e3b5504661b156.zip hardware_ti_omap4-2b70c63841d4cc28852a3a2d81e3b5504661b156.tar.gz hardware_ti_omap4-2b70c63841d4cc28852a3a2d81e3b5504661b156.tar.bz2 |
CameraHal: Add function to rollback state machine
Fix 1/3 for b/5472396.
Adding a function to rollback the state machine to INTITIALIZED_STATE
from any given current state. With this function, we can better
manage the different states that CameraAdapter could be in when
stopPreview is called.
Change-Id: I0a456738e8575873b5ac6fb2a31395dab54ef6f7
Signed-off-by: Tyler Luu <tluu@ti.com>
Diffstat (limited to 'camera/inc')
-rw-r--r-- | camera/inc/BaseCameraAdapter.h | 4 | ||||
-rw-r--r-- | camera/inc/CameraHal.h | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/camera/inc/BaseCameraAdapter.h b/camera/inc/BaseCameraAdapter.h index a11ea1d..d778491 100644 --- a/camera/inc/BaseCameraAdapter.h +++ b/camera/inc/BaseCameraAdapter.h @@ -59,6 +59,9 @@ public: //Retrieves the next Adapter state virtual AdapterState getNextState(); + // Rolls the state machine back to INTIALIZED_STATE from the current state + virtual status_t rollbackToInitializedState(); + protected: //The first two methods will try to switch the adapter state. //Every call to setState() should be followed by a corresponding @@ -163,6 +166,7 @@ private: status_t __sendFrameToSubscribers(CameraFrame* frame, KeyedVector<int, frame_callback> *subscribers, CameraFrame::FrameType frameType); + status_t rollbackToPreviousState(); // protected data types and variables protected: diff --git a/camera/inc/CameraHal.h b/camera/inc/CameraHal.h index 2b1f0c9..c6af5ab 100644 --- a/camera/inc/CameraHal.h +++ b/camera/inc/CameraHal.h @@ -832,6 +832,9 @@ public: // Receive orientation events from CameraHal virtual void onOrientationEvent(uint32_t orientation, uint32_t tilt) = 0; + + // Rolls the state machine back to INTIALIZED_STATE from the current state + virtual status_t rollbackToInitializedState() = 0; protected: //The first two methods will try to switch the adapter state. //Every call to setState() should be followed by a corresponding |