mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
Implement subscription with a signal
Use a signal for subscription events Work on handling OOM errors and other errors.
This commit is contained in:
parent
1b66bbcffd
commit
85d375e4bb
32 changed files with 531 additions and 176 deletions
|
|
@ -123,6 +123,8 @@ module_bind_func (PinosGlobal *global,
|
|||
global->core->uri.module,
|
||||
global->object,
|
||||
NULL);
|
||||
if (resource == NULL)
|
||||
goto no_mem;
|
||||
|
||||
resource->dispatch_func = module_dispatch_func;
|
||||
resource->dispatch_data = global;
|
||||
|
|
@ -141,6 +143,12 @@ module_bind_func (PinosGlobal *global,
|
|||
PINOS_MESSAGE_MODULE_INFO,
|
||||
&m,
|
||||
true);
|
||||
return;
|
||||
|
||||
no_mem:
|
||||
pinos_resource_send_error (resource,
|
||||
SPA_RESULT_NO_MEMORY,
|
||||
"no memory");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -201,6 +209,9 @@ pinos_module_load (PinosCore *core,
|
|||
goto no_pinos_module;
|
||||
|
||||
impl = calloc (1, sizeof (PinosModuleImpl));
|
||||
if (impl == NULL)
|
||||
goto no_mem;
|
||||
|
||||
impl->hnd = hnd;
|
||||
|
||||
this = &impl->this;
|
||||
|
|
@ -229,10 +240,11 @@ not_found:
|
|||
}
|
||||
open_failed:
|
||||
{
|
||||
asprintf (err, "Failed to open module: %s", dlerror ());
|
||||
asprintf (err, "Failed to open module: \"%s\" %s", filename, dlerror ());
|
||||
free (filename);
|
||||
return NULL;
|
||||
}
|
||||
no_mem:
|
||||
no_pinos_module:
|
||||
{
|
||||
asprintf (err, "\"%s\" is not a pinos module", name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue