mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
channelmix: implement per channel volume
Implement per channel volume on channelmix. Extend control on stream to take an array of values when possible. Remove name argument from pw_node_new and pw_device_new. We can pass this as a property instead. Improve properties on nodes to more closely match what pulseaudio does. Don't let the monitor do too much with the udev properties but let the session manager set the description and icon-names. Remove some change_mask flags for things that don't change in introspect. Use the flags to mark changes in -cli and -monitor.
This commit is contained in:
parent
1c27f48992
commit
c6a7b3eedb
45 changed files with 737 additions and 367 deletions
|
|
@ -81,7 +81,7 @@ static void *create_object(void *_data,
|
|||
struct factory_data *data = _data;
|
||||
struct pw_core *core = data->core;
|
||||
struct pw_device *device;
|
||||
const char *factory_name, *name;
|
||||
const char *factory_name;
|
||||
struct device_data *nd;
|
||||
int res;
|
||||
|
||||
|
|
@ -92,15 +92,10 @@ static void *create_object(void *_data,
|
|||
if (factory_name == NULL)
|
||||
goto error_properties;
|
||||
|
||||
name = pw_properties_get(properties, PW_KEY_DEVICE_NAME);
|
||||
if (name == NULL)
|
||||
name = "spa-device";
|
||||
|
||||
device = pw_spa_device_load(core,
|
||||
NULL,
|
||||
pw_factory_get_global(data->this),
|
||||
factory_name,
|
||||
name,
|
||||
0,
|
||||
properties,
|
||||
sizeof(struct device_data));
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
#include "spa-monitor.h"
|
||||
#include "spa-device.h"
|
||||
|
||||
#define MODULE_USAGE "<factory> <name> [key=value ...]"
|
||||
#define MODULE_USAGE "<factory> [key=value ...]"
|
||||
|
||||
static const struct spa_dict_item module_props[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
|
|
@ -82,12 +82,12 @@ int pipewire__module_init(struct pw_module *module, const char *args)
|
|||
if (args == NULL)
|
||||
goto error_arguments;
|
||||
|
||||
argv = pw_split_strv(args, " \t", 3, &n_tokens);
|
||||
if (n_tokens < 2)
|
||||
argv = pw_split_strv(args, " \t", 2, &n_tokens);
|
||||
if (n_tokens < 1)
|
||||
goto error_arguments;
|
||||
|
||||
if (n_tokens == 3) {
|
||||
props = pw_properties_new_string(argv[2]);
|
||||
if (n_tokens == 2) {
|
||||
props = pw_properties_new_string(argv[1]);
|
||||
if (props == NULL) {
|
||||
res = -errno;
|
||||
goto error_exit_cleanup;
|
||||
|
|
@ -97,7 +97,7 @@ int pipewire__module_init(struct pw_module *module, const char *args)
|
|||
device = pw_spa_device_load(core,
|
||||
NULL,
|
||||
pw_module_get_global(module),
|
||||
argv[0], argv[1],
|
||||
argv[0],
|
||||
0,
|
||||
props,
|
||||
sizeof(struct device_data));
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ static void *create_object(void *_data,
|
|||
struct factory_data *data = _data;
|
||||
struct pw_core *core = data->core;
|
||||
struct pw_node *node;
|
||||
const char *factory_name, *name;
|
||||
const char *factory_name;
|
||||
struct node_data *nd;
|
||||
int res;
|
||||
|
||||
|
|
@ -110,15 +110,10 @@ static void *create_object(void *_data,
|
|||
if (factory_name == NULL)
|
||||
goto error_properties;
|
||||
|
||||
name = pw_properties_get(properties, PW_KEY_NODE_NAME);
|
||||
if (name == NULL)
|
||||
name = "spa-node";
|
||||
|
||||
node = pw_spa_node_load(core,
|
||||
NULL,
|
||||
pw_factory_get_global(data->this),
|
||||
factory_name,
|
||||
name,
|
||||
PW_SPA_NODE_FLAG_ACTIVATE,
|
||||
properties,
|
||||
sizeof(struct node_data));
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
#include "spa-monitor.h"
|
||||
#include "spa-node.h"
|
||||
|
||||
#define MODULE_USAGE "<factory> <name> [key=value ...]"
|
||||
#define MODULE_USAGE "<factory> [key=value ...]"
|
||||
|
||||
static const struct spa_dict_item module_props[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
|
|
@ -82,12 +82,12 @@ int pipewire__module_init(struct pw_module *module, const char *args)
|
|||
if (args == NULL)
|
||||
goto error_arguments;
|
||||
|
||||
argv = pw_split_strv(args, " \t", 3, &n_tokens);
|
||||
if (n_tokens < 2)
|
||||
argv = pw_split_strv(args, " \t", 2, &n_tokens);
|
||||
if (n_tokens < 1)
|
||||
goto error_arguments;
|
||||
|
||||
if (n_tokens == 3) {
|
||||
props = pw_properties_new_string(argv[2]);
|
||||
if (n_tokens == 2) {
|
||||
props = pw_properties_new_string(argv[1]);
|
||||
if (props == NULL) {
|
||||
res = -errno;
|
||||
goto error_exit_cleanup;
|
||||
|
|
@ -97,7 +97,7 @@ int pipewire__module_init(struct pw_module *module, const char *args)
|
|||
node = pw_spa_node_load(core,
|
||||
NULL,
|
||||
pw_module_get_global(module),
|
||||
argv[0], argv[1],
|
||||
argv[0],
|
||||
PW_SPA_NODE_FLAG_ACTIVATE,
|
||||
props,
|
||||
sizeof(struct node_data));
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ struct pw_device *
|
|||
pw_spa_device_new(struct pw_core *core,
|
||||
struct pw_client *owner,
|
||||
struct pw_global *parent,
|
||||
const char *name,
|
||||
enum pw_spa_device_flags flags,
|
||||
struct spa_device *device,
|
||||
struct spa_handle *handle,
|
||||
|
|
@ -90,7 +89,7 @@ pw_spa_device_new(struct pw_core *core,
|
|||
struct impl *impl;
|
||||
int res;
|
||||
|
||||
this = pw_device_new(core, name, properties, sizeof(struct impl) + user_data_size);
|
||||
this = pw_device_new(core, properties, sizeof(struct impl) + user_data_size);
|
||||
if (this == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -130,7 +129,6 @@ struct pw_device *pw_spa_device_load(struct pw_core *core,
|
|||
struct pw_client *owner,
|
||||
struct pw_global *parent,
|
||||
const char *factory_name,
|
||||
const char *name,
|
||||
enum pw_spa_device_flags flags,
|
||||
struct pw_properties *properties,
|
||||
size_t user_data_size)
|
||||
|
|
@ -148,7 +146,7 @@ struct pw_device *pw_spa_device_load(struct pw_core *core,
|
|||
if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Device, &iface)) < 0)
|
||||
goto error_interface;
|
||||
|
||||
this = pw_spa_device_new(core, owner, parent, name, flags,
|
||||
this = pw_spa_device_new(core, owner, parent, flags,
|
||||
iface, handle, properties, user_data_size);
|
||||
if (this == NULL)
|
||||
goto error_device;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ struct pw_device *
|
|||
pw_spa_device_new(struct pw_core *core,
|
||||
struct pw_client *owner, /**< optional owner */
|
||||
struct pw_global *parent, /**< optional parent */
|
||||
const char *name,
|
||||
enum pw_spa_device_flags flags,
|
||||
struct spa_device *device,
|
||||
struct spa_handle *handle,
|
||||
|
|
@ -55,7 +54,6 @@ pw_spa_device_load(struct pw_core *core,
|
|||
struct pw_client *owner, /**< optional owner */
|
||||
struct pw_global *parent, /**< optional parent */
|
||||
const char *factory_name,
|
||||
const char *name,
|
||||
enum pw_spa_device_flags flags,
|
||||
struct pw_properties *properties,
|
||||
size_t user_data_size);
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ static struct monitor_object *add_object(struct pw_spa_monitor *this, uint32_t i
|
|||
case SPA_TYPE_INTERFACE_Device:
|
||||
{
|
||||
struct pw_device *device;
|
||||
device = pw_spa_device_new(core, NULL, impl->parent, name,
|
||||
device = pw_spa_device_new(core, NULL, impl->parent,
|
||||
0, iface, handle, props, 0);
|
||||
pw_device_add_listener(device, &obj->object_listener,
|
||||
&device_events, obj);
|
||||
|
|
|
|||
|
|
@ -112,7 +112,6 @@ struct pw_node *
|
|||
pw_spa_node_new(struct pw_core *core,
|
||||
struct pw_client *owner,
|
||||
struct pw_global *parent,
|
||||
const char *name,
|
||||
enum pw_spa_node_flags flags,
|
||||
struct spa_node *node,
|
||||
struct spa_handle *handle,
|
||||
|
|
@ -123,7 +122,7 @@ pw_spa_node_new(struct pw_core *core,
|
|||
struct impl *impl;
|
||||
int res;
|
||||
|
||||
this = pw_node_new(core, name, properties, sizeof(struct impl) + user_data_size);
|
||||
this = pw_node_new(core, properties, sizeof(struct impl) + user_data_size);
|
||||
if (this == NULL) {
|
||||
res = -errno;
|
||||
goto error_exit;
|
||||
|
|
@ -246,7 +245,6 @@ struct pw_node *pw_spa_node_load(struct pw_core *core,
|
|||
struct pw_client *owner,
|
||||
struct pw_global *parent,
|
||||
const char *factory_name,
|
||||
const char *name,
|
||||
enum pw_spa_node_flags flags,
|
||||
struct pw_properties *properties,
|
||||
size_t user_data_size)
|
||||
|
|
@ -281,7 +279,7 @@ struct pw_node *pw_spa_node_load(struct pw_core *core,
|
|||
}
|
||||
}
|
||||
|
||||
this = pw_spa_node_new(core, owner, parent, name, flags,
|
||||
this = pw_spa_node_new(core, owner, parent, flags,
|
||||
spa_node, handle, properties, user_data_size);
|
||||
if (this == NULL) {
|
||||
res = -errno;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ struct pw_node *
|
|||
pw_spa_node_new(struct pw_core *core,
|
||||
struct pw_client *owner, /**< optional owner */
|
||||
struct pw_global *parent, /**< optional parent */
|
||||
const char *name,
|
||||
enum pw_spa_node_flags flags,
|
||||
struct spa_node *node,
|
||||
struct spa_handle *handle,
|
||||
|
|
@ -56,7 +55,6 @@ pw_spa_node_load(struct pw_core *core,
|
|||
struct pw_client *owner, /**< optional owner */
|
||||
struct pw_global *parent, /**< optional parent */
|
||||
const char *factory_name,
|
||||
const char *name,
|
||||
enum pw_spa_node_flags flags,
|
||||
struct pw_properties *properties,
|
||||
size_t user_data_size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue