clean up types

This commit is contained in:
Wim Taymans 2017-03-23 21:15:52 +01:00
parent d9a51b5d14
commit acedfe71c0
64 changed files with 756 additions and 752 deletions

View file

@ -52,8 +52,8 @@ typedef struct {
SpaMediaSubtypes media_subtypes;
SpaPropAudio prop_audio;
SpaAudioFormats audio_formats;
SpaNodeEvents node_events;
SpaNodeCommands node_commands;
SpaEventNode event_node;
SpaCommandNode command_node;
SpaAllocParamBuffers alloc_param_buffers;
SpaAllocParamMetaEnable alloc_param_meta_enable;
} URI;
@ -61,22 +61,22 @@ typedef struct {
static inline void
init_uri (URI *uri, SpaIDMap *map)
{
uri->node = spa_id_map_get_id (map, SPA_NODE_URI);
uri->clock = spa_id_map_get_id (map, SPA_CLOCK_URI);
uri->format = spa_id_map_get_id (map, SPA_FORMAT_URI);
uri->props = spa_id_map_get_id (map, SPA_PROPS_URI);
uri->prop_live = spa_id_map_get_id (map, SPA_PROPS__live);
uri->prop_wave = spa_id_map_get_id (map, SPA_PROPS__waveType);
uri->prop_freq = spa_id_map_get_id (map, SPA_PROPS__frequency);
uri->prop_volume = spa_id_map_get_id (map, SPA_PROPS__volume);
uri->wave_sine = spa_id_map_get_id (map, SPA_PROPS__waveType ":sine");
uri->wave_square = spa_id_map_get_id (map, SPA_PROPS__waveType ":square");
uri->node = spa_id_map_get_id (map, SPA_TYPE__Node);
uri->clock = spa_id_map_get_id (map, SPA_TYPE__Clock);
uri->format = spa_id_map_get_id (map, SPA_TYPE__Format);
uri->props = spa_id_map_get_id (map, SPA_TYPE__Props);
uri->prop_live = spa_id_map_get_id (map, SPA_TYPE_PROPS__live);
uri->prop_wave = spa_id_map_get_id (map, SPA_TYPE_PROPS__waveType);
uri->prop_freq = spa_id_map_get_id (map, SPA_TYPE_PROPS__frequency);
uri->prop_volume = spa_id_map_get_id (map, SPA_TYPE_PROPS__volume);
uri->wave_sine = spa_id_map_get_id (map, SPA_TYPE_PROPS__waveType ":sine");
uri->wave_square = spa_id_map_get_id (map, SPA_TYPE_PROPS__waveType ":square");
spa_media_types_fill (&uri->media_types, map);
spa_media_subtypes_map (map, &uri->media_subtypes);
spa_prop_audio_map (map, &uri->prop_audio);
spa_audio_formats_map (map, &uri->audio_formats);
spa_node_events_map (map, &uri->node_events);
spa_node_commands_map (map, &uri->node_commands);
spa_event_node_map (map, &uri->event_node);
spa_command_node_map (map, &uri->command_node);
spa_alloc_param_buffers_map (map, &uri->alloc_param_buffers);
spa_alloc_param_meta_enable_map (map, &uri->alloc_param_meta_enable);
}
@ -116,7 +116,7 @@ struct _SpaAudioTestSrc {
uint8_t props_buffer[512];
SpaAudioTestSrcProps props;
SpaNodeEventCallback event_cb;
SpaEventNodeCallback event_cb;
void *user_data;
SpaSource timer_source;
@ -240,7 +240,7 @@ send_have_output (SpaAudioTestSrc *this)
{
if (this->event_cb) {
SpaEvent event = SPA_EVENT_INIT (this->uri.node_events.HaveOutput);
SpaEvent event = SPA_EVENT_INIT (this->uri.event_node.HaveOutput);
this->event_cb (&this->node, &event, this->user_data);
}
@ -334,7 +334,7 @@ spa_audiotestsrc_node_send_command (SpaNode *node,
this = SPA_CONTAINER_OF (node, SpaAudioTestSrc, node);
if (SPA_COMMAND_TYPE (command) == this->uri.node_commands.Start) {
if (SPA_COMMAND_TYPE (command) == this->uri.command_node.Start) {
struct timespec now;
if (!this->have_format)
@ -358,7 +358,7 @@ spa_audiotestsrc_node_send_command (SpaNode *node,
set_timer (this, true);
update_state (this, SPA_NODE_STATE_STREAMING);
}
else if (SPA_COMMAND_TYPE (command) == this->uri.node_commands.Pause) {
else if (SPA_COMMAND_TYPE (command) == this->uri.command_node.Pause) {
if (!this->have_format)
return SPA_RESULT_NO_FORMAT;
@ -380,7 +380,7 @@ spa_audiotestsrc_node_send_command (SpaNode *node,
static SpaResult
spa_audiotestsrc_node_set_event_callback (SpaNode *node,
SpaNodeEventCallback event_cb,
SpaEventNodeCallback event_cb,
void *user_data)
{
SpaAudioTestSrc *this;
@ -953,11 +953,11 @@ audiotestsrc_init (const SpaHandleFactory *factory,
this = (SpaAudioTestSrc *) handle;
for (i = 0; i < n_support; i++) {
if (strcmp (support[i].uri, SPA_ID_MAP_URI) == 0)
if (strcmp (support[i].uri, SPA_TYPE__IDMap) == 0)
this->map = support[i].data;
else if (strcmp (support[i].uri, SPA_LOG_URI) == 0)
else if (strcmp (support[i].uri, SPA_TYPE__Log) == 0)
this->log = support[i].data;
else if (strcmp (support[i].uri, SPA_LOOP__DataLoop) == 0)
else if (strcmp (support[i].uri, SPA_TYPE_LOOP__DataLoop) == 0)
this->data_loop = support[i].data;
}
if (this->map == NULL) {
@ -998,8 +998,8 @@ audiotestsrc_init (const SpaHandleFactory *factory,
static const SpaInterfaceInfo audiotestsrc_interfaces[] =
{
{ SPA_NODE_URI, },
{ SPA_CLOCK_URI, },
{ SPA_TYPE__Node, },
{ SPA_TYPE__Clock, },
};
static SpaResult