mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-15 08:56:38 -05:00
improve node io
Unify input and output io areas. Add support for ranges in the io area. Automatically recycle buffers in the output areas in process_output Improve the mixer, add use_buffer support, use a queue of input buffers, fix mixing, add support for ranges. Fix mixer and v4l2 tests
This commit is contained in:
parent
29fbf2e841
commit
01c13adab5
28 changed files with 983 additions and 747 deletions
|
|
@ -472,3 +472,61 @@ spa_debug_dict (const SpaDict *dict)
|
|||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
||||
|
||||
#define DEFAULT_LOG_LEVEL SPA_LOG_LEVEL_TRACE
|
||||
|
||||
static void
|
||||
do_logv (SpaLog *log,
|
||||
SpaLogLevel level,
|
||||
const char *file,
|
||||
int line,
|
||||
const char *func,
|
||||
const char *fmt,
|
||||
va_list args)
|
||||
{
|
||||
char text[16*1024], location[128];
|
||||
static const char *levels[] = {
|
||||
"-",
|
||||
"E",
|
||||
"W",
|
||||
"I",
|
||||
"D",
|
||||
"T",
|
||||
};
|
||||
vsnprintf (text, sizeof(text), fmt, args);
|
||||
if (1) {
|
||||
snprintf (location, sizeof(location), "%s:%i %s()", strrchr (file, '/')+1, line, func);
|
||||
fprintf(stderr, "[%s][%s] %s\n", levels[level], location, text);
|
||||
} else {
|
||||
fprintf(stderr, "[%s] %s\n", levels[level], text);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
do_log (SpaLog *log,
|
||||
SpaLogLevel level,
|
||||
const char *file,
|
||||
int line,
|
||||
const char *func,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start (args, fmt);
|
||||
do_logv (log, level, file, line, func, fmt, args);
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
static SpaLog log = {
|
||||
sizeof (SpaLog),
|
||||
NULL,
|
||||
DEFAULT_LOG_LEVEL,
|
||||
do_log,
|
||||
do_logv,
|
||||
};
|
||||
|
||||
SpaLog *
|
||||
spa_log_get_default (void)
|
||||
{
|
||||
return &log;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ extern "C" {
|
|||
#include <spa/props.h>
|
||||
#include <spa/format.h>
|
||||
#include <spa/dict.h>
|
||||
#include <spa/log.h>
|
||||
|
||||
SpaResult spa_debug_port_info (const SpaPortInfo *info, const SpaTypeMap *map);
|
||||
SpaResult spa_debug_buffer (const SpaBuffer *buffer);
|
||||
|
|
@ -40,6 +41,8 @@ SpaResult spa_debug_format (const SpaFormat *format, const SpaTypeMap *map);
|
|||
SpaResult spa_debug_dump_mem (const void *data, size_t size);
|
||||
SpaResult spa_debug_dict (const SpaDict *dict);
|
||||
|
||||
SpaLog * spa_log_get_default (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue