mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -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;
|
||||
}
|
||||
|
||||
#define PINOS_DEBUG_MESSAGE(format,args...) pinos_log_trace(format,##args)
|
||||
|
||||
static void *
|
||||
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);
|
||||
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;
|
||||
|
||||
|
|
@ -342,7 +340,7 @@ pinos_connection_flush (PinosConnection *conn)
|
|||
}
|
||||
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->n_fds = 0;
|
||||
|
|
|
|||
|
|
@ -126,8 +126,6 @@ core_event_done (void *object,
|
|||
PinosContext *this = proxy->context;
|
||||
|
||||
if (seq == 0) {
|
||||
pinos_core_do_sync (this->core_proxy, 1);
|
||||
} else if (seq == 1) {
|
||||
context_set_state (this, PINOS_CONTEXT_STATE_CONNECTED, NULL);
|
||||
}
|
||||
}
|
||||
|
|
@ -193,12 +191,6 @@ static const PinosModuleEvents module_events = {
|
|||
&module_event_info,
|
||||
};
|
||||
|
||||
static void
|
||||
node_event_done (void *object,
|
||||
uint32_t seq)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
node_event_info (void *object,
|
||||
PinosNodeInfo *info)
|
||||
|
|
@ -224,7 +216,6 @@ node_event_info (void *object,
|
|||
}
|
||||
|
||||
static const PinosNodeEvents node_events = {
|
||||
&node_event_done,
|
||||
&node_event_info
|
||||
};
|
||||
|
||||
|
|
@ -403,10 +394,8 @@ on_context_data (SpaSource *source,
|
|||
|
||||
demarshal = proxy->iface->events;
|
||||
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);
|
||||
spa_debug_pod (message);
|
||||
}
|
||||
} else
|
||||
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;
|
||||
|
||||
pinos_core_do_get_registry (context->core_proxy,
|
||||
0,
|
||||
context->registry_proxy->id);
|
||||
|
||||
pinos_core_do_sync (context->core_proxy, 0);
|
||||
|
||||
return true;
|
||||
|
||||
no_registry:
|
||||
|
|
|
|||
|
|
@ -48,16 +48,13 @@ typedef struct {
|
|||
void (*sync) (void *object,
|
||||
uint32_t seq);
|
||||
void (*get_registry) (void *object,
|
||||
uint32_t seq,
|
||||
uint32_t new_id);
|
||||
void (*create_node) (void *object,
|
||||
uint32_t seq,
|
||||
const char *factory_name,
|
||||
const char *name,
|
||||
const SpaDict *props,
|
||||
uint32_t new_id);
|
||||
void (*create_client_node) (void *object,
|
||||
uint32_t seq,
|
||||
const char *name,
|
||||
const SpaDict *props,
|
||||
uint32_t new_id);
|
||||
|
|
@ -114,13 +111,10 @@ typedef struct {
|
|||
#define pinos_module_notify_info(r,...) ((PinosModuleEvents*)r->iface->events)->info(r,__VA_ARGS__)
|
||||
|
||||
typedef struct {
|
||||
void (*done) (void *object,
|
||||
uint32_t seq);
|
||||
void (*info) (void *object,
|
||||
PinosNodeInfo *info);
|
||||
} 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__)
|
||||
|
||||
struct _PinosClientNodeBuffer {
|
||||
|
|
@ -157,19 +151,17 @@ typedef struct {
|
|||
SpaNodeState state);
|
||||
void (*event) (void *object,
|
||||
SpaNodeEvent *event);
|
||||
void (*destroy) (void *object,
|
||||
uint32_t seq);
|
||||
void (*destroy) (void *object);
|
||||
} PinosClientNodeMethods;
|
||||
|
||||
#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_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_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 {
|
||||
void (*done) (void *object,
|
||||
uint32_t seq,
|
||||
int datafd);
|
||||
void (*event) (void *object,
|
||||
const SpaNodeEvent *event);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,6 @@ core_marshal_sync (void *object,
|
|||
|
||||
static void
|
||||
core_marshal_get_registry (void *object,
|
||||
uint32_t seq,
|
||||
uint32_t new_id)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
|
|
@ -104,7 +103,6 @@ core_marshal_get_registry (void *object,
|
|||
|
||||
spa_pod_builder_add (&b.b,
|
||||
SPA_POD_TYPE_STRUCT, &f,
|
||||
SPA_POD_TYPE_INT, seq,
|
||||
SPA_POD_TYPE_INT, new_id,
|
||||
-SPA_POD_TYPE_STRUCT, &f,
|
||||
0);
|
||||
|
|
@ -114,7 +112,6 @@ core_marshal_get_registry (void *object,
|
|||
|
||||
static void
|
||||
core_marshal_create_node (void *object,
|
||||
uint32_t seq,
|
||||
const char *factory_name,
|
||||
const char *name,
|
||||
const SpaDict *props,
|
||||
|
|
@ -130,7 +127,6 @@ core_marshal_create_node (void *object,
|
|||
|
||||
spa_pod_builder_add (&b.b,
|
||||
SPA_POD_TYPE_STRUCT, &f,
|
||||
SPA_POD_TYPE_INT, seq,
|
||||
SPA_POD_TYPE_STRING, factory_name,
|
||||
SPA_POD_TYPE_STRING, name,
|
||||
SPA_POD_TYPE_INT, n_items, 0);
|
||||
|
|
@ -150,7 +146,6 @@ core_marshal_create_node (void *object,
|
|||
|
||||
static void
|
||||
core_marshal_create_client_node (void *object,
|
||||
uint32_t seq,
|
||||
const char *name,
|
||||
const SpaDict *props,
|
||||
uint32_t new_id)
|
||||
|
|
@ -165,7 +160,6 @@ core_marshal_create_client_node (void *object,
|
|||
|
||||
spa_pod_builder_add (&b.b,
|
||||
SPA_POD_TYPE_STRUCT, &f,
|
||||
SPA_POD_TYPE_INT, seq,
|
||||
SPA_POD_TYPE_STRING, name,
|
||||
SPA_POD_TYPE_INT, n_items, 0);
|
||||
|
||||
|
|
@ -314,25 +308,6 @@ module_demarshal_info (void *object,
|
|||
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
|
||||
node_demarshal_info (void *object,
|
||||
void *data,
|
||||
|
|
@ -517,8 +492,7 @@ client_node_marshal_event (void *object,
|
|||
}
|
||||
|
||||
static void
|
||||
client_node_marshal_destroy (void *object,
|
||||
uint32_t seq)
|
||||
client_node_marshal_destroy (void *object)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
PinosConnection *connection = proxy->context->protocol_private;
|
||||
|
|
@ -527,7 +501,6 @@ client_node_marshal_destroy (void *object,
|
|||
|
||||
spa_pod_builder_add (&b.b,
|
||||
SPA_POD_TYPE_STRUCT, &f,
|
||||
SPA_POD_TYPE_INT, seq,
|
||||
-SPA_POD_TYPE_STRUCT, &f,
|
||||
0);
|
||||
|
||||
|
|
@ -542,18 +515,17 @@ client_node_demarshal_done (void *object,
|
|||
PinosProxy *proxy = object;
|
||||
SpaPODIter it;
|
||||
PinosConnection *connection = proxy->context->protocol_private;
|
||||
int32_t seq, idx;
|
||||
int32_t idx;
|
||||
int fd;
|
||||
|
||||
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 false;
|
||||
|
||||
fd = pinos_connection_get_fd (connection, idx);
|
||||
((PinosClientNodeEvents*)proxy->implementation)->done (proxy, seq, fd);
|
||||
((PinosClientNodeEvents*)proxy->implementation)->done (proxy, fd);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1031,13 +1003,12 @@ static const PinosInterface pinos_protocol_native_client_module_interface = {
|
|||
};
|
||||
|
||||
static const PinosDemarshalFunc pinos_protocol_native_client_node_demarshal[] = {
|
||||
&node_demarshal_done,
|
||||
&node_demarshal_info,
|
||||
};
|
||||
|
||||
static const PinosInterface pinos_protocol_native_client_node_interface = {
|
||||
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[] = {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <pinos/client/log.h>
|
||||
#include <pinos/client/proxy.h>
|
||||
#include <pinos/client/protocol-native.h>
|
||||
|
||||
typedef struct {
|
||||
PinosProxy this;
|
||||
|
|
|
|||
|
|
@ -64,8 +64,6 @@ typedef struct
|
|||
|
||||
SpaNodeState node_state;
|
||||
|
||||
uint32_t seq;
|
||||
|
||||
uint32_t n_possible_formats;
|
||||
SpaFormat **possible_formats;
|
||||
|
||||
|
|
@ -661,7 +659,6 @@ handle_node_command (PinosStream *stream,
|
|||
|
||||
static void
|
||||
client_node_done (void *object,
|
||||
uint32_t seq,
|
||||
int datafd)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
|
|
@ -1000,7 +997,6 @@ pinos_stream_connect (PinosStream *stream,
|
|||
impl->node_proxy->implementation = &client_node_events;
|
||||
|
||||
pinos_core_do_create_client_node (stream->context->core_proxy,
|
||||
++impl->seq,
|
||||
"client-node",
|
||||
&stream->properties->dict,
|
||||
impl->node_proxy->id);
|
||||
|
|
@ -1101,7 +1097,7 @@ pinos_stream_disconnect (PinosStream *stream)
|
|||
|
||||
unhandle_socket (stream);
|
||||
|
||||
pinos_client_node_do_destroy (impl->node_proxy, ++impl->seq);
|
||||
pinos_client_node_do_destroy (impl->node_proxy);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue