summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_device.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-20 15:03:01 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-21 21:47:25 +0200
commit8b8ae521347f293380f471285193aebbb3279f7d (patch)
tree7ce94b74b19d83b138d251d8ee3bf2c29edc9b18 /src/libcamera/v4l2_device.cpp
parent457208178c818a571d77978b5204530ef2c18d51 (diff)
libcamera: Use log categories
Use log categories in the whole existing code base. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/v4l2_device.cpp')
-rw-r--r--src/libcamera/v4l2_device.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
index 54b53de3..59c5ac98 100644
--- a/src/libcamera/v4l2_device.cpp
+++ b/src/libcamera/v4l2_device.cpp
@@ -20,6 +20,8 @@
*/
namespace libcamera {
+LOG_DEFINE_CATEGORY(V4L2)
+
/**
* \struct V4L2Capability
* \brief struct v4l2_capability object wrapper and helpers
@@ -106,15 +108,16 @@ int V4L2Device::open()
int ret;
if (isOpen()) {
- LOG(Error) << "Device already open";
+ LOG(V4L2, Error) << "Device already open";
return -EBUSY;
}
ret = ::open(devnode_.c_str(), O_RDWR);
if (ret < 0) {
ret = -errno;
- LOG(Error) << "Failed to open V4L2 device '" << devnode_
- << "': " << strerror(-ret);
+ LOG(V4L2, Error)
+ << "Failed to open V4L2 device '" << devnode_
+ << "': " << strerror(-ret);
return ret;
}
fd_ = ret;
@@ -122,22 +125,24 @@ int V4L2Device::open()
ret = ioctl(fd_, VIDIOC_QUERYCAP, &caps_);
if (ret < 0) {
ret = -errno;
- LOG(Error) << "Failed to query device capabilities: "
- << strerror(-ret);
+ LOG(V4L2, Error)
+ << "Failed to query device capabilities: "
+ << strerror(-ret);
return ret;
}
- LOG(Debug) << "Opened '" << devnode_ << "' "
- << caps_.bus_info() << ": " << caps_.driver()
- << ": " << caps_.card();
+ LOG(V4L2, Debug)
+ << "Opened '" << devnode_ << "' "
+ << caps_.bus_info() << ": " << caps_.driver()
+ << ": " << caps_.card();
if (!caps_.isCapture() && !caps_.isOutput()) {
- LOG(Debug) << "Device is not a supported type";
+ LOG(V4L2, Debug) << "Device is not a supported type";
return -EINVAL;
}
if (!caps_.hasStreaming()) {
- LOG(Error) << "Device does not support streaming I/O";
+ LOG(V4L2, Error) << "Device does not support streaming I/O";
return -EINVAL;
}