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

@ -139,10 +139,10 @@ static void emit_port_info(struct impl *this, struct port *port, bool full)
uint32_t n_items = 0;
if (PORT_IS_DSP(port->direction, port->id)) {
items[n_items++] = SPA_DICT_ITEM_INIT("format.dsp", "32 bit float mono audio");
items[n_items++] = SPA_DICT_ITEM_INIT("audio.channel", port->position);
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_FORMAT_DSP, "32 bit float mono audio");
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_AUDIO_CHANNEL, port->position);
if (port->direction == SPA_DIRECTION_OUTPUT)
items[n_items++] = SPA_DICT_ITEM_INIT("port.monitor", "1");
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_PORT_MONITOR, "1");
}
port->info.props = &SPA_DICT_INIT(items, n_items);

View file

@ -159,8 +159,8 @@ static int init_port(struct impl *this, enum spa_direction direction,
port->info = SPA_PORT_INFO_INIT();
port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS |
SPA_PORT_FLAG_DYNAMIC_DATA;
port->info_props_items[0] = SPA_DICT_ITEM_INIT("format.dsp", "32 bit float mono audio");
port->info_props_items[1] = SPA_DICT_ITEM_INIT("audio.channel", port->position);
port->info_props_items[0] = SPA_DICT_ITEM_INIT(SPA_KEY_FORMAT_DSP, "32 bit float mono audio");
port->info_props_items[1] = SPA_DICT_ITEM_INIT(SPA_KEY_AUDIO_CHANNEL, port->position);
port->info_props = SPA_DICT_INIT(port->info_props_items, 2);
port->info.props = &port->info_props;
port->params[0] = SPA_PARAM_INFO(SPA_PARAM_EnumFormat, SPA_PARAM_INFO_READ);