FreeSWITCH API Documentation
1.7.0
|
#include <switch.h>
#include <switch_ssl.h>
#include <switch_stun.h>
#include <switch_nat.h>
#include "private/switch_core_pvt.h"
#include <switch_curl.h>
#include <errno.h>
#include <sofia-sip/sdp.h>
#include <sofia-sip/su.h>
Go to the source code of this file.
Data Structures | |
struct | secure_settings_s |
struct | core_video_globals_s |
struct | media_helper |
struct | switch_rtp_engine_s |
struct | switch_media_handle_s |
struct | matches |
Macros | |
#define | RTCP_MUX |
#define | MAX_CODEC_CHECK_FRAMES 50 |
#define | MAX_MISMATCH_FRAMES 5 |
#define | type2str(type) type == SWITCH_MEDIA_TYPE_VIDEO ? "video" : "audio" |
#define | VIDEO_REFRESH_FREQ 1000000 |
#define | add_stat(_i, _s) |
#define | add_stat_double(_i, _s) |
#define | MAX_MATCHES 30 |
#define | RA_PTR_LEN 512 |
#define | SDPBUFLEN 65536 |
Typedefs | |
typedef struct secure_settings_s | switch_secure_settings_t |
typedef struct core_video_globals_s | core_video_globals_t |
typedef struct switch_rtp_engine_s | switch_rtp_engine_t |
Enumerations | |
enum | smh_flag_t { SMF_INIT = (1 << 0), SMF_READY = (1 << 1), SMF_JB_PAUSED = (1 << 2) } |
enum | switch_rtp_crypto_mode_t { CRYPTO_MODE_OPTIONAL, CRYPTO_MODE_MANDATORY, CRYPTO_MODE_FORBIDDEN } |
Variables | |
static core_video_globals_t | video_globals = { 0 } |
static switch_srtp_crypto_suite_t | SUITES [CRYPTO_INVALID] |
#define add_stat | ( | _i, | |
_s | |||
) |
Definition at line 1484 of file switch_core_media.c.
Referenced by set_stats().
#define add_stat_double | ( | _i, | |
_s | |||
) |
Definition at line 1489 of file switch_core_media.c.
Referenced by set_stats().
#define MAX_CODEC_CHECK_FRAMES 50 |
Definition at line 48 of file switch_core_media.c.
Referenced by switch_core_media_read_frame().
#define MAX_MATCHES 30 |
Definition at line 3610 of file switch_core_media.c.
#define MAX_MISMATCH_FRAMES 5 |
Definition at line 49 of file switch_core_media.c.
Referenced by switch_core_media_read_frame().
#define RA_PTR_LEN 512 |
Definition at line 5612 of file switch_core_media.c.
Referenced by switch_core_media_proxy_remote_addr().
#define RTCP_MUX |
Definition at line 47 of file switch_core_media.c.
#define SDPBUFLEN 65536 |
Definition at line 7522 of file switch_core_media.c.
Referenced by switch_core_media_gen_local_sdp().
#define type2str | ( | type | ) | type == SWITCH_MEDIA_TYPE_VIDEO ? "video" : "audio" |
Definition at line 50 of file switch_core_media.c.
Referenced by check_dtls_reinvite(), check_ice(), switch_core_media_build_crypto(), switch_core_media_read_frame(), switch_core_media_read_lock_unlock(), and switch_core_session_write_video_frame().
#define VIDEO_REFRESH_FREQ 1000000 |
Definition at line 51 of file switch_core_media.c.
Referenced by switch_core_media_codec_control(), and switch_core_session_request_video_refresh().
typedef struct core_video_globals_s core_video_globals_t |
typedef struct switch_rtp_engine_s switch_rtp_engine_t |
typedef struct secure_settings_s switch_secure_settings_t |
enum smh_flag_t |
Enumerator | |
---|---|
SMF_INIT | |
SMF_READY | |
SMF_JB_PAUSED |
Definition at line 53 of file switch_core_media.c.
Enumerator | |
---|---|
CRYPTO_MODE_OPTIONAL | |
CRYPTO_MODE_MANDATORY | |
CRYPTO_MODE_FORBIDDEN |
Definition at line 89 of file switch_core_media.c.
|
static |
Definition at line 306 of file switch_core_media.c.
References CF_ZRTP_PASSTHRU_REQ, switch_core_session::channel, switch_media_handle_s::engines, switch_rtp_engine_s::local_sdp_zrtp_hash, switch_core_session::media_handle, switch_rtp_engine_s::remote_sdp_zrtp_hash, SWITCH_CHANNEL_CHANNEL_LOG, switch_channel_set_variable, switch_channel_test_flag(), switch_core_session_strdup, SWITCH_LOG_DEBUG, SWITCH_LOG_DEBUG1, and switch_log_printf().
Referenced by switch_core_media_pass_zrtp_hash2().
|
static |
Definition at line 9993 of file switch_core_media.c.
References switch_codec_fmtp::bits_per_second, switch_codec_fmtp::microseconds_per_packet, switch_codec_implementation::modname, switch_core_codec_parse_fmtp(), switch_default_ptime(), switch_known_bitrate(), switch_snprintf(), SWITCH_STATUS_SUCCESS, and zstr.
Referenced by switch_core_media_set_r_sdp_codec_string().
|
static |
Definition at line 7501 of file switch_core_media.c.
References switch_snprintf().
Referenced by switch_core_media_gen_local_sdp().
|
static |
Definition at line 6193 of file switch_core_media.c.
References CF_REINVITE, switch_core_session::channel, switch_rtp_engine_s::dtls_controller, dtls_ok(), DTLS_TYPE_CLIENT, DTLS_TYPE_RTCP, DTLS_TYPE_RTP, DTLS_TYPE_SERVER, switch_rtp_engine_s::local_dtls_fingerprint, switch_rtp_engine_s::new_dtls, switch_rtp_engine_s::remote_dtls_fingerprint, switch_rtp_engine_s::rtcp_mux, switch_rtp_engine_s::rtp_session, dtls_fp_s::str, SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), SWITCH_LOG_INFO, switch_log_printf(), switch_rtp_add_dtls(), switch_rtp_has_dtls(), switch_rtp_engine_s::type, type2str, and zstr.
Referenced by switch_core_media_activate_rtp().
|
static |
Definition at line 9176 of file switch_core_media.c.
References DS_FAIL, DS_READY, DTLS_TYPE_RTP, switch_rtp_engine_s::read_frame, switch_rtp_engine_s::rtp_session, SWITCH_READ_ACCEPTABLE, switch_rtp_dtls_state(), and switch_rtp_zerocopy_read_frame().
Referenced by switch_core_media_check_dtls().
|
static |
Definition at line 3229 of file switch_core_media.c.
References switch_rtp_engine_s::cand_acl, switch_rtp_engine_s::cand_acl_count, ice_s::cand_idx, icand_s::cand_type, ice_s::cands, CF_DTLS, CF_ICE, CF_RECOVERING, CF_REINVITE, switch_core_session::channel, ice_s::chosen, icand_s::component_id, icand_s::con_addr, icand_s::con_port, switch_rtp_engine_s::cur_payload_map, switch_rtp_engine_s::dtls_controller, dtls_ok(), switch_media_handle_s::engines, icand_s::foundation, generate_local_fingerprint(), icand_s::generation, ICE_CONTROLLED, ICE_GOOGLE_JINGLE, switch_rtp_engine_s::ice_in, switch_rtp_engine_s::ice_out, ICE_VANILLA, if(), ip_choose_family(), ip_possible(), IPR_RTCP, IPR_RTP, ice_s::is_chosen, MAX_CAND, switch_media_handle_s::mparams, switch_rtp_engine_s::new_dtls, switch_rtp_engine_s::new_ice, ice_s::options, icand_s::priority, ice_s::pwd, icand_s::raddr, icand_s::ready, switch_rtp_engine_s::remote_dtls_fingerprint, switch_core_media_params_s::remote_ip, switch_rtp_engine_s::remote_rtcp_ice_addr, switch_rtp_engine_s::remote_rtcp_ice_port, switch_rtp_engine_s::remote_rtcp_port, switch_rtp_engine_s::remote_rtp_ice_addr, switch_rtp_engine_s::remote_rtp_ice_port, payload_map_s::remote_sdp_ip, payload_map_s::remote_sdp_port, switch_rtp_engine_s::remote_ssrc, icand_s::rport, switch_core_media_params_s::rtcp_audio_interval_msec, switch_rtp_engine_s::rtcp_mux, switch_core_media_params_s::rtcp_video_interval_msec, switch_rtp_engine_s::rtp_session, switch_media_handle_s::session, dtls_fp_s::str, SWITCH_CALL_DIRECTION_OUTBOUND, switch_channel_get_name(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_variable, switch_channel_test_flag(), switch_check_network_list_ip, switch_core_session_strdup, switch_ice_direction(), SWITCH_LOG_DEBUG, SWITCH_LOG_DEBUG1, SWITCH_LOG_ERROR, SWITCH_LOG_INFO, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_REMOTE_MEDIA_IP_VARIABLE, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, switch_rtp_activate_ice(), switch_rtp_activate_rtcp(), switch_rtp_has_dtls(), switch_rtp_ready(), switch_rtp_set_remote_ssrc(), switch_set_string, switch_snprintf(), switch_split, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_stristr(), SWITCH_TRUE, icand_s::transport, dtls_fp_s::type, type2str, ice_s::ufrag, and zstr.
Referenced by switch_core_media_negotiate_sdp().
|
static |
Definition at line 1875 of file switch_core_media.c.
References CF_JITTERBUFFER, CF_JITTERBUFFER_PLC, switch_core_session::channel, switch_media_handle_s::engines, switch_codec::implementation, switch_core_media_params_s::jb_msec, switch_core_session::media_handle, switch_codec_implementation::microseconds_per_packet, switch_media_handle_s::mparams, switch_rtp_engine_s::read_codec, switch_rtp_engine_s::read_impl, switch_rtp_engine_s::rtp_session, switch_codec_implementation::samples_per_packet, switch_codec_implementation::samples_per_second, switch_assert, switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_variable, SWITCH_FALSE, switch_false(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_rtp_activate_jitter_buffer(), switch_rtp_deactivate_jitter_buffer(), switch_rtp_debug_jitter_buffer(), switch_rtp_pause_jitter_buffer(), switch_rtp_set_video_buffer_size(), SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and zstr.
Referenced by check_jb_sync(), switch_core_media_activate_rtp(), switch_core_media_read_frame(), and switch_core_media_receive_message().
|
static |
Definition at line 2008 of file switch_core_media.c.
References CF_VIDEO, switch_core_session::channel, check_jb(), switch_media_handle_s::engines, core_video_globals_s::fps, switch_core_session::media_handle, switch_rtp_engine_s::rtp_session, switch_assert, switch_channel_get_name(), switch_channel_get_variable_dup(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), switch_core_media_get_video_fps(), switch_core_session_get_uuid(), SWITCH_FALSE, SWITCH_LOG_DEBUG1, switch_log_printf(), SWITCH_MEDIA_TYPE_VIDEO, switch_rtp_get_video_buffer_size(), switch_rtp_set_video_buffer_size(), SWITCH_TRUE, and core_video_globals_s::synced.
Referenced by switch_core_media_read_frame().
|
static |
Definition at line 3001 of file switch_core_media.c.
References ice_s::cand_idx, ice_s::chosen, switch_media_handle_s::engines, switch_rtp_engine_s::ice_in, ice_s::is_chosen, switch_core_session::media_handle, memset(), switch_rtp_engine_s::remote_rtcp_port, switch_rtp_engine_s::rtp_session, switch_assert, and switch_rtp_reset().
Referenced by switch_core_media_clear_ice().
|
static |
Definition at line 3636 of file switch_core_media.c.
References payload_map_s::allocated, payload_map_s::current, payload_map_s::negotiated, payload_map_s::next, and switch_rtp_engine_s::payload_map.
Referenced by switch_core_media_check_outgoing_proxy(), switch_core_media_negotiate_sdp(), switch_core_media_patch_sdp(), and switch_core_media_receive_message().
|
static |
Definition at line 3152 of file switch_core_media.c.
References CF_DTLS_OK, switch_core_session::channel, and switch_channel_test_flag().
Referenced by check_dtls_reinvite(), check_ice(), switch_core_media_activate_rtp(), switch_core_media_gen_local_sdp(), and switch_core_media_negotiate_sdp().
|
static |
Definition at line 10665 of file switch_core_media.c.
References end_of_p, and switch_stristr().
Referenced by switch_core_media_filter_sdp().
|
static |
Definition at line 6089 of file switch_core_media.c.
References ice_s::cands, switch_media_handle_s::cname, icand_s::component_id, icand_s::con_addr, icand_s::con_port, switch_media_handle_s::engines, icand_s::foundation, icand_s::generation, switch_rtp_engine_s::ice_out, switch_core_session::media_handle, switch_media_handle_s::msid, icand_s::priority, ice_s::pwd, icand_s::ready, switch_rtp_engine_s::rtcp_mux, switch_assert, switch_core_session_strdup, switch_stun_random_string(), SWITCH_TRUE, icand_s::transport, ice_s::ufrag, and zstr.
Referenced by generate_m(), switch_core_media_activate_rtp(), switch_core_media_gen_local_sdp(), and switch_core_session_stop_media().
|
static |
Definition at line 3137 of file switch_core_media.c.
References DTLS_SRTP_FNAME, switch_media_handle_s::engines, dtls_fp_s::len, switch_rtp_engine_s::local_dtls_fingerprint, switch_rtp_engine_s::remote_dtls_fingerprint, switch_core_cert_gen_fingerprint(), and dtls_fp_s::type.
Referenced by check_ice(), and switch_core_media_gen_local_sdp().
|
static |
Definition at line 7096 of file switch_core_media.c.
References switch_codec_implementation::bits_per_second, ice_s::cands, CF_AVPF, CF_DTLS, CF_LIBERAL_DTMF, CF_RECOVERING, CF_VERBOSE_SDP, switch_core_session::channel, switch_media_handle_s::cname, switch_media_handle_s::cng_ianacodes, switch_codec_implementation::codec_type, switch_media_handle_s::codecs, icand_s::con_addr, icand_s::con_port, CRYPTO_INVALID, switch_media_handle_s::crypto_suite_order, switch_rtp_engine_s::crypto_type, DTMF_2833, switch_media_handle_s::dtmf_ianacodes, switch_core_media_params_s::dtmf_type, end_of, switch_media_handle_s::engines, switch_codec_implementation::fmtp, switch_media_handle_s::fmtps, gen_ice(), get_channels(), get_media_profile_name(), get_setup(), switch_media_handle_s::ianacodes, switch_codec_implementation::iananame, switch_rtp_engine_s::ice_out, ice_out(), secure_settings_s::local_crypto_key, switch_rtp_engine_s::local_dtls_fingerprint, switch_rtp_engine_s::local_sdp_ip, switch_rtp_engine_s::local_sdp_port, switch_core_session::media_handle, memset(), switch_codec_implementation::microseconds_per_packet, switch_media_handle_s::mparams, switch_media_handle_s::msid, switch_core_media_params_s::num_codecs, switch_media_handle_s::num_rates, switch_codec_implementation::number_of_channels, ice_s::pwd, switch_media_handle_s::rates, icand_s::ready, switch_core_media_params_s::rtcp_audio_interval_msec, switch_rtp_engine_s::rtcp_mux, switch_codec_implementation::samples_per_second, SCMF_LIBERAL_DTMF, SCMF_SUPPRESS_CNG, switch_rtp_engine_s::ssec, switch_rtp_engine_s::ssrc, dtls_fp_s::str, switch_assert, SWITCH_CALL_DIRECTION_OUTBOUND, switch_channel_direction(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), SWITCH_CODEC_TYPE_AUDIO, switch_core_media_get_zrtp_hash(), switch_event_get_header, SWITCH_LOG_DEBUG, switch_log_printf(), switch_media_handle_test_media_flag(), SWITCH_MEDIA_TYPE_AUDIO, switch_snprintf(), switch_stun_random_string(), SWITCH_TRUE, switch_core_media_params_s::te, icand_s::transport, switch_srtp_crypto_suite_s::type, dtls_fp_s::type, ice_s::ufrag, and zstr.
Referenced by switch_core_media_gen_local_sdp().
|
static |
Definition at line 296 of file switch_core_media.c.
References switch_core_get_variable(), switch_true(), and zstr.
Referenced by generate_m(), and switch_core_media_gen_local_sdp().
|
static |
Definition at line 7053 of file switch_core_media.c.
References CF_AVPF, CF_AVPF_MOZ, CF_DTLS, switch_core_session::channel, switch_assert, and switch_channel_test_flag().
Referenced by generate_m(), and switch_core_media_gen_local_sdp().
|
static |
Definition at line 7081 of file switch_core_media.c.
References switch_rtp_engine_s::dtls_controller, switch_rtp_engine_s::new_dtls, switch_rtp_engine_s::new_ice, and SDP_TYPE_REQUEST.
Referenced by generate_m(), and switch_core_media_gen_local_sdp().
|
static |
Definition at line 3618 of file switch_core_media.c.
References matches::imp, switch_media_handle_s::mparams, and switch_core_media_params_s::num_codecs.
Referenced by switch_core_media_negotiate_sdp().
|
static |
Definition at line 3183 of file switch_core_media.c.
References switch_core_session::channel, switch_media_handle_s::mparams, switch_core_media_params_s::rtpip, switch_core_media_params_s::rtpip4, switch_core_media_params_s::rtpip6, switch_media_handle_s::session, switch_channel_get_name(), SWITCH_CHANNEL_SESSION_LOG, SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and zstr.
Referenced by check_ice().
|
static |
Definition at line 3211 of file switch_core_media.c.
References switch_media_handle_s::mparams, switch_core_media_params_s::rtpip4, switch_core_media_params_s::rtpip6, SWITCH_FALSE, and zstr.
Referenced by check_ice().
int next_cpu | ( | void | ) |
Definition at line 5315 of file switch_core_media.c.
References core_video_globals_s::cpu_count, core_video_globals_s::cur_cpu, core_video_globals_s::mutex, SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, switch_log_printf(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_core_autobind_cpu().
|
static |
|
inlinestatic |
Definition at line 280 of file switch_core_media.c.
References SWITCH_MEDIA_FLOW_INACTIVE, SWITCH_MEDIA_FLOW_RECVONLY, SWITCH_MEDIA_FLOW_SENDONLY, and SWITCH_MEDIA_FLOW_SENDRECV.
Referenced by switch_core_media_negotiate_sdp().
|
static |
Definition at line 1494 of file switch_core_media.c.
References add_stat, add_stat_double, switch_rtp_numbers_t::burstrate, switch_rtp_numbers_t::cng_packet_count, switch_rtp_numbers_t::dtmf_packet_count, switch_rtp_numbers_t::flaws, switch_rtp_numbers_t::flush_packet_count, switch_rtp_stats_t::inbound, switch_rtp_numbers_t::jb_packet_count, switch_rtp_numbers_t::largest_jb_size, switch_rtp_numbers_t::lossrate, switch_rtp_numbers_t::max_variance, switch_rtp_numbers_t::mean_interval, switch_rtp_numbers_t::media_bytes, switch_rtp_numbers_t::media_packet_count, switch_rtp_numbers_t::min_variance, switch_rtp_numbers_t::mos, switch_rtcp_numbers_t::octet_count, switch_rtp_stats_t::outbound, switch_rtp_numbers_t::packet_count, switch_rtcp_numbers_t::packet_count, switch_rtp_numbers_t::R, switch_rtp_numbers_t::raw_bytes, switch_rtp_stats_t::rtcp, switch_rtp_numbers_t::skip_packet_count, switch_rtp_numbers_t::std_deviation, switch_core_media_get_stats(), switch_core_session_get_channel(), and switch_rtp_numbers_t::variance.
Referenced by switch_core_media_set_stats().
void switch_core_autobind_cpu | ( | void | ) |
Definition at line 5330 of file switch_core_media.c.
References core_video_globals_s::cpu_count, next_cpu(), and switch_core_thread_set_cpu_affinity().
Referenced by video_helper_thread().
void switch_core_media_absorb_sdp | ( | switch_core_session_t * | session | ) |
Definition at line 8594 of file switch_core_media.c.
References switch_media_handle_s::engines, if(), switch_rtp_engine_s::proxy_sdp_ip, switch_rtp_engine_s::proxy_sdp_port, switch_assert, SWITCH_B_SDP_VARIABLE, switch_channel_get_variable, switch_core_media_set_local_sdp(), switch_core_session_strdup, SWITCH_MEDIA_TYPE_AUDIO, and SWITCH_TRUE.
Referenced by switch_core_media_receive_message().
switch_status_t switch_core_media_activate_rtp | ( | switch_core_session_t * | session | ) |
Definition at line 6218 of file switch_core_media.c.
References switch_rtp_engine_s::adv_sdp_ip, payload_map_s::agreed_pt, switch_core_media_params_s::auto_rtp_bugs, ice_s::cands, CF_AVPF, CF_FS_RTP, CF_NOTIMER_DURING_BRIDGE, CF_PASS_RFC2833, CF_PROTO_HOLD, CF_PROXY_MEDIA, CF_PROXY_MODE, CF_REINVITE, CF_SECURE, CF_VIDEO, CF_VIDEO_POSSIBLE, CF_ZRTP_PASSTHRU, check_dtls_reinvite(), check_jb(), ice_s::chosen, switch_core_media_params_s::cng_pt, switch_core_media_params_s::codec_flags, payload_map_s::codec_ms, icand_s::con_addr, icand_s::con_port, CRYPTO_INVALID, switch_rtp_engine_s::crypto_type, switch_rtp_engine_s::cur_payload_map, switch_rtp_engine_s::dtls_controller, dtls_ok(), DTLS_TYPE_CLIENT, DTLS_TYPE_RTCP, DTLS_TYPE_RTP, DTLS_TYPE_SERVER, switch_core_media_params_s::dtmf_delay, switch_media_handle_s::engines, switch_rtp_engine_s::fir, gen_ice(), switch_codec_implementation::iananame, ICE_CONTROLLED, ICE_GOOGLE_JINGLE, switch_rtp_engine_s::ice_in, switch_rtp_engine_s::ice_out, ICE_VANILLA, IPR_RTCP, IPR_RTP, switch_rtp_engine_s::local_dtls_fingerprint, switch_rtp_engine_s::local_sdp_ip, switch_rtp_engine_s::local_sdp_port, switch_core_media_params_s::manual_rtp_bugs, switch_core_media_params_s::manual_video_rtp_bugs, switch_rtp_engine_s::max_missed_hold_packets, switch_rtp_engine_s::max_missed_packets, memset(), switch_codec_implementation::microseconds_per_packet, switch_media_handle_s::mparams, switch_rtp_engine_s::nack, payload_map_s::negotiated, switch_rtp_engine_s::payload_map, switch_rtp_engine_s::pli, ice_s::pwd, switch_rtp_engine_s::read_codec, switch_rtp_engine_s::read_impl, switch_media_handle_s::read_mutex, icand_s::ready, switch_core_media_params_s::recv_te, switch_rtp_engine_s::remote_dtls_fingerprint, switch_rtp_engine_s::remote_rtcp_port, payload_map_s::remote_sdp_ip, payload_map_s::remote_sdp_port, switch_rtp_engine_s::remote_ssrc, payload_map_s::rm_encoding, switch_core_media_params_s::rtcp_audio_interval_msec, switch_rtp_engine_s::rtcp_mux, switch_core_media_params_s::rtcp_video_interval_msec, RTP_BUG_IGNORE_MARK_BIT, RTP_BUG_SEND_LINEAR_TIMESTAMPS, switch_rtp_engine_s::rtp_bugs, switch_core_media_params_s::rtp_hold_timeout_sec, switch_rtp_engine_s::rtp_session, switch_core_media_params_s::rtp_timeout_sec, switch_codec_implementation::samples_per_packet, switch_codec_implementation::samples_per_second, SCMF_AUTOFLUSH, SCMF_DISABLE_RTP_AUTOADJ, SCMF_PASS_RFC2833, SCMF_REWRITE_TIMESTAMPS, SCMF_SUPPRESS_CNG, switch_media_handle_s::session, switch_rtp_engine_s::ssrc, dtls_fp_s::str, SWITCH_ADVERTISED_MEDIA_IP_VARIABLE, switch_assert, SWITCH_CALL_DIRECTION_INBOUND, SWITCH_CALL_DIRECTION_OUTBOUND, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, switch_channel_clear_flag(), switch_channel_direction(), switch_channel_down, switch_channel_get_name(), switch_channel_get_variable, switch_channel_hangup, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_variable, switch_channel_set_variable_printf(), switch_channel_test_flag(), switch_channel_up, switch_core_media_check_video_codecs(), switch_core_media_choose_port(), switch_core_media_parse_rtp_bugs(), switch_core_media_proxy_remote_addr(), switch_core_media_set_codec(), switch_core_media_set_video_codec(), switch_core_media_toggle_hold(), switch_core_recovery_track(), switch_core_session_apply_crypto(), switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_start_video_thread(), SWITCH_FALSE, switch_ice_direction(), SWITCH_LOCAL_MEDIA_IP_VARIABLE, SWITCH_LOCAL_MEDIA_PORT_VARIABLE, SWITCH_LOCAL_VIDEO_IP_VARIABLE, SWITCH_LOCAL_VIDEO_PORT_VARIABLE, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, SWITCH_LOG_INFO, switch_log_printf(), switch_media_handle_test_media_flag(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_init(), SWITCH_MUTEX_NESTED, SWITCH_REMOTE_MEDIA_IP_VARIABLE, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, switch_rtp_activate_ice(), switch_rtp_activate_rtcp(), switch_rtp_add_dtls(), switch_rtp_enable_vad(), SWITCH_RTP_FLAG_AUTO_CNG, SWITCH_RTP_FLAG_AUTOADJ, SWITCH_RTP_FLAG_AUTOFLUSH, SWITCH_RTP_FLAG_BYTESWAP, SWITCH_RTP_FLAG_DATAWAIT, SWITCH_RTP_FLAG_FIR, SWITCH_RTP_FLAG_GEN_TS_DELTA, SWITCH_RTP_FLAG_INVALID, SWITCH_RTP_FLAG_NACK, SWITCH_RTP_FLAG_NOBLOCK, SWITCH_RTP_FLAG_PLI, SWITCH_RTP_FLAG_PROXY_MEDIA, SWITCH_RTP_FLAG_RAW_WRITE, SWITCH_RTP_FLAG_TMMBR, SWITCH_RTP_FLAG_USE_TIMER, SWITCH_RTP_FLAG_VIDEO, switch_rtp_get_remote_host(), switch_rtp_get_remote_port(), switch_rtp_get_ssrc(), switch_rtp_has_dtls(), switch_rtp_intentional_bugs(), switch_rtp_new(), switch_rtp_ready(), switch_rtp_reset_media_timer(), switch_rtp_set_cng_pt(), switch_rtp_set_default_payload(), switch_rtp_set_flag(), switch_rtp_set_interdigit_delay(), switch_rtp_set_max_missed_packets(), switch_rtp_set_payload_map(), switch_rtp_set_remote_address(), switch_rtp_set_remote_ssrc(), switch_rtp_set_ssrc(), switch_rtp_set_telephony_event(), switch_rtp_set_telephony_recv_event(), switch_rtp_udptl_mode(), switch_snprintf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_str_nil, SWITCH_TRUE, switch_true(), SWITCH_VAD_FLAG_EVENTS_NOTALK, SWITCH_VAD_FLAG_EVENTS_TALK, SWITCH_VAD_FLAG_TALKING, switch_core_media_params_s::te, switch_core_media_params_s::timer_name, switch_rtp_engine_s::tmmbr, ice_s::ufrag, VAD_IN, VAD_OUT, switch_core_media_params_s::vflags, switch_media_handle_s::write_mutex, and zstr.
Referenced by switch_core_media_patch_sdp(), and switch_core_media_recover_session().
switch_status_t switch_core_media_add_crypto | ( | switch_secure_settings_t * | ssec, |
const char * | key_str, | ||
switch_rtp_crypto_direction_t | direction | ||
) |
Definition at line 1104 of file switch_core_media.c.
References CRYPTO_INVALID, switch_srtp_crypto_suite_s::keylen, secure_settings_s::local_raw_key, secure_settings_s::remote_raw_key, switch_b64_decode(), SWITCH_CHANNEL_LOG, switch_core_media_crypto_str2type(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_RTP_CRYPTO_SEND, SWITCH_RTP_MAX_CRYPTO_LEN, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_media_recover_session(), switch_core_session_apply_crypto(), and switch_core_session_check_incoming_crypto().
switch_status_t switch_core_media_add_ice_acl | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
const char * | acl_name | ||
) |
Definition at line 3085 of file switch_core_media.c.
References switch_rtp_engine_s::cand_acl, switch_rtp_engine_s::cand_acl_count, switch_media_handle_s::engines, switch_assert, switch_core_session_strdup, SWITCH_MAX_CAND_ACL, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
payload_map_t* switch_core_media_add_payload_map | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
const char * | name, | ||
const char * | modname, | ||
const char * | fmtp, | ||
switch_sdp_type_t | sdp_type, | ||
uint32_t | pt, | ||
uint32_t | rate, | ||
uint32_t | ptime, | ||
uint32_t | channels, | ||
uint8_t | negotiated | ||
) |
Definition at line 726 of file switch_core_media.c.
References payload_map_s::allocated, payload_map_s::channels, switch_media_handle_s::engines, payload_map_s::hash, payload_map_s::iananame, payload_map_s::modname, payload_map_s::negotiated, payload_map_s::next, switch_rtp_engine_s::payload_map, switch_rtp_engine_s::pmap_tail, payload_map_s::pt, payload_map_s::ptime, payload_map_s::rate, payload_map_s::recv_pt, payload_map_s::rm_encoding, payload_map_s::rm_fmtp, switch_media_handle_s::sdp_mutex, payload_map_s::sdp_type, SDP_TYPE_REQUEST, switch_assert, switch_ci_hashfunc_default(), switch_core_alloc, switch_core_strdup, switch_mutex_lock(), switch_mutex_unlock(), payload_map_s::type, and zstr.
Referenced by switch_core_media_check_outgoing_proxy(), switch_core_media_gen_local_sdp(), switch_core_media_negotiate_sdp(), switch_core_media_patch_sdp(), and switch_core_media_set_r_sdp_codec_string().
void switch_core_media_break | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 9749 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, switch_rtp_break(), and switch_rtp_ready().
Referenced by switch_channel_queue_dtmf().
|
static |
Definition at line 1028 of file switch_core_media.c.
References AES_CM_128_NULL_AUTH, CF_AVPF, CF_SECURE, switch_core_session::channel, secure_settings_s::crypto_type, switch_media_handle_s::engines, switch_srtp_crypto_suite_s::keylen, secure_settings_s::local_crypto_key, secure_settings_s::local_raw_key, switch_media_handle_s::mparams, switch_srtp_crypto_suite_s::name, switch_core_media_params_s::ndlb, secure_settings_s::remote_raw_key, switch_media_handle_s::session, SM_NDLB_DISABLE_SRTP_AUTH, switch_rtp_engine_s::ssec, switch_assert, switch_b64_encode(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_variable_name_printf(), switch_channel_test_flag(), switch_core_session_get_channel(), switch_core_session_sprintf(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_NO_CRYPTO_TAG, SWITCH_RTP_CRYPTO_SEND, switch_rtp_get_random(), SWITCH_STATUS_SUCCESS, switch_true(), and type2str.
Referenced by switch_core_session_check_incoming_crypto(), and switch_core_session_check_outgoing_crypto().
switch_status_t switch_core_media_check_autoadj | ( | switch_core_session_t * | session | ) |
Definition at line 533 of file switch_core_media.c.
References CF_AVPF, switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, SCMF_DISABLE_RTP_AUTOADJ, switch_assert, switch_channel_get_variable, switch_channel_test_flag(), switch_media_handle_test_media_flag(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_RTP_FLAG_AUTOADJ, switch_rtp_set_flag(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_true().
Referenced by switch_channel_perform_mark_answered(), switch_channel_perform_mark_pre_answered(), switch_core_media_negotiate_sdp(), and switch_core_media_toggle_hold().
switch_bool_t switch_core_media_check_dtls | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 9193 of file switch_core_media.c.
References CF_DTLS, check_engine(), switch_media_handle_s::engines, switch_rtp_engine_s::rmode, switch_rtp_engine_s::rtp_session, switch_assert, switch_channel_media_up, switch_channel_ready, switch_channel_test_flag(), SWITCH_FALSE, SWITCH_MEDIA_FLOW_DISABLED, and SWITCH_TRUE.
Referenced by switch_channel_perform_mark_answered(), switch_channel_perform_mark_pre_answered(), and video_helper_thread().
void switch_core_media_check_dtmf_type | ( | switch_core_session_t * | session | ) |
Definition at line 7403 of file switch_core_media.c.
References DTMF_2833, DTMF_INFO, DTMF_NONE, switch_core_media_params_s::dtmf_type, switch_media_handle_s::mparams, switch_assert, and switch_channel_get_variable.
Referenced by switch_core_media_gen_local_sdp().
int switch_core_media_check_nat | ( | switch_media_handle_t * | smh, |
const char * | network_ip | ||
) |
Definition at line 5801 of file switch_core_media.c.
References switch_assert, and switch_check_network_list_ip.
Referenced by switch_core_media_choose_port(), and switch_core_media_deactivate_rtp().
void switch_core_media_check_outgoing_proxy | ( | switch_core_session_t * | session, |
switch_core_session_t * | o_session | ||
) |
Definition at line 10368 of file switch_core_media.c.
References CF_PROXY_MEDIA, CF_VIDEO, CF_VIDEO_POSSIBLE, clear_pmaps(), switch_rtp_engine_s::cur_payload_map, switch_media_handle_s::engines, SDP_TYPE_RESPONSE, switch_assert, switch_channel_get_variable, switch_channel_set_flag, switch_channel_test_flag(), switch_core_media_add_payload_map(), switch_core_media_choose_port(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_R_SDP_VARIABLE, switch_stristr(), and SWITCH_TRUE.
switch_bool_t switch_core_media_check_udptl_mode | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 9913 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, SWITCH_FALSE, SWITCH_RTP_FLAG_UDPTL, switch_rtp_ready(), switch_rtp_test_flag(), and SWITCH_TRUE.
void switch_core_media_check_video_codecs | ( | switch_core_session_t * | session | ) |
Definition at line 3107 of file switch_core_media.c.
References CF_NOVIDEO, CF_VIDEO_POSSIBLE, switch_codec_implementation::codec_type, switch_media_handle_s::codecs, switch_media_handle_s::mparams, switch_core_media_params_s::num_codecs, switch_assert, SWITCH_CALL_DIRECTION_INBOUND, switch_channel_direction(), switch_channel_set_flag, switch_channel_test_flag(), SWITCH_CODEC_TYPE_VIDEO, and switch_media_handle_s::video_count.
Referenced by switch_core_media_activate_rtp(), switch_core_media_choose_ports(), switch_core_media_negotiate_sdp(), and switch_core_media_receive_message().
int switch_core_media_check_video_function | ( | switch_core_session_t * | session | ) |
Definition at line 5559 of file switch_core_media.c.
References switch_media_handle_s::control_mutex, switch_mutex_lock(), switch_mutex_unlock(), and switch_media_handle_s::video_function_running.
Referenced by audio_bridge_thread().
switch_status_t switch_core_media_choose_port | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
int | force | ||
) |
Definition at line 5913 of file switch_core_media.c.
References switch_core_media_params_s::adv_sdp_audio_ip, switch_rtp_engine_s::adv_sdp_ip, switch_rtp_engine_s::adv_sdp_port, CF_PROXY_MEDIA, CF_PROXY_MODE, switch_media_handle_s::engines, switch_core_media_params_s::extrtpip, switch_rtp_engine_s::local_sdp_ip, switch_rtp_engine_s::local_sdp_port, switch_media_handle_s::mparams, switch_core_media_params_s::remote_ip, switch_core_media_params_s::rtpip, SWITCH_ADVERTISED_MEDIA_IP_VARIABLE, switch_assert, switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable, switch_channel_set_variable_printf(), switch_channel_test_flag(), switch_core_media_check_nat(), switch_core_media_ext_address_lookup(), switch_core_session_strdup, SWITCH_FALSE, SWITCH_LOCAL_MEDIA_IP_VARIABLE, SWITCH_LOCAL_MEDIA_PORT_VARIABLE, SWITCH_LOCAL_VIDEO_IP_VARIABLE, SWITCH_LOCAL_VIDEO_PORT_VARIABLE, SWITCH_LOG_CRIT, switch_log_printf(), switch_media_type2str(), SWITCH_MEDIA_TYPE_AUDIO, switch_nat_add_mapping(), SWITCH_NAT_UDP, switch_rtp_release_port(), switch_rtp_request_port(), switch_snprintf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and zstr.
Referenced by switch_core_media_activate_rtp(), switch_core_media_check_outgoing_proxy(), switch_core_media_choose_ports(), switch_core_media_gen_local_sdp(), and switch_core_media_patch_sdp().
switch_status_t switch_core_media_choose_ports | ( | switch_core_session_t * | session, |
switch_bool_t | audio, | ||
switch_bool_t | video | ||
) |
Definition at line 6003 of file switch_core_media.c.
References CF_VIDEO_POSSIBLE, switch_core_session::channel, switch_media_handle_s::mparams, switch_core_media_params_s::rtpip, switch_media_handle_s::session, SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL, switch_channel_get_name(), switch_channel_hangup, SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), switch_core_media_check_video_codecs(), switch_core_media_choose_port(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and zstr.
void switch_core_media_clear_ice | ( | switch_core_session_t * | session | ) |
Definition at line 3030 of file switch_core_media.c.
References clear_ice(), SWITCH_MEDIA_TYPE_AUDIO, and SWITCH_MEDIA_TYPE_VIDEO.
void switch_core_media_clear_rtp_flag | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
switch_rtp_flag_t | flag | ||
) |
Definition at line 9847 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, switch_rtp_clear_flag(), and switch_rtp_ready().
switch_status_t switch_core_media_codec_chosen | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 10276 of file switch_core_media.c.
References switch_rtp_engine_s::cur_payload_map, switch_media_handle_s::engines, payload_map_s::iananame, switch_assert, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_core_media_codec_control | ( | switch_core_session_t * | session, |
switch_media_type_t | mtype, | ||
switch_io_type_t | iotype, | ||
switch_codec_control_command_t | cmd, | ||
switch_codec_control_type_t | ctype, | ||
void * | cmd_data, | ||
switch_codec_control_type_t | atype, | ||
void * | cmd_arg, | ||
switch_codec_control_type_t * | rtype, | ||
void ** | ret_data | ||
) |
Definition at line 10953 of file switch_core_media.c.
References CF_VIDEO, CF_VIDEO_REFRESH_REQ, switch_media_handle_s::engines, switch_media_handle_s::last_codec_refresh, switch_rtp_engine_s::read_codec, SCC_VIDEO_GEN_KEYFRAME, switch_assert, switch_channel_set_flag, switch_channel_test_flag(), switch_core_codec_control(), switch_core_codec_ready(), SWITCH_IO_READ, SWITCH_MEDIA_TYPE_VIDEO, switch_micro_time_now(), SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_NOTIMPL, VIDEO_REFRESH_FREQ, and switch_rtp_engine_s::write_codec.
Referenced by process_rtcp_report(), and switch_core_session_video_reinit().
void switch_core_media_copy_t38_options | ( | switch_t38_options_t * | t38_options, |
switch_core_session_t * | session | ||
) |
Definition at line 2616 of file switch_core_media.c.
References switch_t38_options_t::remote_ip, switch_t38_options_t::remote_port, switch_assert, switch_channel_get_private(), switch_channel_set_private(), switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_strdup, switch_t38_options_t::T38FaxFillBitRemoval, switch_t38_options_t::T38FaxMaxBuffer, switch_t38_options_t::T38FaxMaxDatagram, switch_t38_options_t::T38FaxRateManagement, switch_t38_options_t::T38FaxTranscodingJBIG, switch_t38_options_t::T38FaxTranscodingMMR, switch_t38_options_t::T38FaxUdpEC, switch_t38_options_t::T38MaxBitRate, and switch_t38_options_t::T38VendorInfo.
Referenced by switch_core_media_negotiate_sdp(), and switch_core_media_process_t38_passthru().
int switch_core_media_crypto_keylen | ( | switch_rtp_crypto_key_type_t | type | ) |
Definition at line 274 of file switch_core_media.c.
References CRYPTO_INVALID, switch_srtp_crypto_suite_s::keylen, and switch_assert.
switch_rtp_crypto_key_type_t switch_core_media_crypto_str2type | ( | const char * | str | ) |
Definition at line 253 of file switch_core_media.c.
References CRYPTO_INVALID, and switch_srtp_crypto_suite_s::type.
Referenced by switch_core_media_add_crypto(), and switch_core_session_get_recovery_crypto_key().
const char* switch_core_media_crypto_type2str | ( | switch_rtp_crypto_key_type_t | type | ) |
Definition at line 267 of file switch_core_media.c.
References CRYPTO_INVALID, switch_srtp_crypto_suite_s::name, and switch_assert.
Referenced by switch_core_session_check_incoming_crypto().
void switch_core_media_deactivate_rtp | ( | switch_core_session_t * | session | ) |
Definition at line 6036 of file switch_core_media.c.
References CF_VIDEO_PASSIVE, switch_media_handle_s::engines, switch_rtp_engine_s::local_sdp_port, switch_rtp_engine_s::media_thread, switch_rtp_engine_s::mh, switch_media_handle_s::mparams, switch_core_media_params_s::remote_ip, switch_rtp_engine_s::rtp_session, switch_core_media_params_s::rtpip, switch_assert, switch_channel_clear_flag(), switch_core_media_check_nat(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_nat_del_mapping(), SWITCH_NAT_UDP, switch_rtp_destroy(), switch_rtp_release_port(), switch_thread_join(), media_helper::up, and zstr.
Referenced by switch_media_handle_destroy().
void switch_core_media_deinit | ( | void | ) |
Definition at line 10623 of file switch_core_media.c.
References core_video_globals_s::pool, and switch_core_destroy_memory_pool.
Referenced by switch_core_destroy().
void switch_core_media_end_video_function | ( | switch_core_session_t * | session | ) |
Definition at line 5575 of file switch_core_media.c.
References switch_media_handle_s::control_mutex, switch_mutex_lock(), switch_mutex_unlock(), switch_yield, and switch_media_handle_s::video_function_running.
Referenced by audio_bridge_thread().
switch_status_t switch_core_media_ext_address_lookup | ( | switch_core_session_t * | session, |
char ** | ip, | ||
switch_port_t * | port, | ||
const char * | sourceip | ||
) |
Definition at line 5811 of file switch_core_media.c.
References switch_media_handle_s::mparams, pool, switch_core_media_params_s::rtpip, STUN_FLAG_SET, switch_core_media_params_s::stun_flags, switch_core_media_params_s::stun_ip, switch_core_media_params_s::stun_port, switch_assert, SWITCH_CHANNEL_LOG, switch_core_session_get_pool(), switch_core_session_strdup, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_safe_free, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SWITCH_STUN_DEFAULT_PORT, switch_stun_host_lookup(), switch_stun_lookup(), switch_yield, and zstr.
Referenced by switch_core_media_choose_port().
switch_t38_options_t* switch_core_media_extract_t38_options | ( | switch_core_session_t * | session, |
const char * | r_sdp | ||
) |
Definition at line 584 of file switch_core_media.c.
References switch_core_media_process_udptl().
char* switch_core_media_filter_sdp | ( | const char * | sdp_str, |
const char * | cmd, | ||
const char * | arg | ||
) |
Definition at line 10688 of file switch_core_media.c.
References end_of_p, find_pt(), payload_number(), skip(), and switch_is_leading_number().
Referenced by switch_core_media_process_sdp_filter().
|
static |
Definition at line 422 of file switch_core_media.c.
References CF_ZRTP_HASH, switch_media_handle_s::engines, switch_core_session::media_handle, switch_rtp_engine_s::remote_sdp_zrtp_hash, SWITCH_CHANNEL_CHANNEL_LOG, switch_channel_set_flag, switch_channel_set_variable, switch_core_session_get_channel(), switch_core_session_strdup, SWITCH_LOG_DEBUG, SWITCH_LOG_DEBUG1, switch_log_printf(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, and zstr.
Referenced by switch_core_media_negotiate_sdp(), and switch_core_media_set_r_sdp_codec_string().
void switch_core_media_gen_local_sdp | ( | switch_core_session_t * | session, |
switch_sdp_type_t | sdp_type, | ||
const char * | ip, | ||
switch_port_t | port, | ||
const char * | sr, | ||
int | force | ||
) |
Definition at line 7523 of file switch_core_media.c.
References add_fb(), payload_map_s::adv_channels, payload_map_s::adv_rm_rate, switch_rtp_engine_s::adv_sdp_ip, switch_rtp_engine_s::adv_sdp_port, payload_map_s::agreed_pt, payload_map_s::allocated, buf, ice_s::cands, CF_3PCC, CF_AVPF, CF_DROP_DTMF, CF_DTLS, CF_DTLS_OK, CF_ICE, CF_LIBERAL_DTMF, CF_NOVIDEO, CF_PROXY_MEDIA, CF_PROXY_MODE, CF_PROXY_OFF, CF_RECOVERING, CF_SECURE, CF_VERBOSE_SDP, CF_VIDEO_POSSIBLE, CF_VIDEO_SDP_RECVD, switch_core_session::channel, switch_media_handle_s::cname, switch_media_handle_s::cng_ianacodes, switch_core_media_params_s::cng_pt, switch_core_media_params_s::cng_rate, switch_rtp_engine_s::codec_negotiated, switch_codec_implementation::codec_type, switch_media_handle_s::codecs, icand_s::con_addr, icand_s::con_port, CRYPTO_INVALID, switch_media_handle_s::crypto_mode, CRYPTO_MODE_FORBIDDEN, CRYPTO_MODE_MANDATORY, switch_media_handle_s::crypto_suite_order, switch_rtp_engine_s::crypto_type, switch_rtp_engine_s::cur_payload_map, dtls_ok(), DTMF_2833, switch_media_handle_s::dtmf_ianacodes, switch_core_media_params_s::dtmf_type, end_of, switch_media_handle_s::engines, switch_rtp_engine_s::fir, switch_codec_implementation::fmtp, payload_map_s::fmtp_out, switch_media_handle_s::fmtps, gen_ice(), generate_local_fingerprint(), generate_m(), get_channels(), get_media_profile_name(), get_setup(), switch_codec_implementation::ianacode, switch_media_handle_s::ianacodes, switch_codec_implementation::iananame, payload_map_s::iananame, switch_rtp_engine_s::ice_out, ice_out(), switch_codec::implementation, secure_settings_s::local_crypto_key, switch_rtp_engine_s::local_dtls_fingerprint, switch_rtp_engine_s::local_sdp_ip, switch_rtp_engine_s::local_sdp_port, memset(), switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::modname, switch_media_handle_s::mparams, switch_media_handle_s::msid, switch_rtp_engine_s::nack, switch_core_media_params_s::ndlb, payload_map_s::negotiated, payload_map_s::next, switch_rtp_engine_s::no_crypto, switch_core_media_params_s::num_codecs, switch_media_handle_s::num_rates, switch_codec_implementation::number_of_channels, switch_media_handle_s::owner_id, switch_media_handle_s::payload_space, switch_rtp_engine_s::pli, switch_rtp_engine_s::proxy_sdp_ip, switch_rtp_engine_s::proxy_sdp_port, payload_map_s::pt, ice_s::pwd, payload_map_s::rate, switch_media_handle_s::rates, switch_rtp_engine_s::read_codec, icand_s::ready, switch_rtp_engine_s::reject_avp, payload_map_s::rm_encoding, payload_map_s::rm_fmtp, payload_map_s::rm_rate, switch_rtp_engine_s::rmode, switch_core_media_params_s::rtcp_audio_interval_msec, switch_rtp_engine_s::rtcp_mux, switch_core_media_params_s::rtcp_video_interval_msec, switch_codec_implementation::samples_per_second, SCMF_LIBERAL_DTMF, SCMF_MULTI_ANSWER_AUDIO, SCMF_MULTI_ANSWER_VIDEO, SCMF_SUPPRESS_CNG, switch_media_handle_s::sdp_mutex, SDP_TYPE_REQUEST, switch_core_media_params_s::sdp_username, SDPBUFLEN, switch_media_handle_s::session, switch_media_handle_s::session_id, SM_NDLB_SENDRECV_IN_SESSION, switch_rtp_engine_s::smode, switch_rtp_engine_s::ssec, switch_rtp_engine_s::ssrc, dtls_fp_s::str, switch_assert, SWITCH_CALL_DIRECTION_INBOUND, SWITCH_CALL_DIRECTION_OUTBOUND, switch_channel_clear_flag(), switch_channel_direction(), switch_channel_get_name(), switch_channel_get_partner_uuid(), switch_channel_get_variable, switch_channel_get_variable_dup(), switch_channel_get_variable_partner(), SWITCH_CHANNEL_LOG, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_variable, switch_channel_test_flag(), SWITCH_CODEC_TYPE_AUDIO, SWITCH_CODEC_TYPE_VIDEO, switch_core_media_add_payload_map(), switch_core_media_check_dtmf_type(), switch_core_media_choose_port(), switch_core_media_get_zrtp_hash(), switch_core_media_set_local_sdp(), switch_core_media_set_video_codec(), switch_core_session_check_outgoing_crypto(), switch_core_session_get_partner, switch_core_session_get_payload_code(), switch_core_session_parse_crypto_prefs(), switch_core_session_rwunlock(), switch_core_session_strdup, switch_epoch_time_now(), switch_event_destroy(), switch_event_get_header, SWITCH_FALSE, switch_false(), SWITCH_LOG_CRIT, SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_MAX_CODECS, SWITCH_MEDIA_FLOW_DISABLED, SWITCH_MEDIA_FLOW_RECVONLY, SWITCH_MEDIA_FLOW_SENDONLY, switch_media_handle_test_media_flag(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_lock(), switch_mutex_unlock(), switch_parse_bandwidth_string(), SWITCH_RTCP_AUDIO_INTERVAL_MSEC, SWITCH_RTCP_VIDEO_INTERVAL_MSEC, switch_rtp_has_dtls(), switch_safe_free, switch_snprintf(), SWITCH_STATUS_SUCCESS, switch_stun_random_string(), SWITCH_TRUE, switch_true(), switch_zmalloc, switch_core_media_params_s::te, switch_core_media_params_s::te_rate, switch_rtp_engine_s::tmmbr, icand_s::transport, switch_srtp_crypto_suite_s::type, dtls_fp_s::type, ice_s::ufrag, and zstr.
Referenced by switch_core_media_receive_message(), and switch_core_media_recover_session().
const char* switch_core_media_get_codec_string | ( | switch_core_session_t * | session | ) |
Definition at line 842 of file switch_core_media.c.
References switch_core_media_params_s::inbound_codec_string, switch_media_handle_s::mparams, switch_core_media_params_s::outbound_codec_string, switch_assert, SWITCH_CALL_DIRECTION_OUTBOUND, switch_channel_direction(), switch_channel_get_variable, and zstr.
Referenced by switch_core_media_prepare_codecs(), and switch_core_media_set_sdp_codec_string().
switch_jb_t* switch_core_media_get_jb | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 9949 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, switch_rtp_get_jitter_buffer(), and switch_rtp_ready().
switch_core_media_params_t* switch_core_media_get_mparams | ( | switch_media_handle_t * | smh | ) |
Definition at line 1793 of file switch_core_media.c.
References switch_assert.
switch_status_t switch_core_media_get_offered_pt | ( | switch_core_session_t * | session, |
const switch_codec_implementation_t * | mimp, | ||
switch_payload_t * | pt | ||
) |
Definition at line 2645 of file switch_core_media.c.
References switch_codec_implementation::actual_samples_per_second, switch_media_handle_s::codecs, switch_media_handle_s::ianacodes, switch_codec_implementation::iananame, switch_media_handle_s::mparams, switch_core_media_params_s::num_codecs, switch_assert, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_media_negotiate_sdp().
switch_rtp_stats_t* switch_core_media_get_stats | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
switch_memory_pool_t * | pool | ||
) |
Definition at line 9895 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, and switch_rtp_get_stats().
Referenced by set_stats(), switch_core_standard_on_hangup(), switch_ivr_set_json_call_stats(), and switch_ivr_set_xml_call_stats().
switch_timer_t* switch_core_media_get_timer | ( | switch_core_session_t * | session, |
switch_media_type_t | mtype | ||
) |
Definition at line 10892 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, and switch_rtp_get_media_timer().
Referenced by switch_core_session_write_video_frame().
switch_status_t switch_core_media_get_vid_params | ( | switch_core_session_t * | session, |
switch_vid_params_t * | vid_params | ||
) |
Definition at line 569 of file switch_core_media.c.
References switch_assert, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_media_handle_s::vid_params.
Referenced by switch_ivr_record_file().
switch_file_handle_t* switch_core_media_get_video_file | ( | switch_core_session_t * | session, |
switch_rw_t | rw | ||
) |
Definition at line 5039 of file switch_core_media.c.
References CF_VIDEO, switch_media_handle_s::engines, media_helper::file_read_mutex, media_helper::file_write_mutex, switch_rtp_engine_s::mh, switch_assert, switch_channel_test_flag(), SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RW_READ, switch_media_handle_s::video_read_fh, and switch_media_handle_s::video_write_fh.
uint32_t switch_core_media_get_video_fps | ( | switch_core_session_t * | session | ) |
Definition at line 339 of file switch_core_media.c.
References CF_VIDEO, core_video_globals_s::fps, switch_vid_params_s::fps, switch_assert, switch_channel_set_variable_printf(), switch_channel_test_flag(), switch_epoch_time_now(), switch_round_to_step(), SWITCH_STATUS_FALSE, switch_media_handle_s::vid_frames, switch_media_handle_s::vid_params, and switch_media_handle_s::vid_started.
Referenced by check_jb_sync(), and switch_core_media_read_frame().
const char* switch_core_media_get_zrtp_hash | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
switch_bool_t | local | ||
) |
Definition at line 406 of file switch_core_media.c.
References switch_rtp_engine_s::local_sdp_zrtp_hash, and switch_rtp_engine_s::remote_sdp_zrtp_hash.
Referenced by generate_m(), and switch_core_media_gen_local_sdp().
void switch_core_media_hard_mute | ( | switch_core_session_t * | session, |
switch_bool_t | on | ||
) |
Definition at line 9165 of file switch_core_media.c.
References switch_core_session_message::from, switch_core_session_message::message_id, switch_core_session_message::numeric_arg, switch_core_session_receive_message, and SWITCH_MESSAGE_INDICATE_HARD_MUTE.
Referenced by switch_core_media_bug_add().
void switch_core_media_init | ( | void | ) |
Definition at line 10611 of file switch_core_media.c.
References core_video_globals_s::cpu_count, core_video_globals_s::cur_cpu, DTLS_SRTP_FNAME, core_video_globals_s::mutex, core_video_globals_s::pool, switch_core_cpu_count(), switch_core_gen_certs(), switch_core_new_memory_pool, switch_mutex_init(), and SWITCH_MUTEX_NESTED.
Referenced by switch_core_init().
void switch_core_media_kill_socket | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 9765 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, switch_rtp_kill_socket(), and switch_rtp_ready().
switch_status_t switch_core_media_lock_video_file | ( | switch_core_session_t * | session, |
switch_rw_t | rw | ||
) |
Definition at line 5156 of file switch_core_media.c.
References CF_VIDEO, switch_media_handle_s::engines, media_helper::file_read_mutex, media_helper::file_write_mutex, switch_rtp_engine_s::mh, switch_assert, switch_channel_test_flag(), SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_lock(), SWITCH_RW_READ, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_ivr_record_file().
uint8_t switch_core_media_negotiate_sdp | ( | switch_core_session_t * | session, |
const char * | r_sdp, | ||
uint8_t * | proceed, | ||
switch_sdp_type_t | sdp_type | ||
) |
Definition at line 3647 of file switch_core_media.c.
References switch_codec_fmtp::actual_samples_per_second, switch_codec_implementation::actual_samples_per_second, payload_map_s::adv_channels, payload_map_s::adv_rm_rate, payload_map_s::agreed_pt, payload_map_s::allocated, switch_core_media_params_s::auto_rtp_bugs, payload_map_s::bitrate, switch_codec_fmtp::bits_per_second, switch_codec_implementation::bits_per_second, CF_ANSWERED, CF_APP_T38, CF_APP_T38_NEGOTIATED, CF_AUDIO_PAUSE, CF_AVPF_MOZ, CF_DTLS, CF_DTLS_OK, CF_LIBERAL_DTMF, CF_NOVIDEO, CF_PROXY_MEDIA, CF_PROXY_MODE, CF_RECOVERING, CF_REINVITE, CF_T38_PASSTHRU, CF_VIDEO_READY, CF_VIDEO_SDP_RECVD, switch_core_session::channel, payload_map_s::channels, check_ice(), clear_pmaps(), switch_core_media_params_s::cng_pt, switch_core_media_params_s::cng_rate, switch_core_media_params_s::codec_flags, matches::codec_idx, payload_map_s::codec_ms, switch_rtp_engine_s::codec_negotiated, switch_codec_implementation::codec_type, switch_media_handle_s::codecs, switch_media_handle_s::crypto_mode, CRYPTO_MODE_MANDATORY, switch_rtp_engine_s::cur_payload_map, payload_map_s::current, dtls_ok(), DTMF_2833, DTMF_AUTO, DTMF_INFO, DTMF_NONE, switch_core_media_params_s::dtmf_type, switch_media_handle_s::engines, switch_rtp_engine_s::fir, switch_core_session_message::from, greedy_sort(), switch_core_media_params_s::hold_laps, switch_codec_implementation::ianacode, switch_codec_implementation::iananame, payload_map_s::iananame, if(), matches::imp, switch_codec::implementation, matches::map, switch_rtp_engine_s::max_missed_hold_packets, switch_rtp_engine_s::max_missed_packets, memset(), switch_core_session_message::message_id, switch_codec_fmtp::microseconds_per_packet, switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::modname, switch_media_handle_s::mparams, switch_rtp_engine_s::nack, switch_core_media_params_s::ndlb, switch_media_handle_s::negotiated_codecs, switch_rtp_engine_s::new_dtls, switch_rtp_engine_s::new_ice, payload_map_s::next, switch_core_media_params_s::num_codecs, switch_media_handle_s::num_negotiated_codecs, switch_codec_implementation::number_of_channels, switch_media_handle_s::origin, switch_rtp_engine_s::pli, payload_map_s::pt, matches::rate, switch_rtp_engine_s::read_codec, switch_rtp_engine_s::read_impl, payload_map_s::recv_pt, switch_core_media_params_s::recv_te, switch_rtp_engine_s::reject_avp, switch_t38_options_t::remote_ip, switch_t38_options_t::remote_port, switch_rtp_engine_s::remote_rtcp_port, payload_map_s::remote_sdp_ip, payload_map_s::remote_sdp_port, switch_rtp_engine_s::reset_codec, payload_map_s::rm_encoding, payload_map_s::rm_fmtp, payload_map_s::rm_rate, switch_rtp_engine_s::rmode, switch_core_media_params_s::rtcp_audio_interval_msec, switch_core_media_params_s::rtcp_video_interval_msec, RTP_BUG_CISCO_SKIP_MARK_BIT_2833, RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833, switch_rtp_engine_s::rtp_bugs, switch_rtp_engine_s::rtp_session, switch_codec_implementation::samples_per_second, SCMF_CODEC_GREEDY, SCMF_CODEC_SCROOGE, SCMF_DISABLE_HOLD, SCMF_LIBERAL_DTMF, SCMF_RENEG_ON_HOLD, SCMF_RENEG_ON_REINVITE, SCMF_SUPPRESS_CNG, switch_rtp_engine_s::sdp_bw, sdp_media_flow(), switch_media_handle_s::sdp_mutex, SDP_TYPE_REQUEST, SDP_TYPE_RESPONSE, switch_media_handle_s::session, skip(), SM_NDLB_ALLOW_BAD_IANANAME, SM_NDLB_ALLOW_CRYPTO_IN_AVP, switch_rtp_engine_s::smode, switch_codec_fmtp::stereo, switch_core_session_message::string_arg, switch_assert, SWITCH_CALL_DIRECTION_INBOUND, SWITCH_CALL_DIRECTION_OUTBOUND, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION, switch_channel_clear_app_flag_key(), switch_channel_clear_flag(), switch_channel_direction(), switch_channel_get_name(), switch_channel_get_variable, switch_channel_hangup, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_variable, switch_channel_set_variable_printf(), switch_channel_test_app_flag_key(), switch_channel_test_flag(), SWITCH_CODEC_TYPE_AUDIO, SWITCH_CODEC_TYPE_VIDEO, switch_core_codec_parse_fmtp(), switch_core_codec_ready(), switch_core_media_add_payload_map(), switch_core_media_check_autoadj(), switch_core_media_check_video_codecs(), switch_core_media_copy_t38_options(), switch_core_media_find_zrtp_hash(), switch_core_media_get_offered_pt(), switch_core_media_pass_zrtp_hash(), switch_core_media_prepare_codecs(), switch_core_media_process_udptl(), switch_core_media_set_codec(), switch_core_media_set_video_codec(), switch_core_media_toggle_hold(), switch_core_session_alloc, switch_core_session_check_incoming_crypto(), switch_core_session_get_channel(), switch_core_session_get_partner, switch_core_session_parse_crypto_prefs(), switch_core_session_queue_message(), switch_core_session_rwunlock(), switch_core_session_set_ice(), switch_core_session_strdup, switch_default_ptime(), SWITCH_FALSE, switch_false(), switch_known_bitrate(), switch_loadable_module_get_codecs_sorted(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_MEDIA_FLOW_DISABLED, SWITCH_MEDIA_FLOW_RECVONLY, SWITCH_MEDIA_FLOW_SENDONLY, SWITCH_MEDIA_FLOW_SENDRECV, switch_media_handle_test_media_flag(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_REMOTE_MEDIA_IP_VARIABLE, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, SWITCH_REMOTE_VIDEO_IP_VARIABLE, SWITCH_REMOTE_VIDEO_PORT_VARIABLE, SWITCH_RTCP_AUDIO_INTERVAL_MSEC, SWITCH_RTCP_VIDEO_INTERVAL_MSEC, switch_rtp_get_remote_host(), switch_rtp_get_remote_port(), switch_rtp_has_dtls(), switch_rtp_ready(), switch_rtp_set_cng_pt(), switch_rtp_set_default_payload(), switch_rtp_set_max_missed_packets(), switch_rtp_set_remote_address(), switch_rtp_set_telephony_event(), switch_rtp_set_telephony_recv_event(), switch_snprintf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_stristr(), SWITCH_TRUE, switch_true(), switch_core_media_params_s::te, switch_core_media_params_s::te_rate, switch_rtp_engine_s::tmmbr, and zstr.
void switch_core_media_parse_rtp_bugs | ( | switch_rtp_bug_flag_t * | flag_pole, |
const char * | str | ||
) |
Definition at line 915 of file switch_core_media.c.
References RTP_BUG_ACCEPT_ANY_PACKETS, RTP_BUG_ACCEPT_ANY_PAYLOAD, RTP_BUG_ALWAYS_AUTO_ADJUST, RTP_BUG_CHANGE_SSRC_ON_MARKER, RTP_BUG_CISCO_SKIP_MARK_BIT_2833, RTP_BUG_FLUSH_JB_ON_DTMF, RTP_BUG_GEN_ONE_GEN_ALL, RTP_BUG_IGNORE_DTMF_DURATION, RTP_BUG_IGNORE_MARK_BIT, RTP_BUG_NEVER_SEND_MARKER, RTP_BUG_SEND_LINEAR_TIMESTAMPS, RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833, RTP_BUG_START_SEQ_AT_ZERO, and switch_stristr().
Referenced by switch_core_media_activate_rtp().
void switch_core_media_pass_zrtp_hash | ( | switch_core_session_t * | session | ) |
Definition at line 387 of file switch_core_media.c.
References CF_ZRTP_PASSTHRU_REQ, SWITCH_CHANNEL_CHANNEL_LOG, switch_channel_test_flag(), switch_core_media_pass_zrtp_hash2(), switch_core_session_get_channel(), switch_core_session_get_partner, switch_core_session_rwunlock(), SWITCH_LOG_DEBUG1, switch_log_printf(), and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_media_negotiate_sdp(), and switch_core_media_set_r_sdp_codec_string().
void switch_core_media_pass_zrtp_hash2 | ( | switch_core_session_t * | aleg_session, |
switch_core_session_t * | bleg_session | ||
) |
Definition at line 380 of file switch_core_media.c.
References _switch_core_media_pass_zrtp_hash2(), SWITCH_MEDIA_TYPE_AUDIO, and SWITCH_MEDIA_TYPE_VIDEO.
Referenced by switch_core_media_pass_zrtp_hash().
void switch_core_media_patch_sdp | ( | switch_core_session_t * | session | ) |
Definition at line 8792 of file switch_core_media.c.
References switch_rtp_engine_s::adv_sdp_ip, switch_rtp_engine_s::adv_sdp_port, CF_ANSWERED, CF_REINVITE, CF_VIDEO_POSSIBLE, clear_pmaps(), switch_rtp_engine_s::codec_negotiated, switch_rtp_engine_s::cur_payload_map, switch_media_handle_s::engines, switch_rtp_engine_s::local_sdp_ip, switch_rtp_engine_s::local_sdp_port, switch_core_media_params_s::local_sdp_str, switch_media_handle_s::mparams, switch_core_media_params_s::ndlb, switch_media_handle_s::owner_id, switch_rtp_engine_s::rtp_session, SDP_TYPE_RESPONSE, switch_core_media_params_s::sdp_username, switch_media_handle_s::session_id, switch_core_media_params_s::sipip, SM_NDLB_NEVER_PATCH_REINVITE, switch_assert, switch_channel_down, switch_channel_get_name(), switch_channel_media_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_test_flag(), switch_core_media_activate_rtp(), switch_core_media_add_payload_map(), switch_core_media_choose_port(), switch_core_media_set_local_sdp(), switch_core_media_set_video_codec(), switch_core_session_alloc, switch_epoch_time_now(), SWITCH_FALSE, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_rtp_ready(), switch_snprintf(), SWITCH_STATUS_SUCCESS, switch_stristr(), SWITCH_TRUE, and zstr.
void switch_core_media_pause | ( | switch_core_session_t * | session | ) |
Definition at line 3037 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_RTP_FLAG_PAUSE, and switch_rtp_set_flag().
void switch_core_media_prepare_codecs | ( | switch_core_session_t * | session, |
switch_bool_t | force | ||
) |
Definition at line 1799 of file switch_core_media.c.
References CF_PROXY_MEDIA, CF_PROXY_MODE, switch_media_handle_s::codec_order, switch_media_handle_s::codec_order_last, switch_media_handle_s::codecs, switch_media_handle_s::media_flags, switch_media_handle_s::mparams, switch_core_media_params_s::num_codecs, switch_media_handle_s::payload_space, SCMF_DISABLE_TRANSCODING, switch_media_handle_s::session, switch_assert, switch_channel_get_variable, switch_channel_get_variable_dup(), switch_channel_set_variable, switch_channel_test_flag(), switch_core_media_get_codec_string(), switch_core_session_sprintf(), switch_core_session_strdup, SWITCH_FALSE, switch_loadable_module_get_codecs_sorted(), SWITCH_MAX_CODECS, SWITCH_ORIGINATOR_CODEC_VARIABLE, switch_separate_string(), and switch_true().
Referenced by switch_core_media_negotiate_sdp(), and switch_core_media_receive_message().
char* switch_core_media_process_sdp_filter | ( | const char * | sdp, |
const char * | cmd_buf, | ||
switch_core_session_t * | session | ||
) |
Definition at line 10841 of file switch_core_media.c.
References SWITCH_CHANNEL_CHANNEL_LOG, switch_channel_get_name(), switch_core_media_filter_sdp(), switch_core_session_get_channel(), switch_core_session_strdup, switch_find_end_paren(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_LOG_WARNING, switch_safe_free, switch_split, and zstr.
Referenced by switch_channel_pass_sdp().
switch_status_t switch_core_media_process_t38_passthru | ( | switch_core_session_t * | session, |
switch_core_session_t * | other_session, | ||
switch_t38_options_t * | t38_options | ||
) |
Definition at line 616 of file switch_core_media.c.
References switch_rtp_engine_s::cur_payload_map, switch_media_handle_s::engines, payload_map_s::remote_sdp_ip, payload_map_s::remote_sdp_port, switch_rtp_engine_s::rtp_session, switch_assert, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION, switch_channel_get_name(), switch_channel_hangup, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable, switch_core_media_copy_t38_options(), switch_core_session_strdup, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_REMOTE_MEDIA_IP_VARIABLE, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, switch_rtp_get_remote_host(), switch_rtp_get_remote_port(), switch_rtp_set_remote_address(), switch_snprintf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and SWITCH_TRUE.
|
static |
Definition at line 466 of file switch_core_media.c.
References CF_APP_T38, switch_core_session::channel, if(), switch_t38_options_t::remote_ip, switch_t38_options_t::remote_port, switch_t38_options_t::sdp_o_line, switch_assert, switch_channel_api_on(), switch_channel_execute_on(), switch_channel_get_private(), switch_channel_set_app_flag_key(), switch_channel_set_private(), switch_channel_set_variable, switch_core_session_alloc, switch_core_session_strdup, switch_safe_atoi(), switch_t38_options_t::T38FaxFillBitRemoval, switch_t38_options_t::T38FaxMaxBuffer, switch_t38_options_t::T38FaxMaxDatagram, switch_t38_options_t::T38FaxRateManagement, switch_t38_options_t::T38FaxTranscodingJBIG, switch_t38_options_t::T38FaxTranscodingMMR, switch_t38_options_t::T38FaxUdpEC, switch_t38_options_t::T38FaxVersion, switch_t38_options_t::T38MaxBitRate, and switch_t38_options_t::T38VendorInfo.
Referenced by switch_core_media_extract_t38_options(), and switch_core_media_negotiate_sdp().
switch_status_t switch_core_media_proxy_remote_addr | ( | switch_core_session_t * | session, |
const char * | sdp_str | ||
) |
Definition at line 5613 of file switch_core_media.c.
References CF_AVPF, CF_PROXY_MODE, CF_VIDEO, CF_VIDEO_POSSIBLE, switch_rtp_engine_s::check_frames, switch_rtp_engine_s::cur_payload_map, switch_media_handle_s::engines, switch_media_handle_s::mparams, RA_PTR_LEN, switch_rtp_engine_s::remote_rtcp_port, payload_map_s::remote_sdp_ip, payload_map_s::remote_sdp_port, switch_core_media_params_s::remote_sdp_str, switch_rtp_engine_s::rtp_session, SCMF_AUTOFIX_TIMING, SCMF_DISABLE_RTP_AUTOADJ, switch_assert, switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_test_flag(), switch_core_session_strdup, switch_goto_status, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_media_handle_test_media_flag(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_RTP_FLAG_AUTOADJ, switch_rtp_get_remote_host(), switch_rtp_get_remote_port(), switch_rtp_ready(), switch_rtp_set_flag(), switch_rtp_set_remote_address(), SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, switch_stristr(), SWITCH_TRUE, switch_true(), and zstr.
Referenced by switch_core_media_activate_rtp().
switch_status_t switch_core_media_queue_rfc2833 | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
const switch_dtmf_t * | dtmf | ||
) |
Definition at line 9781 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, switch_rtp_queue_rfc2833(), switch_rtp_ready(), and SWITCH_STATUS_FALSE.
switch_status_t switch_core_media_queue_rfc2833_in | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
const switch_dtmf_t * | dtmf | ||
) |
Definition at line 9799 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, switch_rtp_queue_rfc2833_in(), switch_rtp_ready(), and SWITCH_STATUS_FALSE.
switch_status_t switch_core_media_read_frame | ( | switch_core_session_t * | session, |
switch_frame_t ** | frame, | ||
switch_io_flag_t | flags, | ||
int | stream_id, | ||
switch_media_type_t | type | ||
) |
Definition at line 2138 of file switch_core_media.c.
References payload_map_s::agreed_pt, CF_LEG_HOLDING, CF_NOT_READY, switch_rtp_engine_s::check_frames, check_jb(), check_jb_sync(), switch_core_media_params_s::cng_pt, switch_core_media_params_s::codec_flags, payload_map_s::codec_ms, switch_rtp_engine_s::codec_negotiated, switch_rtp_engine_s::cur_payload_map, payload_map_s::current, switch_frame::datalen, switch_rtcp_report_block_frame::dlsr, switch_codec_implementation::encoded_bytes_per_packet, switch_media_handle_s::engines, switch_frame::flags, switch_rtcp_report_block_frame::fraction, switch_rtcp_report_block_frame::highest_sequence_number_received, payload_map_s::iananame, switch_frame::img, switch_codec::implementation, switch_rtcp_report_block_frame::jitter, switch_rtp_engine_s::last_codec_ms, switch_rtp_engine_s::last_seq, switch_rtp_engine_s::last_ts, switch_rtcp_report_block_frame::loss_avg, switch_rtcp_report_block_frame::lost, switch_rtcp_report_block_frame::lsr, switch_frame::m, MAX_CODEC_CHECK_FRAMES, MAX_MISMATCH_FRAMES, switch_rtp_engine_s::max_missed_hold_packets, switch_rtp_engine_s::max_missed_packets, switch_media_handle_s::media_flags, memset(), switch_rtp_engine_s::mismatch_count, switch_media_handle_s::mparams, payload_map_s::negotiated, payload_map_s::next, switch_rtcp_frame::ntp_lsw, switch_rtcp_frame::ntp_msw, switch_rtcp_frame::octect_count, switch_rtcp_frame::packet_count, switch_frame::payload, switch_rtp_engine_s::payload_map, payload_map_s::pt, switch_frame::rate, switch_rtp_engine_s::read_codec, switch_rtp_engine_s::read_frame, switch_rtp_engine_s::read_impl, switch_media_handle_s::read_mutex, payload_map_s::recv_pt, switch_core_media_params_s::recv_te, switch_rtcp_frame::report_count, switch_rtcp_frame::reports, switch_rtp_engine_s::reset_codec, switch_rtp_engine_s::rtp_session, switch_frame::samples, switch_codec_implementation::samples_per_packet, switch_codec_implementation::samples_per_second, SCMF_AUTOFIX_TIMING, SCMF_RUNNING, switch_media_handle_s::sdp_mutex, switch_frame::seq, SFF_CNG, SFF_NONE, SFF_PROXY_PACKET, skip(), switch_rtcp_report_block_frame::ssrc, switch_rtcp_frame::ssrc, switch_assert, SWITCH_CAUSE_MEDIA_TIMEOUT, switch_channel_execute_on(), switch_channel_get_name(), switch_channel_get_variable, switch_channel_hangup, switch_channel_queue_dtmf(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable_printf(), switch_channel_test_flag(), switch_channel_up_nosig, switch_core_codec_ready(), switch_core_media_get_video_fps(), switch_core_media_set_codec(), switch_core_media_set_video_codec(), switch_core_session_get_uuid(), switch_epoch_time_now(), switch_event_add_header_string(), switch_event_create, switch_event_fire, SWITCH_EVENT_RECV_RTCP_MESSAGE, SWITCH_FALSE, switch_goto_status, SWITCH_LOG_DEBUG, SWITCH_LOG_DEBUG1, SWITCH_LOG_DEBUG10, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_lock(), switch_mutex_trylock(), switch_mutex_unlock(), switch_rtcp_zerocopy_read_frame(), switch_rtp_dequeue_dtmf(), switch_rtp_has_dtmf(), switch_rtp_ready(), switch_rtp_set_max_missed_packets(), switch_rtp_zerocopy_read_frame(), switch_set_flag, SWITCH_STACK_BOTTOM, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_INUSE, SWITCH_STATUS_SUCCESS, SWITCH_STATUS_TIMEOUT, switch_test_flag, switch_time_now(), SWITCH_TIME_T_FMT, switch_core_media_params_s::te, switch_frame::timestamp, switch_rtcp_frame::timestamp, type2str, switch_media_handle_s::vid_frames, and switch_media_handle_s::vid_started.
switch_status_t switch_core_media_read_lock_unlock | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
switch_bool_t | lock | ||
) |
Definition at line 2094 of file switch_core_media.c.
References CF_NOT_READY, switch_media_handle_s::engines, switch_codec::implementation, switch_media_handle_s::media_flags, switch_rtp_engine_s::read_codec, switch_media_handle_s::read_mutex, switch_rtp_engine_s::rtp_session, SCMF_RUNNING, switch_assert, switch_channel_get_name(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), switch_channel_up_nosig, switch_core_codec_ready(), SWITCH_LOG_DEBUG1, switch_log_printf(), switch_mutex_trylock(), switch_mutex_unlock(), switch_rtp_ready(), SWITCH_STATUS_FALSE, SWITCH_STATUS_INUSE, SWITCH_STATUS_SUCCESS, and type2str.
uint8_t switch_core_media_ready | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 9817 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, and switch_rtp_ready().
Referenced by switch_core_media_recover_session().
switch_status_t switch_core_media_receive_message | ( | switch_core_session_t * | session, |
switch_core_session_message_t * | msg | ||
) |
Definition at line 9278 of file switch_core_media.c.
References CC_FS_RTP, CF_AUTOFLUSH_DURING_BRIDGE, CF_CONFERENCE, CF_CONFERENCE_RESET_MEDIA, CF_FS_RTP, CF_JITTERBUFFER, CF_NOTIMER_DURING_BRIDGE, CF_PASS_RFC2833, CF_PROXY_MODE, CF_RTP_NOTIMER_DURING_BRIDGE, CF_VIDEO, CF_VIDEO_POSSIBLE, check_jb(), clear_pmaps(), switch_rtp_engine_s::codec_negotiated, switch_rtp_engine_s::cur_payload_map, switch_media_handle_s::engines, if(), switch_core_media_params_s::local_sdp_str, switch_media_handle_s::media_flags, switch_media_handle_s::mparams, switch_media_handle_s::mutex, switch_media_handle_s::num_negotiated_codecs, switch_rtp_engine_s::read_codec, payload_map_s::rm_encoding, rtp_flush_read_buffer(), switch_rtp_engine_s::rtp_session, SCC_CODEC_SPECIFIC, SCC_DEBUG, SCCT_INT, SCCT_NONE, SCCT_STRING, SCMF_RENEG_ON_REINVITE, SCMF_RTP_AUTOFLUSH_DURING_BRIDGE, SDP_TYPE_REQUEST, SMF_JB_PAUSED, switch_assert, switch_channel_audio_sync, switch_channel_clear_flag(), switch_channel_down, switch_channel_get_name(), switch_channel_get_partner_uuid(), switch_channel_get_private(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_variable, switch_channel_set_variable_printf(), switch_channel_test_cap_partner(), switch_channel_test_flag(), switch_channel_test_flag_partner(), switch_clear_flag, switch_core_codec_control(), switch_core_media_absorb_sdp(), switch_core_media_check_video_codecs(), switch_core_media_gen_local_sdp(), switch_core_media_prepare_codecs(), switch_core_media_set_local_sdp(), switch_core_media_start_udptl(), switch_core_session_enable_heartbeat(), switch_core_session_get_channel(), switch_core_session_get_partner, switch_core_session_locate, switch_core_session_receive_message, switch_core_session_rwunlock(), SWITCH_FALSE, switch_false(), SWITCH_IO_READ, SWITCH_IO_WRITE, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, switch_media_handle_set_media_flag(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_MESSAGE_INDICATE_3P_MEDIA, SWITCH_MESSAGE_INDICATE_3P_NOMEDIA, SWITCH_MESSAGE_INDICATE_AUDIO_DATA, SWITCH_MESSAGE_INDICATE_AUDIO_SYNC, SWITCH_MESSAGE_INDICATE_BITRATE_ACK, SWITCH_MESSAGE_INDICATE_BITRATE_REQ, SWITCH_MESSAGE_INDICATE_BRIDGE, SWITCH_MESSAGE_INDICATE_CODEC_DEBUG_REQ, SWITCH_MESSAGE_INDICATE_CODEC_SPECIFIC_REQ, SWITCH_MESSAGE_INDICATE_DEBUG_MEDIA, SWITCH_MESSAGE_INDICATE_HARD_MUTE, SWITCH_MESSAGE_INDICATE_JITTER_BUFFER, SWITCH_MESSAGE_INDICATE_MEDIA, SWITCH_MESSAGE_INDICATE_MEDIA_RENEG, SWITCH_MESSAGE_INDICATE_NOMEDIA, SWITCH_MESSAGE_INDICATE_PROXY_MEDIA, SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY, SWITCH_MESSAGE_INDICATE_UDPTL_MODE, SWITCH_MESSAGE_INDICATE_UNBRIDGE, SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ, SWITCH_MESSAGE_INDICATE_VIDEO_SYNC, SWITCH_MESSAGE_RESAMPLE_EVENT, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_REMOTE_MEDIA_IP_VARIABLE, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, switch_rtp_ack_bitrate(), switch_rtp_clear_flag(), switch_rtp_clear_flags(), SWITCH_RTP_FLAG_DEBUG_RTP_READ, SWITCH_RTP_FLAG_DEBUG_RTP_WRITE, SWITCH_RTP_FLAG_FIR, SWITCH_RTP_FLAG_INVALID, SWITCH_RTP_FLAG_MUTE, SWITCH_RTP_FLAG_PASS_RFC2833, SWITCH_RTP_FLAG_PLI, SWITCH_RTP_FLAG_PROXY_MEDIA, SWITCH_RTP_FLAG_UDPTL, SWITCH_RTP_FLAG_USE_TIMER, switch_rtp_flush(), SWITCH_RTP_FLUSH_ONCE, SWITCH_RTP_FLUSH_STICK, SWITCH_RTP_FLUSH_UNSTICK, switch_rtp_pause_jitter_buffer(), switch_rtp_ready(), switch_rtp_req_bitrate(), switch_rtp_reset_jb(), switch_rtp_set_flag(), switch_rtp_set_flags(), switch_rtp_test_flag(), switch_rtp_video_loss(), switch_rtp_video_refresh(), switch_set_flag, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_test_flag, SWITCH_TRUE, switch_true(), switch_rtp_engine_s::write_codec, and zstr.
Referenced by switch_core_session_perform_receive_message().
void switch_core_media_recover_session | ( | switch_core_session_t * | session | ) |
Definition at line 10431 of file switch_core_media.c.
References payload_map_s::adv_rm_rate, switch_rtp_engine_s::adv_sdp_ip, switch_rtp_engine_s::adv_sdp_port, payload_map_s::agreed_pt, CF_PROXY_MODE, CF_SECURE, CF_VIDEO, CF_VIDEO_POSSIBLE, switch_core_session::channel, payload_map_s::channels, switch_core_media_params_s::codec_flags, payload_map_s::codec_ms, switch_rtp_engine_s::codec_negotiated, switch_media_handle_s::codec_order, switch_media_handle_s::codec_order_last, switch_media_handle_s::codecs, secure_settings_s::crypto_tag, switch_rtp_engine_s::crypto_type, switch_rtp_engine_s::cur_payload_map, switch_media_handle_s::engines, switch_core_media_params_s::extrtpip, payload_map_s::iananame, switch_srtp_crypto_suite_s::keylen, secure_settings_s::local_crypto_key, secure_settings_s::local_raw_key, switch_rtp_engine_s::local_sdp_ip, switch_rtp_engine_s::local_sdp_port, switch_media_handle_s::mparams, switch_core_media_params_s::num_codecs, switch_media_handle_s::payload_space, payload_map_s::pt, payload_map_s::recv_pt, switch_core_media_params_s::recv_te, secure_settings_s::remote_crypto_key, secure_settings_s::remote_raw_key, payload_map_s::remote_sdp_ip, payload_map_s::remote_sdp_port, switch_core_media_params_s::remote_sdp_str, payload_map_s::rm_encoding, payload_map_s::rm_fmtp, payload_map_s::rm_rate, switch_rtp_engine_s::rtp_session, switch_core_media_params_s::rtpip, SDP_TYPE_REQUEST, switch_media_handle_s::session, switch_rtp_engine_s::ssec, SWITCH_ADVERTISED_MEDIA_IP_VARIABLE, switch_assert, switch_channel_get_variable, switch_channel_set_flag, switch_channel_set_variable_printf(), switch_channel_test_flag(), switch_core_media_activate_rtp(), switch_core_media_add_crypto(), switch_core_media_gen_local_sdp(), switch_core_media_ready(), switch_core_media_set_codec(), switch_core_media_set_video_codec(), switch_core_session_get_recovery_crypto_key(), switch_core_session_strdup, switch_loadable_module_get_codecs_sorted(), SWITCH_LOCAL_MEDIA_IP_VARIABLE, SWITCH_LOCAL_MEDIA_PORT_VARIABLE, SWITCH_LOCAL_VIDEO_IP_VARIABLE, SWITCH_LOCAL_VIDEO_PORT_VARIABLE, SWITCH_MAX_CODECS, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_R_SDP_VARIABLE, SWITCH_REMOTE_MEDIA_IP_VARIABLE, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, SWITCH_REMOTE_VIDEO_IP_VARIABLE, SWITCH_REMOTE_VIDEO_PORT_VARIABLE, switch_rtp_add_crypto_key(), SWITCH_RTP_CRYPTO_RECV, SWITCH_RTP_CRYPTO_SEND, switch_rtp_set_telephony_event(), switch_rtp_set_telephony_recv_event(), switch_separate_string(), SWITCH_STATUS_SUCCESS, switch_core_media_params_s::te, switch_core_media_params_s::timer_name, and zstr.
Referenced by recover_callback().
void switch_core_media_reset_autofix | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 5892 of file switch_core_media.c.
References switch_rtp_engine_s::check_frames, switch_media_handle_s::engines, switch_rtp_engine_s::last_seq, switch_rtp_engine_s::last_ts, and switch_assert.
switch_status_t switch_core_media_reset_jb | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 9256 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, switch_rtp_ready(), switch_rtp_reset_jb(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
void switch_core_media_resume | ( | switch_core_session_t * | session | ) |
Definition at line 3060 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_rtp_clear_flag(), and SWITCH_RTP_FLAG_PAUSE.
switch_status_t switch_core_media_sdp_map | ( | const char * | r_sdp, |
switch_event_t ** | fmtp, | ||
switch_event_t ** | pt | ||
) |
Definition at line 7426 of file switch_core_media.c.
References buf, switch_event_add_header_string(), switch_event_create, SWITCH_EVENT_REQUEST_PARAMS, switch_snprintf(), SWITCH_STACK_BOTTOM, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_core_media_set_codec | ( | switch_core_session_t * | session, |
int | force, | ||
uint32_t | codec_flags | ||
) |
Definition at line 2825 of file switch_core_media.c.
References switch_codec_implementation::actual_samples_per_second, switch_codec::agreed_pt, payload_map_s::agreed_pt, payload_map_s::bitrate, switch_codec_implementation::bits_per_second, switch_frame::channels, payload_map_s::channels, switch_frame::codec, payload_map_s::codec_ms, switch_rtp_engine_s::codec_settings, switch_rtp_engine_s::cur_payload_map, switch_media_handle_s::engines, switch_codec::fmtp_out, payload_map_s::fmtp_out, switch_codec_implementation::iananame, payload_map_s::iananame, switch_codec::implementation, switch_codec_implementation::microseconds_per_packet, payload_map_s::modname, switch_codec_implementation::number_of_channels, payload_map_s::pt, switch_frame::rate, switch_rtp_engine_s::read_codec, switch_rtp_engine_s::read_frame, switch_rtp_engine_s::read_impl, payload_map_s::rm_fmtp, payload_map_s::rm_rate, switch_rtp_engine_s::rtp_session, switch_codec_implementation::samples_per_packet, switch_codec_implementation::samples_per_second, switch_codec::session, switch_assert, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION, switch_channel_audio_sync, switch_channel_get_name(), switch_channel_hangup, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable, switch_channel_set_variable_printf(), SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_destroy(), switch_core_codec_init_with_bitrate(), switch_core_codec_ready(), switch_core_session_get_pool(), switch_core_session_lock_codec_read(), switch_core_session_lock_codec_write(), switch_core_session_parse_codec_settings(), switch_core_session_reset(), switch_core_session_set_read_impl(), switch_core_session_set_real_read_codec(), switch_core_session_set_write_codec(), switch_core_session_set_write_impl(), switch_core_session_strdup, switch_core_session_unlock_codec_read(), switch_core_session_unlock_codec_write(), switch_goto_status, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, SWITCH_LOG_NOTICE, switch_log_printf(), SWITCH_MEDIA_TYPE_AUDIO, switch_mutex_lock(), switch_mutex_unlock(), switch_resample_destroy(), switch_rtp_change_interval(), switch_rtp_ready(), switch_rtp_reset_jb(), switch_rtp_set_default_payload(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_yield, switch_rtp_engine_s::write_codec, and switch_rtp_engine_s::write_impl.
Referenced by switch_core_media_activate_rtp(), switch_core_media_negotiate_sdp(), switch_core_media_read_frame(), and switch_core_media_recover_session().
void switch_core_media_set_local_sdp | ( | switch_core_session_t * | session, |
const char * | sdp_str, | ||
switch_bool_t | dup | ||
) |
Definition at line 7485 of file switch_core_media.c.
References switch_core_media_params_s::local_sdp_str, switch_media_handle_s::mparams, switch_media_handle_s::sdp_mutex, switch_assert, switch_channel_set_variable, switch_core_session_strdup, switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_core_media_absorb_sdp(), switch_core_media_gen_local_sdp(), switch_core_media_patch_sdp(), switch_core_media_receive_message(), and switch_core_media_set_udptl_image_sdp().
switch_status_t switch_core_media_set_outgoing_bitrate | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
uint32_t | bitrate | ||
) |
Definition at line 9231 of file switch_core_media.c.
References switch_media_handle_s::engines, SCC_VIDEO_BANDWIDTH, SCCT_INT, SCCT_NONE, switch_channel_down, switch_core_codec_control(), switch_core_codec_ready(), SWITCH_STATUS_FALSE, and switch_rtp_engine_s::write_codec.
|
static |
Definition at line 10053 of file switch_core_media.c.
References add_audio_codec(), buf, CF_NOVIDEO, switch_core_session::channel, switch_codec_implementation::codec_type, switch_codec_implementation::ianacode, switch_codec_implementation::iananame, switch_core_session::media_handle, switch_codec_implementation::modname, switch_media_handle_s::mparams, switch_core_media_params_s::ndlb, SM_NDLB_ALLOW_BAD_IANANAME, switch_assert, SWITCH_CALL_DIRECTION_INBOUND, SWITCH_CHANNEL_CHANNEL_LOG, switch_channel_direction(), switch_channel_get_variable, switch_channel_set_variable, switch_channel_test_flag(), SWITCH_CODEC_TYPE_AUDIO, SWITCH_CODEC_TYPE_VIDEO, switch_core_media_add_payload_map(), switch_core_media_find_zrtp_hash(), switch_core_media_pass_zrtp_hash(), switch_core_session_get_channel(), SWITCH_FALSE, switch_loadable_module_get_codecs(), switch_loadable_module_get_codecs_sorted(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_MAX_CODECS, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_safe_free, switch_separate_string(), switch_snprintf(), switch_true(), and zstr.
Referenced by switch_core_media_set_sdp_codec_string().
void switch_core_media_set_rtp_flag | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
switch_rtp_flag_t | flag | ||
) |
Definition at line 9831 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, switch_rtp_ready(), and switch_rtp_set_flag().
void switch_core_media_set_rtp_session | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
switch_rtp_t * | rtp_session | ||
) |
Definition at line 1151 of file switch_core_media.c.
References switch_rtp_engine_s::rtp_session, and switch_rtp_engine_s::type.
void switch_core_media_set_sdp_codec_string | ( | switch_core_session_t * | session, |
const char * | r_sdp, | ||
switch_sdp_type_t | sdp_type | ||
) |
Definition at line 9968 of file switch_core_media.c.
References switch_assert, switch_core_media_get_codec_string(), and switch_core_media_set_r_sdp_codec_string().
void switch_core_media_set_stats | ( | switch_core_session_t * | session | ) |
Definition at line 1562 of file switch_core_media.c.
References set_stats(), switch_core_media_sync_stats(), SWITCH_MEDIA_TYPE_AUDIO, and SWITCH_MEDIA_TYPE_VIDEO.
Referenced by switch_core_session_hangup_state(), and switch_core_standard_on_hangup().
void switch_core_media_set_telephony_event | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
switch_payload_t | te | ||
) |
Definition at line 9863 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, switch_rtp_ready(), and switch_rtp_set_telephony_event().
void switch_core_media_set_telephony_recv_event | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
switch_payload_t | te | ||
) |
Definition at line 9879 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, switch_rtp_ready(), and switch_rtp_set_telephony_recv_event().
void switch_core_media_set_udptl_image_sdp | ( | switch_core_session_t * | session, |
switch_t38_options_t * | t38_options, | ||
int | insist | ||
) |
Definition at line 8643 of file switch_core_media.c.
References switch_rtp_engine_s::adv_sdp_ip, switch_rtp_engine_s::adv_sdp_port, buf, switch_media_handle_s::engines, switch_core_media_params_s::local_sdp_str, switch_media_handle_s::mparams, switch_media_handle_s::owner_id, switch_rtp_engine_s::proxy_sdp_ip, switch_rtp_engine_s::proxy_sdp_port, switch_core_media_params_s::sdp_username, switch_media_handle_s::session_id, switch_assert, switch_channel_get_name(), switch_channel_get_variable, SWITCH_CHANNEL_LOG, SWITCH_CHANNEL_SESSION_LOG, switch_core_media_set_local_sdp(), switch_epoch_time_now(), SWITCH_LOG_CRIT, SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_MEDIA_TYPE_AUDIO, switch_snprintf(), SWITCH_TRUE, and switch_true().
switch_status_t switch_core_media_set_video_codec | ( | switch_core_session_t * | session, |
int | force | ||
) |
Definition at line 2720 of file switch_core_media.c.
References switch_codec::agreed_pt, payload_map_s::agreed_pt, switch_frame::codec, payload_map_s::codec_ms, switch_rtp_engine_s::codec_negotiated, switch_rtp_engine_s::codec_settings, switch_rtp_engine_s::cur_payload_map, switch_media_handle_s::engines, switch_codec::fmtp_out, switch_core_session_message::from, switch_codec_implementation::iananame, switch_codec::implementation, switch_core_session_message::message_id, payload_map_s::modname, switch_frame::rate, switch_rtp_engine_s::read_codec, switch_rtp_engine_s::read_frame, payload_map_s::rm_encoding, payload_map_s::rm_fmtp, payload_map_s::rm_rate, switch_rtp_engine_s::rtp_session, switch_codec_implementation::samples_per_second, switch_assert, switch_channel_get_name(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable, switch_channel_set_variable_printf(), SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_destroy(), switch_core_codec_init, switch_core_codec_ready(), switch_core_session_get_pool(), switch_core_session_parse_codec_settings(), switch_core_session_receive_message, switch_core_session_set_video_read_codec(), switch_core_session_set_video_write_codec(), switch_core_session_strdup, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_MEDIA_TYPE_VIDEO, SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ, switch_rtp_ready(), switch_rtp_set_default_payload(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_rtp_engine_s::write_codec.
Referenced by switch_core_media_activate_rtp(), switch_core_media_gen_local_sdp(), switch_core_media_negotiate_sdp(), switch_core_media_patch_sdp(), switch_core_media_read_frame(), and switch_core_media_recover_session().
switch_status_t switch_core_media_set_video_file | ( | switch_core_session_t * | session, |
switch_file_handle_t * | fh, | ||
switch_rw_t | rw | ||
) |
Definition at line 5209 of file switch_core_media.c.
References CF_VIDEO, CF_VIDEO_DECODED_READ, CF_VIDEO_READ_FILE_ATTACHED, CF_VIDEO_WRITE_FILE_ATTACHED, switch_media_handle_s::engines, media_helper::file_read_mutex, media_helper::file_write_mutex, switch_rtp_engine_s::mh, switch_assert, switch_channel_clear_flag(), switch_channel_clear_flag_recursive(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_flag_recursive(), switch_channel_test_flag(), switch_channel_video_sync, switch_core_file_has_video(), switch_core_media_gen_key_frame, switch_core_session_get_pool(), switch_core_session_start_video_thread(), switch_core_session_video_reset(), switch_core_session_wake_video_thread(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RW_READ, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_create(), switch_thread_join(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_stacksize_set(), SWITCH_TRUE, switch_media_handle_s::video_read_fh, switch_media_handle_s::video_write_fh, switch_media_handle_s::video_write_thread, video_write_thread(), and switch_media_handle_s::video_write_thread_running.
Referenced by switch_ivr_play_file(), and switch_ivr_record_file().
void switch_core_media_start_udptl | ( | switch_core_session_t * | session, |
switch_t38_options_t * | t38_options | ||
) |
Definition at line 9112 of file switch_core_media.c.
References CF_AVPF, CF_NOTIMER_DURING_BRIDGE, switch_media_handle_s::engines, switch_rtp::remote_port, switch_rtp_engine_s::rtp_session, SCMF_DISABLE_RTP_AUTOADJ, switch_assert, switch_channel_clear_flag(), switch_channel_down, switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_media_handle_test_media_flag(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_RTP_FLAG_AUTOADJ, switch_rtp_get_remote_host(), switch_rtp_get_remote_port(), switch_rtp_ready(), switch_rtp_set_flag(), switch_rtp_set_remote_address(), switch_rtp_udptl_mode(), SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and switch_true().
Referenced by switch_core_media_receive_message().
void switch_core_media_start_video_function | ( | switch_core_session_t * | session, |
switch_video_function_t | video_function, | ||
void * | user_data | ||
) |
Definition at line 5540 of file switch_core_media.c.
References switch_media_handle_s::control_mutex, switch_core_session_start_video_thread(), switch_core_session_video_reset(), switch_mutex_lock(), switch_mutex_unlock(), switch_media_handle_s::video_function, switch_media_handle_s::video_function_running, and switch_media_handle_s::video_user_data.
void switch_core_media_sync_stats | ( | switch_core_session_t * | session | ) |
Definition at line 1538 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, and switch_rtp_sync_stats().
Referenced by switch_core_media_set_stats().
int switch_core_media_toggle_hold | ( | switch_core_session_t * | session, |
int | sendonly | ||
) |
Definition at line 4872 of file switch_core_media.c.
References CF_ANSWERED, CF_BROADCAST, CF_BYPASS_MEDIA_AFTER_HOLD, CF_EVENT_LOCK_PRI, CF_HOLD, CF_HOLD_LOCK, CF_PROTO_HOLD, CF_SLA_BARGE, CF_SLA_BARGING, CF_SUSPEND, switch_media_handle_s::engines, switch_rtp_engine_s::max_missed_hold_packets, switch_rtp_engine_s::max_missed_packets, switch_rtp_engine_s::rtp_session, SMF_ECHO_ALEG, SMF_LOOP, SMF_PRIORITY, SMF_REBRIDGE, switch_assert, switch_channel_clear_flag(), switch_channel_get_hold_music(), switch_channel_get_variable, switch_channel_get_variable_dup(), switch_channel_mark_hold(), switch_channel_presence, switch_channel_set_flag, switch_channel_stop_broadcast, switch_channel_test_flag(), switch_channel_wait_for_flag(), switch_core_media_check_autoadj(), switch_core_session_get_channel(), switch_core_session_get_partner, switch_core_session_get_uuid(), switch_core_session_rwunlock(), SWITCH_FALSE, switch_ivr_bg_media(), switch_ivr_broadcast(), switch_ivr_hold_uuid(), switch_ivr_unhold(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_rtp_clear_flag(), SWITCH_RTP_FLAG_PAUSE, switch_rtp_reset_media_timer(), switch_rtp_set_flag(), switch_rtp_set_max_missed_packets(), SWITCH_STATUS_SUCCESS, switch_stristr(), SWITCH_TRUE, switch_true(), and switch_yield.
Referenced by switch_core_media_activate_rtp(), and switch_core_media_negotiate_sdp().
switch_status_t switch_core_media_udptl_mode | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 9931 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::rtp_session, switch_assert, switch_rtp_ready(), switch_rtp_udptl_mode(), and SWITCH_STATUS_FALSE.
switch_status_t switch_core_media_unlock_video_file | ( | switch_core_session_t * | session, |
switch_rw_t | rw | ||
) |
Definition at line 5183 of file switch_core_media.c.
References CF_VIDEO, switch_media_handle_s::engines, media_helper::file_read_mutex, media_helper::file_write_mutex, switch_rtp_engine_s::mh, switch_assert, switch_channel_test_flag(), SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_unlock(), SWITCH_RW_READ, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_ivr_record_file().
switch_status_t switch_core_media_write_frame | ( | switch_core_session_t * | session, |
switch_frame_t * | frame, | ||
switch_io_flag_t | flags, | ||
int | stream_id, | ||
switch_media_type_t | type | ||
) |
Definition at line 2552 of file switch_core_media.c.
References CF_VIDEO_ONLY, switch_codec_implementation::encoded_bytes_per_packet, switch_media_handle_s::engines, switch_codec::implementation, switch_media_handle_s::media_flags, switch_rtp_engine_s::read_codec, switch_rtp_engine_s::read_impl, switch_rtp_engine_s::rtp_session, switch_codec_implementation::samples_per_packet, SCMF_RUNNING, SFF_CNG, SFF_PROXY_PACKET, switch_assert, switch_channel_ready, switch_channel_test_flag(), switch_core_codec_ready(), SWITCH_MEDIA_TYPE_AUDIO, switch_rtp_ready(), switch_rtp_write_frame(), SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_yield, and switch_rtp_engine_s::timestamp_send.
|
static |
Definition at line 1199 of file switch_core_media.c.
References CF_RECOVERING, CF_SECURE, switch_core_session::channel, secure_settings_s::crypto_tag, secure_settings_s::crypto_type, switch_rtp_engine_s::crypto_type, switch_media_handle_s::engines, switch_srtp_crypto_suite_s::keylen, secure_settings_s::local_raw_key, switch_core_session::media_handle, switch_srtp_crypto_suite_s::name, secure_settings_s::remote_crypto_key, secure_settings_s::remote_raw_key, switch_rtp_engine_s::rtp_session, switch_rtp_engine_s::ssec, switch_channel_set_variable, switch_channel_test_flag(), switch_core_media_add_crypto(), SWITCH_MEDIA_TYPE_AUDIO, switch_rtp_add_crypto_key(), SWITCH_RTP_CRYPTO_RECV, and SWITCH_RTP_CRYPTO_SEND.
Referenced by switch_core_media_activate_rtp().
int switch_core_session_check_incoming_crypto | ( | switch_core_session_t * | session, |
const char * | varname, | ||
switch_media_type_t | type, | ||
const char * | crypto, | ||
int | crypto_tag, | ||
switch_sdp_type_t | sdp_type | ||
) |
Definition at line 1325 of file switch_core_media.c.
References CF_AVPF, CF_SECURE, switch_core_session::channel, CRYPTO_INVALID, switch_media_handle_s::crypto_mode, CRYPTO_MODE_FORBIDDEN, switch_media_handle_s::crypto_suite_order, secure_settings_s::crypto_tag, secure_settings_s::crypto_type, switch_rtp_engine_s::crypto_type, switch_srtp_crypto_suite_s::keylen, secure_settings_s::local_crypto_key, secure_settings_s::local_raw_key, switch_srtp_crypto_suite_s::name, secure_settings_s::remote_crypto_key, secure_settings_s::remote_raw_key, switch_rtp_engine_s::rtp_session, SDP_TYPE_REQUEST, switch_media_handle_s::session, switch_rtp_engine_s::ssec, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_variable, switch_channel_set_variable_printf(), switch_channel_test_flag(), switch_core_media_add_crypto(), switch_core_media_build_crypto(), switch_core_media_crypto_type2str(), switch_core_session_strdup, SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_rtp_add_crypto_key(), SWITCH_RTP_CRYPTO_RECV, SWITCH_RTP_CRYPTO_SEND, switch_rtp_ready(), switch_stristr(), switch_srtp_crypto_suite_s::type, switch_rtp_engine_s::type, and zstr.
Referenced by switch_core_media_negotiate_sdp().
void switch_core_session_check_outgoing_crypto | ( | switch_core_session_t * | session | ) |
Definition at line 1450 of file switch_core_media.c.
References CF_AVPF, CF_SECURE, CRYPTO_INVALID, switch_media_handle_s::crypto_mode, CRYPTO_MODE_MANDATORY, CRYPTO_MODE_OPTIONAL, switch_media_handle_s::crypto_suite_order, switch_channel_set_flag, switch_channel_test_flag(), switch_core_media_build_crypto(), switch_core_session_get_channel(), switch_core_session_media_handle_ready(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_NO_CRYPTO_TAG, SWITCH_RTP_CRYPTO_SEND, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_media_gen_local_sdp().
void switch_core_session_clear_crypto | ( | switch_core_session_t * | session | ) |
Definition at line 873 of file switch_core_media.c.
References CRYPTO_INVALID, switch_media_handle_s::engines, memset(), switch_rtp_engine_s::ssec, switch_channel_set_variable, SWITCH_MEDIA_TYPE_AUDIO, and SWITCH_MEDIA_TYPE_VIDEO.
switch_status_t switch_core_session_clear_media_handle | ( | switch_core_session_t * | session | ) |
Definition at line 1784 of file switch_core_media.c.
References SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_media_handle_t* switch_core_session_get_media_handle | ( | switch_core_session_t * | session | ) |
Definition at line 1775 of file switch_core_media.c.
References switch_core_session_media_handle_ready(), and SWITCH_STATUS_SUCCESS.
switch_status_t switch_core_session_get_payload_code | ( | switch_core_session_t * | session, |
switch_media_type_t | type, | ||
const char * | iananame, | ||
uint32_t | rate, | ||
switch_payload_t * | ptP, | ||
switch_payload_t * | recv_ptP, | ||
char ** | fmtpP | ||
) |
Definition at line 668 of file switch_core_media.c.
References payload_map_s::allocated, switch_media_handle_s::engines, payload_map_s::iananame, payload_map_s::next, switch_rtp_engine_s::payload_map, payload_map_s::pt, payload_map_s::rate, payload_map_s::recv_pt, payload_map_s::rm_fmtp, switch_media_handle_s::sdp_mutex, switch_assert, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and zstr.
Referenced by switch_core_media_gen_local_sdp().
|
static |
Definition at line 1161 of file switch_core_media.c.
References CF_SECURE, switch_core_session::channel, secure_settings_s::crypto_tag, switch_rtp_engine_s::crypto_type, switch_media_handle_s::engines, switch_core_session::media_handle, secure_settings_s::remote_crypto_key, switch_rtp_engine_s::ssec, switch_channel_get_variable, switch_channel_set_flag, switch_core_media_crypto_str2type(), switch_core_session_strdup, and SWITCH_MEDIA_TYPE_AUDIO.
Referenced by switch_core_media_recover_session().
switch_bool_t switch_core_session_in_video_thread | ( | switch_core_session_t * | session | ) |
Definition at line 5594 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_assert, SWITCH_FALSE, SWITCH_MEDIA_TYPE_VIDEO, switch_thread_equal(), switch_thread_self(), SWITCH_TRUE, and switch_rtp_engine_s::thread_id.
const char* switch_core_session_local_crypto_key | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 904 of file switch_core_media.c.
switch_media_flow_t switch_core_session_media_flow | ( | switch_core_session_t * | session, |
switch_media_type_t | type | ||
) |
Definition at line 1740 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_media_handle_s::media_flags, SCMF_RUNNING, switch_rtp_engine_s::smode, switch_assert, and SWITCH_MEDIA_FLOW_SENDRECV.
Referenced by switch_core_session_write_encoded_video_frame(), and switch_core_session_write_video_frame().
switch_status_t switch_core_session_media_handle_ready | ( | switch_core_session_t * | session | ) |
Definition at line 1764 of file switch_core_media.c.
References SMF_INIT, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_test_flag.
Referenced by switch_core_session_check_outgoing_crypto(), and switch_core_session_get_media_handle().
|
static |
Definition at line 2672 of file switch_core_media.c.
References switch_video_codec_settings::bandwidth, switch_core_session::channel, switch_rtp_engine_s::codec_settings, switch_media_handle_s::engines, switch_core_session::media_handle, switch_rtp_engine_s::sdp_bw, switch_assert, switch_channel_get_variable, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_parse_bandwidth_string(), switch_true(), switch_video_codec_settings::try_hardware_encoder, and switch_codec_settings::video.
Referenced by switch_core_media_set_codec(), and switch_core_media_set_video_codec().
|
static |
Definition at line 1242 of file switch_core_media.c.
References CF_AVPF, CF_RECOVERING, switch_core_session::channel, CRYPTO_INVALID, switch_media_handle_s::crypto_mode, CRYPTO_MODE_FORBIDDEN, CRYPTO_MODE_MANDATORY, CRYPTO_MODE_OPTIONAL, switch_media_handle_s::crypto_suite_order, switch_core_session::media_handle, SWITCH_CALL_DIRECTION_INBOUND, switch_channel_direction(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), switch_false(), switch_log_printf(), SWITCH_LOG_WARNING, switch_split, switch_true(), switch_srtp_crypto_suite_s::type, and zstr.
Referenced by switch_core_media_gen_local_sdp(), and switch_core_media_negotiate_sdp().
switch_status_t switch_core_session_read_video_frame | ( | switch_core_session_t * | session, |
switch_frame_t ** | frame, | ||
switch_io_flag_t | flags, | ||
int | stream_id | ||
) |
Definition at line 11314 of file switch_core_media.c.
References switch_media_bug::callback, CF_ANSWERED, CF_PAUSE_BUGS, CF_VIDEO_DEBUG_READ, CF_VIDEO_DECODED_READ, CF_VIDEO_PAUSE_READ, CF_VIDEO_READY, switch_runtime::dummy_cng_frame, switch_vid_params_s::height, switch_io_event_hook_video_read_frame::next, switch_media_bug::next, switch_media_bug::read_video_queue, switch_media_bug::ready, switch_media_handle_s::ready_loops, runtime, SFF_CNG, SFF_WAIT_KEY_FRAME, SMBF_ANSWER_REQ, SMBF_NO_PAUSE, SMBF_PRUNE, SMBF_READ_VIDEO_PING, SMBF_READ_VIDEO_STREAM, SMBF_SPY_VIDEO_STREAM, switch_media_bug::stop_time, SWITCH_ABC_TYPE_READ_VIDEO_PING, switch_assert, switch_channel_down_nosig, SWITCH_CHANNEL_LOG, switch_channel_set_flag, switch_channel_set_variable_printf(), switch_channel_test_flag(), switch_clear_flag, switch_cond_next(), switch_core_codec_decode_video(), switch_core_media_bug_patch_spy_frame(), switch_core_media_bug_prune(), switch_core_media_bug_test_flag(), switch_core_session_request_video_refresh(), switch_core_session_video_read_callback(), switch_epoch_time_now(), SWITCH_FALSE, switch_img_copy(), SWITCH_LOG_INFO, switch_log_printf(), switch_queue_push(), SWITCH_RW_READ, switch_set_flag, SWITCH_STATUS_FALSE, SWITCH_STATUS_INUSE, SWITCH_STATUS_MORE_DATA, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_thread_rwlock_rdlock(), switch_thread_rwlock_unlock(), SWITCH_TRUE, switch_media_bug::user_data, switch_media_handle_s::vid_params, switch_media_bug::video_ping_frame, switch_io_event_hook_video_read_frame::video_read_frame, and switch_vid_params_s::width.
Referenced by video_helper_thread().
switch_status_t switch_core_session_request_video_refresh | ( | switch_core_session_t * | session | ) |
Definition at line 10911 of file switch_core_media.c.
References CF_VIDEO, switch_core_session_message::from, switch_media_handle_s::last_video_refresh_req, switch_core_session_message::message_id, switch_assert, switch_channel_test_flag(), switch_core_session_get_channel(), switch_core_session_receive_message, SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ, switch_micro_time_now(), SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and VIDEO_REFRESH_FREQ.
Referenced by do_flush(), dtls_state_ready(), eavesdrop_callback(), jb_frame_inc_line(), jb_next_packet_by_seq(), read_rtp_packet(), switch_channel_perform_video_sync(), switch_channel_set_flag_value(), switch_core_session_execute_application_get_flags(), switch_core_session_read_video_frame(), switch_core_session_send_and_request_video_refresh(), switch_core_session_stop_media(), switch_core_session_video_reinit(), switch_core_session_video_reset(), switch_core_session_wait_for_video_input_params(), switch_ivr_eavesdrop_session(), switch_ivr_record_file(), switch_jb_get_packet(), switch_jb_put_packet(), switch_jb_reset(), switch_rtp_set_video_buffer_size(), and video_helper_thread().
switch_status_t switch_core_session_send_and_request_video_refresh | ( | switch_core_session_t * | session | ) |
Definition at line 10941 of file switch_core_media.c.
References CF_VIDEO, switch_channel_test_flag(), switch_core_media_gen_key_frame, switch_core_session_request_video_refresh(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_session_video_reinit().
void switch_core_session_set_ice | ( | switch_core_session_t * | session | ) |
Definition at line 3592 of file switch_core_media.c.
References CF_AVPF, CF_ICE, CF_VERBOSE_SDP, switch_media_handle_s::mparams, switch_core_media_params_s::rtcp_audio_interval_msec, switch_core_media_params_s::rtcp_video_interval_msec, switch_assert, switch_channel_set_flag, SWITCH_RTCP_AUDIO_INTERVAL_MSEC, and SWITCH_RTCP_VIDEO_INTERVAL_MSEC.
Referenced by switch_core_media_negotiate_sdp().
switch_status_t switch_core_session_start_video_thread | ( | switch_core_session_t * | session | ) |
Definition at line 5494 of file switch_core_media.c.
References payload_map_s::agreed_pt, CF_VIDEO, media_helper::cond, media_helper::cond_mutex, switch_media_handle_s::control_mutex, switch_rtp_engine_s::cur_payload_map, switch_media_handle_s::engines, media_helper::file_read_mutex, media_helper::file_write_mutex, switch_rtp_engine_s::media_thread, switch_rtp_engine_s::mh, pool, switch_media_handle_s::read_mutex, switch_rtp_engine_s::rtp_session, media_helper::session, SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), switch_core_session_get_name, switch_core_session_get_pool(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_init(), switch_mutex_lock(), SWITCH_MUTEX_NESTED, switch_mutex_unlock(), switch_rtp_set_default_payload(), SWITCH_STATUS_FALSE, SWITCH_STATUS_NOTIMPL, SWITCH_STATUS_SUCCESS, switch_thread_cond_create(), switch_thread_create(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_stacksize_set(), video_helper_thread(), and switch_media_handle_s::write_mutex.
Referenced by switch_channel_set_flag_value(), switch_core_media_activate_rtp(), switch_core_media_set_video_file(), switch_core_media_start_video_function(), and switch_core_session_set_video_read_callback().
void switch_core_session_stop_media | ( | switch_core_session_t * | session | ) |
Definition at line 10296 of file switch_core_media.c.
References ice_s::cands, CF_VIDEO_READY, switch_core_session::channel, ice_s::chosen, switch_media_handle_s::cname, icand_s::component_id, switch_media_handle_s::engines, icand_s::foundation, gen_ice(), switch_rtp_engine_s::ice_in, switch_rtp_engine_s::ice_out, dtls_fp_s::len, switch_rtp_engine_s::local_dtls_fingerprint, switch_media_handle_s::msid, switch_media_handle_s::owner_id, ice_s::pwd, switch_rtp_engine_s::read_codec, icand_s::ready, switch_rtp_engine_s::remote_ssrc, switch_rtp_engine_s::rtp_session, SCC_VIDEO_RESET, SCCT_INT, SCCT_NONE, switch_media_handle_s::session, switch_media_handle_s::session_id, switch_assert, switch_channel_clear_flag(), switch_core_codec_control(), switch_core_codec_ready(), switch_core_session_request_video_refresh(), switch_core_session_wake_video_thread(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_rtp_reset(), ice_s::ufrag, and switch_rtp_engine_s::write_codec.
void switch_core_session_video_reinit | ( | switch_core_session_t * | session | ) |
Definition at line 11037 of file switch_core_media.c.
References SCC_VIDEO_RESET, SCCT_INT, SCCT_NONE, switch_assert, switch_channel_down, switch_core_media_codec_control(), switch_core_session_request_video_refresh(), switch_core_session_send_and_request_video_refresh(), SWITCH_IO_READ, SWITCH_MEDIA_TYPE_VIDEO, switch_media_handle_s::video_init, and switch_media_handle_s::video_last_key_time.
Referenced by handle_ice(), and switch_core_session_write_video_frame().
switch_status_t switch_core_session_wait_for_video_input_params | ( | switch_core_session_t * | session, |
uint32_t | timeout_ms | ||
) |
Definition at line 11267 of file switch_core_media.c.
References CF_VIDEO_DECODED_READ, CF_VIDEO_READY, switch_media_handle_s::engines, switch_vid_params_s::fps, switch_vid_params_s::height, switch_codec_implementation::microseconds_per_packet, switch_rtp_engine_s::smode, switch_assert, switch_channel_ready, switch_channel_test_flag(), switch_core_session_get_read_impl(), switch_core_session_read_frame(), switch_core_session_request_video_refresh(), SWITCH_IO_FLAG_NONE, SWITCH_MEDIA_FLOW_SENDONLY, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_READ_ACCEPTABLE, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_NOTIMPL, SWITCH_STATUS_SUCCESS, SWITCH_STATUS_TIMEOUT, core_video_globals_s::synced, switch_media_handle_s::vid_params, and switch_vid_params_s::width.
Referenced by switch_ivr_record_file().
void switch_core_session_wake_video_thread | ( | switch_core_session_t * | session | ) |
Definition at line 6162 of file switch_core_media.c.
References media_helper::cond, media_helper::cond_mutex, switch_media_handle_s::engines, switch_core_media_params_s::external_video_source, switch_rtp_engine_s::media_thread, switch_rtp_engine_s::mh, switch_media_handle_s::mparams, switch_rtp_engine_s::rtp_session, switch_channel_get_name(), SWITCH_CHANNEL_SESSION_LOG, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_trylock(), switch_mutex_unlock(), SWITCH_STATUS_SUCCESS, and switch_thread_cond_broadcast().
Referenced by switch_channel_clear_flag(), switch_core_media_set_video_file(), switch_core_session_run(), and switch_core_session_stop_media().
switch_status_t switch_core_session_write_video_frame | ( | switch_core_session_t * | session, |
switch_frame_t * | frame, | ||
switch_io_flag_t | flags, | ||
int | stream_id | ||
) |
Definition at line 11062 of file switch_core_media.c.
References switch_media_bug::callback, CF_ANSWERED, CF_PAUSE_BUGS, CF_VIDEO_MIRROR_INPUT, CF_VIDEO_PAUSE_WRITE, CF_VIDEO_READY, switch_vid_params_s::height, switch_frame::img, switch_media_handle_s::mparams, switch_media_bug::next, switch_media_bug::ready, switch_timer::samplecount, switch_media_handle_s::session, SFF_PICTURE_RESET, SFF_RAW_RTP_PARSE_FRAME, SFF_SAME_IMAGE, SFF_USE_VIDEO_TIMESTAMP, SMBF_ANSWER_REQ, SMBF_NO_PAUSE, SMBF_PRUNE, SMBF_SPY_VIDEO_STREAM, SMBF_SPY_VIDEO_STREAM_BLEG, SMBF_WRITE_VIDEO_PING, SMBF_WRITE_VIDEO_STREAM, switch_media_bug::stop_time, SWITCH_ABC_TYPE_WRITE_VIDEO_PING, switch_assert, switch_channel_down, switch_channel_get_name(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), switch_clear_flag, switch_core_codec_encode_video(), switch_core_media_bug_patch_spy_frame(), switch_core_media_bug_prune(), switch_core_media_bug_test_flag(), switch_core_media_gen_key_frame, switch_core_media_get_timer(), switch_core_session_get_name, switch_core_session_get_pool(), switch_core_session_get_video_write_codec(), switch_core_session_media_flow(), switch_core_session_video_reinit(), switch_core_session_write_encoded_video_frame(), switch_core_timer_init(), switch_core_timer_sync(), SWITCH_DEFAULT_VIDEO_SIZE, switch_epoch_time_now(), SWITCH_FALSE, switch_goto_status, switch_img_copy(), switch_img_free(), switch_img_letterbox(), SWITCH_IO_FLAG_FORCE, SWITCH_LOG_DEBUG1, SWITCH_LOG_DEBUG3, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_MEDIA_FLOW_RECVONLY, SWITCH_MEDIA_TYPE_VIDEO, switch_micro_time_now(), switch_mutex_trylock(), switch_mutex_unlock(), switch_queue_push(), SWITCH_RW_WRITE, switch_set_flag, SWITCH_STATUS_FALSE, SWITCH_STATUS_INUSE, SWITCH_STATUS_MORE_DATA, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_thread_rwlock_rdlock(), switch_thread_rwlock_unlock(), SWITCH_TRUE, switch_timer::timer_interface, type2str, switch_media_bug::user_data, switch_media_handle_s::vid_params, switch_media_handle_s::video_init, switch_core_media_params_s::video_key_first, switch_core_media_params_s::video_key_freq, switch_media_handle_s::video_last_key_time, switch_media_bug::video_ping_frame, switch_media_handle_s::video_timer, switch_vid_params_s::width, switch_media_handle_s::write_mutex, and switch_media_bug::write_video_queue.
Referenced by video_helper_thread(), and video_write_thread().
switch_call_direction_t switch_ice_direction | ( | switch_core_session_t * | session | ) |
Definition at line 3165 of file switch_core_media.c.
References CF_3PCC, CF_AVPF, CF_RECOVERING, CF_REINVITE, SWITCH_CALL_DIRECTION_INBOUND, SWITCH_CALL_DIRECTION_OUTBOUND, switch_channel_direction(), and switch_channel_test_flag().
Referenced by check_ice(), and switch_core_media_activate_rtp().
void switch_media_handle_clear_media_flag | ( | switch_media_handle_t * | smh, |
switch_core_media_flag_t | flag | ||
) |
Definition at line 1727 of file switch_core_media.c.
References switch_assert.
switch_status_t switch_media_handle_create | ( | switch_media_handle_t ** | smhp, |
switch_core_session_t * | session, | ||
switch_core_media_params_t * | params | ||
) |
Definition at line 1621 of file switch_core_media.c.
References CF_DTLS_OK, CRYPTO_INVALID, switch_core_session::media_handle, SCMF_RUNNING, switch_media_handle_s::session, SMF_INIT, switch_channel_set_flag, switch_channel_set_variable, switch_core_alloc, switch_core_session_alloc, switch_core_session_get_pool(), SWITCH_MEDIA_FLOW_SENDRECV, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_init(), SWITCH_MUTEX_NESTED, SWITCH_RTP_MAX_BUF_LEN, switch_set_flag, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and zstr.
void switch_media_handle_destroy | ( | switch_core_session_t * | session | ) |
Definition at line 1577 of file switch_core_media.c.
References switch_media_handle_s::engines, switch_rtp_engine_s::read_codec, switch_assert, switch_core_codec_destroy(), switch_core_codec_ready(), switch_core_media_deactivate_rtp(), switch_core_session_unset_read_codec(), switch_core_session_unset_write_codec(), switch_core_timer_destroy(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_timer::timer_interface, switch_media_handle_s::video_timer, and switch_rtp_engine_s::write_codec.
void switch_media_handle_set_media_flag | ( | switch_media_handle_t * | smh, |
switch_core_media_flag_t | flag | ||
) |
Definition at line 1706 of file switch_core_media.c.
References switch_assert.
Referenced by switch_core_media_receive_message().
void switch_media_handle_set_media_flags | ( | switch_media_handle_t * | smh, |
switch_core_media_flag_t | flags[SCMF_MAX] | ||
) |
Definition at line 1714 of file switch_core_media.c.
References SCMF_MAX, and switch_assert.
int32_t switch_media_handle_test_media_flag | ( | switch_media_handle_t * | smh, |
switch_core_media_flag_t | flag | ||
) |
Definition at line 1734 of file switch_core_media.c.
References switch_assert.
Referenced by generate_m(), switch_core_media_activate_rtp(), switch_core_media_check_autoadj(), switch_core_media_gen_local_sdp(), switch_core_media_negotiate_sdp(), switch_core_media_proxy_remote_addr(), and switch_core_media_start_udptl().
|
static |
Definition at line 5338 of file switch_core_media.c.
References buf, switch_frame::buflen, buflen, CF_VIDEO, CF_VIDEO_DECODED_READ, CF_VIDEO_ECHO, CF_VIDEO_PASSIVE, CF_VIDEO_READY, CF_VIDEO_WRITING, switch_core_session::channel, media_helper::cond, media_helper::cond_mutex, switch_media_handle_s::control_mutex, vpx_image::d_h, vpx_image::d_w, switch_frame::data, switch_media_handle_s::engines, media_helper::file_read_mutex, switch_mm_s::fps, switch_vid_params_s::fps, switch_frame::img, switch_core_session::media_handle, switch_file_handle::mm, switch_frame::packet, switch_frame::packetlen, media_helper::session, SFF_CNG, switch_channel_get_name(), switch_channel_get_variable, SWITCH_CHANNEL_LOG, switch_channel_media_up, switch_channel_set_flag, switch_channel_test_flag(), switch_channel_up_nosig, switch_color_set_rgb(), switch_cond_next(), switch_core_autobind_cpu(), switch_core_file_write_video(), switch_core_media_check_dtls(), switch_core_media_gen_key_frame, switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_read_lock(), switch_core_session_read_video_frame(), switch_core_session_request_video_refresh(), switch_core_session_rwunlock(), switch_core_session_write_video_frame(), SWITCH_FILE_OPEN, switch_img_alloc(), switch_img_fill(), SWITCH_IMG_FMT_I420, switch_img_free(), switch_img_read_png(), SWITCH_IO_FLAG_FORCE, SWITCH_IO_FLAG_NONE, SWITCH_LOG_DEBUG, SWITCH_LOG_DEBUG1, switch_log_printf(), SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_READ_ACCEPTABLE, SWITCH_RTP_MAX_BUF_LEN, switch_test_flag, switch_thread_cond_wait(), switch_thread_self(), switch_yield, switch_rtp_engine_s::thread_id, media_helper::up, switch_media_handle_s::vid_params, switch_media_handle_s::video_function, switch_media_handle_s::video_function_running, switch_core_session::video_read_callback, switch_media_handle_s::video_read_fh, and switch_media_handle_s::video_user_data.
Referenced by switch_core_session_start_video_thread().
|
static |
Definition at line 5075 of file switch_core_media.c.
References buf, switch_frame::buflen, buflen, CF_VIDEO_WRITING, switch_core_session::channel, switch_frame::data, switch_media_handle_s::engines, media_helper::file_write_mutex, core_video_globals_s::fps, switch_frame::img, switch_core_session::media_handle, switch_rtp_engine_s::mh, switch_file_handle::mm, switch_frame::packet, switch_frame::packetlen, switch_mm_s::source_fps, SVR_BLOCK, SVR_FLUSH, switch_channel_clear_flag(), switch_channel_set_flag, switch_channel_up_nosig, switch_core_file_read_video(), switch_core_media_gen_key_frame, switch_core_session_alloc, switch_core_session_get_pool(), switch_core_session_read_lock(), switch_core_session_rwunlock(), switch_core_session_write_video_frame(), switch_core_timer_destroy(), switch_core_timer_init(), switch_core_timer_next(), SWITCH_FILE_FLAG_VIDEO_EOF, SWITCH_FILE_OPEN, switch_img_free(), SWITCH_IO_FLAG_NONE, SWITCH_MEDIA_TYPE_VIDEO, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_MAX_BUF_LEN, switch_set_flag_locked, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_IGNORE, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_media_handle_s::video_write_fh, and switch_media_handle_s::video_write_thread_running.
Referenced by switch_core_media_set_video_file().
|
static |
Definition at line 241 of file switch_core_media.c.
|
static |
Definition at line 78 of file switch_core_media.c.