libcamera/src
Tomi Valkeinen ab2a10f007 libcamera: base: log: Fix LogCategory creation issues
Each declaration of a LogCategory will create a new LogCategory, and
will be stored in an unordered_set Logger::categories_. This means that
when a plugin .so is unloaded and loaded, as happens when destructing
and creating a CamereManager, we'll get duplicate categories.

The Logger::registerCategory docs say "Log categories must have unique
names. If a category with the same name already exists this function
performs no operation.". The code does not comply with this.

We solve the issue with two changes:

Change the unordered_set to a vector for simplicity, as there's no need
for an unordered_set.

Instead of using the LogCategory constructor to create new categories in
_LOG_CATEGORY() macro, use a factory method. The factory method will
return either an existing LogCategory if one exists with the given name,
or a newly created one.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-20 02:42:07 +03:00
..
android libcamera: framebuffer: Move remaining private data to Private class 2022-10-10 17:49:49 +03:00
cam cam: dng_writer: Add support for 8-bit raw formats 2022-10-19 21:05:56 +09:00
gstreamer gstreamer: Check gstreamer version before using newer macros 2022-09-12 22:44:53 +05:30
ipa ipa: rkisp1: Downgrade sensor controls range message to Debug 2022-10-19 22:58:52 +03:00
lc-compliance lc-compliance: Only download gtest subproject as a fallback 2022-02-03 18:23:48 +02:00
libcamera libcamera: base: log: Fix LogCategory creation issues 2022-10-20 02:42:07 +03:00
py py: Support controls that are ControlTypeNone 2022-09-30 23:12:05 +03:00
qcam qcam, cam: Move DNGWriter from qcam to cam 2022-10-19 21:05:43 +09:00
v4l2 libcamera: v4l2_pixelformat: Return the list of V4L2 formats 2022-08-03 15:07:20 +02:00
meson.build libcamera: Make IPA module signing recommended instead of mandatory 2022-08-09 16:05:58 +03:00