diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-06-13 12:45:50 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-06-13 12:45:50 +0000 |
commit | b6457ecf4c95b5fe148afdac555e9b198e666c23 (patch) | |
tree | 857ccefe1322ae0e28d63bf209482b762087b97d /include/asterisk/timing.h | |
parent | a68a160b75f8fc2fcdb004e9e9ba28b71de77d5e (diff) |
Merge changes from timing branch
- Convert chan_iax2 to use the timing API
- Convert usage of timing in the core to use the timing API instead of
using DAHDI directly
- Make a change to the timing API to add the set_rate() function
- change the timing core to use a rwlock
- merge a timing implementation, res_timing_dahdi
Basic testing was successful using res_timing_dahdi
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/timing.h')
-rw-r--r-- | include/asterisk/timing.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/asterisk/timing.h b/include/asterisk/timing.h index b345f2174..6fe49276b 100644 --- a/include/asterisk/timing.h +++ b/include/asterisk/timing.h @@ -65,8 +65,9 @@ enum ast_timing_event { * public API calls. */ struct ast_timing_functions { - int (*timer_open)(unsigned int rate); + int (*timer_open)(void); void (*timer_close)(int handle); + int (*timer_set_rate)(int handle, unsigned int rate); void (*timer_ack)(int handle, unsigned int quantity); int (*timer_enable_continuous)(int handle); int (*timer_disable_continuous)(int handle); @@ -97,12 +98,10 @@ void ast_uninstall_timing_functions(void *handle); /*! * \brief Open a timing fd * - * \arg rate number of timer ticks per second - * * \retval -1 error, with errno set * \retval >=0 success */ -int ast_timer_open(unsigned int rate); +int ast_timer_open(void); /*! * \brief Close an opened timing handle @@ -114,6 +113,21 @@ int ast_timer_open(unsigned int rate); void ast_timer_close(int handle); /*! + * \brief Set the timing tick rate + * + * \arg handle timing fd returned from timer_open() + * \arg rate ticks per second, 0 turns the ticks off if needed + * + * Use this function if you want the timing fd to show input at a certain + * rate. The other alternative use of a timing fd, is using the continuous + * mode. + * + * \retval -1 error, with errno set + * \retval 0 success + */ +int ast_timer_set_rate(int handle, unsigned int rate); + +/*! * \brief Acknowledge a timer event * * \arg handle timing fd returned from timer_open() |