libcamera: v4l2_videodevice: Better tracking of the device state

Replace the existing streaming_ state variable with an enum to track the
following three state: Streaming, Stopping, and Stopped. The alternate states
will be used in a subsequent commit.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Naushir Patuck
2022-03-25 09:09:00 +00:00
committed by Laurent Pinchart
parent ec173ef5d3
commit 988ec3f417
2 changed files with 13 additions and 5 deletions
@@ -225,6 +225,12 @@ protected:
private:
LIBCAMERA_DISABLE_COPY(V4L2VideoDevice)
enum class State {
Streaming,
Stopping,
Stopped,
};
int getFormatMeta(V4L2DeviceFormat *format);
int trySetFormatMeta(V4L2DeviceFormat *format, bool set);
@@ -258,7 +264,7 @@ private:
EventNotifier *fdBufferNotifier_;
bool streaming_;
State state_;
};
class V4L2M2MDevice