Add more generic export-spa example

Replace the v4l2 example with a more generic version that can add
any spa node to a remote graph
Make the dictionary items const
Add some info to nodes and factories. Add the node info to the node
properties. We can then set the media.class directly on the node,
instead of letting the monitor set it.
Debug node info in spa-inspect.
Do async operation on the audiotestsrc and videotestsrc differently.
This commit is contained in:
Wim Taymans 2017-09-07 19:55:22 +02:00
parent 21cd5a2918
commit dc85a79786
19 changed files with 190 additions and 92 deletions

View file

@ -580,9 +580,18 @@ static int impl_node_process_output(struct spa_node *node)
return SPA_RESULT_OK;
}
static const struct spa_dict_item node_info_items[] = {
{ "media.class", "Audio/Sink" },
};
static const struct spa_dict node_info = {
SPA_N_ELEMENTS(node_info_items),
node_info_items
};
static const struct spa_node impl_node = {
SPA_VERSION_NODE,
NULL,
&node_info,
impl_node_get_props,
impl_node_set_props,
impl_node_send_command,
@ -749,10 +758,20 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
return SPA_RESULT_OK;
}
static const struct spa_dict_item info_items[] = {
{ "factory.author", "Wim Taymans <wim.taymans@gmail.com>" },
{ "factory.description", "Record audio with the alsa API" },
};
static const struct spa_dict info = {
SPA_N_ELEMENTS(info_items),
info_items
};
const struct spa_handle_factory spa_alsa_source_factory = {
SPA_VERSION_HANDLE_FACTORY,
NAME,
NULL,
&info,
sizeof(struct state),
impl_init,
impl_enum_interface_info,