mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: add context to debug functions
Add new spa_debugc_ funnctions that take a context. The user should also redefine the spa_debugc macro to handle the context. Use this to let some plugins log the pod and format to the log without using the global logger. Also use this to remove our custom pod logger function by reusing the spa one with a custom context.
This commit is contained in:
parent
f472fd736d
commit
3c67821c4a
14 changed files with 158 additions and 268 deletions
|
|
@ -46,6 +46,9 @@
|
|||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/pod/parser.h>
|
||||
|
||||
#undef spa_debugc
|
||||
#define spa_debugc(l,...) spa_log_debug(l, __VA_ARGS__)
|
||||
#include <spa/debug/pod.h>
|
||||
|
||||
#include "alsa.h"
|
||||
|
|
@ -736,7 +739,7 @@ static int impl_set_param(void *object,
|
|||
SPA_PARAM_PROFILE_index, SPA_POD_Int(&idx),
|
||||
SPA_PARAM_PROFILE_save, SPA_POD_OPT_Bool(&save))) < 0) {
|
||||
spa_log_warn(this->log, "can't parse profile");
|
||||
spa_debug_pod(0, NULL, param);
|
||||
spa_debugc_pod(this->log, 0, NULL, param);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -761,7 +764,7 @@ static int impl_set_param(void *object,
|
|||
SPA_PARAM_ROUTE_props, SPA_POD_OPT_Pod(&props),
|
||||
SPA_PARAM_ROUTE_save, SPA_POD_OPT_Bool(&save))) < 0) {
|
||||
spa_log_warn(this->log, "can't parse route");
|
||||
spa_debug_pod(0, NULL, param);
|
||||
spa_debugc_pod(this->log, 0, NULL, param);
|
||||
return res;
|
||||
}
|
||||
if (device >= this->card->n_devices)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue