mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-18 07:00:06 -05:00
clean up types
This commit is contained in:
parent
d9a51b5d14
commit
acedfe71c0
64 changed files with 756 additions and 752 deletions
|
|
@ -307,7 +307,7 @@ registry_event_global (void *object,
|
|||
|
||||
pinos_log_debug ("got global %u %s", id, type);
|
||||
|
||||
if (!strcmp (type, PINOS_NODE_URI)) {
|
||||
if (!strcmp (type, PINOS_TYPE__Node)) {
|
||||
proxy = pinos_proxy_new (this,
|
||||
SPA_ID_INVALID,
|
||||
this->uri.node);
|
||||
|
|
@ -315,7 +315,7 @@ registry_event_global (void *object,
|
|||
goto no_mem;
|
||||
|
||||
proxy->implementation = &node_events;
|
||||
} else if (!strcmp (type, PINOS_MODULE_URI)) {
|
||||
} else if (!strcmp (type, PINOS_TYPE__Module)) {
|
||||
proxy = pinos_proxy_new (this,
|
||||
SPA_ID_INVALID,
|
||||
this->uri.module);
|
||||
|
|
@ -323,7 +323,7 @@ registry_event_global (void *object,
|
|||
goto no_mem;
|
||||
|
||||
proxy->implementation = &module_events;
|
||||
} else if (!strcmp (type, PINOS_CLIENT_URI)) {
|
||||
} else if (!strcmp (type, PINOS_TYPE__Client)) {
|
||||
proxy = pinos_proxy_new (this,
|
||||
SPA_ID_INVALID,
|
||||
this->uri.client);
|
||||
|
|
@ -331,7 +331,7 @@ registry_event_global (void *object,
|
|||
goto no_mem;
|
||||
|
||||
proxy->implementation = &client_events;
|
||||
} else if (!strcmp (type, PINOS_LINK_URI)) {
|
||||
} else if (!strcmp (type, PINOS_TYPE__Link)) {
|
||||
proxy = pinos_proxy_new (this,
|
||||
SPA_ID_INVALID,
|
||||
this->uri.link);
|
||||
|
|
|
|||
|
|
@ -354,12 +354,12 @@ send_need_input (PinosStream *stream)
|
|||
{
|
||||
#if 0
|
||||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
SpaNodeEventNeedInput ni;
|
||||
SpaEventNodeNeedInput ni;
|
||||
uint64_t cmd = 1;
|
||||
|
||||
pinos_log_debug ("stream %p: need input", stream);
|
||||
|
||||
ni.event.type = SPA_NODE_EVENT_NEED_INPUT;
|
||||
ni.event.type = SPA_EVENT_NODE_NEED_INPUT;
|
||||
ni.event.size = sizeof (ni);
|
||||
pinos_transport_add_event (impl->trans, &ni.event);
|
||||
write (impl->rtfd, &cmd, 8);
|
||||
|
|
@ -371,12 +371,12 @@ send_have_output (PinosStream *stream)
|
|||
{
|
||||
#if 0
|
||||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
SpaNodeEventHaveOutput ho;
|
||||
SpaEventNodeHaveOutput ho;
|
||||
uint64_t cmd = 1;
|
||||
|
||||
pinos_log_debug ("stream %p: have output", stream);
|
||||
|
||||
ho.event.type = SPA_NODE_EVENT_HAVE_OUTPUT;
|
||||
ho.event.type = SPA_EVENT_NODE_HAVE_OUTPUT;
|
||||
ho.event.size = sizeof (ho);
|
||||
pinos_transport_add_event (impl->trans, &ho.event);
|
||||
write (impl->rtfd, &cmd, 8);
|
||||
|
|
@ -387,9 +387,9 @@ static void
|
|||
add_request_clock_update (PinosStream *stream, bool flush)
|
||||
{
|
||||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
SpaNodeEventRequestClockUpdate rcu =
|
||||
SPA_NODE_EVENT_REQUEST_CLOCK_UPDATE_INIT (stream->context->uri.node_events.RequestClockUpdate,
|
||||
SPA_NODE_EVENT_REQUEST_CLOCK_UPDATE_TIME, 0, 0);
|
||||
SpaEventNodeRequestClockUpdate rcu =
|
||||
SPA_EVENT_NODE_REQUEST_CLOCK_UPDATE_INIT (stream->context->uri.event_node.RequestClockUpdate,
|
||||
SPA_EVENT_NODE_REQUEST_CLOCK_UPDATE_TIME, 0, 0);
|
||||
|
||||
pinos_client_node_do_event (impl->node_proxy, (SpaEvent*)&rcu);
|
||||
}
|
||||
|
|
@ -401,8 +401,8 @@ add_async_complete (PinosStream *stream,
|
|||
bool flush)
|
||||
{
|
||||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
SpaNodeEventAsyncComplete ac =
|
||||
SPA_NODE_EVENT_ASYNC_COMPLETE_INIT (stream->context->uri.node_events.AsyncComplete,
|
||||
SpaEventNodeAsyncComplete ac =
|
||||
SPA_EVENT_NODE_ASYNC_COMPLETE_INIT (stream->context->uri.event_node.AsyncComplete,
|
||||
seq, res);
|
||||
pinos_client_node_do_event (impl->node_proxy, (SpaEvent*)&ac);
|
||||
}
|
||||
|
|
@ -470,7 +470,7 @@ handle_rtnode_event (PinosStream *stream,
|
|||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
PinosContext *context = impl->this.context;
|
||||
|
||||
if (SPA_EVENT_TYPE (event) == context->uri.node_events.HaveOutput) {
|
||||
if (SPA_EVENT_TYPE (event) == context->uri.event_node.HaveOutput) {
|
||||
int i;
|
||||
|
||||
//pinos_log_debug ("stream %p: have output", stream);
|
||||
|
|
@ -486,12 +486,12 @@ handle_rtnode_event (PinosStream *stream,
|
|||
}
|
||||
send_need_input (stream);
|
||||
}
|
||||
else if (SPA_EVENT_TYPE (event) == context->uri.node_events.NeedInput) {
|
||||
else if (SPA_EVENT_TYPE (event) == context->uri.event_node.NeedInput) {
|
||||
//pinos_log_debug ("stream %p: need input", stream);
|
||||
pinos_signal_emit (&stream->need_buffer, stream);
|
||||
}
|
||||
else if (SPA_EVENT_TYPE (event) == context->uri.node_events.ReuseBuffer) {
|
||||
SpaNodeEventReuseBuffer *p = (SpaNodeEventReuseBuffer *) event;
|
||||
else if (SPA_EVENT_TYPE (event) == context->uri.event_node.ReuseBuffer) {
|
||||
SpaEventNodeReuseBuffer *p = (SpaEventNodeReuseBuffer *) event;
|
||||
BufferId *bid;
|
||||
|
||||
if (p->body.port_id.value != impl->port_id)
|
||||
|
|
@ -580,14 +580,14 @@ handle_node_command (PinosStream *stream,
|
|||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
PinosContext *context = stream->context;
|
||||
|
||||
if (SPA_COMMAND_TYPE (command) == context->uri.node_commands.Pause) {
|
||||
if (SPA_COMMAND_TYPE (command) == context->uri.command_node.Pause) {
|
||||
pinos_log_debug ("stream %p: pause %d", stream, seq);
|
||||
|
||||
add_state_change (stream, SPA_NODE_STATE_PAUSED, false);
|
||||
add_async_complete (stream, seq, SPA_RESULT_OK, true);
|
||||
stream_set_state (stream, PINOS_STREAM_STATE_PAUSED, NULL);
|
||||
}
|
||||
else if (SPA_COMMAND_TYPE (command) == context->uri.node_commands.Start) {
|
||||
else if (SPA_COMMAND_TYPE (command) == context->uri.command_node.Start) {
|
||||
pinos_log_debug ("stream %p: start %d", stream, seq);
|
||||
add_state_change (stream, SPA_NODE_STATE_STREAMING, false);
|
||||
add_async_complete (stream, seq, SPA_RESULT_OK, true);
|
||||
|
|
@ -597,9 +597,9 @@ handle_node_command (PinosStream *stream,
|
|||
|
||||
stream_set_state (stream, PINOS_STREAM_STATE_STREAMING, NULL);
|
||||
}
|
||||
else if (SPA_COMMAND_TYPE (command) == context->uri.node_commands.ClockUpdate) {
|
||||
SpaNodeCommandClockUpdate *cu = (SpaNodeCommandClockUpdate *) command;
|
||||
if (cu->body.flags.value & SPA_NODE_COMMAND_CLOCK_UPDATE_FLAG_LIVE) {
|
||||
else if (SPA_COMMAND_TYPE (command) == context->uri.command_node.ClockUpdate) {
|
||||
SpaCommandNodeClockUpdate *cu = (SpaCommandNodeClockUpdate *) command;
|
||||
if (cu->body.flags.value & SPA_COMMAND_NODE_CLOCK_UPDATE_FLAG_LIVE) {
|
||||
pinos_properties_set (stream->properties,
|
||||
"pinos.latency.is-live", "1");
|
||||
pinos_properties_setf (stream->properties,
|
||||
|
|
@ -1125,7 +1125,7 @@ pinos_stream_recycle_buffer (PinosStream *stream,
|
|||
uint32_t id)
|
||||
{
|
||||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
SpaNodeEventReuseBuffer rb = SPA_NODE_EVENT_REUSE_BUFFER_INIT (stream->context->uri.node_events.ReuseBuffer,
|
||||
SpaEventNodeReuseBuffer rb = SPA_EVENT_NODE_REUSE_BUFFER_INIT (stream->context->uri.event_node.ReuseBuffer,
|
||||
impl->port_id, id);
|
||||
uint64_t cmd = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -26,21 +26,23 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define PINOS_CORE_URI "http://pinos.org/ns/core"
|
||||
#define PINOS_CORE_PREFIX PINOS_CORE_URI "#"
|
||||
#define PINOS_CORE_REGISTRY PINOS_CORE_PREFIX "Registry"
|
||||
#define PINOS_TYPE__Core "Pinos:Object:Core"
|
||||
#define PINOS_TYPE_CORE_BASE PINOS_TYPE__Core ":"
|
||||
|
||||
#define PINOS_NODE_URI "http://pinos.org/ns/node"
|
||||
#define PINOS_NODE_PREFIX PINOS_NODE_URI "#"
|
||||
#define PINOS_TYPE__Registry "Pinos:Object:Registry"
|
||||
#define PINOS_TYPE_REGISYRY_BASE PINOS_TYPE__Registry ":"
|
||||
|
||||
#define PINOS_CLIENT_URI "http://pinos.org/ns/client"
|
||||
#define PINOS_CLIENT_PREFIX PINOS_CLIENT_URI "#"
|
||||
#define PINOS_TYPE__Node "Pinos:Object:Node"
|
||||
#define PINOS_TYPE_NODE_BASE PINOS_TYPE__Node ":"
|
||||
|
||||
#define PINOS_LINK_URI "http://pinos.org/ns/link"
|
||||
#define PINOS_LINK_PREFIX PINOS_LINK_URI "#"
|
||||
#define PINOS_TYPE__Client "Pinos:Object:Client"
|
||||
#define PINOS_TYPE_CLIENT_BASE PINOS_TYPE__Client ":"
|
||||
|
||||
#define PINOS_MODULE_URI "http://pinos.org/ns/module"
|
||||
#define PINOS_MODULE_PREFIX PINOS_MODULE_URI "#"
|
||||
#define PINOS_TYPE__Link "Pinos:Object:Link"
|
||||
#define PINOS_TYPE_LINK_BASE PINOS_TYPE__Link ":"
|
||||
|
||||
#define PINOS_TYPE__Module "Pinos:Object:Module"
|
||||
#define PINOS_TYPE_MODULE_BASE PINOS_TYPE__Module ":"
|
||||
|
||||
typedef enum {
|
||||
PINOS_SUBSCRIPTION_EVENT_NEW = 0,
|
||||
|
|
|
|||
|
|
@ -36,21 +36,21 @@ pinos_uri_init (PinosURI *uri)
|
|||
{
|
||||
uri->map = pinos_id_map_get_default();
|
||||
|
||||
uri->core = spa_id_map_get_id (uri->map, PINOS_CORE_URI);
|
||||
uri->registry = spa_id_map_get_id (uri->map, PINOS_CORE_REGISTRY);
|
||||
uri->node = spa_id_map_get_id (uri->map, PINOS_NODE_URI);
|
||||
uri->node_factory = spa_id_map_get_id (uri->map, PINOS_NODE_FACTORY_URI);
|
||||
uri->link = spa_id_map_get_id (uri->map, PINOS_LINK_URI);
|
||||
uri->client = spa_id_map_get_id (uri->map, PINOS_CLIENT_URI);
|
||||
uri->client_node = spa_id_map_get_id (uri->map, PINOS_CLIENT_NODE_URI);
|
||||
uri->module = spa_id_map_get_id (uri->map, PINOS_MODULE_URI);
|
||||
uri->core = spa_id_map_get_id (uri->map, PINOS_TYPE__Core);
|
||||
uri->registry = spa_id_map_get_id (uri->map, PINOS_TYPE__Registry);
|
||||
uri->node = spa_id_map_get_id (uri->map, PINOS_TYPE__Node);
|
||||
uri->node_factory = spa_id_map_get_id (uri->map, PINOS_TYPE__NodeFactory);
|
||||
uri->link = spa_id_map_get_id (uri->map, PINOS_TYPE__Link);
|
||||
uri->client = spa_id_map_get_id (uri->map, PINOS_TYPE__Client);
|
||||
uri->client_node = spa_id_map_get_id (uri->map, PINOS_TYPE__ClientNode);
|
||||
uri->module = spa_id_map_get_id (uri->map, PINOS_TYPE__Module);
|
||||
|
||||
uri->spa_node = spa_id_map_get_id (uri->map, SPA_NODE_URI);
|
||||
uri->spa_clock = spa_id_map_get_id (uri->map, SPA_CLOCK_URI);
|
||||
uri->spa_monitor = spa_id_map_get_id (uri->map, SPA_MONITOR_URI);
|
||||
uri->spa_node = spa_id_map_get_id (uri->map, SPA_TYPE__Node);
|
||||
uri->spa_clock = spa_id_map_get_id (uri->map, SPA_TYPE__Clock);
|
||||
uri->spa_monitor = spa_id_map_get_id (uri->map, SPA_TYPE__Monitor);
|
||||
|
||||
spa_node_events_map (uri->map, &uri->node_events);
|
||||
spa_node_commands_map (uri->map, &uri->node_commands);
|
||||
spa_event_node_map (uri->map, &uri->event_node);
|
||||
spa_command_node_map (uri->map, &uri->command_node);
|
||||
spa_monitor_types_map (uri->map, &uri->monitor_types);
|
||||
spa_alloc_param_buffers_map (uri->map, &uri->alloc_param_buffers);
|
||||
spa_alloc_param_meta_enable_map (uri->map, &uri->alloc_param_meta_enable);
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define PINOS_URI_URI "http://pinos.org/ns/uri"
|
||||
#define PINOS_URI_PREFIX PINOS_URI_URI "#"
|
||||
#define PINOS_TYPE__Uri "Pinos:Object:Uri"
|
||||
#define PINOS_TYPE_URI_BASE PINOS_TYPE__Uri ":"
|
||||
|
||||
#include <pinos/client/map.h>
|
||||
#include <spa/include/spa/id-map.h>
|
||||
|
|
@ -55,8 +55,8 @@ struct _PinosURI {
|
|||
uint32_t spa_clock;
|
||||
uint32_t spa_monitor;
|
||||
|
||||
SpaNodeEvents node_events;
|
||||
SpaNodeCommands node_commands;
|
||||
SpaEventNode event_node;
|
||||
SpaCommandNode command_node;
|
||||
SpaMonitorTypes monitor_types;
|
||||
SpaAllocParamBuffers alloc_param_buffers;
|
||||
SpaAllocParamMetaEnable alloc_param_meta_enable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue