[libcamera-devel,v1.1] libcamera: v4l2_videodevice: Fix uninitialised watchdogDuration_
diff mbox series

Message ID 20220407035409.226233-1-umang.jain@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel,v1.1] libcamera: v4l2_videodevice: Fix uninitialised watchdogDuration_
Related show

Commit Message

Umang Jain April 7, 2022, 3:54 a.m. UTC
Initialise the watchdogDuration_ member to 0ms before it is used
in rest of the code base. Failing to do so, spews out log warnings
regarding dequeue timer being expired.

Fixes: 16f3d2de50ff ("libcamera: v4l2_videodevice: Add a dequeue timer")
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
- Rebased over "libcamera: base: utils: Add missing constructor for
  Duration"
---
 src/libcamera/v4l2_videodevice.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart April 7, 2022, 7:22 a.m. UTC | #1
Hi Umang,

Thank you for the patch.

On Thu, Apr 07, 2022 at 09:24:09AM +0530, Umang Jain wrote:
> Initialise the watchdogDuration_ member to 0ms before it is used
> in rest of the code base. Failing to do so, spews out log warnings
> regarding dequeue timer being expired.
> 
> Fixes: 16f3d2de50ff ("libcamera: v4l2_videodevice: Add a dequeue timer")
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> - Rebased over "libcamera: base: utils: Add missing constructor for
>   Duration"
> ---
>  src/libcamera/v4l2_videodevice.cpp | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
> index 634ac4a5..87976fb2 100644
> --- a/src/libcamera/v4l2_videodevice.cpp
> +++ b/src/libcamera/v4l2_videodevice.cpp
> @@ -39,6 +39,8 @@
>  
>  namespace libcamera {
>  
> +using namespace std::literals::chrono_literals;
> +

You can drop this now. I'll apply the patch with this change removed.

>  LOG_DECLARE_CATEGORY(V4L2)
>  
>  /**
> @@ -520,7 +522,8 @@ const std::string V4L2DeviceFormat::toString() const
>   */
>  V4L2VideoDevice::V4L2VideoDevice(const std::string &deviceNode)
>  	: V4L2Device(deviceNode), formatInfo_(nullptr), cache_(nullptr),
> -	  fdBufferNotifier_(nullptr), state_(State::Stopped)
> +	  fdBufferNotifier_(nullptr), state_(State::Stopped),
> +	  watchdogDuration_(0.0)
>  {
>  	/*
>  	 * We default to an MMAP based CAPTURE video device, however this will

Patch
diff mbox series

diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index 634ac4a5..87976fb2 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -39,6 +39,8 @@ 
 
 namespace libcamera {
 
+using namespace std::literals::chrono_literals;
+
 LOG_DECLARE_CATEGORY(V4L2)
 
 /**
@@ -520,7 +522,8 @@  const std::string V4L2DeviceFormat::toString() const
  */
 V4L2VideoDevice::V4L2VideoDevice(const std::string &deviceNode)
 	: V4L2Device(deviceNode), formatInfo_(nullptr), cache_(nullptr),
-	  fdBufferNotifier_(nullptr), state_(State::Stopped)
+	  fdBufferNotifier_(nullptr), state_(State::Stopped),
+	  watchdogDuration_(0.0)
 {
 	/*
 	 * We default to an MMAP based CAPTURE video device, however this will