mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-13 13:30:05 -05:00
WIP object model change
Work on cleanup
This commit is contained in:
parent
c25ccbb4ba
commit
0d21d633c9
26 changed files with 912 additions and 821 deletions
|
|
@ -20,14 +20,13 @@
|
|||
#ifndef __PINOS_NODE_H__
|
||||
#define __PINOS_NODE_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define PINOS_NODE_URI "http://pinos.org/ns/node"
|
||||
#define PINOS_NODE_PREFIX PINOS_NODE_URI "#"
|
||||
|
||||
typedef struct _PinosPort PinosPort;
|
||||
typedef struct _PinosNode PinosNode;
|
||||
|
||||
#include <spa/include/spa/node.h>
|
||||
|
|
@ -36,57 +35,42 @@ typedef struct _PinosNode PinosNode;
|
|||
#include <pinos/client/mem.h>
|
||||
#include <pinos/client/transport.h>
|
||||
|
||||
#include <pinos/server/daemon.h>
|
||||
#include <pinos/server/core.h>
|
||||
#include <pinos/server/port.h>
|
||||
#include <pinos/server/link.h>
|
||||
#include <pinos/server/client.h>
|
||||
#include <pinos/server/data-loop.h>
|
||||
|
||||
struct _PinosPort {
|
||||
PINOS_SIGNAL (destroy_signal, (PinosListener *listener, PinosPort *));
|
||||
|
||||
PinosNode *node;
|
||||
PinosDirection direction;
|
||||
uint32_t port;
|
||||
|
||||
gboolean allocated;
|
||||
PinosMemblock buffer_mem;
|
||||
SpaBuffer **buffers;
|
||||
guint n_buffers;
|
||||
|
||||
GPtrArray *links;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint32_t seq;
|
||||
SpaResult res;
|
||||
} PinosNodeAsyncCompleteData;
|
||||
|
||||
typedef struct {
|
||||
PinosNodeState old;
|
||||
PinosNodeState state;
|
||||
} PinosNodeStateChangeData;
|
||||
|
||||
/**
|
||||
* PinosNode:
|
||||
*
|
||||
* Pinos node class.
|
||||
*/
|
||||
struct _PinosNode {
|
||||
PinosCore *core;
|
||||
SpaList list;
|
||||
PinosCore *core;
|
||||
SpaList list;
|
||||
PinosGlobal *global;
|
||||
|
||||
bool unlinking;
|
||||
|
||||
char *name;
|
||||
PinosProperties *properties;
|
||||
PinosNodeState state;
|
||||
char *error;
|
||||
|
||||
SpaHandle *handle;
|
||||
SpaNode *node;
|
||||
bool live;
|
||||
SpaClock *clock;
|
||||
|
||||
gboolean have_inputs;
|
||||
gboolean have_outputs;
|
||||
SpaList input_ports;
|
||||
SpaList output_ports;
|
||||
|
||||
PinosPort **input_port_map;
|
||||
PinosPort **output_port_map;
|
||||
|
||||
unsigned int n_used_output_links;
|
||||
unsigned int n_used_input_links;
|
||||
|
||||
PinosTransport *transport;
|
||||
PINOS_SIGNAL (transport_changed, (PinosListener *listener,
|
||||
|
|
@ -104,13 +88,6 @@ struct _PinosNode {
|
|||
PINOS_SIGNAL (loop_changed, (PinosListener *listener,
|
||||
PinosNode *object));
|
||||
|
||||
PinosPort * (*get_free_port) (PinosNode *node,
|
||||
PinosDirection direction);
|
||||
PinosPort * (*enum_ports) (PinosNode *node,
|
||||
PinosDirection direction,
|
||||
void **state);
|
||||
SpaResult (*set_state) (PinosNode *node,
|
||||
PinosNodeState state);
|
||||
};
|
||||
|
||||
PinosNode * pinos_node_new (PinosCore *core,
|
||||
|
|
@ -129,27 +106,16 @@ PinosClient * pinos_node_get_client (PinosNode *node);
|
|||
PinosPort * pinos_node_get_free_port (PinosNode *node,
|
||||
PinosDirection direction);
|
||||
|
||||
GList * pinos_node_get_ports (PinosNode *node,
|
||||
PinosDirection direction);
|
||||
|
||||
gboolean pinos_node_set_state (PinosNode *node, PinosNodeState state);
|
||||
SpaResult pinos_node_set_state (PinosNode *node, PinosNodeState state);
|
||||
void pinos_node_update_state (PinosNode *node, PinosNodeState state);
|
||||
|
||||
void pinos_node_report_error (PinosNode *node, GError *error);
|
||||
void pinos_node_report_error (PinosNode *node, char *error);
|
||||
void pinos_node_report_idle (PinosNode *node);
|
||||
void pinos_node_report_busy (PinosNode *node);
|
||||
|
||||
PinosLink * pinos_port_link (PinosPort *output_port,
|
||||
PinosPort *input_port,
|
||||
GPtrArray *format_filter,
|
||||
PinosProperties *properties,
|
||||
GError **error);
|
||||
SpaResult pinos_port_unlink (PinosPort *port,
|
||||
PinosLink *link);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
SpaResult pinos_port_clear_buffers (PinosPort *port);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __PINOS_NODE_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue