RTS API Documentation
1.10.11
|
Go to the source code of this file.
Data Structures | |
struct | switch_jb_node_s |
struct | switch_jb_stats_s |
struct | switch_jb_jitter_s |
struct | switch_jb_s |
Macros | |
#define | NACK_TIME 80000 |
#define | RENACK_TIME 100000 |
#define | MAX_FRAME_PADDING 2 |
#define | MAX_MISSING_SEQ 20 |
#define | jb_debug(_jb, _level, _format, ...) if (_jb->debug_level >= _level) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(_jb->session), SWITCH_LOG_ALERT, "JB:%p:%s:%d/%d lv:%d ln:%.4d sz:%.3u/%.3u/%.3u/%.3u c:%.3u %.3u/%.3u/%.3u/%.3u %.2f%% ->" _format, (void *) _jb, (jb->type == SJB_TEXT ? "txt" : (jb->type == SJB_AUDIO ? "aud" : "vid")), _jb->allocated_nodes, _jb->visible_nodes, _level, __LINE__, _jb->min_frame_len, _jb->max_frame_len, _jb->frame_len, _jb->complete_frames, _jb->period_count, _jb->consec_good_count, _jb->period_good_count, _jb->consec_miss_count, _jb->period_miss_count, _jb->period_miss_pct, __VA_ARGS__) |
#define | jb_frame_inc(_jb, _i) jb_frame_inc_line(_jb, _i, __LINE__) |
Typedefs | |
typedef struct switch_jb_node_s | switch_jb_node_t |
typedef struct switch_jb_stats_s | switch_jb_stats_t |
typedef struct switch_jb_jitter_s | switch_jb_jitter_t |
#define jb_debug | ( | _jb, | |
_level, | |||
_format, | |||
... | |||
) | if (_jb->debug_level >= _level) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(_jb->session), SWITCH_LOG_ALERT, "JB:%p:%s:%d/%d lv:%d ln:%.4d sz:%.3u/%.3u/%.3u/%.3u c:%.3u %.3u/%.3u/%.3u/%.3u %.2f%% ->" _format, (void *) _jb, (jb->type == SJB_TEXT ? "txt" : (jb->type == SJB_AUDIO ? "aud" : "vid")), _jb->allocated_nodes, _jb->visible_nodes, _level, __LINE__, _jb->min_frame_len, _jb->max_frame_len, _jb->frame_len, _jb->complete_frames, _jb->period_count, _jb->consec_good_count, _jb->period_good_count, _jb->consec_miss_count, _jb->period_miss_count, _jb->period_miss_pct, __VA_ARGS__) |
Definition at line 40 of file switch_jitterbuffer.c.
Referenced by add_node(), check_jb_size(), drop_oldest_frame(), jb_find_lowest_ts(), jb_frame_inc_line(), jb_next_packet_by_seq(), jb_next_packet_by_seq_with_acceleration(), jb_next_packet_by_ts(), new_node(), switch_jb_destroy(), switch_jb_get_packet(), switch_jb_get_packet_by_seq(), switch_jb_pop_nack(), switch_jb_put_packet(), and switch_jb_reset().
#define jb_frame_inc | ( | _jb, | |
_i | |||
) | jb_frame_inc_line(_jb, _i, __LINE__) |
Definition at line 583 of file switch_jitterbuffer.c.
Referenced by jb_next_packet_by_seq(), switch_jb_get_packet(), and switch_jb_put_packet().
#define MAX_FRAME_PADDING 2 |
Definition at line 38 of file switch_jitterbuffer.c.
#define MAX_MISSING_SEQ 20 |
Definition at line 39 of file switch_jitterbuffer.c.
#define NACK_TIME 80000 |
Definition at line 36 of file switch_jitterbuffer.c.
#define RENACK_TIME 100000 |
Definition at line 37 of file switch_jitterbuffer.c.
Referenced by switch_jb_pop_nack().
typedef struct switch_jb_jitter_s switch_jb_jitter_t |
typedef struct switch_jb_node_s switch_jb_node_t |
typedef struct switch_jb_stats_s switch_jb_stats_t |
|
inlinestatic |
Definition at line 681 of file switch_jitterbuffer.c.
References check_seq(), check_ts(), switch_jb_node_s::complete_frame_mark, switch_jb_s::complete_frames, switch_jb_s::frame_len, switch_rtp_packet_t::header, switch_jb_s::highest_wrote_seq, switch_jb_s::highest_wrote_ts, jb_debug, switch_jb_s::jitter, switch_jb_node_s::len, switch_rtp_hdr_t::m, switch_jb_s::max_packet_len, new_node(), switch_jb_s::node_hash, switch_jb_s::node_hash_ts, switch_jb_node_s::packet, switch_jb_s::packet_count, switch_jb_stats_s::reset_ts_jump, switch_rtp_hdr_t::seq, SJB_AUDIO, SJB_TEXT, SJB_VIDEO, switch_jb_jitter_s::stats, switch_core_inthash_insert(), switch_jb_reset(), TRUE, switch_rtp_hdr_t::ts, switch_jb_s::type, switch_jb_s::visible_nodes, and switch_jb_s::write_init.
Referenced by switch_jb_put_packet().
|
inlinestatic |
Definition at line 913 of file switch_jitterbuffer.c.
References switch_jb_stats_s::acceleration, switch_jb_s::channel, count, switch_jb_jitter_s::estimate, switch_jb_stats_s::estimate_ms, switch_jb_stats_s::expand, switch_rtp_packet_t::header, hide_node(), if(), jb_debug, switch_jb_s::jitter, switch_jb_stats_s::jitter_max_ms, switch_jb_s::list_mutex, switch_jb_node_s::next, switch_jb_s::node_list, switch_jb_node_s::packet, switch_jb_jitter_s::samples_per_frame, switch_jb_jitter_s::samples_per_second, switch_rtp_hdr_t::seq, switch_jb_stats_s::size_est, switch_jb_stats_s::size_max, sort_free_nodes(), switch_jb_jitter_s::stats, switch_channel_set_variable_printf(), SWITCH_FALSE, SWITCH_LOG_INFO, switch_mutex_lock(), switch_mutex_unlock(), switch_jb_s::target_seq, and switch_jb_node_s::visible.
Referenced by jb_next_packet_by_seq_with_acceleration(), and switch_jb_get_packet().
|
inlinestatic |
Definition at line 657 of file switch_jitterbuffer.c.
Referenced by add_node(), and switch_jb_get_packet().
|
inlinestatic |
Definition at line 669 of file switch_jitterbuffer.c.
Referenced by add_node(), and switch_jb_get_packet().
|
inlinestatic |
Definition at line 785 of file switch_jitterbuffer.c.
References switch_jb_s::last_target_seq, and switch_jb_s::target_seq.
Referenced by switch_jb_get_packet().
|
inlinestatic |
Definition at line 635 of file switch_jitterbuffer.c.
References drop_ts(), switch_rtp_packet_t::header, jb_debug, jb_find_lowest_ts(), switch_jb_node_s::packet, and switch_rtp_hdr_t::ts.
Referenced by switch_jb_put_packet().
|
inlinestatic |
Definition at line 384 of file switch_jitterbuffer.c.
References switch_rtp_packet_t::header, hide_node(), switch_jb_s::list_mutex, switch_jb_node_s::next, switch_jb_s::node_list, switch_jb_node_s::packet, sort_free_nodes(), SWITCH_FALSE, switch_mutex_lock(), switch_mutex_unlock(), switch_rtp_hdr_t::ts, and switch_jb_node_s::visible.
Referenced by drop_oldest_frame(), jb_find_lowest_ts(), and jb_next_packet_by_seq().
|
inlinestatic |
Definition at line 1065 of file switch_jitterbuffer.c.
References switch_jb_s::list_mutex, switch_jb_s::node_list, switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_jb_destroy().
|
inlinestatic |
Definition at line 316 of file switch_jitterbuffer.c.
References switch_jb_node_s::bad_hits, switch_jb_node_s::complete_frame_mark, switch_jb_s::complete_frames, FALSE, switch_rtp_packet_t::header, switch_jb_s::list_mutex, switch_jb_s::node_hash, switch_jb_s::node_hash_ts, switch_jb_node_s::packet, switch_jb_node_s::parent, push_to_top(), switch_rtp_hdr_t::seq, SJB_VIDEO, switch_core_inthash_delete(), switch_mutex_lock(), switch_mutex_unlock(), switch_rtp_hdr_t::ts, switch_jb_s::type, switch_jb_node_s::visible, and switch_jb_s::visible_nodes.
Referenced by check_jb_size(), drop_ts(), hide_nodes(), and switch_jb_get_packet().
|
inlinestatic |
Definition at line 353 of file switch_jitterbuffer.c.
References hide_node(), switch_jb_s::list_mutex, switch_jb_node_s::next, switch_jb_s::node_list, SWITCH_FALSE, switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_jb_reset().
|
inlinestatic |
Definition at line 779 of file switch_jitterbuffer.c.
References switch_jb_s::last_target_seq, and switch_jb_s::target_seq.
Referenced by jb_next_packet_by_seq().
|
inlinestatic |
Definition at line 758 of file switch_jitterbuffer.c.
References switch_jb_s::last_psuedo_seq, switch_jb_s::last_target_ts, switch_jb_s::psuedo_seq, switch_jb_s::samples_per_frame, and switch_jb_s::target_ts.
Referenced by jb_next_packet_by_ts().
|
inlinestatic |
Definition at line 425 of file switch_jitterbuffer.c.
References switch_rtp_packet_t::header, switch_jb_s::list_mutex, switch_jb_node_s::next, switch_jb_s::node_list, switch_jb_node_s::packet, switch_mutex_lock(), switch_mutex_unlock(), switch_rtp_hdr_t::ts, and switch_jb_node_s::visible.
Referenced by jb_find_lowest_ts(), jb_miss(), and jb_next_packet_by_ts().
|
inlinestatic |
Definition at line 406 of file switch_jitterbuffer.c.
References switch_rtp_packet_t::header, switch_jb_s::list_mutex, switch_jb_node_s::next, switch_jb_s::node_list, switch_jb_node_s::packet, switch_rtp_hdr_t::seq, switch_mutex_lock(), switch_mutex_unlock(), switch_rtp_hdr_t::ts, and switch_jb_node_s::visible.
Referenced by jb_miss(), and jb_next_packet_by_seq().
|
inlinestatic |
Definition at line 442 of file switch_jitterbuffer.c.
References drop_ts(), switch_rtp_packet_t::header, jb_debug, jb_find_lowest_node(), switch_jb_s::list_mutex, switch_jb_node_s::next, switch_jb_s::node_list, switch_jb_node_s::packet, sort_free_nodes(), switch_mutex_lock(), switch_mutex_unlock(), switch_rtp_hdr_t::ts, and switch_jb_node_s::visible.
Referenced by drop_oldest_frame().
|
static |
Definition at line 541 of file switch_jitterbuffer.c.
References switch_jb_s::frame_len, switch_jb_s::highest_frame_len, jb_debug, switch_jb_s::max_frame_len, and switch_jb_s::min_frame_len.
|
inlinestatic |
Definition at line 534 of file switch_jitterbuffer.c.
References switch_jb_s::consec_good_count, switch_jb_s::consec_miss_count, and switch_jb_s::period_good_count.
Referenced by jb_next_packet_by_seq(), and jb_next_packet_by_ts().
|
inlinestatic |
Definition at line 586 of file switch_jitterbuffer.c.
References switch_jb_s::consec_good_count, switch_jb_s::consec_miss_count, switch_rtp_packet_t::header, jb_find_lowest_node(), jb_find_lowest_seq(), switch_jb_s::missing_seq_hash, switch_jb_s::mutex, switch_jb_node_s::next, node_cmp(), switch_jb_s::node_list, switch_jb_node_s::packet, switch_jb_s::period_miss_count, sort_nodes(), switch_core_inthash_find(), switch_core_inthash_insert(), switch_mutex_lock(), switch_mutex_unlock(), and switch_rtp_hdr_t::ts.
Referenced by jb_next_packet_by_seq(), and jb_next_packet_by_ts().
|
inlinestatic |
Definition at line 1052 of file switch_jitterbuffer.c.
References switch_jb_s::elastic, switch_jb_jitter_s::estimate, jb_next_packet_by_seq(), jb_next_packet_by_seq_with_acceleration(), jb_next_packet_by_ts(), switch_jb_s::jitter, and switch_jb_s::samples_per_frame.
Referenced by switch_jb_get_packet().
|
inlinestatic |
Definition at line 797 of file switch_jitterbuffer.c.
References drop_ts(), switch_jb_s::dropped, switch_rtp_packet_t::header, switch_jb_s::highest_dropped_ts, switch_jb_s::highest_read_ts, increment_seq(), jb_debug, jb_find_lowest_seq(), jb_frame_inc, jb_hit(), jb_miss(), switch_rtp_hdr_t::m, switch_jb_s::node_hash, switch_jb_node_s::packet, switch_jb_s::period_miss_count, switch_jb_s::period_miss_inc, switch_rtp_hdr_t::seq, switch_jb_s::session, set_read_seq(), SJB_VIDEO, switch_core_inthash_find(), switch_core_session_request_video_refresh, SWITCH_STATUS_NOTFOUND, SWITCH_STATUS_SUCCESS, switch_jb_s::target_seq, switch_rtp_hdr_t::ts, and switch_jb_s::type.
Referenced by jb_next_packet(), and jb_next_packet_by_seq_with_acceleration().
|
inlinestatic |
Definition at line 996 of file switch_jitterbuffer.c.
References switch_jb_stats_s::acceleration, switch_jb_stats_s::buffer_size_ms, check_jb_size(), switch_jb_s::complete_frames, switch_jb_jitter_s::drop_gap, switch_jb_s::elastic, switch_jb_jitter_s::estimate, switch_jb_stats_s::estimate_ms, switch_jb_s::frame_len, jb_debug, jb_next_packet_by_seq(), switch_jb_s::jitter, switch_jb_node_s::len, switch_jb_node_s::packet, packet_vad(), switch_jb_jitter_s::samples_per_frame, switch_jb_jitter_s::samples_per_second, switch_jb_jitter_s::stats, SWITCH_FALSE, SWITCH_LOG_INFO, SWITCH_STATUS_SUCCESS, switch_jb_s::target_seq, and switch_jb_s::visible_nodes.
Referenced by jb_next_packet().
|
inlinestatic |
Definition at line 881 of file switch_jitterbuffer.c.
References switch_rtp_packet_t::header, increment_ts(), jb_debug, jb_find_lowest_node(), jb_hit(), jb_miss(), switch_jb_s::node_hash_ts, switch_jb_node_s::packet, switch_jb_s::psuedo_seq, switch_rtp_hdr_t::seq, set_read_ts(), switch_core_inthash_find(), SWITCH_STATUS_NOTFOUND, SWITCH_STATUS_SUCCESS, switch_jb_s::target_ts, and switch_rtp_hdr_t::ts.
Referenced by jb_next_packet().
|
inlinestatic |
Definition at line 239 of file switch_jitterbuffer.c.
References switch_jb_s::allocated_nodes, switch_jb_node_s::bad_hits, jb_debug, switch_jb_s::jitter, switch_jb_s::list_mutex, switch_jb_s::max_frame_len, switch_jb_s::max_packet_len, switch_jb_node_s::next, switch_jb_s::node_list, switch_jb_node_s::parent, switch_jb_s::pool, switch_jb_node_s::prev, switch_jb_stats_s::reset_too_big, SJB_VIDEO, switch_jb_jitter_s::stats, switch_assert, switch_core_alloc, switch_jb_reset(), switch_mutex_lock(), switch_mutex_unlock(), switch_jb_s::type, switch_jb_node_s::visible, and switch_jb_s::visible_nodes.
Referenced by add_node().
|
static |
Definition at line 146 of file switch_jitterbuffer.c.
References b, switch_rtp_packet_t::header, switch_jb_node_s::packet, switch_rtp_hdr_t::seq, and switch_jb_node_s::visible.
Referenced by jb_miss(), and sort_free_nodes().
|
inlinestatic |
Definition at line 364 of file switch_jitterbuffer.c.
References switch_rtp_packet_t::body, switch_rtp_packet_t::ebody, switch_jb_node_s::len, SCC_AUDIO_VAD, SCCT_INT, SCCT_STRING, switch_jb_s::session, switch_core_media_codec_control(), SWITCH_FALSE, SWITCH_IO_WRITE, SWITCH_MEDIA_TYPE_AUDIO, and SWITCH_TRUE.
Referenced by jb_next_packet_by_seq_with_acceleration().
|
inlinestatic |
Definition at line 291 of file switch_jitterbuffer.c.
References switch_jb_node_s::next, switch_jb_s::node_list, switch_jb_node_s::prev, and switch_assert.
Referenced by hide_node().
|
inlinestatic |
Definition at line 791 of file switch_jitterbuffer.c.
References switch_jb_s::last_target_seq, and switch_jb_s::target_seq.
Referenced by jb_next_packet_by_seq().
|
inlinestatic |
Definition at line 768 of file switch_jitterbuffer.c.
References switch_jb_s::last_psuedo_seq, switch_jb_s::last_target_ts, switch_jb_s::psuedo_seq, switch_jb_s::samples_per_frame, and switch_jb_s::target_ts.
Referenced by jb_next_packet_by_ts().
|
inlinestatic |
Definition at line 346 of file switch_jitterbuffer.c.
References switch_jb_s::list_mutex, node_cmp(), switch_jb_s::node_list, sort_nodes(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by check_jb_size(), drop_ts(), and jb_find_lowest_ts().
switch_jb_node_t* sort_nodes | ( | switch_jb_node_t * | list, |
int(*)(const void *, const void *) | cmp | ||
) |
Definition at line 158 of file switch_jitterbuffer.c.
References switch_jb_node_s::next, and switch_jb_node_s::prev.
Referenced by jb_miss(), and sort_free_nodes().
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_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().