spa: add keys for properties

Define and document property keys
This commit is contained in:
Wim Taymans 2019-06-03 16:48:01 +02:00
parent 1f250046a3
commit 49ef8f9b5f
35 changed files with 333 additions and 134 deletions

View file

@ -34,6 +34,8 @@
#include <spa/support/loop.h>
#include <spa/support/log.h>
#include <spa/utils/list.h>
#include <spa/utils/keys.h>
#include <spa/monitor/device.h>
#include <spa/node/node.h>
#include <spa/node/utils.h>
@ -557,9 +559,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", "bluez5" },
{ "media.class", "Audio/Source" },
{ "node.driver", "true" },
{ SPA_KEY_DEVICE_API, "bluez5" },
{ SPA_KEY_MEDIA_CLASS, "Audio/Source" },
{ SPA_KEY_NODE_DRIVER, "true" },
};
static void emit_node_info(struct impl *this, bool full)
@ -1168,7 +1170,7 @@ impl_init(const struct spa_handle_factory *factory,
spa_list_init(&port->free);
for (i = 0; info && i < info->n_items; i++) {
if (strcmp(info->items[i].key, "bluez5.transport") == 0)
if (strcmp(info->items[i].key, SPA_KEY_API_BLUEZ5_TRANSPORT) == 0)
sscanf(info->items[i].value, "%p", &this->transport);
}
if (this->transport == NULL) {
@ -1209,8 +1211,9 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
}
static const struct spa_dict_item info_items[] = {
{ "factory.author", "Collabora Ltd. <contact@collabora.com>" },
{ "factory.description", "Capture bluetooth audio with a2dp" },
{ SPA_KEY_FACTORY_AUTHOR, "Collabora Ltd. <contact@collabora.com>" },
{ SPA_KEY_FACTORY_DESCRIPTION, "Capture bluetooth audio with a2dp" },
{ SPA_KEY_FACTORY_USAGE, SPA_KEY_API_BLUEZ5_TRANSPORT"=<transport>" },
};
static const struct spa_dict info = SPA_DICT_INIT_ARRAY(info_items);