mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
Remove some events
Remove port added and port removed, we can get that info by inspecting the port ids. Remove data from ringbuffer, we just need the ringbuffer to keep track of the read and write positions. Handle async-complete in the main thread Work on async node initialization Work on using a queue as the link between nodes Make the daemon link things based on the node states Use queue helper in v4l2
This commit is contained in:
parent
68148188fa
commit
1ba10cf848
17 changed files with 366 additions and 273 deletions
|
|
@ -59,10 +59,9 @@ typedef enum {
|
|||
/* client to server */
|
||||
SPA_CONTROL_CMD_NODE_UPDATE = 1,
|
||||
SPA_CONTROL_CMD_PORT_UPDATE = 2,
|
||||
SPA_CONTROL_CMD_PORT_REMOVED = 3,
|
||||
SPA_CONTROL_CMD_NODE_STATE_CHANGE = 4,
|
||||
SPA_CONTROL_CMD_NODE_STATE_CHANGE = 3,
|
||||
|
||||
SPA_CONTROL_CMD_PORT_STATUS_CHANGE = 5,
|
||||
SPA_CONTROL_CMD_PORT_STATUS_CHANGE = 4,
|
||||
|
||||
/* server to client */
|
||||
SPA_CONTROL_CMD_ADD_PORT = 32,
|
||||
|
|
@ -109,11 +108,6 @@ typedef struct {
|
|||
const SpaPortInfo *info;
|
||||
} SpaControlCmdPortUpdate;
|
||||
|
||||
/* SPA_CONTROL_CMD_PORT_REMOVED */
|
||||
typedef struct {
|
||||
uint32_t port_id;
|
||||
} SpaControlCmdPortRemoved;
|
||||
|
||||
/* SPA_CONTROL_CMD_PORT_STATUS_CHANGE */
|
||||
|
||||
/* SPA_CONTROL_CMD_NODE_STATE_CHANGE */
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@ typedef struct _SpaNodeEvent SpaNodeEvent;
|
|||
* SpaEventType:
|
||||
* @SPA_NODE_EVENT_TYPE_INVALID: invalid event, should be ignored
|
||||
* @SPA_NODE_EVENT_TYPE_ASYNC_COMPLETE: an async operation completed
|
||||
* @SPA_NODE_EVENT_TYPE_PORT_ADDED: a new port is added
|
||||
* @SPA_NODE_EVENT_TYPE_PORT_REMOVED: a port is removed
|
||||
* @SPA_NODE_EVENT_TYPE_HAVE_OUTPUT: emited when an async node has output that can be pulled
|
||||
* @SPA_NODE_EVENT_TYPE_NEED_INPUT: emited when more data can be pushed to an async node
|
||||
* @SPA_NODE_EVENT_TYPE_REUSE_BUFFER: emited when a buffer can be reused
|
||||
|
|
@ -47,12 +45,11 @@ typedef struct _SpaNodeEvent SpaNodeEvent;
|
|||
* @SPA_NODE_EVENT_TYPE_ERROR: emited when error occured
|
||||
* @SPA_NODE_EVENT_TYPE_BUFFERING: emited when buffering is in progress
|
||||
* @SPA_NODE_EVENT_TYPE_REQUEST_REFRESH: emited when a keyframe refresh is needed
|
||||
* @SPA_NODE_EVENT_TYPE_REQUEST_CLOCK_UPDATE: the element asks for a clock update
|
||||
*/
|
||||
typedef enum {
|
||||
SPA_NODE_EVENT_TYPE_INVALID = 0,
|
||||
SPA_NODE_EVENT_TYPE_ASYNC_COMPLETE,
|
||||
SPA_NODE_EVENT_TYPE_PORT_ADDED,
|
||||
SPA_NODE_EVENT_TYPE_PORT_REMOVED,
|
||||
SPA_NODE_EVENT_TYPE_HAVE_OUTPUT,
|
||||
SPA_NODE_EVENT_TYPE_NEED_INPUT,
|
||||
SPA_NODE_EVENT_TYPE_REUSE_BUFFER,
|
||||
|
|
|
|||
|
|
@ -29,20 +29,18 @@ typedef struct _SpaRingbuffer SpaRingbuffer;
|
|||
#include <spa/defs.h>
|
||||
|
||||
typedef struct {
|
||||
uint8_t *data;
|
||||
size_t len;
|
||||
off_t offset;
|
||||
size_t len;
|
||||
} SpaRingbufferArea;
|
||||
|
||||
/**
|
||||
* SpaRingbuffer:
|
||||
* @data: pointer to data
|
||||
* @readindex: the current read index
|
||||
* @writeindex: the current write index
|
||||
* @size: the size of the ringbuffer
|
||||
* @size_mask: mask if @size is power of 2
|
||||
*/
|
||||
struct _SpaRingbuffer {
|
||||
uint8_t *data;
|
||||
volatile size_t readindex;
|
||||
volatile size_t writeindex;
|
||||
size_t size;
|
||||
|
|
@ -50,7 +48,7 @@ struct _SpaRingbuffer {
|
|||
};
|
||||
|
||||
SpaResult spa_ringbuffer_init (SpaRingbuffer *rbuf,
|
||||
uint8_t *data, size_t size);
|
||||
size_t size);
|
||||
|
||||
SpaResult spa_ringbuffer_clear (SpaRingbuffer *rbuf);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue