diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-03-02 14:07:51 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-03-04 10:05:47 +0200 |
commit | aaaa2e833bd417a03eb94ba17c6d7e4605df6a27 (patch) | |
tree | 2ccedbfbf0378fda74ddf2f56d69af862091bc5a /src | |
parent | f2067dffedfe41ab5de62778c478a2add67d5dfb (diff) |
libcamera: v4l2_videodevice: Print fd value in log prefix
When opening a V4L2VideoDevice multiple times, for instance to run
multiple jobs on a M2M device, it's useful to attribute log messages to
a particular instance. Include the device fd in the log prefix.
This turns the existing output
[1:43:01.958321522] [277] DEBUG V4L2 v4l2_videodevice.cpp:1440 /dev/video0[cap]: Queueing buffer 0
[1:43:01.958350060] [277] DEBUG V4L2 v4l2_videodevice.cpp:1440 /dev/video0[cap]: Queueing buffer 1
[1:43:01.958365137] [277] DEBUG V4L2 v4l2_videodevice.cpp:1440 /dev/video0[cap]: Queueing buffer 2
into
[1:43:01.958321522] [277] DEBUG V4L2 v4l2_videodevice.cpp:1440 /dev/video0[14:cap]: Queueing buffer 0
[1:43:01.958350060] [277] DEBUG V4L2 v4l2_videodevice.cpp:1440 /dev/video0[14:cap]: Queueing buffer 1
[1:43:01.958365137] [277] DEBUG V4L2 v4l2_videodevice.cpp:1440 /dev/video0[14:cap]: Queueing buffer 2
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/v4l2_videodevice.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index c77e1aff..cb52d4ce 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -711,7 +711,8 @@ void V4L2VideoDevice::close() std::string V4L2VideoDevice::logPrefix() const { - return deviceNode() + (V4L2_TYPE_IS_OUTPUT(bufferType_) ? "[out]" : "[cap]"); + return deviceNode() + "[" + std::to_string(fd()) + + (V4L2_TYPE_IS_OUTPUT(bufferType_) ? ":out]" : ":cap]"); } /** |