mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-21 08:56:56 -05:00
resource: improve error handling
Make some more varargs error functions Make pw_resource_error always just send the error to the resource id. Make sure we send errors to the right destination. Add proxy error event and emit it when the core finds an error for the given proxy id. The client error is supposed to be sent to all resources of a client for the given global.
This commit is contained in:
parent
cbdc024f4c
commit
8ae5424359
17 changed files with 107 additions and 64 deletions
|
|
@ -252,23 +252,17 @@ static void core_marshal_done(void *object, uint32_t seq)
|
|||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static void core_marshal_error(void *object, uint32_t id, int res, const char *error, ...)
|
||||
static void core_marshal_error(void *object, uint32_t id, int res, const char *error)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
char buffer[128];
|
||||
struct spa_pod_builder *b;
|
||||
va_list ap;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_ERROR);
|
||||
|
||||
va_start(ap, error);
|
||||
vsnprintf(buffer, sizeof(buffer), error, ap);
|
||||
va_end(ap);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id),
|
||||
SPA_POD_Int(res),
|
||||
SPA_POD_String(buffer));
|
||||
SPA_POD_String(error));
|
||||
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue