rework: make client and server nodes

work on making nodes and ports on the client.
This commit is contained in:
Wim Taymans 2016-05-12 17:03:28 +02:00
parent c67d3d7f04
commit 8407430891
34 changed files with 1500 additions and 3844 deletions

View file

@ -23,11 +23,68 @@
#include <gio/gio.h>
#include <glib-object.h>
G_BEGIN_DECLS
/**
* PinosNodeState:
* @PINOS_NODE_STATE_ERROR: the node is in error
* @PINOS_NODE_STATE_SUSPENDED: the node is suspended, the device might
* be closed
* @PINOS_NODE_STATE_INITIALIZING: the node is initializing, the device is
* being opened and the capabilities are queried
* @PINOS_NODE_STATE_IDLE: the node is running but there is no active
* port
* @PINOS_NODE_STATE_RUNNING: the node is running
*
* The different node states
*/
typedef enum {
PINOS_NODE_STATE_ERROR = -1,
PINOS_NODE_STATE_SUSPENDED = 0,
PINOS_NODE_STATE_INITIALIZING = 1,
PINOS_NODE_STATE_IDLE = 2,
PINOS_NODE_STATE_RUNNING = 3,
} PinosNodeState;
const gchar * pinos_node_state_as_string (PinosNodeState state);
/**
* PinosDirection:
* @PINOS_DIRECTION_INVALID: invalid direction
* @PINOS_DIRECTION_INPUT: an input port
* @PINOS_DIRECTION_OUTPUT: an output port
*
* The direction of a port
*/
typedef enum {
PINOS_DIRECTION_INVALID = -1,
PINOS_DIRECTION_INPUT = 0,
PINOS_DIRECTION_OUTPUT = 1
} PinosDirection;
const gchar * pinos_direction_as_string (PinosDirection direction);
/**
* PinosPortState:
* @PINOS_PORT_STATE_ERROR: the port is in error
* @PINOS_PORT_STATE_STOPPED: the port is stopped
* @PINOS_PORT_STATE_STARTING: the port is starting
* @PINOS_PORT_STATE_STREAMING: the port is streaming
*
* The different port states
*/
typedef enum {
PINOS_PORT_STATE_ERROR = -1,
PINOS_PORT_STATE_STOPPED = 0,
PINOS_PORT_STATE_STARTING = 1,
PINOS_PORT_STATE_STREAMING = 2,
} PinosPortState;
const gchar * pinos_port_state_as_string (PinosPortState state);
#include <pinos/client/context.h>
#include <pinos/client/properties.h>
G_BEGIN_DECLS
gboolean pinos_context_info_finish (GObject *object,
GAsyncResult *res,
GError **error);
@ -143,29 +200,6 @@ void pinos_context_get_client_info_by_id (PinosContext *context,
GAsyncReadyCallback callback,
gpointer user_data);
/**
* PinosNodeState:
* @PINOS_NODE_STATE_ERROR: the node is in error
* @PINOS_NODE_STATE_SUSPENDED: the node is suspended, the device might
* be closed
* @PINOS_NODE_STATE_INITIALIZING: the node is initializing, the device is
* being opened and the capabilities are queried
* @PINOS_NODE_STATE_IDLE: the node is running but there is no active
* channel
* @PINOS_NODE_STATE_RUNNING: the node is running
*
* The different node states
*/
typedef enum {
PINOS_NODE_STATE_ERROR = -1,
PINOS_NODE_STATE_SUSPENDED = 0,
PINOS_NODE_STATE_INITIALIZING = 1,
PINOS_NODE_STATE_IDLE = 2,
PINOS_NODE_STATE_RUNNING = 3,
} PinosNodeState;
const gchar * pinos_node_state_as_string (PinosNodeState state);
/**
* PinosNodeInfo:
* @id: generic id of the node
@ -223,21 +257,6 @@ void pinos_context_get_node_info_by_id (PinosContext *context,
GAsyncReadyCallback callback,
gpointer user_data);
/**
* PinosDirection:
* @PINOS_DIRECTION_INVALID: invalid direction
* @PINOS_DIRECTION_INPUT: an input port/channel
* @PINOS_DIRECTION_OUTPUT: an output port/channel
*
* The direction of a port or channel
*/
typedef enum {
PINOS_DIRECTION_INVALID = -1,
PINOS_DIRECTION_INPUT = 0,
PINOS_DIRECTION_OUTPUT = 1
} PinosDirection;
const gchar * pinos_direction_as_string (PinosDirection direction);
/**
* PinosPortInfo:
@ -302,92 +321,60 @@ void pinos_context_get_port_info_by_id (PinosContext *context,
GAsyncReadyCallback callback,
gpointer user_data);
/**
* PinosChannelState:
* @PINOS_CHANNEL_STATE_ERROR: the channel is in error
* @PINOS_CHANNEL_STATE_STOPPED: the channel is stopped
* @PINOS_CHANNEL_STATE_STARTING: the channel is starting
* @PINOS_CHANNEL_STATE_STREAMING: the channel is streaming
*
* The different channel states
*/
typedef enum {
PINOS_CHANNEL_STATE_ERROR = -1,
PINOS_CHANNEL_STATE_STOPPED = 0,
PINOS_CHANNEL_STATE_STARTING = 1,
PINOS_CHANNEL_STATE_STREAMING = 2,
} PinosChannelState;
const gchar * pinos_channel_state_as_string (PinosChannelState state);
/**
* PinosChannelInfo:
* @id: generic id of the channel_
* @channel_path: the unique path of the channel
* @direction: the channel direction
* @client_path: the owner client
* PinosConnectionInfo:
* @id: generic id of the connection
* @connection_path: the unique path of the connection
* @change_mask: bitfield of changed fields since last call
* @port_path: the owner port
* @properties: the properties of the channel
* @state: the state
* @possible_formats: the possible formats
* @format: when streaming, the current format
* @source_port_path: the source port
* @destination_port_path: the destination port
*
* The channel information. Extra information can be added in later
* The connection information. Extra information can be added in later
* versions.
*/
typedef struct {
gpointer id;
const char *channel_path;
PinosDirection direction;
const char *client_path;
const char *connection_path;
guint64 change_mask;
const char *port_path;
PinosProperties *properties;
PinosChannelState state;
GBytes *possible_formats;
GBytes *format;
} PinosChannelInfo;
const char *source_port_path;
const char *destination_port_path;
} PinosConnectionInfo;
/**
* PinosChannelInfoFlags:
* @PINOS_CHANNEL_INFO_FLAGS_NONE: no flags
* @PINOS_CHANNEL_INFO_FLAGS_NO_INPUT: don't list input channels
* @PINOS_CHANNEL_INFO_FLAGS_NO_OUTPUT: don't list output channels
* PinosConnectionInfoFlags:
* @PINOS_CONNECTION_INFO_FLAGS_NONE: no flags
*
* Extra flags to pass to pinos_context_list_channel_info() and
* pinos_context_get_channel_info_by_id().
* Extra flags to pass to pinos_context_list_connection_info() and
* pinos_context_get_connection_info_by_id().
*/
typedef enum {
PINOS_CHANNEL_INFO_FLAGS_NONE = 0,
PINOS_CHANNEL_INFO_FLAGS_NO_INPUT = (1 << 0),
PINOS_CHANNEL_INFO_FLAGS_NO_OUTPUT = (1 << 1),
} PinosChannelInfoFlags;
PINOS_CONNECTION_INFO_FLAGS_NONE = 0,
} PinosConnectionInfoFlags;
/**
* PinosChannelInfoCallback:
* PinosConnectionInfoCallback:
* @c: a #PinosContext
* @info: a #PinosChannelInfo
* @info: a #PinosConnectionInfo
* @user_data: user data
*
* Callback with information about the Pinos channel in @info.
* Callback with information about the Pinos connection in @info.
*/
typedef void (*PinosChannelInfoCallback) (PinosContext *c,
const PinosChannelInfo *info,
gpointer user_data);
typedef void (*PinosConnectionInfoCallback) (PinosContext *c,
const PinosConnectionInfo *info,
gpointer user_data);
void pinos_context_list_channel_info (PinosContext *context,
PinosChannelInfoFlags flags,
PinosChannelInfoCallback cb,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
void pinos_context_get_channel_info_by_id (PinosContext *context,
gpointer id,
PinosChannelInfoFlags flags,
PinosChannelInfoCallback cb,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
void pinos_context_list_connection_info (PinosContext *context,
PinosConnectionInfoFlags flags,
PinosConnectionInfoCallback cb,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
void pinos_context_get_connection_info_by_id (PinosContext *context,
gpointer id,
PinosConnectionInfoFlags flags,
PinosConnectionInfoCallback cb,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
G_END_DECLS
#endif /* __PINOS_INTROSPECT_H__ */