[libcamera-devel,v3,12/22] v4l2: v4l2_camera: Add isRunning()

Message ID 20200623190836.53446-13-paul.elder@ideasonboard.com
State Superseded
Headers show
Series
  • Support v4l2-compliance
Related show

Commit Message

Paul Elder June 23, 2020, 7:08 p.m. UTC
Add a method isRunning() to V4L2Camera so that V4L2CameraProxy can use
it for checks.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

---
Changes in v3:
- cosmetic changes

Changes in v2:
- replace V4L2CameraProxy::streaming_ with
  V4L2CameraProxy::isRunning()
- moved the checks to different patches
---
 src/v4l2/v4l2_camera.cpp | 5 +++++
 src/v4l2/v4l2_camera.h   | 2 ++
 2 files changed, 7 insertions(+)

Patch

diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp
index 2557320..177b1ea 100644
--- a/src/v4l2/v4l2_camera.cpp
+++ b/src/v4l2/v4l2_camera.cpp
@@ -227,3 +227,8 @@  int V4L2Camera::qbuf(unsigned int index)
 
 	return 0;
 }
+
+bool V4L2Camera::isRunning()
+{
+	return isRunning_;
+}
diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h
index 30114ed..ee53c2b 100644
--- a/src/v4l2/v4l2_camera.h
+++ b/src/v4l2/v4l2_camera.h
@@ -57,6 +57,8 @@  public:
 
 	int qbuf(unsigned int index);
 
+	bool isRunning();
+
 	Semaphore bufferSema_;
 
 private: