From e48a1595a67e41de41e87b8fc8022397cba6a382 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 10 Sep 2024 14:49:34 +0200 Subject: [PATCH] spa: v4l2: Add missing v4l2_log_topic_init() call to device/udev impl_init() Wireplumber creates SPA objects of the "api.v4l2.enum.udev" type without ever creating any "api.v4l2.source" objects. This was causing the v4l2_log_topic variable to never get initialized, causing spa_log_xxx() calls in v4l2-udev.c to not work. Call v4l2_log_topic_init() from v4l2-udev's impl_init() to fix this. v4l2-device's impl_init() is also missing a call to v4l2_log_topic_init(), add this as well. Signed-off-by: Hans de Goede --- spa/plugins/v4l2/v4l2-device.c | 1 + spa/plugins/v4l2/v4l2-udev.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/spa/plugins/v4l2/v4l2-device.c b/spa/plugins/v4l2/v4l2-device.c index 2379d2105..4257a01c1 100644 --- a/spa/plugins/v4l2/v4l2-device.c +++ b/spa/plugins/v4l2/v4l2-device.c @@ -231,6 +231,7 @@ impl_init(const struct spa_handle_factory *factory, handle->clear = impl_clear, this = (struct impl *) handle; this->log = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log); + v4l2_log_topic_init(this->log); spa_hook_list_init(&this->hooks); diff --git a/spa/plugins/v4l2/v4l2-udev.c b/spa/plugins/v4l2/v4l2-udev.c index 7118b6239..2ff8438b2 100644 --- a/spa/plugins/v4l2/v4l2-udev.c +++ b/spa/plugins/v4l2/v4l2-udev.c @@ -695,6 +695,8 @@ impl_init(const struct spa_handle_factory *factory, this->notify.fd = -1; this->log = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log); + v4l2_log_topic_init(this->log); + this->main_loop = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Loop); if (this->main_loop == NULL) {