Improve rate matching and clock slaving

Use a new rate_match io area to exhange rate matching info between
sink/source and resampler.
Compensate for the rate match delay when scheduling timeouts.
Let the resampler notify the source of how many samples it needs to
produce the desired quantum. Make sure we keep an extra buffer in
the device to be able to make this possible.
Let the adapter directly call the slave node process function.
This commit is contained in:
Wim Taymans 2019-07-09 16:56:05 +02:00
parent 595dc0ab5b
commit c7d7058896
10 changed files with 147 additions and 98 deletions

View file

@ -49,6 +49,7 @@ enum spa_io_type {
SPA_IO_Control, /**< area for control messages */
SPA_IO_Notify, /**< area for notify messages */
SPA_IO_Position, /**< position information in the graph */
SPA_IO_RateMatch, /**< rate matching between nodes */
};
struct spa_io_buffers {
@ -138,6 +139,13 @@ struct spa_io_position {
struct spa_io_position_video video; /**< when mask & SPA_IO_POSITION_FLAG_VIDEO */
};
/** rate matching */
struct spa_io_rate_match {
uint32_t delay; /**< extra delay in samples for resampler */
uint32_t size; /**< requested input size for resampler */
double rate; /**< rate for resampler */
};
#ifdef __cplusplus
} /* extern "C" */
#endif

View file

@ -47,6 +47,7 @@ static const struct spa_type_info spa_type_io[] = {
{ SPA_IO_Control, SPA_TYPE_Int, SPA_TYPE_INFO_IO_BASE "Control", NULL },
{ SPA_IO_Notify, SPA_TYPE_Int, SPA_TYPE_INFO_IO_BASE "Notify", NULL },
{ SPA_IO_Position, SPA_TYPE_Int, SPA_TYPE_INFO_IO_BASE "Position", NULL },
{ SPA_IO_RateMatch, SPA_TYPE_Int, SPA_TYPE_INFO_IO_BASE "RateMatch", NULL },
{ 0, 0, NULL, NULL },
};