mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-21 08:56:56 -05:00
device: add media.class to global properties
This commit is contained in:
parent
bf43b55d16
commit
417c1cd756
2 changed files with 4 additions and 3 deletions
|
|
@ -111,12 +111,11 @@ pw_spa_device_new(struct pw_core *core,
|
||||||
impl->user_data = SPA_MEMBER(impl, sizeof(struct impl), void);
|
impl->user_data = SPA_MEMBER(impl, sizeof(struct impl), void);
|
||||||
|
|
||||||
pw_device_add_listener(this, &impl->device_listener, &device_events, impl);
|
pw_device_add_listener(this, &impl->device_listener, &device_events, impl);
|
||||||
|
pw_device_set_implementation(this, impl->device);
|
||||||
|
|
||||||
if (!SPA_FLAG_CHECK(impl->flags, PW_SPA_DEVICE_FLAG_NO_REGISTER))
|
if (!SPA_FLAG_CHECK(impl->flags, PW_SPA_DEVICE_FLAG_NO_REGISTER))
|
||||||
pw_device_register(this, impl->owner, impl->parent, NULL);
|
pw_device_register(this, impl->owner, impl->parent, NULL);
|
||||||
|
|
||||||
pw_device_set_implementation(this, impl->device);
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,7 @@ int pw_device_register(struct pw_device *device,
|
||||||
struct pw_properties *properties)
|
struct pw_properties *properties)
|
||||||
{
|
{
|
||||||
struct pw_core *core = device->core;
|
struct pw_core *core = device->core;
|
||||||
|
const char *str;
|
||||||
|
|
||||||
if (properties == NULL)
|
if (properties == NULL)
|
||||||
properties = pw_properties_new(NULL, NULL);
|
properties = pw_properties_new(NULL, NULL);
|
||||||
|
|
@ -162,6 +163,8 @@ int pw_device_register(struct pw_device *device,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
pw_properties_set(properties, "device.name", device->info.name);
|
pw_properties_set(properties, "device.name", device->info.name);
|
||||||
|
if ((str = pw_properties_get(device->properties, "media.class")) != NULL)
|
||||||
|
pw_properties_set(properties, "media.class", str);
|
||||||
|
|
||||||
spa_list_append(&core->device_list, &device->link);
|
spa_list_append(&core->device_list, &device->link);
|
||||||
device->registered = true;
|
device->registered = true;
|
||||||
|
|
@ -294,7 +297,6 @@ static const struct spa_device_callbacks device_callbacks = {
|
||||||
void pw_device_set_implementation(struct pw_device *device, struct spa_device *spa_device)
|
void pw_device_set_implementation(struct pw_device *device, struct spa_device *spa_device)
|
||||||
{
|
{
|
||||||
device->implementation = spa_device;
|
device->implementation = spa_device;
|
||||||
|
|
||||||
spa_device_set_callbacks(device->implementation, &device_callbacks, device);
|
spa_device_set_callbacks(device->implementation, &device_callbacks, device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue