mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
Fix proxy ids
The proxy/resource ids are generated by the client and so we need to used them as index in the client resource map instead of making our own number. Fix stream disconnect and client-node destroy Fix gstreamer device provider Make all sockets non-blocking to avoid errors with bad clients Advertise the subsystems we monitor and disable the gstreamer monitors. Implement core properties updates Make sure we send REMOVE_ID after we are done with the resource.
This commit is contained in:
parent
e579efea10
commit
4b55d7c4da
18 changed files with 222 additions and 69 deletions
|
|
@ -116,8 +116,14 @@ pinos__module_init (PinosModule * module, const char * args)
|
|||
pinos_free_strv (tmp_argv);
|
||||
}
|
||||
|
||||
pinos_spa_monitor_load (module->core, "build/spa/plugins/alsa/libspa-alsa.so", "alsa-monitor");
|
||||
pinos_spa_monitor_load (module->core, "build/spa/plugins/v4l2/libspa-v4l2.so", "v4l2-monitor");
|
||||
pinos_spa_monitor_load (module->core,
|
||||
"build/spa/plugins/alsa/libspa-alsa.so",
|
||||
"alsa-monitor",
|
||||
"alsa");
|
||||
pinos_spa_monitor_load (module->core,
|
||||
"build/spa/plugins/v4l2/libspa-v4l2.so",
|
||||
"v4l2-monitor",
|
||||
"v4l2");
|
||||
pinos_spa_node_load (module->core,
|
||||
"build/spa/plugins/audiotestsrc/libspa-audiotestsrc.so",
|
||||
"audiotestsrc",
|
||||
|
|
|
|||
|
|
@ -81,17 +81,19 @@ add_item (PinosSpaMonitor *this, SpaMonitorItem *item)
|
|||
pinos_log_info ("no CLOCK interface: %d", res);
|
||||
}
|
||||
|
||||
props = pinos_properties_new (NULL, NULL);
|
||||
|
||||
if (item->info) {
|
||||
unsigned int i;
|
||||
|
||||
props = pinos_properties_new (NULL, NULL);
|
||||
|
||||
for (i = 0; i < item->info->n_items; i++)
|
||||
pinos_properties_set (props,
|
||||
item->info->items[i].key,
|
||||
item->info->items[i].value);
|
||||
}
|
||||
|
||||
pinos_properties_set (props, "media.class", item->klass);
|
||||
|
||||
mitem = calloc (1, sizeof (PinosSpaMonitorItem));
|
||||
mitem->id = strdup (item->id);
|
||||
mitem->node = pinos_node_new (impl->core,
|
||||
|
|
@ -168,10 +170,31 @@ on_monitor_event (SpaMonitor *monitor,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_monitor (PinosCore *core,
|
||||
const char *name)
|
||||
{
|
||||
PinosProperties *props;
|
||||
const char *monitors;
|
||||
|
||||
if (!(props = core->properties))
|
||||
props = pinos_properties_new (NULL, NULL);
|
||||
|
||||
monitors = pinos_properties_get (props, "monitors");
|
||||
|
||||
if (monitors == NULL)
|
||||
pinos_properties_setf (props, "monitors", "%s", name);
|
||||
else
|
||||
pinos_properties_setf (props, "monitors", "%s,%s", monitors, name);
|
||||
|
||||
pinos_core_update_properties (core, &props->dict);
|
||||
}
|
||||
|
||||
PinosSpaMonitor *
|
||||
pinos_spa_monitor_load (PinosCore *core,
|
||||
const char *lib,
|
||||
const char *factory_name)
|
||||
const char *factory_name,
|
||||
const char *system_name)
|
||||
{
|
||||
PinosSpaMonitorImpl *impl;
|
||||
PinosSpaMonitor *this;
|
||||
|
|
@ -226,8 +249,11 @@ pinos_spa_monitor_load (PinosCore *core,
|
|||
this->monitor = iface;
|
||||
this->lib = strdup (lib);
|
||||
this->factory_name = strdup (factory_name);
|
||||
this->system_name = strdup (system_name);
|
||||
this->handle = handle;
|
||||
|
||||
update_monitor (core, this->system_name);
|
||||
|
||||
spa_list_init (&impl->item_list);
|
||||
|
||||
state = NULL;
|
||||
|
|
@ -273,6 +299,7 @@ pinos_spa_monitor_destroy (PinosSpaMonitor * monitor)
|
|||
free (monitor->handle);
|
||||
free (monitor->lib);
|
||||
free (monitor->factory_name);
|
||||
free (monitor->system_name);
|
||||
|
||||
dlclose (impl->hnd);
|
||||
free (impl);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ struct _PinosSpaMonitor {
|
|||
|
||||
char *lib;
|
||||
char *factory_name;
|
||||
char *system_name;
|
||||
SpaHandle *handle;
|
||||
|
||||
PINOS_SIGNAL (destroy_signal, (PinosListener *listener, PinosSpaMonitor *monitor));
|
||||
|
|
@ -41,7 +42,8 @@ struct _PinosSpaMonitor {
|
|||
|
||||
PinosSpaMonitor * pinos_spa_monitor_load (PinosCore *core,
|
||||
const char *lib,
|
||||
const char *factory_name);
|
||||
const char *factory_name,
|
||||
const char *system_name);
|
||||
void pinos_spa_monitor_destroy (PinosSpaMonitor *monitor);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue