RTS API Documentation
1.10.11
|
Go to the source code of this file.
Enumerations | |
enum | switch_jb_flag_t { SJB_QUEUE_ONLY = (1 << 0) } |
enum | switch_jb_type_t { SJB_VIDEO = 0, SJB_AUDIO, SJB_TEXT } |
enum switch_jb_flag_t |
Enumerator | |
---|---|
SJB_QUEUE_ONLY |
Definition at line 36 of file switch_jitterbuffer.h.
enum switch_jb_type_t |
Enumerator | |
---|---|
SJB_VIDEO | |
SJB_AUDIO | |
SJB_TEXT |
Definition at line 40 of file switch_jitterbuffer.h.
void switch_jb_clear_flag | ( | switch_jb_t * | jb, |
switch_jb_flag_t | flag | ||
) |
Definition at line 1143 of file switch_jitterbuffer.c.
References switch_clear_flag.
SWITCH_BEGIN_EXTERN_C switch_status_t switch_jb_create | ( | switch_jb_t ** | jbp, |
switch_jb_type_t | type, | ||
uint32_t | min_frame_len, | ||
uint32_t | max_frame_len, | ||
switch_memory_pool_t * | pool | ||
) |
Definition at line 1322 of file switch_jitterbuffer.c.
References switch_jb_s::frame_len, switch_jb_s::free_pool, switch_jb_s::highest_frame_len, switch_jb_s::list_mutex, switch_jb_s::max_frame_len, switch_jb_s::min_frame_len, switch_jb_s::missing_seq_hash, switch_jb_s::mutex, switch_jb_s::node_hash, switch_jb_s::period_len, pool, switch_jb_s::pool, SJB_VIDEO, switch_core_alloc, switch_core_inthash_init(), switch_core_new_memory_pool, switch_mutex_init(), SWITCH_MUTEX_NESTED, SWITCH_STATUS_SUCCESS, and switch_jb_s::type.
Referenced by rtp_common_write(), switch_ivr_delay_echo(), switch_rtp_activate_jitter_buffer(), and switch_rtp_set_video_buffer_size().
void switch_jb_debug_level | ( | switch_jb_t * | jb, |
uint8_t | level | ||
) |
Definition at line 1169 of file switch_jitterbuffer.c.
References switch_jb_s::debug_level.
Referenced by switch_ivr_delay_echo(), and switch_rtp_debug_jitter_buffer().
switch_status_t switch_jb_destroy | ( | switch_jb_t ** | jbp | ) |
Definition at line 1357 of file switch_jitterbuffer.c.
References free_nodes(), switch_jb_s::free_pool, jb_debug, switch_jb_s::missing_seq_hash, switch_jb_s::nack_didnt_save_the_day, switch_jb_s::nack_saved_the_day, switch_jb_s::node_hash, switch_jb_s::node_hash_ts, switch_jb_s::pool, SJB_QUEUE_ONLY, SJB_VIDEO, switch_core_destroy_memory_pool, switch_core_inthash_destroy(), switch_hashtable_count(), SWITCH_STATUS_SUCCESS, switch_test_flag, and switch_jb_s::type.
Referenced by read_rtp_packet(), switch_ivr_delay_echo(), and switch_rtp_destroy().
int switch_jb_frame_count | ( | switch_jb_t * | jb | ) |
switch_status_t switch_jb_get_frames | ( | switch_jb_t * | jb, |
uint32_t * | min_frame_len, | ||
uint32_t * | max_frame_len, | ||
uint32_t * | cur_frame_len, | ||
uint32_t * | highest_frame_len | ||
) |
Definition at line 1268 of file switch_jitterbuffer.c.
References switch_jb_s::frame_len, switch_jb_s::max_frame_len, switch_jb_s::min_frame_len, switch_jb_s::mutex, switch_mutex_lock(), switch_mutex_unlock(), and SWITCH_STATUS_SUCCESS.
Referenced by switch_rtp_get_stats(), and switch_rtp_get_video_buffer_size().
switch_size_t switch_jb_get_last_read_len | ( | switch_jb_t * | jb | ) |
Definition at line 1567 of file switch_jitterbuffer.c.
References switch_jb_s::last_len.
Referenced by read_rtp_packet().
uint32_t switch_jb_get_nack_success | ( | switch_jb_t * | jb | ) |
Definition at line 1224 of file switch_jitterbuffer.c.
References switch_jb_s::mutex, switch_jb_s::nack_didnt_save_the_day, switch_jb_s::nack_saved_the_day, switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_rtp_destroy().
switch_status_t switch_jb_get_packet | ( | switch_jb_t * | jb, |
switch_rtp_packet_t * | packet, | ||
switch_size_t * | len | ||
) |
Definition at line 1572 of file switch_jitterbuffer.c.
References switch_jb_s::bitrate_control, switch_jb_stats_s::buffer_size_ms, CF_VIDEO_BITRATE_UNMANAGABLE, switch_jb_s::channel, check_jb_size(), check_seq(), check_ts(), switch_jb_s::complete_frames, switch_jb_s::consec_good_count, switch_jb_s::consec_miss_count, decrement_seq(), switch_jb_s::elastic, switch_jb_jitter_s::estimate, switch_jb_stats_s::estimate_ms, switch_jb_stats_s::expand, switch_jb_s::flush, switch_jb_s::frame_len, switch_core_session_message::from, switch_rtp_packet_t::header, hide_node(), switch_jb_s::highest_read_seq, switch_jb_s::highest_read_ts, jb_debug, jb_frame_inc, jb_next_packet(), switch_jb_s::jitter, switch_jb_s::last_len, switch_jb_s::last_psuedo_seq, switch_jb_s::last_target_seq, switch_jb_s::last_target_ts, switch_jb_node_s::len, switch_rtp_hdr_t::m, switch_jb_s::max_frame_len, switch_core_session_message::message_id, switch_jb_s::min_frame_len, switch_jb_s::mutex, switch_core_session_message::numeric_arg, switch_jb_node_s::packet, switch_jb_s::period_count, switch_jb_s::period_good_count, switch_jb_s::period_len, switch_jb_s::period_miss_count, switch_jb_s::period_miss_inc, switch_jb_s::period_miss_pct, switch_jb_s::read_init, switch_jb_stats_s::reset_error, switch_jb_jitter_s::samples_per_frame, switch_jb_s::samples_per_frame, switch_jb_jitter_s::samples_per_second, switch_rtp_hdr_t::seq, switch_jb_s::session, SJB_VIDEO, switch_jb_jitter_s::stats, switch_channel_clear_flag_recursive(), switch_channel_set_flag_recursive(), switch_channel_test_flag(), switch_core_session_receive_message, switch_core_session_request_video_refresh, switch_goto_status, switch_jb_poll(), switch_jb_reset(), SWITCH_LOG_INFO, SWITCH_MESSAGE_INDICATE_BITRATE_REQ, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_BREAK, SWITCH_STATUS_MORE_DATA, SWITCH_STATUS_NOTFOUND, SWITCH_STATUS_RESTART, SWITCH_STATUS_SUCCESS, SWITCH_STATUS_TIMEOUT, SWITCH_TRUE, switch_rtp_hdr_t::ts, switch_jb_s::type, switch_rtp_hdr_t::version, switch_jb_s::video_low_bitrate, and switch_jb_s::visible_nodes.
Referenced by read_rtp_packet(), and switch_ivr_delay_echo().
switch_status_t switch_jb_get_packet_by_seq | ( | switch_jb_t * | jb, |
uint16_t | seq, | ||
switch_rtp_packet_t * | packet, | ||
switch_size_t * | len | ||
) |
Definition at line 1547 of file switch_jitterbuffer.c.
References switch_rtp_packet_t::header, jb_debug, switch_jb_node_s::len, switch_jb_s::mutex, switch_jb_s::node_hash, switch_jb_node_s::packet, switch_core_inthash_find(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_NOTFOUND, SWITCH_STATUS_SUCCESS, and switch_rtp_hdr_t::version.
Referenced by handle_nack().
uint32_t switch_jb_get_packets_per_frame | ( | switch_jb_t * | jb | ) |
Definition at line 1233 of file switch_jitterbuffer.c.
References switch_jb_s::mutex, switch_jb_s::packet_count, switch_mutex_lock(), and switch_mutex_unlock().
switch_status_t switch_jb_peek_frame | ( | switch_jb_t * | jb, |
uint32_t | ts, | ||
uint16_t | seq, | ||
int | peek, | ||
switch_frame_t * | frame | ||
) |
Definition at line 1242 of file switch_jitterbuffer.c.
References switch_rtp_packet_t::body, switch_frame::buflen, switch_frame::data, switch_frame::datalen, switch_rtp_packet_t::header, switch_jb_node_s::len, switch_frame::m, switch_rtp_hdr_t::m, switch_jb_s::node_hash, switch_jb_s::node_hash_ts, switch_jb_node_s::packet, switch_jb_s::samples_per_frame, switch_frame::seq, switch_rtp_hdr_t::seq, switch_core_inthash_find(), SWITCH_RTP_HEADER_LEN, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_frame::timestamp, and switch_rtp_hdr_t::ts.
Referenced by switch_core_media_read_frame().
int switch_jb_poll | ( | switch_jb_t * | jb | ) |
Definition at line 1148 of file switch_jitterbuffer.c.
References switch_jb_s::buffer_lag, switch_jb_s::complete_frames, switch_jb_s::flush, switch_jb_s::frame_len, SJB_TEXT, and switch_jb_s::type.
Referenced by rtp_common_read(), and switch_jb_get_packet().
uint32_t switch_jb_pop_nack | ( | switch_jb_t * | jb | ) |
Definition at line 1385 of file switch_jitterbuffer.c.
References switch_jb_s::frame_len, jb_debug, switch_jb_s::missing_seq_hash, switch_jb_s::mutex, RENACK_TIME, SJB_VIDEO, switch_core_hash_first_iter(), switch_core_hash_next(), switch_core_hash_this(), switch_core_inthash_delete(), switch_core_inthash_insert(), switch_mutex_lock(), switch_mutex_unlock(), switch_safe_free, switch_time_now(), switch_jb_s::target_seq, and switch_jb_s::type.
Referenced by check_rtcp_and_ice().
switch_status_t switch_jb_put_packet | ( | switch_jb_t * | jb, |
switch_rtp_packet_t * | packet, | ||
switch_size_t | len | ||
) |
Definition at line 1467 of file switch_jitterbuffer.c.
References add_node(), switch_jb_s::allocated_nodes, drop_oldest_frame(), switch_jb_s::frame_len, switch_rtp_packet_t::header, switch_jb_s::highest_dropped_ts, jb_debug, jb_frame_inc, switch_jb_s::jitter, switch_jb_s::max_frame_len, switch_jb_s::max_packet_len, switch_jb_s::missing_seq_hash, switch_jb_s::mutex, switch_jb_s::nack_didnt_save_the_day, switch_jb_s::nack_saved_the_day, switch_jb_s::next_seq, switch_jb_stats_s::reset_missing_frames, switch_rtp_hdr_t::seq, SJB_AUDIO, SJB_QUEUE_ONLY, SJB_TEXT, SJB_VIDEO, switch_jb_jitter_s::stats, SWITCH_CHANNEL_LOG, switch_core_inthash_delete(), switch_core_inthash_insert(), switch_jb_reset(), switch_log_printf(), SWITCH_LOG_WARNING, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_MAX_PACKET_LEN, SWITCH_SIZE_T_FMT, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_jb_s::target_seq, switch_rtp_hdr_t::ts, switch_jb_s::type, and switch_jb_s::visible_nodes.
Referenced by read_bundle_rtp_packet(), read_rtp_packet(), rtp_common_write(), and switch_ivr_delay_echo().
void switch_jb_reset | ( | switch_jb_t * | jb | ) |
Definition at line 1174 of file switch_jitterbuffer.c.
References switch_jb_s::channel, switch_jb_s::complete_frames, switch_jb_s::consec_good_count, switch_jb_s::consec_miss_count, switch_jb_s::drop_flag, hide_nodes(), switch_jb_s::highest_read_seq, switch_jb_s::highest_read_ts, switch_jb_s::highest_wrote_seq, switch_jb_s::highest_wrote_ts, jb_debug, switch_jb_s::jitter, switch_jb_s::last_target_seq, switch_jb_s::last_target_ts, switch_jb_s::missing_seq_hash, switch_jb_s::mutex, switch_jb_s::next_seq, switch_jb_s::period_count, switch_jb_s::period_good_count, switch_jb_s::period_miss_count, switch_jb_s::period_miss_inc, switch_jb_s::period_miss_pct, switch_jb_s::read_init, switch_jb_stats_s::reset, switch_jb_stats_s::reset_error, switch_jb_stats_s::reset_missing_frames, switch_jb_stats_s::reset_too_big, switch_jb_stats_s::reset_ts_jump, switch_jb_s::session, SJB_VIDEO, switch_jb_jitter_s::stats, switch_channel_set_variable_printf(), switch_core_inthash_destroy(), switch_core_inthash_init(), switch_core_session_request_video_refresh, switch_mutex_lock(), switch_mutex_unlock(), switch_jb_s::target_seq, switch_jb_s::target_ts, switch_jb_s::type, and switch_jb_s::write_init.
Referenced by add_node(), do_flush(), handle_rfc2833(), new_node(), read_rtp_packet(), switch_jb_get_packet(), switch_jb_put_packet(), switch_rtp_del_dtls(), switch_rtp_pause_jitter_buffer(), switch_rtp_reset_jb(), switch_rtp_reset_vb(), and switch_rtp_set_flag().
void switch_jb_set_flag | ( | switch_jb_t * | jb, |
switch_jb_flag_t | flag | ||
) |
Definition at line 1138 of file switch_jitterbuffer.c.
References switch_set_flag.
Referenced by rtp_common_write().
switch_status_t switch_jb_set_frames | ( | switch_jb_t * | jb, |
uint32_t | min_frame_len, | ||
uint32_t | max_frame_len | ||
) |
Definition at line 1290 of file switch_jitterbuffer.c.
References switch_jb_s::frame_len, switch_jb_s::highest_frame_len, switch_jb_s::max_frame_len, switch_jb_s::min_frame_len, switch_jb_s::mutex, switch_mutex_lock(), switch_mutex_unlock(), and SWITCH_STATUS_SUCCESS.
Referenced by switch_rtp_activate_jitter_buffer(), and switch_rtp_set_video_buffer_size().
void switch_jb_set_jitter_estimator | ( | switch_jb_t * | jb, |
double * | jitter, | ||
uint32_t | samples_per_frame, | ||
uint32_t | samples_per_second | ||
) |
Definition at line 1079 of file switch_jitterbuffer.c.
References switch_jb_s::channel, switch_jb_jitter_s::drop_gap, switch_jb_jitter_s::estimate, switch_jb_s::jitter, memset(), switch_jb_jitter_s::samples_per_frame, switch_jb_jitter_s::samples_per_second, and switch_channel_set_variable_printf().
Referenced by switch_rtp_activate_jitter_buffer().
void switch_jb_set_session | ( | switch_jb_t * | jb, |
switch_core_session_t * | session | ||
) |
Definition at line 1104 of file switch_jitterbuffer.c.
References switch_jb_s::channel, switch_jb_s::codec, switch_jb_s::elastic, switch_codec_implementation::iananame, switch_codec::implementation, switch_jb_s::session, SJB_AUDIO, SJB_QUEUE_ONLY, SJB_VIDEO, switch_channel_get_variable_dup(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_var_true(), switch_core_session_get_channel(), switch_core_session_get_read_codec(), SWITCH_FALSE, SWITCH_LOG_DEBUG, SWITCH_LOG_DEBUG1, switch_log_printf(), switch_test_flag, SWITCH_TRUE, switch_jb_s::type, and switch_jb_s::video_low_bitrate.
Referenced by switch_rtp_activate_jitter_buffer(), and switch_rtp_set_video_buffer_size().
void switch_jb_ts_mode | ( | switch_jb_t * | jb, |
uint32_t | samples_per_frame, | ||
uint32_t | samples_per_second | ||
) |
Definition at line 1072 of file switch_jitterbuffer.c.
References switch_jb_s::node_hash_ts, switch_jb_s::samples_per_frame, switch_jb_s::samples_per_second, and switch_core_inthash_init().
Referenced by switch_rtp_activate_jitter_buffer().