mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 04:31:50 +00:00
enhance timers and make rtp use it that way
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2669 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -787,6 +787,20 @@ SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, ch
|
||||
*/
|
||||
SWITCH_DECLARE(int) switch_core_timer_next(switch_timer_t *timer);
|
||||
|
||||
/*!
|
||||
\brief Step the timer one step
|
||||
\param timer the timer to wait on
|
||||
\return the newest sample count
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_timer_step(switch_timer_t *timer);
|
||||
|
||||
/*!
|
||||
\brief Check if the current step has been exceeded
|
||||
\param timer the timer to wait on
|
||||
\return the newest sample count
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_timer_check(switch_timer_t *timer);
|
||||
|
||||
/*!
|
||||
\brief Destroy an allocated timer
|
||||
\param timer timer to destroy
|
||||
|
||||
@@ -240,6 +240,10 @@ struct switch_timer_interface {
|
||||
switch_status_t (*timer_init)(switch_timer_t *);
|
||||
/*! function to wait for one cycle to pass */
|
||||
switch_status_t (*timer_next)(switch_timer_t *);
|
||||
/*! function to step the timer one step */
|
||||
switch_status_t (*timer_step)(switch_timer_t *);
|
||||
/*! function to check if the current step has expired */
|
||||
switch_status_t (*timer_check)(switch_timer_t *);
|
||||
/*! function to deallocate the timer */
|
||||
switch_status_t (*timer_destroy)(switch_timer_t *);
|
||||
const struct switch_timer_interface *next;
|
||||
|
||||
+19
-17
@@ -77,13 +77,14 @@ SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(void);
|
||||
\return the new RTP session or NULL on failure
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t)switch_rtp_create(switch_rtp_t **new_rtp_session,
|
||||
switch_payload_t payload,
|
||||
uint32_t packet_size,
|
||||
uint32_t ms_per_packet,
|
||||
switch_rtp_flag_t flags,
|
||||
char *crypto_key,
|
||||
const char **err,
|
||||
switch_memory_pool_t *pool);
|
||||
switch_payload_t payload,
|
||||
uint32_t packet_size,
|
||||
uint32_t ms_per_packet,
|
||||
switch_rtp_flag_t flags,
|
||||
char *crypto_key,
|
||||
char *timer_name,
|
||||
const char **err,
|
||||
switch_memory_pool_t *pool);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -102,16 +103,17 @@ SWITCH_DECLARE(switch_status_t)switch_rtp_create(switch_rtp_t **new_rtp_session,
|
||||
\return the new RTP session or NULL on failure
|
||||
*/
|
||||
SWITCH_DECLARE(switch_rtp_t *)switch_rtp_new(char *rx_host,
|
||||
switch_port_t rx_port,
|
||||
char *tx_host,
|
||||
switch_port_t tx_port,
|
||||
switch_payload_t payload,
|
||||
uint32_t packet_size,
|
||||
uint32_t ms_per_packet,
|
||||
switch_rtp_flag_t flags,
|
||||
char *crypto_key,
|
||||
const char **err,
|
||||
switch_memory_pool_t *pool);
|
||||
switch_port_t rx_port,
|
||||
char *tx_host,
|
||||
switch_port_t tx_port,
|
||||
switch_payload_t payload,
|
||||
uint32_t packet_size,
|
||||
uint32_t ms_per_packet,
|
||||
switch_rtp_flag_t flags,
|
||||
char *crypto_key,
|
||||
char *timer_name,
|
||||
const char **err,
|
||||
switch_memory_pool_t *pool);
|
||||
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user