command: add more commands

This commit is contained in:
Wim Taymans 2018-01-23 15:54:56 +01:00
parent 5df5afd0a9
commit 54a6086e45

View file

@ -30,16 +30,32 @@ extern "C" {
#define SPA_TYPE_COMMAND__Node SPA_TYPE_COMMAND_BASE "Node"
#define SPA_TYPE_COMMAND_NODE_BASE SPA_TYPE_COMMAND__Node ":"
/** Suspend a node. This will release all resources of the node */
#define SPA_TYPE_COMMAND_NODE__Suspend SPA_TYPE_COMMAND_NODE_BASE "Suspend"
/** Pause processing of a node */
#define SPA_TYPE_COMMAND_NODE__Pause SPA_TYPE_COMMAND_NODE_BASE "Pause"
/** Start processing of a node */
#define SPA_TYPE_COMMAND_NODE__Start SPA_TYPE_COMMAND_NODE_BASE "Start"
/** Enable ports of a node. When sent to a port, enables just that port. Enabled
* ports on a Started node begin streaming immediately */
#define SPA_TYPE_COMMAND_NODE__Enable SPA_TYPE_COMMAND_NODE_BASE "Enable"
/** Disable ports of a node. When sent to a port, disables just that port. */
#define SPA_TYPE_COMMAND_NODE__Disable SPA_TYPE_COMMAND_NODE_BASE "Disable"
/** Flush all data from the node or port */
#define SPA_TYPE_COMMAND_NODE__Flush SPA_TYPE_COMMAND_NODE_BASE "Flush"
/** Drain all data from the node or port */
#define SPA_TYPE_COMMAND_NODE__Drain SPA_TYPE_COMMAND_NODE_BASE "Drain"
/** Set a marker on a node or port */
#define SPA_TYPE_COMMAND_NODE__Marker SPA_TYPE_COMMAND_NODE_BASE "Marker"
/** Send a clock update to a node */
#define SPA_TYPE_COMMAND_NODE__ClockUpdate SPA_TYPE_COMMAND_NODE_BASE "ClockUpdate"
struct spa_type_command_node {
uint32_t Suspend;
uint32_t Pause;
uint32_t Start;
uint32_t Enable;
uint32_t Disable;
uint32_t Flush;
uint32_t Drain;
uint32_t Marker;
@ -49,9 +65,12 @@ struct spa_type_command_node {
static inline void
spa_type_command_node_map(struct spa_type_map *map, struct spa_type_command_node *type)
{
if (type->Pause == 0) {
if (type->Suspend == 0) {
type->Suspend = spa_type_map_get_id(map, SPA_TYPE_COMMAND_NODE__Suspend);
type->Pause = spa_type_map_get_id(map, SPA_TYPE_COMMAND_NODE__Pause);
type->Start = spa_type_map_get_id(map, SPA_TYPE_COMMAND_NODE__Start);
type->Enable = spa_type_map_get_id(map, SPA_TYPE_COMMAND_NODE__Enable);
type->Disable = spa_type_map_get_id(map, SPA_TYPE_COMMAND_NODE__Disable);
type->Flush = spa_type_map_get_id(map, SPA_TYPE_COMMAND_NODE__Flush);
type->Drain = spa_type_map_get_id(map, SPA_TYPE_COMMAND_NODE__Drain);
type->Marker = spa_type_map_get_id(map, SPA_TYPE_COMMAND_NODE__Marker);