summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/lux_status.h
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-05-06 18:10:42 +0200
committerJacopo Mondi <jacopo@jmondi.org>2021-06-14 12:26:27 +0200
commit1f38e4c73f5d39b366f75b774e76490850031532 (patch)
tree84e1d455472d29b80ad5179822c79f2f26f166e5 /src/ipa/raspberrypi/controller/lux_status.h
parentf461ffb69a85b6df6a8413cb7716e2b89414d64e (diff)
android: camera_device: Replace running_ with CameraState
The CameraDevice class maintains the camera state in the 'running_' boolean flag to check if the camera has to be started at the first received process_capture_request() call which happens after the camera had been stopped. So far this was correct, as the operations that change the camera could only start or stop the camera, so a simple boolean flag was enough. To prepare to handle the flush() operation that will introduce a new 'flushing' state, replace the simple plain boolean flag with an enumeration of values that define the CameraState. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/lux_status.h')
0 files changed, 0 insertions, 0 deletions
ss="hl opt">; class V4L2Device : protected Loggable { public: void close(); bool isOpen() const { return fd_.isValid(); } const ControlInfoMap &controls() const { return controls_; } ControlList getControls(const std::vector<uint32_t> &ids); int setControls(ControlList *ctrls); const struct v4l2_query_ext_ctrl *controlInfo(uint32_t id) const; const std::string &deviceNode() const { return deviceNode_; } std::string devicePath() const; int setFrameStartEnabled(bool enable); Signal<uint32_t> frameStart; void updateControlInfo(); protected: V4L2Device(const std::string &deviceNode); ~V4L2Device(); int open(unsigned int flags); int setFd(UniqueFD fd); int ioctl(unsigned long request, void *argp); int fd() const { return fd_.get(); } template<typename T> static std::optional<ColorSpace> toColorSpace(const T &v4l2Format, PixelFormatInfo::ColourEncoding colourEncoding); template<typename T> static int fromColorSpace(const std::optional<ColorSpace> &colorSpace, T &v4l2Format); private: static ControlType v4l2CtrlType(uint32_t ctrlType); static std::unique_ptr<ControlId> v4l2ControlId(const v4l2_query_ext_ctrl &ctrl); std::optional<ControlInfo> v4l2ControlInfo(const v4l2_query_ext_ctrl &ctrl); std::optional<ControlInfo> v4l2MenuControlInfo(const v4l2_query_ext_ctrl &ctrl); void listControls(); void updateControls(ControlList *ctrls, Span<const v4l2_ext_control> v4l2Ctrls); void eventAvailable(); std::map<unsigned int, struct v4l2_query_ext_ctrl> controlInfo_; std::vector<std::unique_ptr<ControlId>> controlIds_; ControlIdMap controlIdMap_; ControlInfoMap controls_; std::string deviceNode_; UniqueFD fd_; EventNotifier *fdEventNotifier_; bool frameStartEnabled_; }; } /* namespace libcamera */