mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: add Latency param and object
Add a new latency param that contains a latency object. The latency object contains the min and max delay from a port to the terminal sink/source. It is also possible to express this delay as a fraction of the quantum to avoid having to recalculate the latency every time the quantum changes.
This commit is contained in:
parent
46ef88e520
commit
1a8f274a80
4 changed files with 24 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ enum spa_param_type {
|
|||
SPA_PARAM_EnumRoute, /**< routing enumeration as SPA_TYPE_OBJECT_ParamRoute */
|
||||
SPA_PARAM_Route, /**< routing configuration as SPA_TYPE_OBJECT_ParamRoute */
|
||||
SPA_PARAM_Control, /**< Control parameter, a SPA_TYPE_Sequence */
|
||||
SPA_PARAM_Latency, /**< latency reporting, a SPA_TYPE_OBJECT_ParamLatency */
|
||||
};
|
||||
|
||||
/** information about a parameter */
|
||||
|
|
@ -172,6 +173,15 @@ enum spa_param_route {
|
|||
};
|
||||
|
||||
|
||||
/** properties for SPA_TYPE_OBJECT_ParamLatency */
|
||||
enum spa_param_latency {
|
||||
SPA_PARAM_LATENCY_START,
|
||||
SPA_PARAM_LATENCY_direction, /**< direction, input/output (Id enum spa_direction) */
|
||||
SPA_PARAM_LATENCY_quantum, /**< latency relative to quantum (Float) */
|
||||
SPA_PARAM_LATENCY_min, /**< min latency (Int) relative to rate */
|
||||
SPA_PARAM_LATENCY_max, /**< max latency (Int) relative to rate */
|
||||
};
|
||||
|
||||
/**
|
||||
* \}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ static const struct spa_type_info spa_type_param[] = {
|
|||
{ SPA_PARAM_EnumRoute, SPA_TYPE_OBJECT_ParamRoute, SPA_TYPE_INFO_PARAM_ID_BASE "EnumRoute", NULL },
|
||||
{ SPA_PARAM_Route, SPA_TYPE_OBJECT_ParamRoute, SPA_TYPE_INFO_PARAM_ID_BASE "Route", NULL },
|
||||
{ SPA_PARAM_Control, SPA_TYPE_Sequence, SPA_TYPE_INFO_PARAM_ID_BASE "Control", NULL },
|
||||
{ SPA_PARAM_Latency, SPA_TYPE_OBJECT_ParamLatency, SPA_TYPE_INFO_PARAM_ID_BASE "Latency", NULL },
|
||||
{ 0, 0, NULL, NULL },
|
||||
};
|
||||
|
||||
|
|
@ -383,6 +384,17 @@ static const struct spa_type_info spa_type_profiler[] = {
|
|||
{ 0, 0, NULL, NULL },
|
||||
};
|
||||
|
||||
#define SPA_TYPE_INFO_PARAM_Latency SPA_TYPE_INFO_PARAM_BASE "Latency"
|
||||
#define SPA_TYPE_INFO_PARAM_LATENCY_BASE SPA_TYPE_INFO_PARAM_Latency ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param_latency[] = {
|
||||
{ SPA_PARAM_LATENCY_START, SPA_TYPE_Id, SPA_TYPE_INFO_PARAM_LATENCY_BASE, spa_type_param, },
|
||||
{ SPA_PARAM_LATENCY_direction, SPA_TYPE_Id, SPA_TYPE_INFO_PARAM_LATENCY_BASE "direction", spa_type_direction, },
|
||||
{ SPA_PARAM_LATENCY_quantum, SPA_TYPE_Float, SPA_TYPE_INFO_PARAM_LATENCY_BASE "quantum", NULL, },
|
||||
{ SPA_PARAM_LATENCY_min, SPA_TYPE_Int, SPA_TYPE_INFO_PARAM_LATENCY_BASE "min", NULL, },
|
||||
{ SPA_PARAM_LATENCY_max, SPA_TYPE_Int, SPA_TYPE_INFO_PARAM_LATENCY_BASE "max", NULL, },
|
||||
{ 0, 0, NULL, NULL },
|
||||
};
|
||||
|
||||
/**
|
||||
* \}
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ static const struct spa_type_info spa_types[] = {
|
|||
{ SPA_TYPE_OBJECT_ParamPortConfig, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_PortConfig, spa_type_param_port_config },
|
||||
{ SPA_TYPE_OBJECT_ParamRoute, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Route, spa_type_param_route },
|
||||
{ SPA_TYPE_OBJECT_Profiler, SPA_TYPE_Object, SPA_TYPE_INFO_Profiler, spa_type_profiler },
|
||||
{ SPA_TYPE_OBJECT_ParamLatency, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Latency, spa_type_param_latency },
|
||||
|
||||
{ 0, 0, NULL, NULL }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ enum {
|
|||
SPA_TYPE_OBJECT_ParamPortConfig,
|
||||
SPA_TYPE_OBJECT_ParamRoute,
|
||||
SPA_TYPE_OBJECT_Profiler,
|
||||
SPA_TYPE_OBJECT_ParamLatency,
|
||||
_SPA_TYPE_OBJECT_LAST, /**< not part of ABI */
|
||||
|
||||
/* vendor extensions */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue