From 70238ceca5b2f0be1330ecb9664ae0f59f151152 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Tue, 23 Mar 2021 13:55:09 +0000 Subject: utils: ipc: proxy: Track IPA with a state machine Asynchronous tasks can only be submitted while the IPA is running. Further more, the shutdown sequence can not be tracked with a simple running flag. We can also be in the state 'Stopping' where we have not yet completed all events, but we must not commence anything new. Refactor the running_ boolean into a stateful enum to track this. Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- include/libcamera/internal/ipa_proxy.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/libcamera/internal/ipa_proxy.h b/include/libcamera/internal/ipa_proxy.h index f651a3ae..9fe446c3 100644 --- a/include/libcamera/internal/ipa_proxy.h +++ b/include/libcamera/internal/ipa_proxy.h @@ -17,6 +17,12 @@ namespace libcamera { class IPAModule; +enum ProxyState { + ProxyStopped, + ProxyStopping, + ProxyRunning, +}; + class IPAProxy : public IPAInterface { public: @@ -31,6 +37,7 @@ protected: std::string resolvePath(const std::string &file) const; bool valid_; + ProxyState state_; private: IPAModule *ipam_; -- cgit v1.2.1