mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
spa: add keys for properties
Define and document property keys
This commit is contained in:
parent
1f250046a3
commit
49ef8f9b5f
35 changed files with 333 additions and 134 deletions
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
#include <spa/node/node.h>
|
||||
#include <spa/node/utils.h>
|
||||
#include <spa/monitor/device.h>
|
||||
#include <spa/utils/keys.h>
|
||||
#include <spa/param/audio/format.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/debug/pod.h>
|
||||
|
|
@ -226,9 +228,9 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
|
|||
}
|
||||
|
||||
static const struct spa_dict_item node_info_items[] = {
|
||||
{ "device.api", "alsa" },
|
||||
{ "media.class", "Audio/Sink" },
|
||||
{ "node.driver", "true" },
|
||||
{ SPA_KEY_DEVICE_API, "alsa" },
|
||||
{ SPA_KEY_MEDIA_CLASS, "Audio/Sink" },
|
||||
{ SPA_KEY_NODE_DRIVER, "true" },
|
||||
};
|
||||
|
||||
static void emit_node_info(struct state *this, bool full)
|
||||
|
|
@ -761,7 +763,7 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
spa_list_init(&this->ready);
|
||||
|
||||
for (i = 0; info && i < info->n_items; i++) {
|
||||
if (!strcmp(info->items[i].key, "alsa.device")) {
|
||||
if (!strcmp(info->items[i].key, SPA_KEY_API_ALSA_PATH)) {
|
||||
snprintf(this->props.device, 63, "%s", info->items[i].value);
|
||||
}
|
||||
}
|
||||
|
|
@ -793,8 +795,9 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
|
|||
}
|
||||
|
||||
static const struct spa_dict_item info_items[] = {
|
||||
{ "factory.author", "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ "factory.description", "Play audio with the alsa API" },
|
||||
{ SPA_KEY_FACTORY_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ SPA_KEY_FACTORY_DESCRIPTION, "Play audio with the alsa API" },
|
||||
{ SPA_KEY_FACTORY_USAGE, "["SPA_KEY_API_ALSA_PATH"=<path>]" },
|
||||
};
|
||||
|
||||
static const struct spa_dict info = SPA_DICT_INIT_ARRAY(info_items);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue