summaryrefslogtreecommitdiffstats
path: root/camera/inc
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2011-10-26 04:44:38 -0500
committerIliyan Malchev <malchev@google.com>2011-11-07 12:07:36 -0800
commita58c483de2c8188e41fd9635042c31820d13b845 (patch)
tree96c330d843163689d59011128e27d99decf60082 /camera/inc
parentd9949c1e47698ef0e36ffadeebe642a3abe53f8b (diff)
downloadhardware_ti_omap4xxx-a58c483de2c8188e41fd9635042c31820d13b845.zip
hardware_ti_omap4xxx-a58c483de2c8188e41fd9635042c31820d13b845.tar.gz
hardware_ti_omap4xxx-a58c483de2c8188e41fd9635042c31820d13b845.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.h4
-rw-r--r--camera/inc/CameraHal.h3
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