treewide: Remove libcamera::LOG(...) occurrences

When a class inherits from `Loggable`, it will have a protected `_log()`
function and that will be used instead of the global `_log()` function in the
expansion of the `LOG()` macro. However, if such a class has static member
functions, then simply writing `LOG()` will not work because name lookup will
find the non-static member function and not the global function, resulting in
a compiler error because the non-static member cannot be invoked without an
object, and there is no object in a static member function.

This can be avoided by using `using libcamera::_log;`, thereby bringing the
global declaration into the current scope.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze
2025-03-03 16:08:21 +01:00
parent 6725ea8edd
commit 95bf04298e
2 changed files with 11 additions and 7 deletions

View File

@@ -172,10 +172,12 @@ CameraSensorRaw::~CameraSensorRaw() = default;
std::variant<std::unique_ptr<CameraSensor>, 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 };