mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
remove some unused event and seqnum
This commit is contained in:
parent
1e600713a5
commit
8fbcb0fef1
9 changed files with 42 additions and 127 deletions
|
|
@ -78,8 +78,6 @@ pinos_connection_add_fd (PinosConnection *conn,
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PINOS_DEBUG_MESSAGE(format,args...) pinos_log_trace(format,##args)
|
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
connection_ensure_size (PinosConnection *conn, ConnectionBuffer *buf, size_t size)
|
connection_ensure_size (PinosConnection *conn, ConnectionBuffer *buf, size_t size)
|
||||||
{
|
{
|
||||||
|
|
@ -129,7 +127,7 @@ refill_buffer (PinosConnection *conn, ConnectionBuffer *buf)
|
||||||
buf->n_fds = (cmsg->cmsg_len - ((char *)CMSG_DATA (cmsg) - (char *)cmsg)) / sizeof (int);
|
buf->n_fds = (cmsg->cmsg_len - ((char *)CMSG_DATA (cmsg) - (char *)cmsg)) / sizeof (int);
|
||||||
memcpy (buf->fds, CMSG_DATA (cmsg), buf->n_fds * sizeof (int));
|
memcpy (buf->fds, CMSG_DATA (cmsg), buf->n_fds * sizeof (int));
|
||||||
}
|
}
|
||||||
PINOS_DEBUG_MESSAGE ("connection %p: %d read %zd bytes and %d fds", conn, conn->fd, len, buf->n_fds);
|
pinos_log_trace ("connection %p: %d read %zd bytes and %d fds", conn, conn->fd, len, buf->n_fds);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
@ -342,7 +340,7 @@ pinos_connection_flush (PinosConnection *conn)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
PINOS_DEBUG_MESSAGE ("connection %p: %d written %zd bytes and %u fds", conn, conn->fd, len, buf->n_fds);
|
pinos_log_trace ("connection %p: %d written %zd bytes and %u fds", conn, conn->fd, len, buf->n_fds);
|
||||||
|
|
||||||
buf->buffer_size -= len;
|
buf->buffer_size -= len;
|
||||||
buf->n_fds = 0;
|
buf->n_fds = 0;
|
||||||
|
|
|
||||||
|
|
@ -126,8 +126,6 @@ core_event_done (void *object,
|
||||||
PinosContext *this = proxy->context;
|
PinosContext *this = proxy->context;
|
||||||
|
|
||||||
if (seq == 0) {
|
if (seq == 0) {
|
||||||
pinos_core_do_sync (this->core_proxy, 1);
|
|
||||||
} else if (seq == 1) {
|
|
||||||
context_set_state (this, PINOS_CONTEXT_STATE_CONNECTED, NULL);
|
context_set_state (this, PINOS_CONTEXT_STATE_CONNECTED, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -193,12 +191,6 @@ static const PinosModuleEvents module_events = {
|
||||||
&module_event_info,
|
&module_event_info,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
|
||||||
node_event_done (void *object,
|
|
||||||
uint32_t seq)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
node_event_info (void *object,
|
node_event_info (void *object,
|
||||||
PinosNodeInfo *info)
|
PinosNodeInfo *info)
|
||||||
|
|
@ -224,7 +216,6 @@ node_event_info (void *object,
|
||||||
}
|
}
|
||||||
|
|
||||||
static const PinosNodeEvents node_events = {
|
static const PinosNodeEvents node_events = {
|
||||||
&node_event_done,
|
|
||||||
&node_event_info
|
&node_event_info
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -403,10 +394,8 @@ on_context_data (SpaSource *source,
|
||||||
|
|
||||||
demarshal = proxy->iface->events;
|
demarshal = proxy->iface->events;
|
||||||
if (demarshal[opcode]) {
|
if (demarshal[opcode]) {
|
||||||
if (!demarshal[opcode] (proxy, message, size)) {
|
if (!demarshal[opcode] (proxy, message, size))
|
||||||
pinos_log_error ("context %p: invalid message received %u", this, opcode);
|
pinos_log_error ("context %p: invalid message received %u", this, opcode);
|
||||||
spa_debug_pod (message);
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
pinos_log_error ("context %p: function %d not implemented", this, opcode);
|
pinos_log_error ("context %p: function %d not implemented", this, opcode);
|
||||||
|
|
||||||
|
|
@ -612,8 +601,10 @@ pinos_context_connect_fd (PinosContext *context,
|
||||||
context->registry_proxy->implementation = ®istry_events;
|
context->registry_proxy->implementation = ®istry_events;
|
||||||
|
|
||||||
pinos_core_do_get_registry (context->core_proxy,
|
pinos_core_do_get_registry (context->core_proxy,
|
||||||
0,
|
|
||||||
context->registry_proxy->id);
|
context->registry_proxy->id);
|
||||||
|
|
||||||
|
pinos_core_do_sync (context->core_proxy, 0);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
no_registry:
|
no_registry:
|
||||||
|
|
|
||||||
|
|
@ -48,16 +48,13 @@ typedef struct {
|
||||||
void (*sync) (void *object,
|
void (*sync) (void *object,
|
||||||
uint32_t seq);
|
uint32_t seq);
|
||||||
void (*get_registry) (void *object,
|
void (*get_registry) (void *object,
|
||||||
uint32_t seq,
|
|
||||||
uint32_t new_id);
|
uint32_t new_id);
|
||||||
void (*create_node) (void *object,
|
void (*create_node) (void *object,
|
||||||
uint32_t seq,
|
|
||||||
const char *factory_name,
|
const char *factory_name,
|
||||||
const char *name,
|
const char *name,
|
||||||
const SpaDict *props,
|
const SpaDict *props,
|
||||||
uint32_t new_id);
|
uint32_t new_id);
|
||||||
void (*create_client_node) (void *object,
|
void (*create_client_node) (void *object,
|
||||||
uint32_t seq,
|
|
||||||
const char *name,
|
const char *name,
|
||||||
const SpaDict *props,
|
const SpaDict *props,
|
||||||
uint32_t new_id);
|
uint32_t new_id);
|
||||||
|
|
@ -114,13 +111,10 @@ typedef struct {
|
||||||
#define pinos_module_notify_info(r,...) ((PinosModuleEvents*)r->iface->events)->info(r,__VA_ARGS__)
|
#define pinos_module_notify_info(r,...) ((PinosModuleEvents*)r->iface->events)->info(r,__VA_ARGS__)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void (*done) (void *object,
|
|
||||||
uint32_t seq);
|
|
||||||
void (*info) (void *object,
|
void (*info) (void *object,
|
||||||
PinosNodeInfo *info);
|
PinosNodeInfo *info);
|
||||||
} PinosNodeEvents;
|
} PinosNodeEvents;
|
||||||
|
|
||||||
#define pinos_node_notify_done(r,...) ((PinosNodeEvents*)r->iface->events)->done(r,__VA_ARGS__)
|
|
||||||
#define pinos_node_notify_info(r,...) ((PinosNodeEvents*)r->iface->events)->info(r,__VA_ARGS__)
|
#define pinos_node_notify_info(r,...) ((PinosNodeEvents*)r->iface->events)->info(r,__VA_ARGS__)
|
||||||
|
|
||||||
struct _PinosClientNodeBuffer {
|
struct _PinosClientNodeBuffer {
|
||||||
|
|
@ -157,19 +151,17 @@ typedef struct {
|
||||||
SpaNodeState state);
|
SpaNodeState state);
|
||||||
void (*event) (void *object,
|
void (*event) (void *object,
|
||||||
SpaNodeEvent *event);
|
SpaNodeEvent *event);
|
||||||
void (*destroy) (void *object,
|
void (*destroy) (void *object);
|
||||||
uint32_t seq);
|
|
||||||
} PinosClientNodeMethods;
|
} PinosClientNodeMethods;
|
||||||
|
|
||||||
#define pinos_client_node_do_update(r,...) ((PinosClientNodeMethods*)r->iface->methods)->update(r,__VA_ARGS__)
|
#define pinos_client_node_do_update(r,...) ((PinosClientNodeMethods*)r->iface->methods)->update(r,__VA_ARGS__)
|
||||||
#define pinos_client_node_do_port_update(r,...) ((PinosClientNodeMethods*)r->iface->methods)->port_update(r,__VA_ARGS__)
|
#define pinos_client_node_do_port_update(r,...) ((PinosClientNodeMethods*)r->iface->methods)->port_update(r,__VA_ARGS__)
|
||||||
#define pinos_client_node_do_state_change(r,...) ((PinosClientNodeMethods*)r->iface->methods)->state_change(r,__VA_ARGS__)
|
#define pinos_client_node_do_state_change(r,...) ((PinosClientNodeMethods*)r->iface->methods)->state_change(r,__VA_ARGS__)
|
||||||
#define pinos_client_node_do_event(r,...) ((PinosClientNodeMethods*)r->iface->methods)->event(r,__VA_ARGS__)
|
#define pinos_client_node_do_event(r,...) ((PinosClientNodeMethods*)r->iface->methods)->event(r,__VA_ARGS__)
|
||||||
#define pinos_client_node_do_destroy(r,...) ((PinosClientNodeMethods*)r->iface->methods)->destroy(r,__VA_ARGS__)
|
#define pinos_client_node_do_destroy(r) ((PinosClientNodeMethods*)r->iface->methods)->destroy(r)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void (*done) (void *object,
|
void (*done) (void *object,
|
||||||
uint32_t seq,
|
|
||||||
int datafd);
|
int datafd);
|
||||||
void (*event) (void *object,
|
void (*event) (void *object,
|
||||||
const SpaNodeEvent *event);
|
const SpaNodeEvent *event);
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,6 @@ core_marshal_sync (void *object,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
core_marshal_get_registry (void *object,
|
core_marshal_get_registry (void *object,
|
||||||
uint32_t seq,
|
|
||||||
uint32_t new_id)
|
uint32_t new_id)
|
||||||
{
|
{
|
||||||
PinosProxy *proxy = object;
|
PinosProxy *proxy = object;
|
||||||
|
|
@ -104,7 +103,6 @@ core_marshal_get_registry (void *object,
|
||||||
|
|
||||||
spa_pod_builder_add (&b.b,
|
spa_pod_builder_add (&b.b,
|
||||||
SPA_POD_TYPE_STRUCT, &f,
|
SPA_POD_TYPE_STRUCT, &f,
|
||||||
SPA_POD_TYPE_INT, seq,
|
|
||||||
SPA_POD_TYPE_INT, new_id,
|
SPA_POD_TYPE_INT, new_id,
|
||||||
-SPA_POD_TYPE_STRUCT, &f,
|
-SPA_POD_TYPE_STRUCT, &f,
|
||||||
0);
|
0);
|
||||||
|
|
@ -114,7 +112,6 @@ core_marshal_get_registry (void *object,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
core_marshal_create_node (void *object,
|
core_marshal_create_node (void *object,
|
||||||
uint32_t seq,
|
|
||||||
const char *factory_name,
|
const char *factory_name,
|
||||||
const char *name,
|
const char *name,
|
||||||
const SpaDict *props,
|
const SpaDict *props,
|
||||||
|
|
@ -130,7 +127,6 @@ core_marshal_create_node (void *object,
|
||||||
|
|
||||||
spa_pod_builder_add (&b.b,
|
spa_pod_builder_add (&b.b,
|
||||||
SPA_POD_TYPE_STRUCT, &f,
|
SPA_POD_TYPE_STRUCT, &f,
|
||||||
SPA_POD_TYPE_INT, seq,
|
|
||||||
SPA_POD_TYPE_STRING, factory_name,
|
SPA_POD_TYPE_STRING, factory_name,
|
||||||
SPA_POD_TYPE_STRING, name,
|
SPA_POD_TYPE_STRING, name,
|
||||||
SPA_POD_TYPE_INT, n_items, 0);
|
SPA_POD_TYPE_INT, n_items, 0);
|
||||||
|
|
@ -150,7 +146,6 @@ core_marshal_create_node (void *object,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
core_marshal_create_client_node (void *object,
|
core_marshal_create_client_node (void *object,
|
||||||
uint32_t seq,
|
|
||||||
const char *name,
|
const char *name,
|
||||||
const SpaDict *props,
|
const SpaDict *props,
|
||||||
uint32_t new_id)
|
uint32_t new_id)
|
||||||
|
|
@ -165,7 +160,6 @@ core_marshal_create_client_node (void *object,
|
||||||
|
|
||||||
spa_pod_builder_add (&b.b,
|
spa_pod_builder_add (&b.b,
|
||||||
SPA_POD_TYPE_STRUCT, &f,
|
SPA_POD_TYPE_STRUCT, &f,
|
||||||
SPA_POD_TYPE_INT, seq,
|
|
||||||
SPA_POD_TYPE_STRING, name,
|
SPA_POD_TYPE_STRING, name,
|
||||||
SPA_POD_TYPE_INT, n_items, 0);
|
SPA_POD_TYPE_INT, n_items, 0);
|
||||||
|
|
||||||
|
|
@ -314,25 +308,6 @@ module_demarshal_info (void *object,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
|
||||||
node_demarshal_done (void *object,
|
|
||||||
void *data,
|
|
||||||
size_t size)
|
|
||||||
{
|
|
||||||
PinosProxy *proxy = object;
|
|
||||||
SpaPODIter it;
|
|
||||||
uint32_t seq;
|
|
||||||
|
|
||||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
|
||||||
!spa_pod_iter_get (&it,
|
|
||||||
SPA_POD_TYPE_INT, &seq,
|
|
||||||
0))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
((PinosNodeEvents*)proxy->implementation)->done (proxy, seq);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
node_demarshal_info (void *object,
|
node_demarshal_info (void *object,
|
||||||
void *data,
|
void *data,
|
||||||
|
|
@ -517,8 +492,7 @@ client_node_marshal_event (void *object,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
client_node_marshal_destroy (void *object,
|
client_node_marshal_destroy (void *object)
|
||||||
uint32_t seq)
|
|
||||||
{
|
{
|
||||||
PinosProxy *proxy = object;
|
PinosProxy *proxy = object;
|
||||||
PinosConnection *connection = proxy->context->protocol_private;
|
PinosConnection *connection = proxy->context->protocol_private;
|
||||||
|
|
@ -527,7 +501,6 @@ client_node_marshal_destroy (void *object,
|
||||||
|
|
||||||
spa_pod_builder_add (&b.b,
|
spa_pod_builder_add (&b.b,
|
||||||
SPA_POD_TYPE_STRUCT, &f,
|
SPA_POD_TYPE_STRUCT, &f,
|
||||||
SPA_POD_TYPE_INT, seq,
|
|
||||||
-SPA_POD_TYPE_STRUCT, &f,
|
-SPA_POD_TYPE_STRUCT, &f,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
|
|
@ -542,18 +515,17 @@ client_node_demarshal_done (void *object,
|
||||||
PinosProxy *proxy = object;
|
PinosProxy *proxy = object;
|
||||||
SpaPODIter it;
|
SpaPODIter it;
|
||||||
PinosConnection *connection = proxy->context->protocol_private;
|
PinosConnection *connection = proxy->context->protocol_private;
|
||||||
int32_t seq, idx;
|
int32_t idx;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||||
!spa_pod_iter_get (&it,
|
!spa_pod_iter_get (&it,
|
||||||
SPA_POD_TYPE_INT, &seq,
|
|
||||||
SPA_POD_TYPE_INT, &idx,
|
SPA_POD_TYPE_INT, &idx,
|
||||||
0))
|
0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
fd = pinos_connection_get_fd (connection, idx);
|
fd = pinos_connection_get_fd (connection, idx);
|
||||||
((PinosClientNodeEvents*)proxy->implementation)->done (proxy, seq, fd);
|
((PinosClientNodeEvents*)proxy->implementation)->done (proxy, fd);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1031,13 +1003,12 @@ static const PinosInterface pinos_protocol_native_client_module_interface = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PinosDemarshalFunc pinos_protocol_native_client_node_demarshal[] = {
|
static const PinosDemarshalFunc pinos_protocol_native_client_node_demarshal[] = {
|
||||||
&node_demarshal_done,
|
|
||||||
&node_demarshal_info,
|
&node_demarshal_info,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PinosInterface pinos_protocol_native_client_node_interface = {
|
static const PinosInterface pinos_protocol_native_client_node_interface = {
|
||||||
0, NULL,
|
0, NULL,
|
||||||
2, pinos_protocol_native_client_node_demarshal,
|
1, pinos_protocol_native_client_node_demarshal,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PinosDemarshalFunc pinos_protocol_native_client_client_demarshal[] = {
|
static const PinosDemarshalFunc pinos_protocol_native_client_client_demarshal[] = {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include <pinos/client/log.h>
|
#include <pinos/client/log.h>
|
||||||
#include <pinos/client/proxy.h>
|
#include <pinos/client/proxy.h>
|
||||||
|
#include <pinos/client/protocol-native.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
PinosProxy this;
|
PinosProxy this;
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,6 @@ typedef struct
|
||||||
|
|
||||||
SpaNodeState node_state;
|
SpaNodeState node_state;
|
||||||
|
|
||||||
uint32_t seq;
|
|
||||||
|
|
||||||
uint32_t n_possible_formats;
|
uint32_t n_possible_formats;
|
||||||
SpaFormat **possible_formats;
|
SpaFormat **possible_formats;
|
||||||
|
|
||||||
|
|
@ -661,7 +659,6 @@ handle_node_command (PinosStream *stream,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
client_node_done (void *object,
|
client_node_done (void *object,
|
||||||
uint32_t seq,
|
|
||||||
int datafd)
|
int datafd)
|
||||||
{
|
{
|
||||||
PinosProxy *proxy = object;
|
PinosProxy *proxy = object;
|
||||||
|
|
@ -1000,7 +997,6 @@ pinos_stream_connect (PinosStream *stream,
|
||||||
impl->node_proxy->implementation = &client_node_events;
|
impl->node_proxy->implementation = &client_node_events;
|
||||||
|
|
||||||
pinos_core_do_create_client_node (stream->context->core_proxy,
|
pinos_core_do_create_client_node (stream->context->core_proxy,
|
||||||
++impl->seq,
|
|
||||||
"client-node",
|
"client-node",
|
||||||
&stream->properties->dict,
|
&stream->properties->dict,
|
||||||
impl->node_proxy->id);
|
impl->node_proxy->id);
|
||||||
|
|
@ -1101,7 +1097,7 @@ pinos_stream_disconnect (PinosStream *stream)
|
||||||
|
|
||||||
unhandle_socket (stream);
|
unhandle_socket (stream);
|
||||||
|
|
||||||
pinos_client_node_do_destroy (impl->node_proxy, ++impl->seq);
|
pinos_client_node_do_destroy (impl->node_proxy);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -971,8 +971,7 @@ client_node_event (void *object,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
client_node_destroy (void *object,
|
client_node_destroy (void *object)
|
||||||
uint32_t seq)
|
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
PinosClientNode *node = resource->object;
|
PinosClientNode *node = resource->object;
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,6 @@ core_sync (void *object,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
core_get_registry (void *object,
|
core_get_registry (void *object,
|
||||||
uint32_t seq,
|
|
||||||
uint32_t new_id)
|
uint32_t new_id)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
|
|
@ -126,8 +125,6 @@ core_get_registry (void *object,
|
||||||
global->id,
|
global->id,
|
||||||
spa_id_map_get_uri (this->uri.map, global->type));
|
spa_id_map_get_uri (this->uri.map, global->type));
|
||||||
|
|
||||||
pinos_core_notify_done (client->core_resource, seq);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
no_mem:
|
no_mem:
|
||||||
|
|
@ -140,7 +137,6 @@ no_mem:
|
||||||
|
|
||||||
static void
|
static void
|
||||||
core_create_node (void *object,
|
core_create_node (void *object,
|
||||||
uint32_t seq,
|
|
||||||
const char *factory_name,
|
const char *factory_name,
|
||||||
const char *name,
|
const char *name,
|
||||||
const SpaDict *props,
|
const SpaDict *props,
|
||||||
|
|
@ -157,7 +153,6 @@ core_create_node (void *object,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
core_create_client_node (void *object,
|
core_create_client_node (void *object,
|
||||||
uint32_t seq,
|
|
||||||
const char *name,
|
const char *name,
|
||||||
const SpaDict *props,
|
const SpaDict *props,
|
||||||
uint32_t new_id)
|
uint32_t new_id)
|
||||||
|
|
@ -194,7 +189,6 @@ core_create_client_node (void *object,
|
||||||
}
|
}
|
||||||
|
|
||||||
pinos_client_node_notify_done (node->resource,
|
pinos_client_node_notify_done (node->resource,
|
||||||
seq,
|
|
||||||
data_fd);
|
data_fd);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ write_pod (SpaPODBuilder *b, uint32_t ref, const void *data, uint32_t size)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
core_marshal_info (void *object,
|
core_marshal_info (void *object,
|
||||||
PinosCoreInfo *info)
|
PinosCoreInfo *info)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
PinosConnection *connection = resource->client->protocol_private;
|
PinosConnection *connection = resource->client->protocol_private;
|
||||||
|
|
@ -81,7 +81,7 @@ core_marshal_info (void *object,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
core_marshal_done (void *object,
|
core_marshal_done (void *object,
|
||||||
uint32_t seq)
|
uint32_t seq)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
PinosConnection *connection = resource->client->protocol_private;
|
PinosConnection *connection = resource->client->protocol_private;
|
||||||
|
|
@ -98,9 +98,9 @@ core_marshal_done (void *object,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
core_marshal_error (void *object,
|
core_marshal_error (void *object,
|
||||||
uint32_t id,
|
uint32_t id,
|
||||||
SpaResult res,
|
SpaResult res,
|
||||||
const char *error, ...)
|
const char *error, ...)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
PinosConnection *connection = resource->client->protocol_private;
|
PinosConnection *connection = resource->client->protocol_private;
|
||||||
|
|
@ -126,7 +126,7 @@ core_marshal_error (void *object,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
core_marshal_remove_id (void *object,
|
core_marshal_remove_id (void *object,
|
||||||
uint32_t id)
|
uint32_t id)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
PinosConnection *connection = resource->client->protocol_private;
|
PinosConnection *connection = resource->client->protocol_private;
|
||||||
|
|
@ -171,8 +171,8 @@ core_demarshal_client_update (void *object,
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
core_demarshal_sync (void *object,
|
core_demarshal_sync (void *object,
|
||||||
void *data,
|
void *data,
|
||||||
size_t size)
|
size_t size)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
SpaPODIter it;
|
SpaPODIter it;
|
||||||
|
|
@ -190,38 +190,36 @@ core_demarshal_sync (void *object,
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
core_demarshal_get_registry (void *object,
|
core_demarshal_get_registry (void *object,
|
||||||
void *data,
|
void *data,
|
||||||
size_t size)
|
size_t size)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
SpaPODIter it;
|
SpaPODIter it;
|
||||||
int32_t seq, new_id;
|
int32_t new_id;
|
||||||
|
|
||||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||||
!spa_pod_iter_get (&it,
|
!spa_pod_iter_get (&it,
|
||||||
SPA_POD_TYPE_INT, &seq,
|
|
||||||
SPA_POD_TYPE_INT, &new_id,
|
SPA_POD_TYPE_INT, &new_id,
|
||||||
0))
|
0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
((PinosCoreMethods*)resource->implementation)->get_registry (resource, seq, new_id);
|
((PinosCoreMethods*)resource->implementation)->get_registry (resource, new_id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
core_demarshal_create_node (void *object,
|
core_demarshal_create_node (void *object,
|
||||||
void *data,
|
void *data,
|
||||||
size_t size)
|
size_t size)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
SpaPODIter it;
|
SpaPODIter it;
|
||||||
uint32_t seq, new_id, i;
|
uint32_t new_id, i;
|
||||||
const char *factory_name, *name;
|
const char *factory_name, *name;
|
||||||
SpaDict props;
|
SpaDict props;
|
||||||
|
|
||||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||||
!spa_pod_iter_get (&it,
|
!spa_pod_iter_get (&it,
|
||||||
SPA_POD_TYPE_INT, &seq,
|
|
||||||
SPA_POD_TYPE_STRING, &factory_name,
|
SPA_POD_TYPE_STRING, &factory_name,
|
||||||
SPA_POD_TYPE_STRING, &name,
|
SPA_POD_TYPE_STRING, &name,
|
||||||
SPA_POD_TYPE_INT, &props.n_items,
|
SPA_POD_TYPE_INT, &props.n_items,
|
||||||
|
|
@ -240,7 +238,6 @@ core_demarshal_create_node (void *object,
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
((PinosCoreMethods*)resource->implementation)->create_node (resource,
|
((PinosCoreMethods*)resource->implementation)->create_node (resource,
|
||||||
seq,
|
|
||||||
factory_name,
|
factory_name,
|
||||||
name,
|
name,
|
||||||
&props,
|
&props,
|
||||||
|
|
@ -250,18 +247,17 @@ core_demarshal_create_node (void *object,
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
core_demarshal_create_client_node (void *object,
|
core_demarshal_create_client_node (void *object,
|
||||||
void *data,
|
void *data,
|
||||||
size_t size)
|
size_t size)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
SpaPODIter it;
|
SpaPODIter it;
|
||||||
uint32_t seq, new_id, i;
|
uint32_t new_id, i;
|
||||||
const char *name;
|
const char *name;
|
||||||
SpaDict props;
|
SpaDict props;
|
||||||
|
|
||||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||||
!spa_pod_iter_get (&it,
|
!spa_pod_iter_get (&it,
|
||||||
SPA_POD_TYPE_INT, &seq,
|
|
||||||
SPA_POD_TYPE_STRING, &name,
|
SPA_POD_TYPE_STRING, &name,
|
||||||
SPA_POD_TYPE_INT, &props.n_items,
|
SPA_POD_TYPE_INT, &props.n_items,
|
||||||
0))
|
0))
|
||||||
|
|
@ -279,7 +275,6 @@ core_demarshal_create_client_node (void *object,
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
((PinosCoreMethods*)resource->implementation)->create_client_node (resource,
|
((PinosCoreMethods*)resource->implementation)->create_client_node (resource,
|
||||||
seq,
|
|
||||||
name,
|
name,
|
||||||
&props,
|
&props,
|
||||||
new_id);
|
new_id);
|
||||||
|
|
@ -288,8 +283,8 @@ core_demarshal_create_client_node (void *object,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
registry_marshal_global (void *object,
|
registry_marshal_global (void *object,
|
||||||
uint32_t id,
|
uint32_t id,
|
||||||
const char *type)
|
const char *type)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
PinosConnection *connection = resource->client->protocol_private;
|
PinosConnection *connection = resource->client->protocol_private;
|
||||||
|
|
@ -307,7 +302,7 @@ registry_marshal_global (void *object,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
registry_marshal_global_remove (void *object,
|
registry_marshal_global_remove (void *object,
|
||||||
uint32_t id)
|
uint32_t id)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
PinosConnection *connection = resource->client->protocol_private;
|
PinosConnection *connection = resource->client->protocol_private;
|
||||||
|
|
@ -324,8 +319,8 @@ registry_marshal_global_remove (void *object,
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
registry_demarshal_bind (void *object,
|
registry_demarshal_bind (void *object,
|
||||||
void *data,
|
void *data,
|
||||||
size_t size)
|
size_t size)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
SpaPODIter it;
|
SpaPODIter it;
|
||||||
|
|
@ -374,23 +369,6 @@ module_marshal_info (void *object,
|
||||||
pinos_connection_end_write (connection, resource->id, 0, b.b.offset);
|
pinos_connection_end_write (connection, resource->id, 0, b.b.offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
node_marshal_done (void *object,
|
|
||||||
uint32_t seq)
|
|
||||||
{
|
|
||||||
PinosResource *resource = object;
|
|
||||||
PinosConnection *connection = resource->client->protocol_private;
|
|
||||||
Builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
|
|
||||||
SpaPODFrame f;
|
|
||||||
|
|
||||||
spa_pod_builder_add (&b.b,
|
|
||||||
SPA_POD_TYPE_STRUCT, &f,
|
|
||||||
SPA_POD_TYPE_INT, seq,
|
|
||||||
-SPA_POD_TYPE_STRUCT, &f, 0);
|
|
||||||
|
|
||||||
pinos_connection_end_write (connection, resource->id, 0, b.b.offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
node_marshal_info (void *object,
|
node_marshal_info (void *object,
|
||||||
PinosNodeInfo *info)
|
PinosNodeInfo *info)
|
||||||
|
|
@ -435,7 +413,7 @@ node_marshal_info (void *object,
|
||||||
}
|
}
|
||||||
spa_pod_builder_add (&b.b, -SPA_POD_TYPE_STRUCT, &f, 0);
|
spa_pod_builder_add (&b.b, -SPA_POD_TYPE_STRUCT, &f, 0);
|
||||||
|
|
||||||
pinos_connection_end_write (connection, resource->id, 1, b.b.offset);
|
pinos_connection_end_write (connection, resource->id, 0, b.b.offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -468,7 +446,6 @@ client_marshal_info (void *object,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
client_node_marshal_done (void *object,
|
client_node_marshal_done (void *object,
|
||||||
uint32_t seq,
|
|
||||||
int datafd)
|
int datafd)
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
|
|
@ -478,7 +455,6 @@ client_node_marshal_done (void *object,
|
||||||
|
|
||||||
spa_pod_builder_add (&b.b,
|
spa_pod_builder_add (&b.b,
|
||||||
SPA_POD_TYPE_STRUCT, &f,
|
SPA_POD_TYPE_STRUCT, &f,
|
||||||
SPA_POD_TYPE_INT, seq,
|
|
||||||
SPA_POD_TYPE_INT, pinos_connection_add_fd (connection, datafd),
|
SPA_POD_TYPE_INT, pinos_connection_add_fd (connection, datafd),
|
||||||
-SPA_POD_TYPE_STRUCT, &f, 0);
|
-SPA_POD_TYPE_STRUCT, &f, 0);
|
||||||
|
|
||||||
|
|
@ -884,13 +860,11 @@ client_node_demarshal_destroy (void *object,
|
||||||
{
|
{
|
||||||
PinosResource *resource = object;
|
PinosResource *resource = object;
|
||||||
SpaPODIter it;
|
SpaPODIter it;
|
||||||
uint32_t seq;
|
|
||||||
|
|
||||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
if (!spa_pod_iter_struct (&it, data, size))
|
||||||
!spa_pod_iter_get (&it, SPA_POD_TYPE_INT, &seq, 0))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
((PinosClientNodeMethods*)resource->implementation)->destroy (resource, seq);
|
((PinosClientNodeMethods*)resource->implementation)->destroy (resource);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -960,13 +934,12 @@ const PinosInterface pinos_protocol_native_server_module_interface = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PinosNodeEvents pinos_protocol_native_server_node_events = {
|
static const PinosNodeEvents pinos_protocol_native_server_node_events = {
|
||||||
&node_marshal_done,
|
|
||||||
&node_marshal_info,
|
&node_marshal_info,
|
||||||
};
|
};
|
||||||
|
|
||||||
const PinosInterface pinos_protocol_native_server_node_interface = {
|
const PinosInterface pinos_protocol_native_server_node_interface = {
|
||||||
0, NULL,
|
0, NULL,
|
||||||
2, &pinos_protocol_native_server_node_events,
|
1, &pinos_protocol_native_server_node_events,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PinosClientEvents pinos_protocol_native_server_client_events = {
|
static const PinosClientEvents pinos_protocol_native_server_client_events = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue