diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2019-08-08 12:06:10 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2019-08-13 10:23:21 +0100 |
commit | 3a278eb460810e6774915fc058d420549cfb00d3 (patch) | |
tree | d93358ef6778c0a84952e0fbec9ea4169b48c9e3 /src | |
parent | e0f35d6f57465a54ac03eed62ff23833ec051029 (diff) |
libcamera: v4l2_videodevice: Fix ordering of debug statement
The "Opened device" statement occurs before the buffertype_ is set.
This causes all devices to report that they are [out] devices at open()
regardless of their type.
As the message operates in the past-tense, move the statement to the end
of the function when all work has been completed.
Fixes: 04d5be7f76fe ("libcamera: v4l2_device: Inherit from Loggable to print device node name")
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/v4l2_videodevice.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index c43d7cc5..81098dd7 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -314,10 +314,6 @@ int V4L2VideoDevice::open() return ret; } - LOG(V4L2, Debug) - << "Opened device " << caps_.bus_info() << ": " - << caps_.driver() << ": " << caps_.card(); - if (!caps_.hasStreaming()) { LOG(V4L2, Error) << "Device does not support streaming I/O"; return -EINVAL; @@ -352,6 +348,10 @@ int V4L2VideoDevice::open() fdEvent_->activated.connect(this, &V4L2VideoDevice::bufferAvailable); fdEvent_->setEnabled(false); + LOG(V4L2, Debug) + << "Opened device " << caps_.bus_info() << ": " + << caps_.driver() << ": " << caps_.card(); + return 0; } |