Files
external_libcamera/include/libcamera/internal/ipa_proxy.h
Kieran Bingham 70238ceca5 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 <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-29 12:18:02 +01:00

49 lines
846 B
C++

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* ipa_proxy.h - Image Processing Algorithm proxy
*/
#ifndef __LIBCAMERA_INTERNAL_IPA_PROXY_H__
#define __LIBCAMERA_INTERNAL_IPA_PROXY_H__
#include <memory>
#include <string>
#include <vector>
#include <libcamera/ipa/ipa_interface.h>
namespace libcamera {
class IPAModule;
enum ProxyState {
ProxyStopped,
ProxyStopping,
ProxyRunning,
};
class IPAProxy : public IPAInterface
{
public:
IPAProxy(IPAModule *ipam);
~IPAProxy();
bool isValid() const { return valid_; }
std::string configurationFile(const std::string &file) const;
protected:
std::string resolvePath(const std::string &file) const;
bool valid_;
ProxyState state_;
private:
IPAModule *ipam_;
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_INTERNAL_IPA_PROXY_H__ */