[libcamera-devel] libcamera: v4l2_device: Prefix V4L2 direction in log messages

Message ID 20190427012509.32153-1-kieran.bingham@ideasonboard.com
State Accepted
Commit c34e09d33a6d81e1bbe818a8e652e0c60de50982
Headers show
Series
  • [libcamera-devel] libcamera: v4l2_device: Prefix V4L2 direction in log messages
Related show

Commit Message

Kieran Bingham April 27, 2019, 1:25 a.m. UTC
The V4L2Device will use the same deviceNode for two directions in the
case of an M2M device.

Add the direction to identify the queue direction on each instance.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera/v4l2_device.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Laurent Pinchart April 27, 2019, 1:28 a.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Sat, Apr 27, 2019 at 03:25:09AM +0200, Kieran Bingham wrote:
> The V4L2Device will use the same deviceNode for two directions in the
> case of an M2M device.
> 
> Add the direction to identify the queue direction on each instance.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/libcamera/v4l2_device.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
> index a6e9ca247828..a21944160253 100644
> --- a/src/libcamera/v4l2_device.cpp
> +++ b/src/libcamera/v4l2_device.cpp
> @@ -415,7 +415,7 @@ void V4L2Device::close()
>  
>  std::string V4L2Device::logPrefix() const
>  {
> -	return deviceNode_;
> +	return deviceNode_ + (V4L2_TYPE_IS_OUTPUT(bufferType_) ? "[out]" : "[cap]");
>  }
>  
>  /**

Patch

diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
index a6e9ca247828..a21944160253 100644
--- a/src/libcamera/v4l2_device.cpp
+++ b/src/libcamera/v4l2_device.cpp
@@ -415,7 +415,7 @@  void V4L2Device::close()
 
 std::string V4L2Device::logPrefix() const
 {
-	return deviceNode_;
+	return deviceNode_ + (V4L2_TYPE_IS_OUTPUT(bufferType_) ? "[out]" : "[cap]");
 }
 
 /**