Rework transport protocol

Use a more simple tranport protocol for the realtime data. Use a piece
of shared memory and a socket where we use a 1byte read/write to trigger
remote actions. Also use a ringbuffer for events.
This commit is contained in:
Wim Taymans 2016-11-07 10:24:13 +01:00
parent 7e46f9e3ad
commit b774b99db5
22 changed files with 797 additions and 364 deletions

View file

@ -43,18 +43,21 @@ typedef enum {
PINOS_MESSAGE_NODE_EVENT = 5,
/* server to client */
PINOS_MESSAGE_ADD_PORT = 32,
PINOS_MESSAGE_REMOVE_PORT = 33,
PINOS_MESSAGE_TRANSPORT_UPDATE = 32,
PINOS_MESSAGE_SET_FORMAT = 34,
PINOS_MESSAGE_SET_PROPERTY = 35,
PINOS_MESSAGE_ADD_PORT = 33,
PINOS_MESSAGE_REMOVE_PORT = 34,
PINOS_MESSAGE_NODE_COMMAND = 36,
PINOS_MESSAGE_PORT_COMMAND = 37,
PINOS_MESSAGE_SET_FORMAT = 35,
PINOS_MESSAGE_SET_PROPERTY = 36,
PINOS_MESSAGE_NODE_COMMAND = 37,
PINOS_MESSAGE_PORT_COMMAND = 38,
/* both */
PINOS_MESSAGE_ADD_MEM = 64,
PINOS_MESSAGE_USE_BUFFERS = 66,
PINOS_MESSAGE_PROCESS_BUFFER = 67,
} PinosMessageType;
@ -142,6 +145,13 @@ typedef struct {
SpaNodeCommand *command;
} PinosMessagePortCommand;
/* PINOS_MESSAGE_TRANSPORT_UPDATE */
typedef struct {
unsigned int memfd_index;
off_t offset;
size_t size;
} PinosMessageTransportUpdate;
/* PINOS_MESSAGE_ADD_MEM */
typedef struct {
SpaDirection direction;