From e784de3933c154d160abb7972376349da171263a Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 10 Mar 2024 17:32:56 +0200 Subject: [PATCH] spa: use log topics everywhere Use log topics properly everywhere, convert from "#define NAME". --- spa/plugins/audioconvert/test-source.c | 24 +++++++++-------- spa/plugins/audiotestsrc/audiotestsrc.c | 20 ++++++++------- spa/plugins/audiotestsrc/plugin.c | 3 +++ spa/plugins/control/mixer.c | 34 +++++++++++++------------ spa/plugins/control/plugin.c | 3 +++ spa/plugins/ffmpeg/ffmpeg-dec.c | 4 +++ spa/plugins/ffmpeg/ffmpeg-enc.c | 4 +++ spa/plugins/ffmpeg/ffmpeg.c | 3 +++ spa/plugins/jack/jack-device.c | 6 +++-- spa/plugins/jack/jack-sink.c | 18 +++++++------ spa/plugins/jack/jack-source.c | 20 ++++++++------- spa/plugins/jack/plugin.c | 3 +++ spa/plugins/support/dbus.c | 2 ++ spa/plugins/support/evl-plugin.c | 3 +++ spa/plugins/support/evl-system.c | 8 +++--- spa/plugins/support/journal.c | 7 +++-- spa/plugins/support/logger.c | 6 +++-- spa/plugins/support/null-audio-sink.c | 14 +++++----- spa/plugins/test/fakesink.c | 20 ++++++++------- spa/plugins/test/fakesrc.c | 18 +++++++------ spa/plugins/test/plugin.c | 3 +++ spa/plugins/v4l2/v4l2-device.c | 4 ++- spa/plugins/videotestsrc/plugin.c | 3 +++ spa/plugins/videotestsrc/videotestsrc.c | 18 +++++++------ spa/plugins/volume/plugin.c | 3 +++ spa/plugins/volume/volume.c | 18 +++++++------ spa/plugins/vulkan/plugin.c | 3 +++ 27 files changed, 170 insertions(+), 102 deletions(-) diff --git a/spa/plugins/audioconvert/test-source.c b/spa/plugins/audioconvert/test-source.c index d4abf5ba0..a11861c86 100644 --- a/spa/plugins/audioconvert/test-source.c +++ b/spa/plugins/audioconvert/test-source.c @@ -20,7 +20,9 @@ #include #include -#define NAME "test-source" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.test-source"); #define DEFAULT_RATE 44100 #define DEFAULT_CHANNELS 2 @@ -135,7 +137,7 @@ impl_node_add_listener(void *object, spa_return_val_if_fail(this != NULL, -EINVAL); - spa_log_trace(this->log, NAME" %p: add listener %p", this, listener); + spa_log_trace(this->log, "%p: add listener %p", this, listener); spa_hook_list_isolate(&this->hooks, &save, listener, events, data); emit_info(this, true); @@ -494,7 +496,7 @@ impl_node_port_enum_params(void *object, int seq, static int clear_buffers(struct impl *this, struct port *port) { if (port->n_buffers > 0) { - spa_log_debug(this->log, NAME " %p: clear buffers %p", this, port); + spa_log_debug(this->log, "%p: clear buffers %p", this, port); port->n_buffers = 0; spa_list_init(&port->queue); } @@ -571,7 +573,7 @@ static int port_set_format(void *object, port->have_format = true; port->format = info; - spa_log_debug(this->log, NAME " %p: set format on port %d %d", this, port_id, res); + spa_log_debug(this->log, "%p: set format on port %d %d", this, port_id, res); } port->info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS; @@ -599,7 +601,7 @@ impl_node_port_set_param(void *object, spa_return_val_if_fail(object != NULL, -EINVAL); spa_return_val_if_fail(CHECK_PORT(object, direction, port_id), -EINVAL); - spa_log_debug(this->log, NAME" %p: set param %d", this, id); + spa_log_debug(this->log, "%p: set param %d", this, id); switch (id) { case SPA_PARAM_Format: @@ -616,7 +618,7 @@ static void recycle_buffer(struct impl *this, struct port *port, struct buffer * if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) { spa_list_append(&port->queue, &b->link); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT); - spa_log_trace_fp(this->log, NAME " %p: recycle buffer %d", this, b->id); + spa_log_trace_fp(this->log, "%p: recycle buffer %d", this, b->id); } } @@ -637,7 +639,7 @@ impl_node_port_use_buffers(void *object, spa_return_val_if_fail(port->have_format, -EIO); - spa_log_debug(this->log, NAME " %p: use buffers %d on port %d", this, n_buffers, port_id); + spa_log_debug(this->log, "%p: use buffers %d on port %d", this, n_buffers, port_id); clear_buffers(this, port); @@ -659,12 +661,12 @@ impl_node_port_use_buffers(void *object, return -EINVAL; if (d[j].data == NULL) { - spa_log_error(this->log, NAME " %p: invalid memory on buffer %p", this, + spa_log_error(this->log, "%p: invalid memory on buffer %p", this, buffers[i]); return -EINVAL; } if (!SPA_IS_ALIGNED(d[j].data, 16)) { - spa_log_warn(this->log, NAME " %p: memory %d on buffer %d not aligned", + spa_log_warn(this->log, "%p: memory %d on buffer %d not aligned", this, j, i); } } @@ -742,7 +744,7 @@ static int impl_node_process(void *object) if ((io = port->io) == NULL) return -EIO; - spa_log_trace_fp(this->log, NAME " %p: status %d", this, io->status); + spa_log_trace_fp(this->log, "%p: status %d", this, io->status); if (io->status == SPA_STATUS_HAVE_DATA) goto done; @@ -839,7 +841,7 @@ impl_init(const struct spa_handle_factory *factory, spa_atou32(s, &this->quantum_limit, 0); } - spa_log_debug(this->log, NAME " %p: init", this); + spa_log_debug(this->log, "%p: init", this); spa_hook_list_init(&this->hooks); this->node.iface = SPA_INTERFACE_INIT( diff --git a/spa/plugins/audiotestsrc/audiotestsrc.c b/spa/plugins/audiotestsrc/audiotestsrc.c index b45e2b35c..8586ac74d 100644 --- a/spa/plugins/audiotestsrc/audiotestsrc.c +++ b/spa/plugins/audiotestsrc/audiotestsrc.c @@ -25,7 +25,9 @@ #include #include -#define NAME "audiotestsrc" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.audiotestsrc"); #define SAMPLES_TO_TIME(this,s) ((s) * SPA_NSEC_PER_SEC / (port)->current_format.info.raw.rate) #define BYTES_TO_SAMPLES(this,b) ((b)/(port)->bpf) @@ -338,7 +340,7 @@ static int read_timer(struct impl *this) if ((res = spa_system_timerfd_read(this->data_system, this->timer_source.fd, &expirations)) < 0) { if (res != -EAGAIN) - spa_log_error(this->log, NAME " %p: timerfd error: %s", + spa_log_error(this->log, "%p: timerfd error: %s", this, spa_strerror(res)); } } @@ -369,7 +371,7 @@ static int make_buffer(struct impl *this) if (spa_list_is_empty(&port->empty)) { set_timer(this, false); - spa_log_error(this->log, NAME " %p: out of buffers", this); + spa_log_error(this->log, "%p: out of buffers", this); return -EPIPE; } b = spa_list_first(&port->empty, struct buffer, link); @@ -382,7 +384,7 @@ static int make_buffer(struct impl *this) n_bytes = maxsize; - spa_log_trace(this->log, NAME " %p: dequeue buffer %d %d %d", this, b->id, + spa_log_trace(this->log, "%p: dequeue buffer %d %d %d", this, b->id, maxsize, n_bytes); filled = 0; @@ -704,7 +706,7 @@ impl_node_port_enum_params(void *object, int seq, static int clear_buffers(struct impl *this, struct port *port) { if (port->n_buffers > 0) { - spa_log_info(this->log, NAME " %p: clear buffers", this); + spa_log_info(this->log, "%p: clear buffers", this); port->n_buffers = 0; spa_list_init(&port->empty); this->started = false; @@ -837,7 +839,7 @@ impl_node_port_use_buffers(void *object, b->h = spa_buffer_find_meta_data(buffers[i], SPA_META_Header, sizeof(*b->h)); if (d[0].data == NULL) { - spa_log_error(this->log, NAME " %p: invalid memory on buffer %p", this, + spa_log_error(this->log, "%p: invalid memory on buffer %p", this, buffers[i]); return -EINVAL; } @@ -882,7 +884,7 @@ static inline void reuse_buffer(struct impl *this, struct port *port, uint32_t i struct buffer *b = &port->buffers[id]; spa_return_if_fail(b->outstanding); - spa_log_trace(this->log, NAME " %p: reuse buffer %d", this, id); + spa_log_trace(this->log, "%p: reuse buffer %d", this, id); b->outstanding = false; spa_list_append(&port->empty, &b->link); @@ -1102,7 +1104,7 @@ impl_init(const struct spa_handle_factory *factory, port->info.n_params = 5; spa_list_init(&port->empty); - spa_log_info(this->log, NAME " %p: initialized", this); + spa_log_info(this->log, "%p: initialized", this); return 0; } @@ -1141,7 +1143,7 @@ static const struct spa_dict info = SPA_DICT_INIT_ARRAY(info_items); const struct spa_handle_factory spa_audiotestsrc_factory = { SPA_VERSION_HANDLE_FACTORY, - NAME, + "audiotestsrc", &info, impl_get_size, impl_init, diff --git a/spa/plugins/audiotestsrc/plugin.c b/spa/plugins/audiotestsrc/plugin.c index e03174b9b..cf3d95e6a 100644 --- a/spa/plugins/audiotestsrc/plugin.c +++ b/spa/plugins/audiotestsrc/plugin.c @@ -5,9 +5,12 @@ #include #include +#include extern const struct spa_handle_factory spa_audiotestsrc_factory; +SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED; + SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) { diff --git a/spa/plugins/control/mixer.c b/spa/plugins/control/mixer.c index 87b8f1f9d..ec7237978 100644 --- a/spa/plugins/control/mixer.c +++ b/spa/plugins/control/mixer.c @@ -21,7 +21,9 @@ #include #include -#define NAME "control-mixer" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.control-mixer"); #define MAX_BUFFERS 64 #define MAX_PORTS 512 @@ -226,7 +228,7 @@ static int impl_node_add_port(void *object, enum spa_direction direction, uint32 this->last_port = port_id + 1; port->valid = true; - spa_log_debug(this->log, NAME " %p: add port %d %d", this, port_id, this->last_port); + spa_log_debug(this->log, "%p: add port %d %d", this, port_id, this->last_port); emit_port_info(this, port, true); return 0; @@ -260,7 +262,7 @@ impl_node_remove_port(void *object, enum spa_direction direction, uint32_t port_ this->last_port = i + 1; } - spa_log_debug(this->log, NAME " %p: remove port %d %d", this, port_id, this->last_port); + spa_log_debug(this->log, "%p: remove port %d %d", this, port_id, this->last_port); spa_node_emit_port_info(&this->hooks, direction, port_id, NULL); @@ -371,7 +373,7 @@ next: static int clear_buffers(struct impl *this, struct port *port) { if (port->n_buffers > 0) { - spa_log_debug(this->log, NAME " %p: clear buffers %p", this, port); + spa_log_debug(this->log, "%p: clear buffers %p", this, port); port->n_buffers = 0; spa_list_init(&port->queue); } @@ -385,7 +387,7 @@ static int queue_buffer(struct impl *this, struct port *port, struct buffer *b) spa_list_append(&port->queue, &b->link); SPA_FLAG_SET(b->flags, BUFFER_FLAG_QUEUED); - spa_log_trace_fp(this->log, NAME " %p: queue buffer %d", this, b->id); + spa_log_trace_fp(this->log, "%p: queue buffer %d", this, b->id); return 0; } @@ -399,7 +401,7 @@ static struct buffer *dequeue_buffer(struct impl *this, struct port *port) b = spa_list_first(&port->queue, struct buffer, link); spa_list_remove(&b->link); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_QUEUED); - spa_log_trace_fp(this->log, NAME " %p: dequeue buffer %d", this, b->id); + spa_log_trace_fp(this->log, "%p: dequeue buffer %d", this, b->id); return b; } @@ -438,7 +440,7 @@ static int port_set_format(void *object, if (!port->have_format) { this->n_formats++; port->have_format = true; - spa_log_debug(this->log, NAME " %p: set format on port %d:%d", + spa_log_debug(this->log, "%p: set format on port %d:%d", this, direction, port_id); } } @@ -491,7 +493,7 @@ impl_node_port_use_buffers(void *object, port = GET_PORT(this, direction, port_id); - spa_log_debug(this->log, NAME " %p: use buffers %d on port %d:%d", + spa_log_debug(this->log, "%p: use buffers %d on port %d:%d", this, n_buffers, direction, port_id); spa_return_val_if_fail(!this->started || port->io == NULL, -EIO); @@ -513,7 +515,7 @@ impl_node_port_use_buffers(void *object, b->id = i; if (d[0].data == NULL) { - spa_log_error(this->log, NAME " %p: invalid memory on buffer %d", this, i); + spa_log_error(this->log, "%p: invalid memory on buffer %d", this, i); return -EINVAL; } if (direction == SPA_DIRECTION_OUTPUT) @@ -548,7 +550,7 @@ impl_node_port_set_io(void *object, spa_return_val_if_fail(this != NULL, -EINVAL); - spa_log_debug(this->log, NAME " %p: port %d:%d io %d %p/%zd", this, + spa_log_debug(this->log, "%p: port %d:%d io %d %p/%zd", this, direction, port_id, id, data, size); spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL); @@ -634,7 +636,7 @@ static int impl_node_process(void *object) if ((outio = outport->io) == NULL) return -EIO; - spa_log_trace_fp(this->log, NAME " %p: status %p %d %d", + spa_log_trace_fp(this->log, "%p: status %p %d %d", this, outio, outio->status, outio->buffer_id); if (outio->status == SPA_STATUS_HAVE_DATA) @@ -649,7 +651,7 @@ static int impl_node_process(void *object) /* get output buffer */ if ((outb = dequeue_buffer(this, outport)) == NULL) { if (outport->n_buffers > 0) - spa_log_warn(this->log, NAME " %p: out of buffers (%d)", + spa_log_warn(this->log, "%p: out of buffers (%d)", this, outport->n_buffers); return -EPIPE; } @@ -668,7 +670,7 @@ static int impl_node_process(void *object) (inio = inport->io) == NULL || inio->buffer_id >= inport->n_buffers || inio->status != SPA_STATUS_HAVE_DATA) { - spa_log_trace_fp(this->log, NAME " %p: skip input idx:%d valid:%d " + spa_log_trace_fp(this->log, "%p: skip input idx:%d valid:%d " "io:%p status:%d buf_id:%d n_buffers:%d", this, i, inport->valid, inio, inio ? inio->status : -1, @@ -677,20 +679,20 @@ static int impl_node_process(void *object) continue; } - spa_log_trace_fp(this->log, NAME " %p: mix input %d %p->%p %d %d", this, + spa_log_trace_fp(this->log, "%p: mix input %d %p->%p %d %d", this, i, inio, outio, inio->status, inio->buffer_id); d = inport->buffers[inio->buffer_id].buffer->datas; if ((pod = spa_pod_from_data(d->data, d->maxsize, d->chunk->offset, d->chunk->size)) == NULL) { - spa_log_trace_fp(this->log, NAME " %p: skip input idx:%d max:%u " + spa_log_trace_fp(this->log, "%p: skip input idx:%d max:%u " "offset:%u size:%u", this, i, d->maxsize, d->chunk->offset, d->chunk->size); continue; } if (!spa_pod_is_sequence(pod)) { - spa_log_trace_fp(this->log, NAME " %p: skip input idx:%d", this, i); + spa_log_trace_fp(this->log, "%p: skip input idx:%d", this, i); continue; } diff --git a/spa/plugins/control/plugin.c b/spa/plugins/control/plugin.c index 7bcc5e62d..2b19acf2e 100644 --- a/spa/plugins/control/plugin.c +++ b/spa/plugins/control/plugin.c @@ -5,9 +5,12 @@ #include #include +#include extern const struct spa_handle_factory spa_control_mixer_factory; +SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED; + SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) { diff --git a/spa/plugins/ffmpeg/ffmpeg-dec.c b/spa/plugins/ffmpeg/ffmpeg-dec.c index 4c67128f4..61b9a1a65 100644 --- a/spa/plugins/ffmpeg/ffmpeg-dec.c +++ b/spa/plugins/ffmpeg/ffmpeg-dec.c @@ -20,6 +20,10 @@ #include "ffmpeg.h" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.ffmpeg.dec"); + #define IS_VALID_PORT(this,d,id) ((id) == 0) #define GET_IN_PORT(this,p) (&this->in_ports[p]) #define GET_OUT_PORT(this,p) (&this->out_ports[p]) diff --git a/spa/plugins/ffmpeg/ffmpeg-enc.c b/spa/plugins/ffmpeg/ffmpeg-enc.c index 25eff1eec..b9a5e42b0 100644 --- a/spa/plugins/ffmpeg/ffmpeg-enc.c +++ b/spa/plugins/ffmpeg/ffmpeg-enc.c @@ -19,6 +19,10 @@ #include "ffmpeg.h" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.ffmpeg.enc"); + #define IS_VALID_PORT(this,d,id) ((id) == 0) #define GET_IN_PORT(this,p) (&this->in_ports[p]) #define GET_OUT_PORT(this,p) (&this->out_ports[p]) diff --git a/spa/plugins/ffmpeg/ffmpeg.c b/spa/plugins/ffmpeg/ffmpeg.c index e839a0a4f..af3c51bff 100644 --- a/spa/plugins/ffmpeg/ffmpeg.c +++ b/spa/plugins/ffmpeg/ffmpeg.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -104,6 +105,8 @@ static const AVCodec *find_codec_by_index(uint32_t index) } #endif +SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED; + SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) { diff --git a/spa/plugins/jack/jack-device.c b/spa/plugins/jack/jack-device.c index 51e3f8d59..632c00b8e 100644 --- a/spa/plugins/jack/jack-device.c +++ b/spa/plugins/jack/jack-device.c @@ -28,7 +28,9 @@ #include "jack-client.h" -#define NAME "jack-device" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.jack-device"); #define MAX_DEVICES 64 @@ -108,7 +110,7 @@ static int activate_profile(struct impl *this, uint32_t id) res = spa_jack_client_open(&this->client, "PipeWire", NULL); if (res < 0) { - spa_log_error(this->log, NAME" %p: can't open client: %s", + spa_log_error(this->log, "%p: can't open client: %s", this, spa_strerror(res)); return res; } diff --git a/spa/plugins/jack/jack-sink.c b/spa/plugins/jack/jack-sink.c index 51b83779d..ab502315f 100644 --- a/spa/plugins/jack/jack-sink.c +++ b/spa/plugins/jack/jack-sink.c @@ -27,7 +27,9 @@ #include "jack-client.h" -#define NAME "jack-sink" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.jack-sink"); #define MAX_PORTS 128 #define MAX_BUFFERS 8 @@ -404,7 +406,7 @@ static int init_ports(struct impl *this) NULL, JACK_DEFAULT_AUDIO_TYPE, JackPortIsPhysical|JackPortIsInput); if (ports == NULL) { - spa_log_error(this->log, NAME" %p: can't enumerate ports", this); + spa_log_error(this->log, "%p: can't enumerate ports", this); res = -ENODEV; goto exit; } @@ -421,7 +423,7 @@ static int init_ports(struct impl *this) jack_port_type(p), JackPortIsOutput, 0); if (port->jack_port == NULL) { - spa_log_error(this->log, NAME" %p: jack_port_register() %d (%s) failed", + spa_log_error(this->log, "%p: jack_port_register() %d (%s) failed", this, i, ports[i]); res = -EFAULT; goto exit_free; @@ -452,7 +454,7 @@ static int init_ports(struct impl *this) for (i = 0; ports[i]; i++) { struct port *port = GET_IN_PORT(this, i); if (jack_connect(client, jack_port_name(port->jack_port), ports[i])) { - spa_log_warn(this->log, NAME" %p: Failed to connect %s to %s", + spa_log_warn(this->log, "%p: Failed to connect %s to %s", this, jack_port_name(port->jack_port), ports[i]); } } @@ -591,7 +593,7 @@ impl_node_port_enum_params(void *object, int seq, static int clear_buffers(struct impl *this, struct port *port) { if (port->n_buffers > 0) { - spa_log_debug(this->log, NAME " %p: clear buffers", this); + spa_log_debug(this->log, "%p: clear buffers", this); port->n_buffers = 0; this->started = false; } @@ -739,7 +741,7 @@ static int impl_node_process(void *object) uint32_t i; int res = 0; - spa_log_trace(this->log, NAME" %p: process %d", this, this->n_in_ports); + spa_log_trace(this->log, "%p: process %d", this, this->n_in_ports); for (i = 0; i < this->n_in_ports; i++) { struct port *port = GET_IN_PORT(this, i); @@ -758,7 +760,7 @@ static int impl_node_process(void *object) continue; } - spa_log_trace(this->log, NAME" %p: port %d: buffer %d", this, i, io->buffer_id); + spa_log_trace(this->log, "%p: port %d: buffer %d", this, i, io->buffer_id); b = &port->buffers[io->buffer_id]; src = &b->outbuf->datas[0]; @@ -840,7 +842,7 @@ impl_init(const struct spa_handle_factory *factory, sscanf(str, "pointer:%p", &this->client); if (this->client == NULL) { - spa_log_error(this->log, NAME" %p: missing "SPA_KEY_API_JACK_CLIENT + spa_log_error(this->log, "%p: missing "SPA_KEY_API_JACK_CLIENT " property", this); return -EINVAL; } diff --git a/spa/plugins/jack/jack-source.c b/spa/plugins/jack/jack-source.c index 3beea042c..67b3a1992 100644 --- a/spa/plugins/jack/jack-source.c +++ b/spa/plugins/jack/jack-source.c @@ -27,7 +27,9 @@ #include "jack-client.h" -#define NAME "jack-source" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.jack-source"); #define MAX_PORTS 128 #define MAX_BUFFERS 8 @@ -209,7 +211,7 @@ static inline void reuse_buffer(struct impl *this, struct port *port, uint32_t i struct buffer *b = &port->buffers[id]; if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) { - spa_log_trace(this->log, NAME " %p: reuse buffer %d", this, id); + spa_log_trace(this->log, "%p: reuse buffer %d", this, id); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT); spa_list_append(&port->empty, &b->link); } @@ -404,7 +406,7 @@ static int init_ports(struct impl *this) NULL, JACK_DEFAULT_AUDIO_TYPE, JackPortIsPhysical|JackPortIsOutput); if (ports == NULL) { - spa_log_error(this->log, NAME" %p: can't enumerate ports", this); + spa_log_error(this->log, "%p: can't enumerate ports", this); res = -ENODEV; goto exit; } @@ -421,7 +423,7 @@ static int init_ports(struct impl *this) jack_port_type(p), JackPortIsInput, 0); if (port->jack_port == NULL) { - spa_log_error(this->log, NAME" %p: jack_port_register() %d (%s) failed", + spa_log_error(this->log, "%p: jack_port_register() %d (%s) failed", this, i, ports[i]); res = -EFAULT; goto exit_free; @@ -452,7 +454,7 @@ static int init_ports(struct impl *this) for (i = 0; ports[i]; i++) { struct port *port = GET_OUT_PORT(this, i); if (jack_connect(client, ports[i], jack_port_name(port->jack_port))) { - spa_log_warn(this->log, NAME" %p: Failed to connect %s to %s", + spa_log_warn(this->log, "%p: Failed to connect %s to %s", this, jack_port_name(port->jack_port), ports[i]); } } @@ -591,7 +593,7 @@ impl_node_port_enum_params(void *object, int seq, static int clear_buffers(struct impl *this, struct port *port) { if (port->n_buffers > 0) { - spa_log_debug(this->log, NAME " %p: clear buffers", this); + spa_log_debug(this->log, "%p: clear buffers", this); port->n_buffers = 0; spa_list_init(&port->empty); this->started = false; @@ -753,7 +755,7 @@ static int impl_node_process(void *object) uint32_t i; int res = 0; - spa_log_trace(this->log, NAME" %p: process %d", this, this->n_out_ports); + spa_log_trace(this->log, "%p: process %d", this, this->n_out_ports); for (i = 0; i < this->n_out_ports; i++) { struct port *port = GET_OUT_PORT(this, i); @@ -772,7 +774,7 @@ static int impl_node_process(void *object) } if ((b = dequeue_buffer(this, port)) == NULL) { - spa_log_trace(this->log, NAME" %p: out of buffers", this); + spa_log_trace(this->log, "%p: out of buffers", this); io->status = -EPIPE; continue; } @@ -865,7 +867,7 @@ impl_init(const struct spa_handle_factory *factory, sscanf(str, "pointer:%p", &this->client); if (this->client == NULL) { - spa_log_error(this->log, NAME" %p: missing "SPA_KEY_API_JACK_CLIENT + spa_log_error(this->log, "%p: missing "SPA_KEY_API_JACK_CLIENT " property", this); return -EINVAL; } diff --git a/spa/plugins/jack/plugin.c b/spa/plugins/jack/plugin.c index 55481db35..317fcc066 100644 --- a/spa/plugins/jack/plugin.c +++ b/spa/plugins/jack/plugin.c @@ -5,11 +5,14 @@ #include #include +#include extern const struct spa_handle_factory spa_jack_device_factory; extern const struct spa_handle_factory spa_jack_source_factory; extern const struct spa_handle_factory spa_jack_sink_factory; +SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED; + SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) { diff --git a/spa/plugins/support/dbus.c b/spa/plugins/support/dbus.c index 1c5f26eac..d047fca0b 100644 --- a/spa/plugins/support/dbus.c +++ b/spa/plugins/support/dbus.c @@ -558,6 +558,8 @@ static const struct spa_handle_factory dbus_factory = { impl_enum_interface_info, }; +SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED; + SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) { diff --git a/spa/plugins/support/evl-plugin.c b/spa/plugins/support/evl-plugin.c index bdbae4f70..453834623 100644 --- a/spa/plugins/support/evl-plugin.c +++ b/spa/plugins/support/evl-plugin.c @@ -6,9 +6,12 @@ #include #include +#include extern const struct spa_handle_factory spa_support_evl_system_factory; +SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED; + SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) { diff --git a/spa/plugins/support/evl-system.c b/spa/plugins/support/evl-system.c index a5cb9fd5e..b0fade33d 100644 --- a/spa/plugins/support/evl-system.c +++ b/spa/plugins/support/evl-system.c @@ -24,7 +24,9 @@ #include #include -#define NAME "evl-system" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.evl-system"); #define MAX_POLL 512 @@ -465,11 +467,11 @@ impl_init(const struct spa_handle_factory *factory, impl->pid = getpid(); if ((res = evl_init()) < 0) { - spa_log_error(impl->log, NAME " %p: init failed: %s", impl, spa_strerror(res)); + spa_log_error(impl->log, "%p: init failed: %s", impl, spa_strerror(res)); return res; } - spa_log_info(impl->log, NAME " %p: initialized", impl); + spa_log_info(impl->log, "%p: initialized", impl); return 0; } diff --git a/spa/plugins/support/journal.c b/spa/plugins/support/journal.c index fdc865625..b67932114 100644 --- a/spa/plugins/support/journal.c +++ b/spa/plugins/support/journal.c @@ -21,7 +21,9 @@ #include -#define NAME "journal" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.journal"); #define DEFAULT_LOG_LEVEL SPA_LOG_LEVEL_INFO @@ -250,7 +252,7 @@ impl_init(const struct spa_handle_factory *factory, else impl->chain_log = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log); - spa_log_debug(&impl->log, NAME " %p: initialized", impl); + spa_log_debug(&impl->log, "%p: initialized", impl); return 0; } @@ -289,6 +291,7 @@ static const struct spa_handle_factory journal_factory = { .enum_interface_info = impl_enum_interface_info, }; +SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED; SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) diff --git a/spa/plugins/support/logger.c b/spa/plugins/support/logger.c index 04adc70f5..af3e2dc1a 100644 --- a/spa/plugins/support/logger.c +++ b/spa/plugins/support/logger.c @@ -24,7 +24,9 @@ #define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC #endif -#define NAME "logger" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.logger"); #define DEFAULT_LOG_LEVEL SPA_LOG_LEVEL_INFO @@ -357,7 +359,7 @@ impl_init(const struct spa_handle_factory *factory, spa_ringbuffer_init(&this->trace_rb); - spa_log_debug(&this->log, NAME " %p: initialized to %s linebuf:%u", this, dest, linebuf); + spa_log_debug(&this->log, "%p: initialized to %s linebuf:%u", this, dest, linebuf); return 0; } diff --git a/spa/plugins/support/null-audio-sink.c b/spa/plugins/support/null-audio-sink.c index ad2c4db2a..e7f4cff30 100644 --- a/spa/plugins/support/null-audio-sink.c +++ b/spa/plugins/support/null-audio-sink.c @@ -29,7 +29,9 @@ #include #include -#define NAME "null-audio-sink" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.null-audio-sink"); #define DEFAULT_CLOCK_NAME "clock.system.monotonic" @@ -227,7 +229,7 @@ static int reassign_follower(struct impl *this) following = is_following(this); if (following != this->following) { - spa_log_debug(this->log, NAME" %p: reassign follower %d->%d", this, this->following, following); + spa_log_debug(this->log, "%p: reassign follower %d->%d", this, this->following, following); this->following = following; spa_loop_invoke(this->data_loop, do_set_timers, 0, NULL, 0, true, this); } @@ -274,7 +276,7 @@ static void on_timeout(struct spa_source *source) if ((res = spa_system_timerfd_read(this->data_system, this->timer_source.fd, &expirations)) < 0) { if (res != -EAGAIN) - spa_log_error(this->log, NAME " %p: timerfd error: %s", + spa_log_error(this->log, "%p: timerfd error: %s", this, spa_strerror(res)); return; } @@ -573,7 +575,7 @@ impl_node_port_enum_params(void *object, int seq, static int clear_buffers(struct impl *this, struct port *port) { if (port->n_buffers > 0) { - spa_log_info(this->log, NAME " %p: clear buffers", this); + spa_log_info(this->log, "%p: clear buffers", this); port->n_buffers = 0; this->started = false; } @@ -728,7 +730,7 @@ impl_node_port_use_buffers(void *object, b->outbuf = buffers[i]; if (d[0].data == NULL) { - spa_log_error(this->log, NAME " %p: invalid memory on buffer %p", this, + spa_log_error(this->log, "%p: invalid memory on buffer %p", this, buffers[i]); return -EINVAL; } @@ -994,7 +996,7 @@ impl_init(const struct spa_handle_factory *factory, if (this->props.n_pos > 0) this->props.channels = this->props.n_pos; - spa_log_info(this->log, NAME " %p: initialized", this); + spa_log_info(this->log, "%p: initialized", this); return 0; } diff --git a/spa/plugins/test/fakesink.c b/spa/plugins/test/fakesink.c index b90bf9c4c..f71dc3d5e 100644 --- a/spa/plugins/test/fakesink.c +++ b/spa/plugins/test/fakesink.c @@ -22,7 +22,9 @@ #include #include -#define NAME "fakesink" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.fakesink"); struct props { bool live; @@ -205,7 +207,7 @@ static inline int read_timer(struct impl *this) if ((res = spa_system_timerfd_read(this->data_system, this->timer_source.fd, &expirations)) < 0) { if (res != -EAGAIN) - spa_log_error(this->log, NAME " %p: timerfd error: %s", + spa_log_error(this->log, "%p: timerfd error: %s", this, spa_strerror(res)); } } @@ -231,7 +233,7 @@ static int consume_buffer(struct impl *this) spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_DATA); } if (spa_list_is_empty(&port->ready)) { - spa_log_error(this->log, NAME " %p: no buffers", this); + spa_log_error(this->log, "%p: no buffers", this); return -EPIPE; } @@ -240,7 +242,7 @@ static int consume_buffer(struct impl *this) n_bytes = b->outbuf->datas[0].maxsize; - spa_log_trace(this->log, NAME " %p: dequeue buffer %d", this, b->id); + spa_log_trace(this->log, "%p: dequeue buffer %d", this, b->id); render_buffer(this, b); @@ -505,7 +507,7 @@ impl_node_port_enum_params(void *object, int seq, static int clear_buffers(struct impl *this, struct port *port) { if (port->n_buffers > 0) { - spa_log_debug(this->log, NAME " %p: clear buffers", this); + spa_log_debug(this->log, "%p: clear buffers", this); port->n_buffers = 0; spa_list_init(&port->ready); this->started = false; @@ -583,7 +585,7 @@ impl_node_port_use_buffers(void *object, b->h = spa_buffer_find_meta_data(buffers[i], SPA_META_Header, sizeof(*b->h)); if (d[0].data == NULL) { - spa_log_error(this->log, NAME " %p: invalid memory on buffer %p", this, + spa_log_error(this->log, "%p: invalid memory on buffer %p", this, buffers[i]); } } @@ -635,13 +637,13 @@ static int impl_node_process(void *object) struct buffer *b = &port->buffers[io->buffer_id]; if (!b->outstanding) { - spa_log_warn(this->log, NAME " %p: buffer %u in use", this, + spa_log_warn(this->log, "%p: buffer %u in use", this, io->buffer_id); io->status = -EINVAL; return -EINVAL; } - spa_log_trace(this->log, NAME " %p: queue buffer %u", this, io->buffer_id); + spa_log_trace(this->log, "%p: queue buffer %u", this, io->buffer_id); spa_list_append(&port->ready, &b->link); b->outstanding = false; @@ -818,7 +820,7 @@ impl_enum_interface_info(const struct spa_handle_factory *factory, const struct spa_handle_factory spa_fakesink_factory = { SPA_VERSION_HANDLE_FACTORY, - NAME, + "fakesink", NULL, impl_get_size, impl_init, diff --git a/spa/plugins/test/fakesrc.c b/spa/plugins/test/fakesrc.c index 4c912764b..d9658c9fc 100644 --- a/spa/plugins/test/fakesrc.c +++ b/spa/plugins/test/fakesrc.c @@ -22,7 +22,9 @@ #include #include -#define NAME "fakesrc" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.fakesrc"); struct props { bool live; @@ -220,7 +222,7 @@ static inline int read_timer(struct impl *this) if ((res = spa_system_timerfd_read(this->data_system, this->timer_source.fd, &expirations)) < 0) { if (res != -EAGAIN) - spa_log_error(this->log, NAME " %p: timerfd error: %s", + spa_log_error(this->log, "%p: timerfd error: %s", this, spa_strerror(res)); } } @@ -240,7 +242,7 @@ static int make_buffer(struct impl *this) if (spa_list_is_empty(&port->empty)) { set_timer(this, false); this->underrun = true; - spa_log_error(this->log, NAME " %p: out of buffers", this); + spa_log_error(this->log, "%p: out of buffers", this); return -EPIPE; } b = spa_list_first(&port->empty, struct buffer, link); @@ -249,7 +251,7 @@ static int make_buffer(struct impl *this) n_bytes = b->outbuf->datas[0].maxsize; - spa_log_trace(this->log, NAME " %p: dequeue buffer %d", this, b->id); + spa_log_trace(this->log, "%p: dequeue buffer %d", this, b->id); fill_buffer(this, b); @@ -518,7 +520,7 @@ impl_node_port_enum_params(void *object, int seq, static int clear_buffers(struct impl *this, struct port *port) { if (port->n_buffers > 0) { - spa_log_debug(this->log, NAME " %p: clear buffers", this); + spa_log_debug(this->log, "%p: clear buffers", this); port->n_buffers = 0; spa_list_init(&port->empty); this->started = false; @@ -595,7 +597,7 @@ impl_node_port_use_buffers(void *object, b->h = spa_buffer_find_meta_data(buffers[i], SPA_META_Header, sizeof(*b->h)); if (d[0].data == NULL) { - spa_log_error(this->log, NAME " %p: invalid memory on buffer %p", this, + spa_log_error(this->log, "%p: invalid memory on buffer %p", this, buffers[i]); } spa_list_append(&port->empty, &b->link); @@ -633,7 +635,7 @@ static inline void reuse_buffer(struct impl *this, struct port *port, uint32_t i struct buffer *b = &port->buffers[id]; spa_return_if_fail(b->outstanding); - spa_log_trace(this->log, NAME " %p: reuse buffer %d", this, id); + spa_log_trace(this->log, "%p: reuse buffer %d", this, id); b->outstanding = false; spa_list_append(&port->empty, &b->link); @@ -848,7 +850,7 @@ impl_enum_interface_info(const struct spa_handle_factory *factory, const struct spa_handle_factory spa_fakesrc_factory = { SPA_VERSION_HANDLE_FACTORY, - NAME, + "fakesrc", NULL, impl_get_size, impl_init, diff --git a/spa/plugins/test/plugin.c b/spa/plugins/test/plugin.c index 06e3f3468..e770428af 100644 --- a/spa/plugins/test/plugin.c +++ b/spa/plugins/test/plugin.c @@ -5,10 +5,13 @@ #include #include +#include extern const struct spa_handle_factory spa_fakesrc_factory; extern const struct spa_handle_factory spa_fakesink_factory; +SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED; + SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) { diff --git a/spa/plugins/v4l2/v4l2-device.c b/spa/plugins/v4l2/v4l2-device.c index 572d9512d..527cc5974 100644 --- a/spa/plugins/v4l2/v4l2-device.c +++ b/spa/plugins/v4l2/v4l2-device.c @@ -23,7 +23,9 @@ #include "v4l2.h" -#define NAME "v4l2-device" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.v4l2-device"); static const char default_device[] = "/dev/video0"; diff --git a/spa/plugins/videotestsrc/plugin.c b/spa/plugins/videotestsrc/plugin.c index 93656d794..10b1b065f 100644 --- a/spa/plugins/videotestsrc/plugin.c +++ b/spa/plugins/videotestsrc/plugin.c @@ -5,9 +5,12 @@ #include #include +#include extern const struct spa_handle_factory spa_videotestsrc_factory; +SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED; + SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) { diff --git a/spa/plugins/videotestsrc/videotestsrc.c b/spa/plugins/videotestsrc/videotestsrc.c index 9a95aedab..a10c3be63 100644 --- a/spa/plugins/videotestsrc/videotestsrc.c +++ b/spa/plugins/videotestsrc/videotestsrc.c @@ -23,7 +23,9 @@ #include #include -#define NAME "videotestsrc" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.videotestsrc"); #define FRAMES_TO_TIME(port,f) ((port->current_format.info.raw.framerate.denom * (f) * SPA_NSEC_PER_SEC) / \ (port->current_format.info.raw.framerate.num)) @@ -289,7 +291,7 @@ static int read_timer(struct impl *this) if ((res = spa_system_timerfd_read(this->data_system, this->timer_source.fd, &expirations)) < 0) { if (res != -EAGAIN) - spa_log_error(this->log, NAME " %p: timerfd error: %s", + spa_log_error(this->log, "%p: timerfd error: %s", this, spa_strerror(res)); } } @@ -308,7 +310,7 @@ static int make_buffer(struct impl *this) if (spa_list_is_empty(&port->empty)) { set_timer(this, false); - spa_log_error(this->log, NAME " %p: out of buffers", this); + spa_log_error(this->log, "%p: out of buffers", this); return -EPIPE; } b = spa_list_first(&port->empty, struct buffer, link); @@ -317,7 +319,7 @@ static int make_buffer(struct impl *this) n_bytes = b->outbuf->datas[0].maxsize; - spa_log_trace(this->log, NAME " %p: dequeue buffer %d", this, b->id); + spa_log_trace(this->log, "%p: dequeue buffer %d", this, b->id); fill_buffer(this, b); @@ -612,7 +614,7 @@ impl_node_port_enum_params(void *object, int seq, static int clear_buffers(struct impl *this, struct port *port) { if (port->n_buffers > 0) { - spa_log_debug(this->log, NAME " %p: clear buffers", this); + spa_log_debug(this->log, "%p: clear buffers", this); port->n_buffers = 0; spa_list_init(&port->empty); this->started = false; @@ -729,7 +731,7 @@ impl_node_port_use_buffers(void *object, b->h = spa_buffer_find_meta_data(buffers[i], SPA_META_Header, sizeof(*b->h)); if (d[0].data == NULL) { - spa_log_error(this->log, NAME " %p: invalid memory on buffer %p", this, + spa_log_error(this->log, "%p: invalid memory on buffer %p", this, buffers[i]); return -EINVAL; } @@ -769,7 +771,7 @@ static inline void reuse_buffer(struct impl *this, struct port *port, uint32_t i struct buffer *b = &port->buffers[id]; spa_return_if_fail(b->outstanding); - spa_log_trace(this->log, NAME " %p: reuse buffer %d", this, id); + spa_log_trace(this->log, "%p: reuse buffer %d", this, id); b->outstanding = false; spa_list_append(&port->empty, &b->link); @@ -990,7 +992,7 @@ static const struct spa_dict info = SPA_DICT_INIT_ARRAY(info_items); const struct spa_handle_factory spa_videotestsrc_factory = { SPA_VERSION_HANDLE_FACTORY, - NAME, + "videotestsrc", &info, impl_get_size, impl_init, diff --git a/spa/plugins/volume/plugin.c b/spa/plugins/volume/plugin.c index d8f1f8b4b..0791894ab 100644 --- a/spa/plugins/volume/plugin.c +++ b/spa/plugins/volume/plugin.c @@ -5,9 +5,12 @@ #include #include +#include extern const struct spa_handle_factory spa_volume_factory; +SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED; + SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) { diff --git a/spa/plugins/volume/volume.c b/spa/plugins/volume/volume.c index 31c3af175..db582ffa5 100644 --- a/spa/plugins/volume/volume.c +++ b/spa/plugins/volume/volume.c @@ -17,7 +17,9 @@ #include #include -#define NAME "volume" +#undef SPA_LOG_TOPIC_DEFAULT +#define SPA_LOG_TOPIC_DEFAULT &log_topic +SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.volume"); #define DEFAULT_RATE 48000 #define DEFAULT_CHANNELS 2 @@ -417,7 +419,7 @@ impl_node_port_enum_params(void *object, int seq, static int clear_buffers(struct impl *this, struct port *port) { if (port->n_buffers > 0) { - spa_log_debug(this->log, NAME " %p: clear buffers", this); + spa_log_debug(this->log, "%p: clear buffers", this); port->n_buffers = 0; spa_list_init(&port->empty); } @@ -529,7 +531,7 @@ impl_node_port_use_buffers(void *object, b->ptr = d[0].data; b->size = d[0].maxsize; } else { - spa_log_error(this->log, NAME " %p: invalid memory on buffer %p", this, + spa_log_error(this->log, "%p: invalid memory on buffer %p", this, buffers[i]); return -EINVAL; } @@ -572,13 +574,13 @@ static void recycle_buffer(struct impl *this, uint32_t id) struct buffer *b = &port->buffers[id]; if (!SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) { - spa_log_warn(this->log, NAME " %p: buffer %d not outstanding", this, id); + spa_log_warn(this->log, "%p: buffer %d not outstanding", this, id); return; } spa_list_append(&port->empty, &b->link); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT); - spa_log_trace(this->log, NAME " %p: recycle buffer %d", this, id); + spa_log_trace(this->log, "%p: recycle buffer %d", this, id); } static int impl_node_port_reuse_buffer(void *object, uint32_t port_id, uint32_t buffer_id) @@ -695,13 +697,13 @@ static int impl_node_process(void *object) } if ((dbuf = find_free_buffer(this, out_port)) == NULL) { - spa_log_error(this->log, NAME " %p: out of buffers", this); + spa_log_error(this->log, "%p: out of buffers", this); return -EPIPE; } sbuf = &in_port->buffers[input->buffer_id]; - spa_log_trace(this->log, NAME " %p: do volume %d -> %d", this, sbuf->id, dbuf->id); + spa_log_trace(this->log, "%p: do volume %d -> %d", this, sbuf->id, dbuf->id); do_volume(this, dbuf->outbuf, sbuf->outbuf); output->buffer_id = dbuf->id; @@ -866,7 +868,7 @@ impl_enum_interface_info(const struct spa_handle_factory *factory, const struct spa_handle_factory spa_volume_factory = { SPA_VERSION_HANDLE_FACTORY, - NAME, + "volume", NULL, impl_get_size, impl_init, diff --git a/spa/plugins/vulkan/plugin.c b/spa/plugins/vulkan/plugin.c index 379f24435..89a36e256 100644 --- a/spa/plugins/vulkan/plugin.c +++ b/spa/plugins/vulkan/plugin.c @@ -5,12 +5,15 @@ #include #include +#include extern const struct spa_handle_factory spa_vulkan_compute_filter_factory; extern const struct spa_handle_factory spa_vulkan_compute_source_factory; extern const struct spa_handle_factory spa_vulkan_blit_filter_factory; extern const struct spa_handle_factory spa_vulkan_blit_dsp_filter_factory; +SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED; + SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) {