diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp index 759cccaf..81d8985e 100644 --- a/src/libcamera/sensor/camera_sensor_raw.cpp +++ b/src/libcamera/sensor/camera_sensor_raw.cpp @@ -172,10 +172,12 @@ CameraSensorRaw::~CameraSensorRaw() = default; std::variant, int> CameraSensorRaw::match(MediaEntity *entity) { + using libcamera::_log; + /* Check the entity type. */ if (entity->type() != MediaEntity::Type::V4L2Subdevice || entity->function() != MEDIA_ENT_F_CAM_SENSOR) { - libcamera::LOG(CameraSensor, Debug) + LOG(CameraSensor, Debug) << entity->name() << ": unsupported entity type (" << utils::to_underlying(entity->type()) << ") or function (" << utils::hex(entity->function()) << ")"; @@ -200,7 +202,7 @@ CameraSensorRaw::match(MediaEntity *entity) break; default: - libcamera::LOG(CameraSensor, Debug) + LOG(CameraSensor, Debug) << entity->name() << ": unsupported pad " << pad->index() << " type " << utils::hex(pad->flags()); return { 0 }; @@ -208,7 +210,7 @@ CameraSensorRaw::match(MediaEntity *entity) } if (numSinks < 1 || numSinks > 2 || numSources != 1) { - libcamera::LOG(CameraSensor, Debug) + LOG(CameraSensor, Debug) << entity->name() << ": unsupported number of sinks (" << numSinks << ") or sources (" << numSources << ")"; return { 0 }; diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 1582c03e..b49d73b1 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -1032,6 +1032,8 @@ template std::optional V4L2Device::toColorSpace(const struct v4l2_mb template int V4L2Device::fromColorSpace(const std::optional &colorSpace, T &v4l2Format) { + using libcamera::_log; + v4l2Format.colorspace = V4L2_COLORSPACE_DEFAULT; v4l2Format.xfer_func = V4L2_XFER_FUNC_DEFAULT; v4l2Format.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; @@ -1060,7 +1062,7 @@ int V4L2Device::fromColorSpace(const std::optional &colorSpace, T &v if (itPrimaries != primariesToV4l2.end()) { v4l2Format.colorspace = itPrimaries->second; } else { - libcamera::LOG(V4L2, Warning) + LOG(V4L2, Warning) << "Unrecognised primaries in " << ColorSpace::toString(colorSpace); ret = -EINVAL; @@ -1070,7 +1072,7 @@ int V4L2Device::fromColorSpace(const std::optional &colorSpace, T &v if (itTransfer != transferFunctionToV4l2.end()) { v4l2Format.xfer_func = itTransfer->second; } else { - libcamera::LOG(V4L2, Warning) + LOG(V4L2, Warning) << "Unrecognised transfer function in " << ColorSpace::toString(colorSpace); ret = -EINVAL; @@ -1080,7 +1082,7 @@ int V4L2Device::fromColorSpace(const std::optional &colorSpace, T &v if (itYcbcrEncoding != ycbcrEncodingToV4l2.end()) { v4l2Format.ycbcr_enc = itYcbcrEncoding->second; } else { - libcamera::LOG(V4L2, Warning) + LOG(V4L2, Warning) << "Unrecognised YCbCr encoding in " << ColorSpace::toString(colorSpace); ret = -EINVAL; @@ -1090,7 +1092,7 @@ int V4L2Device::fromColorSpace(const std::optional &colorSpace, T &v if (itRange != rangeToV4l2.end()) { v4l2Format.quantization = itRange->second; } else { - libcamera::LOG(V4L2, Warning) + LOG(V4L2, Warning) << "Unrecognised quantization in " << ColorSpace::toString(colorSpace); ret = -EINVAL;