mediastreamer2
2.9.1
|
Ticker API to manage mediastreamer2 graphs. More...
Typedefs | |
typedef uint64_t(* | MSTickerTimeFunc) (void *) |
typedef int(* | MSTickerTickFunc) (void *, uint64_t ticker_virtual_time) |
typedef struct _MSTicker | MSTicker |
typedef struct _MSTickerSynchronizer | MSTickerSynchronizer |
Enumerations | |
enum | _MSTickerPrio { MS_TICKER_PRIO_NORMAL, MS_TICKER_PRIO_HIGH, MS_TICKER_PRIO_REALTIME } |
Ticker API to manage mediastreamer2 graphs.
Describes the ticker API. The ticker is the thread responsible for scheduling audio & video processing for one or several filter graphs.
MSTickerTimeFunc |
Function pointer for method getting time in miliseconds from an external source.
MSTickerTickFunc |
Function pointer for method waiting next tick from an external source.
It shall return the number of late milliseconds, if this value is known.
Structure for ticker object.
Structure for ticker synchronizer object.
enum _MSTickerPrio |
MSTicker* ms_ticker_new | ( | void | ) |
Create a ticker that will be used to start and stop a graph.
Returns: MSTicker * if successfull, NULL otherwise.
MSTicker* ms_ticker_new_with_params | ( | const MSTickerParams * | params | ) |
Create a ticker that will be used to start and stop a graph.
Returns: MSTicker * if successfull, NULL otherwise.
void ms_ticker_set_name | ( | MSTicker * | ticker, |
const char * | name | ||
) |
Set a name to the ticker (used for logging)
void ms_ticker_set_priority | ( | MSTicker * | ticker, |
MSTickerPrio | prio | ||
) |
Deprecated: Set priority to the ticker
Attach a chain of filters to a ticker. The processing chain will be executed until ms_ticker_detach will be called. This variadic can be used to attach multiple chains in a single call. The argument list MUST be NULL terminated.
Returns: 0 if successfull, -1 otherwise.
void ms_ticker_set_time_func | ( | MSTicker * | ticker, |
MSTickerTimeFunc | func, | ||
void * | user_data | ||
) |
Override MSTicker's time function. This can be used to control the ticker from an external time provider, for example the clock of a sound card. WARNING: this must not be used in conjunction with ms_ticker_set_tick_func().
ticker | A MSTicker object. |
func | A replacement method for calculating "current time" |
user_data | Any pointer to user private data. |
void ms_ticker_set_tick_func | ( | MSTicker * | ticker, |
MSTickerTickFunc | func, | ||
void * | user_data | ||
) |
Override MSTicker's ticking function. This can be used to control the ticker from an external ticking source, for example an interrupt, an event on a file descriptor, etc. WARNING: this must not be used in conjunction with ms_ticker_set_time_func().
ticker | A MSTicker object. |
func | A replacement method waiting the next tick. |
user_data | Any pointer to user private data. |
void ms_ticker_print_graphs | ( | MSTicker * | ticker | ) |
Print on stdout all filters of a ticker. (INTERNAL: DO NOT USE)
ticker | A MSTicker object. |
float ms_ticker_get_average_load | ( | MSTicker * | ticker | ) |
Get the average load of the ticker. It is expressed as the ratio between real time spent in processing all graphs for a tick divided by the tick interval (default is 10 ms). This value is averaged over several ticks to get consistent and useful value. A load greater than 100% clearly means that the ticker is over loaded and runs late.
MSTickerSynchronizer* ms_ticker_synchronizer_new | ( | void | ) |
Create a ticker synchronizer.
Returns: MSTickerSynchronizer * if successfull, NULL otherwise.
double ms_ticker_synchronizer_set_external_time | ( | MSTickerSynchronizer * | ts, |
const MSTimeSpec * | time | ||
) |
Set the current external time.
ts | A MSTickerSynchronizer object. |
time | A #MSTimeSpec object. |
Returns: Average skew.
uint64_t ms_ticker_synchronizer_get_corrected_time | ( | MSTickerSynchronizer * | ts | ) |
Get the corrected current time following the set external times.
ts | A MSTickerSynchronizer object. |
Returns: A corrected current time.
void ms_ticker_synchronizer_destroy | ( | MSTickerSynchronizer * | ts | ) |
Destroy a ticker synchronizer.
ts | A MSTickerSynchronizer object. |