mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
Use types with known sizes where we can, easier to serialize
Add iterator for POD and use it to implement some demarshalling.
This commit is contained in:
parent
23d09d5b60
commit
f92b68c3c3
77 changed files with 839 additions and 695 deletions
|
|
@ -36,7 +36,7 @@ typedef struct {
|
|||
size_t buffer_size;
|
||||
size_t buffer_maxsize;
|
||||
int fds[MAX_FDS];
|
||||
unsigned int n_fds;
|
||||
uint32_t n_fds;
|
||||
|
||||
off_t offset;
|
||||
void *data;
|
||||
|
|
@ -52,7 +52,7 @@ struct _PinosConnection {
|
|||
|
||||
int
|
||||
pinos_connection_get_fd (PinosConnection *conn,
|
||||
int index)
|
||||
uint32_t index)
|
||||
{
|
||||
if (index < 0 || index >= conn->in.n_fds)
|
||||
return -1;
|
||||
|
|
@ -60,11 +60,11 @@ pinos_connection_get_fd (PinosConnection *conn,
|
|||
return conn->in.fds[index];
|
||||
}
|
||||
|
||||
int
|
||||
uint32_t
|
||||
pinos_connection_add_fd (PinosConnection *conn,
|
||||
int fd)
|
||||
{
|
||||
int index, i;
|
||||
uint32_t index, i;
|
||||
|
||||
for (i = 0; i < conn->out.n_fds; i++) {
|
||||
if (conn->out.fds[i] == fd)
|
||||
|
|
@ -202,7 +202,7 @@ pinos_connection_get_next (PinosConnection *conn,
|
|||
uint8_t *opcode,
|
||||
uint32_t *dest_id,
|
||||
void **dt,
|
||||
size_t *sz)
|
||||
uint32_t *sz)
|
||||
{
|
||||
size_t len, size;
|
||||
uint8_t *data;
|
||||
|
|
@ -265,7 +265,7 @@ again:
|
|||
|
||||
void *
|
||||
pinos_connection_begin_write (PinosConnection *conn,
|
||||
size_t size)
|
||||
uint32_t size)
|
||||
{
|
||||
uint32_t *p;
|
||||
ConnectionBuffer *buf = &conn->out;
|
||||
|
|
@ -278,7 +278,7 @@ void
|
|||
pinos_connection_end_write (PinosConnection *conn,
|
||||
uint32_t dest_id,
|
||||
uint8_t opcode,
|
||||
size_t size)
|
||||
uint32_t size)
|
||||
{
|
||||
uint32_t *p;
|
||||
ConnectionBuffer *buf = &conn->out;
|
||||
|
|
|
|||
|
|
@ -31,23 +31,23 @@ typedef struct _PinosConnection PinosConnection;
|
|||
PinosConnection * pinos_connection_new (int fd);
|
||||
void pinos_connection_destroy (PinosConnection *conn);
|
||||
|
||||
int pinos_connection_add_fd (PinosConnection *conn,
|
||||
uint32_t pinos_connection_add_fd (PinosConnection *conn,
|
||||
int fd);
|
||||
int pinos_connection_get_fd (PinosConnection *conn,
|
||||
int index);
|
||||
uint32_t index);
|
||||
|
||||
bool pinos_connection_get_next (PinosConnection *conn,
|
||||
uint8_t *opcode,
|
||||
uint32_t *dest_id,
|
||||
void **data,
|
||||
size_t *size);
|
||||
uint32_t *size);
|
||||
|
||||
void * pinos_connection_begin_write (PinosConnection *conn,
|
||||
size_t size);
|
||||
uint32_t size);
|
||||
void pinos_connection_end_write (PinosConnection *conn,
|
||||
uint32_t dest_id,
|
||||
uint8_t opcode,
|
||||
size_t size);
|
||||
uint32_t size);
|
||||
|
||||
bool pinos_connection_flush (PinosConnection *conn);
|
||||
bool pinos_connection_clear (PinosConnection *conn);
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ on_context_data (SpaSource *source,
|
|||
PinosConnection *conn = impl->connection;
|
||||
uint8_t opcode;
|
||||
uint32_t id;
|
||||
size_t size;
|
||||
uint32_t size;
|
||||
void *message;
|
||||
|
||||
while (pinos_connection_get_next (conn, &opcode, &id, &message, &size)) {
|
||||
|
|
|
|||
|
|
@ -117,8 +117,8 @@ typedef struct {
|
|||
|
||||
struct _PinosClientNodeBuffer {
|
||||
uint32_t mem_id;
|
||||
off_t offset;
|
||||
size_t size;
|
||||
uint32_t offset;
|
||||
uint32_t size;
|
||||
SpaBuffer *buffer;
|
||||
};
|
||||
|
||||
|
|
@ -128,8 +128,8 @@ typedef struct {
|
|||
#define PINOS_MESSAGE_NODE_UPDATE_MAX_OUTPUTS (1 << 1)
|
||||
#define PINOS_MESSAGE_NODE_UPDATE_PROPS (1 << 2)
|
||||
uint32_t change_mask,
|
||||
unsigned int max_input_ports,
|
||||
unsigned int max_output_ports,
|
||||
uint32_t max_input_ports,
|
||||
uint32_t max_output_ports,
|
||||
const SpaProps *props);
|
||||
|
||||
void (*port_update) (void *object,
|
||||
|
|
@ -140,7 +140,7 @@ typedef struct {
|
|||
#define PINOS_MESSAGE_PORT_UPDATE_PROPS (1 << 2)
|
||||
#define PINOS_MESSAGE_PORT_UPDATE_INFO (1 << 3)
|
||||
uint32_t change_mask,
|
||||
unsigned int n_possible_formats,
|
||||
uint32_t n_possible_formats,
|
||||
const SpaFormat **possible_formats,
|
||||
const SpaFormat *format,
|
||||
const SpaProps *props,
|
||||
|
|
@ -182,7 +182,7 @@ typedef struct {
|
|||
void (*set_property) (void *object,
|
||||
uint32_t seq,
|
||||
uint32_t id,
|
||||
size_t size,
|
||||
uint32_t size,
|
||||
const void *value);
|
||||
void (*add_mem) (void *object,
|
||||
SpaDirection direction,
|
||||
|
|
@ -191,13 +191,13 @@ typedef struct {
|
|||
SpaDataType type,
|
||||
int memfd,
|
||||
uint32_t flags,
|
||||
off_t offset,
|
||||
size_t size);
|
||||
uint32_t offset,
|
||||
uint32_t size);
|
||||
void (*use_buffers) (void *object,
|
||||
uint32_t seq,
|
||||
SpaDirection direction,
|
||||
uint32_t port_id,
|
||||
unsigned int n_buffers,
|
||||
uint32_t n_buffers,
|
||||
PinosClientNodeBuffer *buffers);
|
||||
void (*node_command) (void *object,
|
||||
uint32_t seq,
|
||||
|
|
@ -207,8 +207,8 @@ typedef struct {
|
|||
const SpaNodeCommand *command);
|
||||
void (*transport) (void *object,
|
||||
int memfd,
|
||||
off_t offset,
|
||||
size_t size);
|
||||
uint32_t offset,
|
||||
uint32_t size);
|
||||
} PinosClientNodeEvent;
|
||||
|
||||
#define pinos_client_node_notify_done(r,...) ((PinosClientNodeEvent*)r->event)->done(r,__VA_ARGS__)
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ static SpaDict *
|
|||
pinos_spa_dict_copy (SpaDict *dict)
|
||||
{
|
||||
SpaDict *copy;
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
|
||||
if (dict == NULL)
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -256,13 +256,13 @@ struct _PinosNodeInfo {
|
|||
uint32_t id;
|
||||
uint64_t change_mask;
|
||||
const char *name;
|
||||
unsigned int max_inputs;
|
||||
unsigned int n_inputs;
|
||||
unsigned int n_input_formats;
|
||||
uint32_t max_inputs;
|
||||
uint32_t n_inputs;
|
||||
uint32_t n_input_formats;
|
||||
SpaFormat **input_formats;
|
||||
unsigned int max_outputs;
|
||||
unsigned int n_outputs;
|
||||
unsigned int n_output_formats;
|
||||
uint32_t max_outputs;
|
||||
uint32_t n_outputs;
|
||||
uint32_t n_output_formats;
|
||||
SpaFormat **output_formats;
|
||||
PinosNodeState state;
|
||||
const char *error;
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ event_func (SpaSource *source,
|
|||
void *data)
|
||||
{
|
||||
PinosLoopImpl *impl = data;
|
||||
size_t offset;
|
||||
uint32_t offset;
|
||||
|
||||
while (spa_ringbuffer_get_read_offset (&impl->buffer, &offset) > 0) {
|
||||
InvokeItem *item = SPA_MEMBER (impl->buffer_data, offset, InvokeItem);
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ pinos_properties_new (const char *key, ...)
|
|||
PinosProperties *
|
||||
pinos_properties_new_dict (const SpaDict *dict)
|
||||
{
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
PinosPropertiesImpl *impl;
|
||||
|
||||
impl = calloc (1, sizeof (PinosPropertiesImpl));
|
||||
|
|
@ -307,7 +307,7 @@ pinos_properties_iterate (PinosProperties *properties,
|
|||
void **state)
|
||||
{
|
||||
PinosPropertiesImpl *impl = SPA_CONTAINER_OF (properties, PinosPropertiesImpl, this);
|
||||
unsigned int index;
|
||||
uint32_t index;
|
||||
|
||||
if (*state == NULL)
|
||||
index = 0;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <errno.h>
|
||||
|
||||
#include "spa/pod-iter.h"
|
||||
#include "pinos/client/pinos.h"
|
||||
|
||||
#include "pinos/client/protocol-native.h"
|
||||
|
|
@ -30,8 +31,8 @@ typedef struct {
|
|||
PinosConnection *connection;
|
||||
} Builder;
|
||||
|
||||
static off_t
|
||||
write_pod (SpaPODBuilder *b, off_t ref, const void *data, size_t size)
|
||||
static uint32_t
|
||||
write_pod (SpaPODBuilder *b, uint32_t ref, const void *data, uint32_t size)
|
||||
{
|
||||
if (ref == -1)
|
||||
ref = b->offset;
|
||||
|
|
@ -165,31 +166,30 @@ core_demarshal_info (void *object,
|
|||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaDict props;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
PinosCoreInfo info;
|
||||
int32_t i1, i2, i3;
|
||||
int64_t l1;
|
||||
SpaPODIter it;
|
||||
int i;
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1) ||
|
||||
!spa_pod_get_long (&p, &l1) ||
|
||||
!spa_pod_get_string (&p, &info.user_name) ||
|
||||
!spa_pod_get_string (&p, &info.host_name) ||
|
||||
!spa_pod_get_string (&p, &info.version) ||
|
||||
!spa_pod_get_string (&p, &info.name) ||
|
||||
!spa_pod_get_int (&p, &i3) ||
|
||||
!spa_pod_get_int (&p, &i2))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &info.id,
|
||||
SPA_POD_TYPE_LONG, &info.change_mask,
|
||||
SPA_POD_TYPE_STRING, &info.user_name,
|
||||
SPA_POD_TYPE_STRING, &info.host_name,
|
||||
SPA_POD_TYPE_STRING, &info.version,
|
||||
SPA_POD_TYPE_STRING, &info.name,
|
||||
SPA_POD_TYPE_INT, &info.cookie,
|
||||
SPA_POD_TYPE_INT, &props.n_items,
|
||||
0))
|
||||
return;
|
||||
|
||||
info.id = i1;
|
||||
info.change_mask = l1;
|
||||
info.cookie = i3;
|
||||
info.props = &props;
|
||||
props.n_items = i2;
|
||||
props.items = alloca (props.n_items * sizeof (SpaDictItem));
|
||||
for (i = 0; i < props.n_items; i++) {
|
||||
if (!spa_pod_get_string (&p, &props.items[i].key) ||
|
||||
!spa_pod_get_string (&p, &props.items[i].value))
|
||||
if (!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_STRING, &props.items[i].key,
|
||||
SPA_POD_TYPE_STRING, &props.items[i].value,
|
||||
0))
|
||||
return;
|
||||
}
|
||||
pinos_core_notify_info (proxy, &info);
|
||||
|
|
@ -201,13 +201,16 @@ core_demarshal_done (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
int32_t i32;
|
||||
SpaPODIter it;
|
||||
uint32_t seq;
|
||||
|
||||
if (!spa_pod_get_int (&p, &i32))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &seq,
|
||||
0))
|
||||
return;
|
||||
|
||||
pinos_core_notify_done (proxy, i32);
|
||||
pinos_core_notify_done (proxy, seq);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -216,16 +219,19 @@ core_demarshal_error (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
int32_t i1, i2;
|
||||
SpaPODIter it;
|
||||
uint32_t id, res;
|
||||
const char *error;
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1) ||
|
||||
!spa_pod_get_int (&p, &i2) ||
|
||||
!spa_pod_get_string (&p, &error))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &id,
|
||||
SPA_POD_TYPE_INT, &res,
|
||||
SPA_POD_TYPE_STRING, &error,
|
||||
0))
|
||||
return;
|
||||
|
||||
pinos_core_notify_error (proxy, i1, i2, error);
|
||||
pinos_core_notify_error (proxy, id, res, error);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -234,13 +240,16 @@ core_demarshal_remove_id (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
int32_t i1;
|
||||
SpaPODIter it;
|
||||
uint32_t id;
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &id,
|
||||
0))
|
||||
return;
|
||||
|
||||
pinos_core_notify_remove_id (proxy, i1);
|
||||
pinos_core_notify_remove_id (proxy, id);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -249,29 +258,29 @@ module_demarshal_info (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPODIter it;
|
||||
SpaDict props;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
PinosModuleInfo info;
|
||||
int32_t i1, i2;
|
||||
int64_t l1;
|
||||
int i;
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1) ||
|
||||
!spa_pod_get_long (&p, &l1) ||
|
||||
!spa_pod_get_string (&p, &info.name) ||
|
||||
!spa_pod_get_string (&p, &info.filename) ||
|
||||
!spa_pod_get_string (&p, &info.args) ||
|
||||
!spa_pod_get_int (&p, &i2))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &info.id,
|
||||
SPA_POD_TYPE_LONG, &info.change_mask,
|
||||
SPA_POD_TYPE_STRING, &info.name,
|
||||
SPA_POD_TYPE_STRING, &info.filename,
|
||||
SPA_POD_TYPE_STRING, &info.args,
|
||||
SPA_POD_TYPE_INT, &props.n_items,
|
||||
0))
|
||||
return;
|
||||
|
||||
info.id = i1;
|
||||
info.change_mask = l1;
|
||||
info.props = &props;
|
||||
props.n_items = i2;
|
||||
props.items = alloca (props.n_items * sizeof (SpaDictItem));
|
||||
for (i = 0; i < props.n_items; i++) {
|
||||
if (!spa_pod_get_string (&p, &props.items[i].key) ||
|
||||
!spa_pod_get_string (&p, &props.items[i].value))
|
||||
if (!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_STRING, &props.items[i].key,
|
||||
SPA_POD_TYPE_STRING, &props.items[i].value,
|
||||
0))
|
||||
return;
|
||||
}
|
||||
pinos_module_notify_info (proxy, &info);
|
||||
|
|
@ -283,13 +292,16 @@ node_demarshal_done (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
int32_t i1;
|
||||
SpaPODIter it;
|
||||
uint32_t seq;
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &seq,
|
||||
0))
|
||||
return;
|
||||
|
||||
pinos_node_notify_done (proxy, i1);
|
||||
pinos_node_notify_done (proxy, seq);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -298,54 +310,52 @@ node_demarshal_info (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPODIter it;
|
||||
SpaDict props;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
PinosNodeInfo info;
|
||||
int32_t i1, i2, i3, i4;
|
||||
int64_t l1;
|
||||
int i;
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1) ||
|
||||
!spa_pod_get_long (&p, &l1) ||
|
||||
!spa_pod_get_string (&p, &info.name) ||
|
||||
!spa_pod_get_int (&p, &i2) ||
|
||||
!spa_pod_get_int (&p, &i3) ||
|
||||
!spa_pod_get_int (&p, &i4))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &info.id,
|
||||
SPA_POD_TYPE_LONG, &info.change_mask,
|
||||
SPA_POD_TYPE_STRING, &info.name,
|
||||
SPA_POD_TYPE_INT, &info.max_inputs,
|
||||
SPA_POD_TYPE_INT, &info.n_inputs,
|
||||
SPA_POD_TYPE_INT, &info.n_input_formats,
|
||||
0))
|
||||
return;
|
||||
|
||||
info.id = i1;
|
||||
info.change_mask = l1;
|
||||
info.max_inputs = i2;
|
||||
info.n_inputs = i3;
|
||||
info.n_input_formats = i4;
|
||||
info.input_formats = alloca (info.n_input_formats * sizeof (SpaFormat*));
|
||||
for (i = 0; i < info.n_input_formats; i++)
|
||||
spa_pod_get_object (&p, (const SpaPOD**)&info.input_formats[i]);
|
||||
spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_OBJECT, &info.input_formats[i], 0);
|
||||
|
||||
if (!spa_pod_get_int (&p, &i2) ||
|
||||
!spa_pod_get_int (&p, &i3) ||
|
||||
!spa_pod_get_int (&p, &i4))
|
||||
if (!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &info.max_outputs,
|
||||
SPA_POD_TYPE_INT, &info.n_outputs,
|
||||
SPA_POD_TYPE_INT, &info.n_output_formats,
|
||||
0))
|
||||
return;
|
||||
|
||||
info.max_outputs = i2;
|
||||
info.n_outputs = i3;
|
||||
info.n_output_formats = i4;
|
||||
info.output_formats = alloca (info.n_output_formats * sizeof (SpaFormat*));
|
||||
for (i = 0; i < info.n_output_formats; i++)
|
||||
spa_pod_get_object (&p, (const SpaPOD**)&info.output_formats[i]);
|
||||
spa_pod_iter_get (&it, SPA_POD_TYPE_OBJECT, &info.output_formats[i], 0);
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1) ||
|
||||
!spa_pod_get_string (&p, &info.error) ||
|
||||
!spa_pod_get_int (&p, &i2))
|
||||
if (!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &info.state,
|
||||
SPA_POD_TYPE_STRING, &info.error,
|
||||
SPA_POD_TYPE_INT, &props.n_items,
|
||||
0))
|
||||
return;
|
||||
|
||||
info.state = i1;
|
||||
info.props = &props;
|
||||
props.n_items = i2;
|
||||
props.items = alloca (props.n_items * sizeof (SpaDictItem));
|
||||
for (i = 0; i < props.n_items; i++) {
|
||||
if (!spa_pod_get_string (&p, &props.items[i].key) ||
|
||||
!spa_pod_get_string (&p, &props.items[i].value))
|
||||
if (!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_STRING, &props.items[i].key,
|
||||
SPA_POD_TYPE_STRING, &props.items[i].value,
|
||||
0))
|
||||
return;
|
||||
}
|
||||
pinos_node_notify_info (proxy, &info);
|
||||
|
|
@ -354,8 +364,8 @@ node_demarshal_info (void *object,
|
|||
static void
|
||||
client_node_marshal_update (void *object,
|
||||
uint32_t change_mask,
|
||||
unsigned int max_input_ports,
|
||||
unsigned int max_output_ports,
|
||||
uint32_t max_input_ports,
|
||||
uint32_t max_output_ports,
|
||||
const SpaProps *props)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
|
|
@ -380,7 +390,7 @@ client_node_marshal_port_update (void *object,
|
|||
SpaDirection direction,
|
||||
uint32_t port_id,
|
||||
uint32_t change_mask,
|
||||
unsigned int n_possible_formats,
|
||||
uint32_t n_possible_formats,
|
||||
const SpaFormat **possible_formats,
|
||||
const SpaFormat *format,
|
||||
const SpaProps *props,
|
||||
|
|
@ -481,17 +491,20 @@ client_node_demarshal_done (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
SpaPODIter it;
|
||||
PinosConnection *connection = proxy->context->protocol_private;
|
||||
int32_t i1, i2;
|
||||
int32_t seq, idx;
|
||||
int fd;
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1) ||
|
||||
!spa_pod_get_int (&p, &i2))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &seq,
|
||||
SPA_POD_TYPE_INT, &idx,
|
||||
0))
|
||||
return;
|
||||
|
||||
fd = pinos_connection_get_fd (connection, i2);
|
||||
pinos_client_node_notify_done (proxy, i1, fd);
|
||||
fd = pinos_connection_get_fd (connection, idx);
|
||||
pinos_client_node_notify_done (proxy, seq, fd);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -500,11 +513,14 @@ client_node_demarshal_event (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
SpaPODIter it;
|
||||
const SpaNodeEvent *event;
|
||||
uint32_t s;
|
||||
|
||||
if (!spa_pod_get_bytes (&p, (const void**)&event, &s))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_BYTES, &event, &s,
|
||||
0))
|
||||
return;
|
||||
|
||||
pinos_client_node_notify_event (proxy, event);
|
||||
|
|
@ -516,15 +532,18 @@ client_node_demarshal_add_port (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
int32_t i1, i2, i3;
|
||||
SpaPODIter it;
|
||||
int32_t seq, direction, port_id;
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1) ||
|
||||
!spa_pod_get_int (&p, &i2) ||
|
||||
!spa_pod_get_int (&p, &i3))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &seq,
|
||||
SPA_POD_TYPE_INT, &direction,
|
||||
SPA_POD_TYPE_INT, &port_id,
|
||||
0))
|
||||
return;
|
||||
|
||||
pinos_client_node_notify_add_port (proxy, i1, i2, i3);
|
||||
pinos_client_node_notify_add_port (proxy, seq, direction, port_id);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -533,15 +552,18 @@ client_node_demarshal_remove_port (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
int32_t i1, i2, i3;
|
||||
SpaPODIter it;
|
||||
int32_t seq, direction, port_id;
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1) ||
|
||||
!spa_pod_get_int (&p, &i2) ||
|
||||
!spa_pod_get_int (&p, &i3))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &seq,
|
||||
SPA_POD_TYPE_INT, &direction,
|
||||
SPA_POD_TYPE_INT, &port_id,
|
||||
0))
|
||||
return;
|
||||
|
||||
pinos_client_node_notify_remove_port (proxy, i1, i2, i3);
|
||||
pinos_client_node_notify_remove_port (proxy, seq, direction, port_id);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -550,18 +572,21 @@ client_node_demarshal_set_format (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
int32_t seq, direction, port_id, flags, have_format;
|
||||
SpaPODIter it;
|
||||
uint32_t seq, direction, port_id, flags, have_format;
|
||||
const SpaFormat *format = NULL;
|
||||
|
||||
if (!spa_pod_get_int (&p, &seq) ||
|
||||
!spa_pod_get_int (&p, &direction) ||
|
||||
!spa_pod_get_int (&p, &port_id) ||
|
||||
!spa_pod_get_int (&p, &flags) ||
|
||||
!spa_pod_get_int (&p, &have_format))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &seq,
|
||||
SPA_POD_TYPE_INT, &direction,
|
||||
SPA_POD_TYPE_INT, &port_id,
|
||||
SPA_POD_TYPE_INT, &flags,
|
||||
SPA_POD_TYPE_INT, &have_format,
|
||||
0))
|
||||
return;
|
||||
|
||||
if (have_format && !spa_pod_get_object (&p, (const SpaPOD**)&format))
|
||||
if (have_format && !spa_pod_iter_get (&it, SPA_POD_TYPE_OBJECT, &format, 0))
|
||||
return;
|
||||
|
||||
pinos_client_node_notify_set_format (proxy, seq, direction, port_id,
|
||||
|
|
@ -574,14 +599,17 @@ client_node_demarshal_set_property (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
int32_t seq, id;
|
||||
SpaPODIter it;
|
||||
uint32_t seq, id;
|
||||
const void *value;
|
||||
uint32_t s;
|
||||
|
||||
if (!spa_pod_get_int (&p, &seq) ||
|
||||
!spa_pod_get_int (&p, &id) ||
|
||||
!spa_pod_get_bytes (&p, &value, &s))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &seq,
|
||||
SPA_POD_TYPE_INT, &id,
|
||||
SPA_POD_TYPE_BYTES, &value, &s,
|
||||
0))
|
||||
return;
|
||||
|
||||
pinos_client_node_notify_set_property (proxy, seq, id, s, value);
|
||||
|
|
@ -593,21 +621,25 @@ client_node_demarshal_add_mem (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
SpaPODIter it;
|
||||
PinosConnection *connection = proxy->context->protocol_private;
|
||||
int32_t direction, port_id, mem_id, type, memfd, flags, offset, sz;
|
||||
uint32_t direction, port_id, mem_id, type, memfd_idx, flags, offset, sz;
|
||||
int memfd;
|
||||
|
||||
if (!spa_pod_get_int (&p, &direction) ||
|
||||
!spa_pod_get_int (&p, &port_id) ||
|
||||
!spa_pod_get_int (&p, &mem_id) ||
|
||||
!spa_pod_get_int (&p, &type) ||
|
||||
!spa_pod_get_int (&p, &memfd) ||
|
||||
!spa_pod_get_int (&p, &flags) ||
|
||||
!spa_pod_get_int (&p, &offset) ||
|
||||
!spa_pod_get_int (&p, &sz))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &direction,
|
||||
SPA_POD_TYPE_INT, &port_id,
|
||||
SPA_POD_TYPE_INT, &mem_id,
|
||||
SPA_POD_TYPE_INT, &type,
|
||||
SPA_POD_TYPE_INT, &memfd_idx,
|
||||
SPA_POD_TYPE_INT, &flags,
|
||||
SPA_POD_TYPE_INT, &offset,
|
||||
SPA_POD_TYPE_INT, &sz,
|
||||
0))
|
||||
return;
|
||||
|
||||
memfd = pinos_connection_get_fd (connection, memfd);
|
||||
memfd = pinos_connection_get_fd (connection, memfd_idx);
|
||||
|
||||
pinos_client_node_notify_add_mem (proxy,
|
||||
direction,
|
||||
|
|
@ -626,66 +658,60 @@ client_node_demarshal_use_buffers (void *object,
|
|||
size_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
SpaPOD *p = SPA_POD_CONTENTS (SpaPODStruct, data);
|
||||
int32_t seq, direction, port_id, n_buffers;
|
||||
SpaPODIter it;
|
||||
uint32_t seq, direction, port_id, n_buffers, data_id;
|
||||
PinosClientNodeBuffer *buffers;
|
||||
int i, j;
|
||||
|
||||
if (!spa_pod_get_int (&p, &seq) ||
|
||||
!spa_pod_get_int (&p, &direction) ||
|
||||
!spa_pod_get_int (&p, &port_id) ||
|
||||
!spa_pod_get_int (&p, &n_buffers))
|
||||
if (!spa_pod_iter_struct (&it, data, size) ||
|
||||
!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &seq,
|
||||
SPA_POD_TYPE_INT, &direction,
|
||||
SPA_POD_TYPE_INT, &port_id,
|
||||
SPA_POD_TYPE_INT, &n_buffers,
|
||||
0))
|
||||
return;
|
||||
|
||||
buffers = alloca (sizeof (PinosClientNodeBuffer) * n_buffers);
|
||||
for (i = 0; i < n_buffers; i++) {
|
||||
SpaBuffer *buf = buffers[i].buffer = alloca (sizeof (SpaBuffer));
|
||||
int32_t i1, i2, i3, i4, i5;
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1) ||
|
||||
!spa_pod_get_int (&p, &i2) ||
|
||||
!spa_pod_get_int (&p, &i3) ||
|
||||
!spa_pod_get_int (&p, &i4) ||
|
||||
!spa_pod_get_int (&p, &i5))
|
||||
if (!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &buffers[i].mem_id,
|
||||
SPA_POD_TYPE_INT, &buffers[i].offset,
|
||||
SPA_POD_TYPE_INT, &buffers[i].size,
|
||||
SPA_POD_TYPE_INT, &buf->id,
|
||||
SPA_POD_TYPE_INT, &buf->n_metas, 0))
|
||||
return;
|
||||
|
||||
buffers[i].mem_id = i1;
|
||||
buffers[i].offset = i2;
|
||||
buffers[i].size = i3;
|
||||
buf->id = i4;
|
||||
buf->n_metas = i5;
|
||||
|
||||
buf->metas = alloca (sizeof (SpaMeta) * buf->n_metas);
|
||||
for (j = 0; j < buf->n_metas; j++) {
|
||||
SpaMeta *m = &buf->metas[j];
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1) ||
|
||||
!spa_pod_get_int (&p, &i2))
|
||||
if (!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &m->type,
|
||||
SPA_POD_TYPE_INT, &size, 0))
|
||||
return;
|
||||
|
||||
m->type = i1;
|
||||
m->size = i2;
|
||||
m->size = size;
|
||||
}
|
||||
if (!spa_pod_get_int (&p, &i1))
|
||||
if (!spa_pod_iter_get (&it, SPA_POD_TYPE_INT, &buf->n_datas, 0))
|
||||
return;
|
||||
|
||||
buf->n_datas = i1;
|
||||
buf->datas = alloca (sizeof (SpaData) * buf->n_datas);
|
||||
for (j = 0; j < buf->n_datas; j++) {
|
||||
SpaData *d = &buf->datas[j];
|
||||
|
||||
if (!spa_pod_get_int (&p, &i1) ||
|
||||
!spa_pod_get_int (&p, &i2) ||
|
||||
!spa_pod_get_int (&p, &i3) ||
|
||||
!spa_pod_get_int (&p, &i4) ||
|
||||
!spa_pod_get_int (&p, &i5))
|
||||
if (!spa_pod_iter_get (&it,
|
||||
SPA_POD_TYPE_INT, &d->type,
|
||||
SPA_POD_TYPE_INT, &data_id,
|
||||
SPA_POD_TYPE_INT, &d->flags,
|
||||
SPA_POD_TYPE_INT, &d->mapoffset,
|
||||
SPA_POD_TYPE_INT, &d->maxsize,
|
||||
0))
|
||||
return;
|
||||
|
||||
d->type = i1;
|
||||
d->data = SPA_UINT32_TO_PTR (i2);
|
||||
d->flags = i3;
|
||||
d->mapoffset = i4;
|
||||
d->maxsize = i5;
|
||||
d->data = SPA_UINT32_TO_PTR (data_id);
|
||||
}
|
||||
}
|
||||
pinos_client_node_notify_use_buffers (proxy,
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ typedef struct {
|
|||
int fd;
|
||||
uint32_t flags;
|
||||
void *ptr;
|
||||
off_t offset;
|
||||
size_t size;
|
||||
uint32_t offset;
|
||||
uint32_t size;
|
||||
} MemId;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -66,7 +66,7 @@ typedef struct
|
|||
|
||||
uint32_t seq;
|
||||
|
||||
unsigned int n_possible_formats;
|
||||
uint32_t n_possible_formats;
|
||||
SpaFormat **possible_formats;
|
||||
|
||||
SpaFormat *format;
|
||||
|
|
@ -310,7 +310,7 @@ static void
|
|||
add_node_update (PinosStream *stream, uint32_t change_mask, bool flush)
|
||||
{
|
||||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
unsigned int max_input_ports = 0, max_output_ports = 0;
|
||||
uint32_t max_input_ports = 0, max_output_ports = 0;
|
||||
|
||||
if (change_mask & PINOS_MESSAGE_NODE_UPDATE_MAX_INPUTS)
|
||||
max_input_ports = impl->direction == SPA_DIRECTION_INPUT ? 1 : 0;
|
||||
|
|
@ -724,7 +724,7 @@ static void
|
|||
client_node_set_property (void *object,
|
||||
uint32_t seq,
|
||||
uint32_t id,
|
||||
size_t size,
|
||||
uint32_t size,
|
||||
const void *value)
|
||||
{
|
||||
pinos_log_warn ("set property not implemented");
|
||||
|
|
@ -738,8 +738,8 @@ client_node_add_mem (void *object,
|
|||
SpaDataType type,
|
||||
int memfd,
|
||||
uint32_t flags,
|
||||
off_t offset,
|
||||
size_t size)
|
||||
uint32_t offset,
|
||||
uint32_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
PinosStream *stream = proxy->user_data;
|
||||
|
|
@ -748,12 +748,12 @@ client_node_add_mem (void *object,
|
|||
|
||||
m = find_mem (stream, mem_id);
|
||||
if (m) {
|
||||
pinos_log_debug ("update mem %u, fd %d, flags %d, off %zd, size %zd",
|
||||
pinos_log_debug ("update mem %u, fd %d, flags %d, off %d, size %d",
|
||||
mem_id, memfd, flags, offset, size);
|
||||
clear_memid (m);
|
||||
} else {
|
||||
m = pinos_array_add (&impl->mem_ids, sizeof (MemId));
|
||||
pinos_log_debug ("add mem %u, fd %d, flags %d, off %zd, size %zd",
|
||||
pinos_log_debug ("add mem %u, fd %d, flags %d, off %d, size %d",
|
||||
mem_id, memfd, flags, offset, size);
|
||||
}
|
||||
m->id = mem_id;
|
||||
|
|
@ -769,14 +769,14 @@ client_node_use_buffers (void *object,
|
|||
uint32_t seq,
|
||||
SpaDirection direction,
|
||||
uint32_t port_id,
|
||||
unsigned int n_buffers,
|
||||
uint32_t n_buffers,
|
||||
PinosClientNodeBuffer *buffers)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
PinosStream *stream = proxy->user_data;
|
||||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
BufferId *bid;
|
||||
unsigned int i, j, len;
|
||||
uint32_t i, j, len;
|
||||
SpaBuffer *b;
|
||||
|
||||
/* clear previous buffers */
|
||||
|
|
@ -795,7 +795,7 @@ client_node_use_buffers (void *object,
|
|||
mid->ptr = mmap (NULL, mid->size + mid->offset, PROT_READ | PROT_WRITE, MAP_SHARED, mid->fd, 0);
|
||||
if (mid->ptr == MAP_FAILED) {
|
||||
mid->ptr = NULL;
|
||||
pinos_log_warn ("Failed to mmap memory %zd %p: %s", mid->size, mid, strerror (errno));
|
||||
pinos_log_warn ("Failed to mmap memory %d %p: %s", mid->size, mid, strerror (errno));
|
||||
continue;
|
||||
}
|
||||
mid->ptr = SPA_MEMBER (mid->ptr, mid->offset, void);
|
||||
|
|
@ -820,7 +820,7 @@ client_node_use_buffers (void *object,
|
|||
pinos_log_warn ("unexpected id %u found, expected %u", bid->id, len);
|
||||
impl->in_order = false;
|
||||
}
|
||||
pinos_log_debug ("add buffer %d %d %zd", mid->id, bid->id, buffers[i].offset);
|
||||
pinos_log_debug ("add buffer %d %d %u", mid->id, bid->id, buffers[i].offset);
|
||||
|
||||
for (j = 0; j < b->n_metas; j++) {
|
||||
SpaMeta *m = &b->metas[j];
|
||||
|
|
@ -893,8 +893,8 @@ client_node_port_command (void *object,
|
|||
static void
|
||||
client_node_transport (void *object,
|
||||
int memfd,
|
||||
off_t offset,
|
||||
size_t size)
|
||||
uint32_t offset,
|
||||
uint32_t size)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
PinosStream *stream = proxy->user_data;
|
||||
|
|
@ -964,7 +964,7 @@ pinos_stream_connect (PinosStream *stream,
|
|||
PinosStreamMode mode,
|
||||
const char *port_path,
|
||||
PinosStreamFlags flags,
|
||||
unsigned int n_possible_formats,
|
||||
uint32_t n_possible_formats,
|
||||
SpaFormat **possible_formats)
|
||||
{
|
||||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
|
|
@ -1030,7 +1030,7 @@ bool
|
|||
pinos_stream_finish_format (PinosStream *stream,
|
||||
SpaResult res,
|
||||
SpaAllocParam **params,
|
||||
unsigned int n_params)
|
||||
uint32_t n_params)
|
||||
{
|
||||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
|
||||
|
|
|
|||
|
|
@ -105,14 +105,14 @@ bool pinos_stream_connect (PinosStream *stream,
|
|||
PinosStreamMode mode,
|
||||
const char *port_path,
|
||||
PinosStreamFlags flags,
|
||||
unsigned int n_possible_formats,
|
||||
uint32_t n_possible_formats,
|
||||
SpaFormat **possible_formats);
|
||||
bool pinos_stream_disconnect (PinosStream *stream);
|
||||
|
||||
bool pinos_stream_finish_format (PinosStream *stream,
|
||||
SpaResult res,
|
||||
SpaAllocParam **params,
|
||||
unsigned int n_params);
|
||||
uint32_t n_params);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ transport_setup_area (void *p, PinosTransport *trans)
|
|||
}
|
||||
|
||||
PinosTransport *
|
||||
pinos_transport_new (unsigned int max_inputs,
|
||||
unsigned int max_outputs)
|
||||
pinos_transport_new (uint32_t max_inputs,
|
||||
uint32_t max_outputs)
|
||||
{
|
||||
PinosTransportImpl *impl;
|
||||
PinosTransport *trans;
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@ typedef struct _PinosTransportArea PinosTransportArea;
|
|||
#include <pinos/client/sig.h>
|
||||
|
||||
typedef struct {
|
||||
int memfd;
|
||||
off_t offset;
|
||||
size_t size;
|
||||
int memfd;
|
||||
uint32_t offset;
|
||||
uint32_t size;
|
||||
} PinosTransportInfo;
|
||||
|
||||
/**
|
||||
|
|
@ -48,10 +48,10 @@ typedef struct {
|
|||
* Shared structure between client and server
|
||||
*/
|
||||
struct _PinosTransportArea {
|
||||
unsigned int max_inputs;
|
||||
unsigned int n_inputs;
|
||||
unsigned int max_outputs;
|
||||
unsigned int n_outputs;
|
||||
uint32_t max_inputs;
|
||||
uint32_t n_inputs;
|
||||
uint32_t max_outputs;
|
||||
uint32_t n_outputs;
|
||||
};
|
||||
|
||||
struct _PinosTransport {
|
||||
|
|
@ -67,8 +67,8 @@ struct _PinosTransport {
|
|||
SpaRingbuffer *output_buffer;
|
||||
};
|
||||
|
||||
PinosTransport * pinos_transport_new (unsigned int max_inputs,
|
||||
unsigned int max_outputs);
|
||||
PinosTransport * pinos_transport_new (uint32_t max_inputs,
|
||||
uint32_t max_outputs);
|
||||
PinosTransport * pinos_transport_new_from_info (PinosTransportInfo *info);
|
||||
|
||||
void pinos_transport_destroy (PinosTransport *trans);
|
||||
|
|
|
|||
|
|
@ -353,8 +353,8 @@ handle_audio_fields (ConvertData *d)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static off_t
|
||||
write_pod (SpaPODBuilder *b, off_t ref, const void *data, size_t size)
|
||||
static uint32_t
|
||||
write_pod (SpaPODBuilder *b, uint32_t ref, const void *data, uint32_t size)
|
||||
{
|
||||
if (ref == -1)
|
||||
ref = b->offset;
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ on_add_buffer (PinosListener *listener,
|
|||
GstPinosSink *pinossink = SPA_CONTAINER_OF (listener, GstPinosSink, stream_add_buffer);
|
||||
SpaBuffer *b;
|
||||
GstBuffer *buf;
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
ProcessMemData data;
|
||||
|
||||
GST_LOG_OBJECT (pinossink, "add buffer");
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ on_add_buffer (PinosListener *listener,
|
|||
GstPinosSrc *pinossrc = SPA_CONTAINER_OF (listener, GstPinosSrc, stream_add_buffer);
|
||||
SpaBuffer *b;
|
||||
GstBuffer *buf;
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
ProcessMemData data;
|
||||
|
||||
GST_LOG_OBJECT (pinossrc, "add buffer");
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ connection_data (SpaSource *source,
|
|||
PinosConnection *conn = client->connection;
|
||||
uint8_t opcode;
|
||||
uint32_t id;
|
||||
size_t size;
|
||||
uint32_t size;
|
||||
PinosClient *c = client->client;
|
||||
void *message;
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ add_item (PinosSpaMonitor *this, SpaMonitorItem *item)
|
|||
props = pinos_properties_new (NULL, NULL);
|
||||
|
||||
if (item->info) {
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < item->info->n_items; i++) {
|
||||
pinos_properties_set (props,
|
||||
|
|
@ -203,7 +203,7 @@ pinos_spa_monitor_load (PinosCore *core,
|
|||
SpaResult res;
|
||||
void *iface;
|
||||
void *hnd;
|
||||
unsigned int index;
|
||||
uint32_t index;
|
||||
SpaEnumHandleFactoryFunc enum_func;
|
||||
const SpaHandleFactory *factory;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ pinos_spa_node_load (PinosCore *core,
|
|||
SpaResult res;
|
||||
SpaHandle *handle;
|
||||
void *hnd;
|
||||
unsigned int index;
|
||||
uint32_t index;
|
||||
SpaEnumHandleFactoryFunc enum_func;
|
||||
const SpaHandleFactory *factory;
|
||||
void *iface;
|
||||
|
|
|
|||
|
|
@ -72,11 +72,11 @@ typedef struct {
|
|||
bool valid;
|
||||
SpaPortInfo *info;
|
||||
SpaFormat *format;
|
||||
unsigned int n_formats;
|
||||
uint32_t n_formats;
|
||||
SpaFormat **formats;
|
||||
void *io;
|
||||
|
||||
unsigned int n_buffers;
|
||||
uint32_t n_buffers;
|
||||
ProxyBuffer buffers[MAX_BUFFERS];
|
||||
|
||||
uint32_t buffer_mem_id;
|
||||
|
|
@ -101,10 +101,10 @@ struct _SpaProxy
|
|||
|
||||
SpaSource data_source;
|
||||
|
||||
unsigned int max_inputs;
|
||||
unsigned int n_inputs;
|
||||
unsigned int max_outputs;
|
||||
unsigned int n_outputs;
|
||||
uint32_t max_inputs;
|
||||
uint32_t n_inputs;
|
||||
uint32_t max_outputs;
|
||||
uint32_t n_outputs;
|
||||
SpaProxyPort in_ports[MAX_INPUTS];
|
||||
SpaProxyPort out_ports[MAX_OUTPUTS];
|
||||
|
||||
|
|
@ -254,10 +254,10 @@ spa_proxy_node_set_event_callback (SpaNode *node,
|
|||
|
||||
static SpaResult
|
||||
spa_proxy_node_get_n_ports (SpaNode *node,
|
||||
unsigned int *n_input_ports,
|
||||
unsigned int *max_input_ports,
|
||||
unsigned int *n_output_ports,
|
||||
unsigned int *max_output_ports)
|
||||
uint32_t *n_input_ports,
|
||||
uint32_t *max_input_ports,
|
||||
uint32_t *n_output_ports,
|
||||
uint32_t *max_output_ports)
|
||||
{
|
||||
SpaProxy *this;
|
||||
|
||||
|
|
@ -280,9 +280,9 @@ spa_proxy_node_get_n_ports (SpaNode *node,
|
|||
|
||||
static SpaResult
|
||||
spa_proxy_node_get_port_ids (SpaNode *node,
|
||||
unsigned int n_input_ports,
|
||||
uint32_t n_input_ports,
|
||||
uint32_t *input_ids,
|
||||
unsigned int n_output_ports,
|
||||
uint32_t n_output_ports,
|
||||
uint32_t *output_ids)
|
||||
{
|
||||
SpaProxy *this;
|
||||
|
|
@ -313,14 +313,14 @@ do_update_port (SpaProxy *this,
|
|||
SpaDirection direction,
|
||||
uint32_t port_id,
|
||||
uint32_t change_mask,
|
||||
unsigned int n_possible_formats,
|
||||
uint32_t n_possible_formats,
|
||||
const SpaFormat **possible_formats,
|
||||
const SpaFormat *format,
|
||||
const SpaProps *props,
|
||||
const SpaPortInfo *info)
|
||||
{
|
||||
SpaProxyPort *port;
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
size_t size;
|
||||
|
||||
if (direction == SPA_DIRECTION_INPUT) {
|
||||
|
|
@ -459,7 +459,7 @@ spa_proxy_node_port_enum_formats (SpaNode *node,
|
|||
uint32_t port_id,
|
||||
SpaFormat **format,
|
||||
const SpaFormat *filter,
|
||||
unsigned int index)
|
||||
uint32_t index)
|
||||
{
|
||||
SpaProxy *this;
|
||||
SpaProxyPort *port;
|
||||
|
|
@ -630,7 +630,7 @@ spa_proxy_node_port_use_buffers (SpaNode *node,
|
|||
{
|
||||
SpaProxy *this;
|
||||
SpaProxyPort *port;
|
||||
unsigned int i, j;
|
||||
uint32_t i, j;
|
||||
size_t n_mem;
|
||||
PinosClientNodeBuffer *mb;
|
||||
SpaMetaShared *msh;
|
||||
|
|
@ -886,8 +886,8 @@ handle_node_event (SpaProxy *this,
|
|||
static void
|
||||
client_node_update (void *object,
|
||||
uint32_t change_mask,
|
||||
unsigned int max_input_ports,
|
||||
unsigned int max_output_ports,
|
||||
uint32_t max_input_ports,
|
||||
uint32_t max_output_ports,
|
||||
const SpaProps *props)
|
||||
{
|
||||
PinosResource *resource = object;
|
||||
|
|
@ -909,7 +909,7 @@ client_node_port_update (void *object,
|
|||
SpaDirection direction,
|
||||
uint32_t port_id,
|
||||
uint32_t change_mask,
|
||||
unsigned int n_possible_formats,
|
||||
uint32_t n_possible_formats,
|
||||
const SpaFormat **possible_formats,
|
||||
const SpaFormat *format,
|
||||
const SpaProps *props,
|
||||
|
|
@ -1044,9 +1044,9 @@ static SpaResult
|
|||
proxy_init (SpaProxy *this,
|
||||
SpaDict *info,
|
||||
const SpaSupport *support,
|
||||
unsigned int n_support)
|
||||
uint32_t n_support)
|
||||
{
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < n_support; i++) {
|
||||
if (strcmp (support[i].uri, SPA_LOG_URI) == 0)
|
||||
|
|
@ -1114,7 +1114,7 @@ on_global_added (PinosListener *listener,
|
|||
static SpaResult
|
||||
proxy_clear (SpaProxy *this)
|
||||
{
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < MAX_INPUTS; i++) {
|
||||
if (this->in_ports[i].valid)
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ pinos_client_update_properties (PinosClient *client,
|
|||
if (dict)
|
||||
client->properties = pinos_properties_new_dict (dict);
|
||||
} else {
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < dict->n_items; i++)
|
||||
pinos_properties_set (client->properties,
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ pinos_core_update_properties (PinosCore *core,
|
|||
if (dict)
|
||||
core->properties = pinos_properties_new_dict (dict);
|
||||
} else if (dict != &core->properties->dict) {
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < dict->n_items; i++)
|
||||
pinos_properties_set (core->properties,
|
||||
|
|
@ -456,7 +456,7 @@ pinos_core_find_port (PinosCore *core,
|
|||
PinosPort *other_port,
|
||||
uint32_t id,
|
||||
PinosProperties *props,
|
||||
unsigned int n_format_filters,
|
||||
uint32_t n_format_filters,
|
||||
SpaFormat **format_filters,
|
||||
char **error)
|
||||
{
|
||||
|
|
@ -520,14 +520,14 @@ pinos_core_find_format (PinosCore *core,
|
|||
PinosPort *output,
|
||||
PinosPort *input,
|
||||
PinosProperties *props,
|
||||
unsigned int n_format_filters,
|
||||
uint32_t n_format_filters,
|
||||
SpaFormat **format_filterss,
|
||||
char **error)
|
||||
{
|
||||
SpaNodeState out_state, in_state;
|
||||
SpaResult res;
|
||||
SpaFormat *filter = NULL, *format;
|
||||
unsigned int iidx = 0, oidx = 0;
|
||||
uint32_t iidx = 0, oidx = 0;
|
||||
|
||||
out_state = output->node->node->state;
|
||||
in_state = input->node->node->state;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ struct _PinosCore {
|
|||
PinosDataLoop *data_loop;
|
||||
|
||||
SpaSupport *support;
|
||||
unsigned int n_support;
|
||||
uint32_t n_support;
|
||||
|
||||
PINOS_SIGNAL (destroy_signal, (PinosListener *listener,
|
||||
PinosCore *core));
|
||||
|
|
@ -122,7 +122,7 @@ SpaFormat * pinos_core_find_format (PinosCore *core,
|
|||
PinosPort *output,
|
||||
PinosPort *input,
|
||||
PinosProperties *props,
|
||||
unsigned int n_format_filters,
|
||||
uint32_t n_format_filters,
|
||||
SpaFormat **format_filters,
|
||||
char **error);
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ PinosPort * pinos_core_find_port (PinosCore *core,
|
|||
PinosPort *other_port,
|
||||
uint32_t id,
|
||||
PinosProperties *props,
|
||||
unsigned int n_format_filters,
|
||||
uint32_t n_format_filters,
|
||||
SpaFormat **format_filters,
|
||||
char **error);
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ typedef struct
|
|||
bool allocated;
|
||||
PinosMemblock buffer_mem;
|
||||
SpaBuffer **buffers;
|
||||
unsigned int n_buffers;
|
||||
uint32_t n_buffers;
|
||||
} PinosLinkImpl;
|
||||
|
||||
static void
|
||||
|
|
@ -142,7 +142,7 @@ error:
|
|||
static void *
|
||||
find_param (const SpaPortInfo *info, SpaAllocParamType type)
|
||||
{
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < info->n_params; i++) {
|
||||
if (info->params[i]->type == type)
|
||||
|
|
@ -154,7 +154,7 @@ find_param (const SpaPortInfo *info, SpaAllocParamType type)
|
|||
static void *
|
||||
find_meta_enable (const SpaPortInfo *info, SpaMetaType type)
|
||||
{
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < info->n_params; i++) {
|
||||
if (info->params[i]->type == SPA_ALLOC_PARAM_TYPE_META_ENABLE &&
|
||||
|
|
@ -167,20 +167,20 @@ find_meta_enable (const SpaPortInfo *info, SpaMetaType type)
|
|||
|
||||
static SpaBuffer **
|
||||
alloc_buffers (PinosLink *this,
|
||||
unsigned int n_buffers,
|
||||
unsigned int n_params,
|
||||
uint32_t n_buffers,
|
||||
uint32_t n_params,
|
||||
SpaAllocParam **params,
|
||||
unsigned int n_datas,
|
||||
uint32_t n_datas,
|
||||
size_t *data_sizes,
|
||||
ssize_t *data_strides,
|
||||
PinosMemblock *mem)
|
||||
{
|
||||
SpaBuffer **buffers, *bp;
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
size_t skel_size, data_size, meta_size;
|
||||
SpaChunk *cdp;
|
||||
void *ddp;
|
||||
unsigned int n_metas;
|
||||
uint32_t n_metas;
|
||||
SpaMeta *metas;
|
||||
|
||||
n_metas = data_size = meta_size = 0;
|
||||
|
|
@ -382,7 +382,7 @@ do_allocation (PinosLink *this, SpaNodeState in_state, SpaNodeState out_state)
|
|||
if (impl->buffers == NULL) {
|
||||
SpaAllocParamBuffers *in_alloc, *out_alloc;
|
||||
SpaAllocParamMetaEnableRingbuffer *in_me, *out_me;
|
||||
unsigned int max_buffers;
|
||||
uint32_t max_buffers;
|
||||
size_t minsize, stride, blocks;
|
||||
|
||||
in_me = find_meta_enable (iinfo, SPA_META_TYPE_RINGBUFFER);
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ struct _PinosLink {
|
|||
PinosPort *port));
|
||||
|
||||
struct {
|
||||
unsigned int in_ready;
|
||||
uint32_t in_ready;
|
||||
PinosPort *input;
|
||||
PinosPort *output;
|
||||
SpaList input_link;
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ update_port_ids (PinosNode *node, bool create)
|
|||
{
|
||||
PinosNodeImpl *impl = SPA_CONTAINER_OF (node, PinosNodeImpl, this);
|
||||
uint32_t *input_port_ids, *output_port_ids;
|
||||
unsigned int n_input_ports, n_output_ports, max_input_ports, max_output_ports;
|
||||
unsigned int i;
|
||||
uint32_t n_input_ports, n_output_ports, max_input_ports, max_output_ports;
|
||||
uint32_t i;
|
||||
SpaList *ports;
|
||||
|
||||
if (node->node == NULL)
|
||||
|
|
@ -524,7 +524,7 @@ pinos_node_new (PinosCore *core,
|
|||
spa_list_init (&this->output_ports);
|
||||
|
||||
if (this->node->info) {
|
||||
unsigned int i;
|
||||
uint32_t i;
|
||||
|
||||
if (this->properties == NULL)
|
||||
this->properties = pinos_properties_new (NULL, NULL);
|
||||
|
|
@ -681,7 +681,7 @@ PinosPort *
|
|||
pinos_node_get_free_port (PinosNode *node,
|
||||
PinosDirection direction)
|
||||
{
|
||||
unsigned int n_ports, max_ports;
|
||||
uint32_t n_ports, max_ports;
|
||||
SpaList *ports;
|
||||
PinosPort *port = NULL, *p;
|
||||
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ struct _PinosNode {
|
|||
PinosPort **input_port_map;
|
||||
PinosPort **output_port_map;
|
||||
|
||||
unsigned int n_used_output_links;
|
||||
unsigned int n_used_input_links;
|
||||
uint32_t n_used_output_links;
|
||||
uint32_t n_used_input_links;
|
||||
|
||||
PinosTransport *transport;
|
||||
PINOS_SIGNAL (transport_changed, (PinosListener *listener,
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ struct _PinosPort {
|
|||
bool allocated;
|
||||
PinosMemblock buffer_mem;
|
||||
SpaBuffer **buffers;
|
||||
unsigned int n_buffers;
|
||||
uint32_t n_buffers;
|
||||
|
||||
SpaList links;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ typedef struct {
|
|||
PinosConnection *connection;
|
||||
} Builder;
|
||||
|
||||
static off_t
|
||||
write_pod (SpaPODBuilder *b, off_t ref, const void *data, size_t size)
|
||||
static uint32_t
|
||||
write_pod (SpaPODBuilder *b, uint32_t ref, const void *data, uint32_t size)
|
||||
{
|
||||
if (ref == -1)
|
||||
ref = b->offset;
|
||||
|
|
@ -512,7 +512,7 @@ static void
|
|||
client_node_marshal_set_property (void *object,
|
||||
uint32_t seq,
|
||||
uint32_t id,
|
||||
size_t size,
|
||||
uint32_t size,
|
||||
const void *value)
|
||||
{
|
||||
PinosResource *resource = object;
|
||||
|
|
@ -537,8 +537,8 @@ client_node_marshal_add_mem (void *object,
|
|||
SpaDataType type,
|
||||
int memfd,
|
||||
uint32_t flags,
|
||||
off_t offset,
|
||||
size_t size)
|
||||
uint32_t offset,
|
||||
uint32_t size)
|
||||
{
|
||||
PinosResource *resource = object;
|
||||
PinosConnection *connection = resource->client->protocol_private;
|
||||
|
|
@ -564,7 +564,7 @@ client_node_marshal_use_buffers (void *object,
|
|||
uint32_t seq,
|
||||
SpaDirection direction,
|
||||
uint32_t port_id,
|
||||
unsigned int n_buffers,
|
||||
uint32_t n_buffers,
|
||||
PinosClientNodeBuffer *buffers)
|
||||
{
|
||||
PinosResource *resource = object;
|
||||
|
|
@ -645,8 +645,8 @@ client_node_marshal_port_command (void *object,
|
|||
static void
|
||||
client_node_marshal_transport (void *object,
|
||||
int memfd,
|
||||
off_t offset,
|
||||
size_t size)
|
||||
uint32_t offset,
|
||||
uint32_t size)
|
||||
{
|
||||
PinosResource *resource = object;
|
||||
PinosConnection *connection = resource->client->protocol_private;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue