FreeSWITCH API Documentation
1.7.0
|
Macros | |
#define | switch_core_codec_init(_codec, _codec_name, _modname, _fmtp, _rate, _ms, _channels, _flags, _codec_settings, _pool) switch_core_codec_init_with_bitrate(_codec, _codec_name, _modname, _fmtp, _rate, _ms, _channels, 0, _flags, _codec_settings, _pool) |
Initialize a codec handle. More... | |
#define switch_core_codec_init | ( | _codec, | |
_codec_name, | |||
_modname, | |||
_fmtp, | |||
_rate, | |||
_ms, | |||
_channels, | |||
_flags, | |||
_codec_settings, | |||
_pool | |||
) | switch_core_codec_init_with_bitrate(_codec, _codec_name, _modname, _fmtp, _rate, _ms, _channels, 0, _flags, _codec_settings, _pool) |
Initialize a codec handle.
codec | the handle to initilize |
codec_name | the name of the codec module to use |
fmtp | codec parameters to send |
rate | the desired rate (0 for any) |
ms | the desired number of milliseconds (0 for any) |
channels | the desired number of channels (0 for any) |
flags | flags to alter behaviour |
codec_settings | desired codec settings |
pool | the memory pool to use |
Definition at line 1602 of file switch_core.h.
Referenced by audio_bridge_thread(), early_thread_run(), setup_ringback(), switch_core_codec_copy(), switch_core_media_set_video_codec(), switch_core_session_set_codec_slin(), switch_ivr_activate_unicast(), switch_ivr_collect_digits_count(), switch_ivr_eavesdrop_session(), switch_ivr_gentones(), switch_ivr_park(), switch_ivr_play_file(), switch_ivr_record_file(), switch_ivr_sleep(), switch_ivr_sound_test(), switch_ivr_speak_text(), switch_ivr_wait_for_answer(), switch_ivr_wait_for_silence(), and switch_rtp_enable_vad().
switch_status_t switch_core_codec_control | ( | switch_codec_t * | codec, |
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 | ||
) |
send control data using a codec handle
codec | the codec handle to use |
cmd | the command to send |
ctype | the type of the arguement |
cmd_data | a void pointer to the data matching the passed type |
atype | the type of the extra arguement |
cmd_arg | a void pointer to the data matching the passed type |
rtype | the type of the response if any |
ret_data | a void pointer to a pointer of return data |
Definition at line 870 of file switch_core_codec.c.
References switch_assert, SWITCH_CHANNEL_LOG, switch_core_codec_ready(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), and SWITCH_STATUS_FALSE.
Referenced by switch_core_media_codec_control(), switch_core_media_receive_message(), switch_core_media_set_outgoing_bitrate(), and switch_core_session_stop_media().
switch_status_t switch_core_codec_copy | ( | switch_codec_t * | codec, |
switch_codec_t * | new_codec, | ||
const switch_codec_settings_t * | codec_settings, | ||
switch_memory_pool_t * | pool | ||
) |
Definition at line 612 of file switch_core_codec.c.
References switch_assert, and switch_core_codec_init.
Referenced by switch_core_session_read_frame().
switch_status_t switch_core_codec_decode | ( | switch_codec_t * | codec, |
switch_codec_t * | other_codec, | ||
void * | encoded_data, | ||
uint32_t | encoded_data_len, | ||
uint32_t | encoded_rate, | ||
void * | decoded_data, | ||
uint32_t * | decoded_data_len, | ||
uint32_t * | decoded_rate, | ||
unsigned int * | flag | ||
) |
Decode data using a codec handle.
codec | the codec handle to use |
other_codec | the codec handle of the last codec used |
encoded_data | the buffer to read the encoded data from |
encoded_data_len | the size of the encoded_data buffer |
encoded_rate | the rate of the encoded data |
decoded_data | the raw data buffer |
decoded_data_len | then length of the raw buffer |
decoded_rate | the new rate of the decoded data |
flag | flags to exchange |
Definition at line 763 of file switch_core_codec.c.
References memset(), switch_assert, SWITCH_CHANNEL_LOG, SWITCH_CODEC_FLAG_DECODE, switch_core_codec_ready(), SWITCH_LOG_CRIT, SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_NOT_INITALIZED, SWITCH_STATUS_SUCCESS, and switch_test_flag.
Referenced by main(), rtp_common_write(), switch_core_session_read_frame(), switch_core_session_write_frame(), and switch_ivr_park().
switch_status_t switch_core_codec_decode_video | ( | switch_codec_t * | codec, |
switch_frame_t * | frame | ||
) |
Decode video data using a codec handle.
codec | the codec handle to use |
frame | the frame to be decoded |
img | the new image in I420 format, allocated by the codec |
flag | flags to exchange |
Definition at line 842 of file switch_core_codec.c.
References switch_assert, SWITCH_CHANNEL_LOG, SWITCH_CODEC_FLAG_DECODE, switch_core_codec_ready(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_NOT_INITALIZED, and switch_test_flag.
Referenced by switch_core_session_read_video_frame().
switch_status_t switch_core_codec_destroy | ( | switch_codec_t * | codec | ) |
Destroy an initalized codec handle.
codec | the codec handle to destroy |
Definition at line 905 of file switch_core_codec.c.
References memset(), mutex, pool, switch_assert, SWITCH_CHANNEL_LOG, switch_clear_flag, SWITCH_CODEC_FLAG_FREE_POOL, SWITCH_CODEC_FLAG_READY, switch_core_codec_ready(), switch_core_destroy_memory_pool, switch_log_printf(), SWITCH_LOG_WARNING, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_NOT_INITALIZED, SWITCH_STATUS_SUCCESS, switch_test_flag, and UNPROTECT_INTERFACE.
Referenced by audio_bridge_thread(), early_thread_run(), main(), switch_core_media_bug_prune(), switch_core_media_bug_remove(), switch_core_media_bug_remove_all_function(), switch_core_media_bug_remove_callback(), switch_core_media_bug_transfer_callback(), switch_core_media_set_codec(), switch_core_media_set_video_codec(), switch_core_session_raw_read(), switch_core_session_reset(), switch_core_session_set_real_read_codec(), switch_ivr_clear_speech_cache(), switch_ivr_collect_digits_count(), switch_ivr_deactivate_unicast(), switch_ivr_eavesdrop_session(), switch_ivr_gentones(), switch_ivr_originate(), switch_ivr_park(), switch_ivr_play_file(), switch_ivr_record_file(), switch_ivr_sleep(), switch_ivr_sound_test(), switch_ivr_speak_text(), switch_ivr_wait_for_answer(), switch_ivr_wait_for_silence(), switch_media_handle_destroy(), and switch_rtp_disable_vad().
switch_status_t switch_core_codec_encode | ( | switch_codec_t * | codec, |
switch_codec_t * | other_codec, | ||
void * | decoded_data, | ||
uint32_t | decoded_data_len, | ||
uint32_t | decoded_rate, | ||
void * | encoded_data, | ||
uint32_t * | encoded_data_len, | ||
uint32_t * | encoded_rate, | ||
unsigned int * | flag | ||
) |
Encode data using a codec handle.
codec | the codec handle to use |
other_codec | the codec handle of the last codec used |
decoded_data | the raw data |
decoded_data_len | then length of the raw buffer |
decoded_rate | the rate of the decoded data |
encoded_data | the buffer to write the encoded data to |
encoded_data_len | the size of the encoded_data buffer |
encoded_rate | the new rate of the encoded data |
flag | flags to exchange |
Definition at line 731 of file switch_core_codec.c.
References switch_assert, SWITCH_CHANNEL_LOG, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_ready(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_NOT_INITALIZED, and switch_test_flag.
Referenced by main(), switch_core_session_read_frame(), and switch_core_session_write_frame().
switch_status_t switch_core_codec_encode_video | ( | switch_codec_t * | codec, |
switch_frame_t * | frame | ||
) |
Encode video data using a codec handle.
codec | the codec handle to use |
frame | the frame to encode |
Definition at line 806 of file switch_core_codec.c.
References SFF_SAME_IMAGE, switch_assert, SWITCH_CHANNEL_LOG, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_ready(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_MORE_DATA, SWITCH_STATUS_NOT_INITALIZED, and switch_test_flag.
Referenced by switch_core_session_write_video_frame().
switch_status_t switch_core_codec_init_with_bitrate | ( | switch_codec_t * | codec, |
const char * | codec_name, | ||
const char * | fmtp, | ||
const char * | modname, | ||
uint32_t | rate, | ||
int | ms, | ||
int | channels, | ||
uint32_t | bitrate, | ||
uint32_t | flags, | ||
const switch_codec_settings_t * | codec_settings, | ||
switch_memory_pool_t * | pool | ||
) |
Definition at line 631 of file switch_core_codec.c.
References switch_codec_implementation::actual_samples_per_second, switch_codec_implementation::bits_per_second, switch_cache_db_handle::flags, switch_codec_interface::implementations, switch_codec_implementation::init, memset(), switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::next, switch_codec_implementation::number_of_channels, pool, switch_codec_implementation::samples_per_second, switch_assert, SWITCH_CHANNEL_LOG, SWITCH_CODEC_FLAG_FREE_POOL, SWITCH_CODEC_FLAG_READY, switch_core_memory_pool_get_data(), switch_core_new_memory_pool, switch_core_strdup, switch_loadable_module_get_codec_interface(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, switch_mutex_init(), SWITCH_MUTEX_NESTED, switch_set_flag, SWITCH_STATUS_GENERR, SWITCH_STATUS_NOTIMPL, SWITCH_STATUS_SUCCESS, and UNPROTECT_INTERFACE.
Referenced by main(), and switch_core_media_set_codec().
switch_status_t switch_core_codec_parse_fmtp | ( | const char * | codec_name, |
const char * | fmtp, | ||
uint32_t | rate, | ||
switch_codec_fmtp_t * | codec_fmtp | ||
) |
Definition at line 578 of file switch_core_codec.c.
References memset(), switch_codec_interface::parse_fmtp, switch_loadable_module_get_codec_interface(), SWITCH_STATUS_FALSE, UNPROTECT_INTERFACE, and zstr.
Referenced by add_audio_codec(), and switch_core_media_negotiate_sdp().
switch_status_t switch_core_codec_reset | ( | switch_codec_t * | codec | ) |
Definition at line 601 of file switch_core_codec.c.
References switch_assert, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_session_read_frame(), and switch_core_session_write_frame().
switch_codec_t* switch_core_session_get_effective_read_codec | ( | _In_ switch_core_session_t * | session | ) |
Retrieve the effevtive read codec from a given session.
session | session to retrieve from |
switch_codec_t* switch_core_session_get_effective_write_codec | ( | _In_ switch_core_session_t * | session | ) |
Retrieve the effevtive write codec from a given session.
session | session to retrieve from |
switch_codec_t* switch_core_session_get_read_codec | ( | _In_ switch_core_session_t * | session | ) |
Retrieve the read codec from a given session.
session | session to retrieve from |
Referenced by setup_ringback(), switch_channel_test_ready(), switch_core_session_outgoing_channel(), switch_ivr_activate_unicast(), switch_ivr_delay_echo(), switch_ivr_displace_session(), switch_ivr_inband_dtmf_generate_session(), switch_ivr_park(), switch_ivr_play_file(), switch_ivr_record_session(), and switch_ivr_wait_for_answer().
switch_status_t switch_core_session_get_read_impl | ( | switch_core_session_t * | session, |
switch_codec_implementation_t * | impp | ||
) |
Definition at line 317 of file switch_core_codec.c.
References memset(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by audio_bridge_thread(), early_thread_run(), inband_dtmf_generate_callback(), inherit_codec(), preprocess_callback(), record_callback(), recording_thread(), session_audio_callback(), setup_ringback(), switch_channel_event_set_basic_data(), switch_core_media_bug_add(), switch_core_media_bug_read(), switch_core_session_get_real_read_impl(), switch_core_session_set_codec_slin(), switch_core_session_wait_for_video_input_params(), switch_ivr_collect_digits_count(), switch_ivr_delay_echo(), switch_ivr_detect_speech_init(), switch_ivr_displace_session(), switch_ivr_eavesdrop_session(), switch_ivr_gentones(), switch_ivr_inband_dtmf_session(), switch_ivr_insert_file(), switch_ivr_originate(), switch_ivr_park(), switch_ivr_play_file(), switch_ivr_preprocess_session(), switch_ivr_record_file(), switch_ivr_record_session(), switch_ivr_session_audio(), switch_ivr_sleep(), switch_ivr_sound_test(), switch_ivr_speak_text(), switch_ivr_tone_detect_session(), and switch_ivr_wait_for_silence().
switch_status_t switch_core_session_get_real_read_impl | ( | switch_core_session_t * | session, |
switch_codec_implementation_t * | impp | ||
) |
Definition at line 329 of file switch_core_codec.c.
References switch_core_session_get_read_impl(), and SWITCH_STATUS_SUCCESS.
switch_codec_t* switch_core_session_get_video_read_codec | ( | _In_ switch_core_session_t * | session | ) |
Retrieve the video_read codec from a given session.
session | session to retrieve from |
Referenced by switch_core_session_outgoing_channel().
switch_status_t switch_core_session_get_video_read_impl | ( | switch_core_session_t * | session, |
switch_codec_implementation_t * | impp | ||
) |
Definition at line 351 of file switch_core_codec.c.
References memset(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by inherit_codec().
switch_codec_t* switch_core_session_get_video_write_codec | ( | _In_ switch_core_session_t * | session | ) |
Retrieve the video_write codec from a given session.
session | session to retrieve from |
Referenced by switch_core_session_write_video_frame().
switch_status_t switch_core_session_get_video_write_impl | ( | switch_core_session_t * | session, |
switch_codec_implementation_t * | impp | ||
) |
Definition at line 363 of file switch_core_codec.c.
References memset(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_codec_t* switch_core_session_get_write_codec | ( | _In_ switch_core_session_t * | session | ) |
Retrieve the write codec from a given session.
session | session to retrieve from |
Referenced by setup_ringback(), and switch_channel_test_ready().
switch_status_t switch_core_session_get_write_impl | ( | switch_core_session_t * | session, |
switch_codec_implementation_t * | impp | ||
) |
Definition at line 339 of file switch_core_codec.c.
References memset(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by setup_ringback(), switch_channel_event_set_basic_data(), and switch_core_media_bug_add().
void switch_core_session_lock_codec_read | ( | _In_ switch_core_session_t * | session | ) |
Referenced by switch_core_media_set_codec().
void switch_core_session_lock_codec_write | ( | _In_ switch_core_session_t * | session | ) |
Referenced by switch_core_media_set_codec().
switch_status_t switch_core_session_set_read_codec | ( | _In_ switch_core_session_t * | session, |
switch_codec_t * | codec | ||
) |
Assign the read codec to a given session.
session | session to add the codec to |
codec | the codec to add |
Referenced by early_thread_run(), setup_ringback(), switch_core_session_reset(), switch_core_session_set_codec_slin(), switch_ivr_eavesdrop_session(), switch_ivr_record_file(), switch_ivr_wait_for_answer(), and switch_ivr_wait_for_silence().
switch_status_t switch_core_session_set_real_read_codec | ( | _In_ switch_core_session_t * | session, |
switch_codec_t * | codec | ||
) |
Assign the original read codec to a given session. This is the read codec used by an endpoint.
session | session to add the codec to |
codec | the codec to add |
Referenced by switch_core_media_set_codec().
switch_status_t switch_core_session_set_video_read_codec | ( | _In_ switch_core_session_t * | session, |
switch_codec_t * | codec | ||
) |
Assign the video_read codec to a given session.
session | session to add the codec to |
codec | the codec to add |
Referenced by switch_core_media_set_video_codec().
switch_status_t switch_core_session_set_video_write_codec | ( | _In_ switch_core_session_t * | session, |
switch_codec_t * | codec | ||
) |
Assign the video_write codec to a given session.
session | session to add the codec to |
codec | the codec to add |
Referenced by switch_core_media_set_video_codec().
switch_status_t switch_core_session_set_write_codec | ( | _In_ switch_core_session_t * | session, |
switch_codec_t * | codec | ||
) |
Assign the write codec to a given session.
session | session to add the codec to |
codec | the codec to add |
Referenced by switch_core_media_set_codec().
void switch_core_session_unlock_codec_read | ( | _In_ switch_core_session_t * | session | ) |
Referenced by switch_core_media_set_codec().
void switch_core_session_unlock_codec_write | ( | _In_ switch_core_session_t * | session | ) |
Referenced by switch_core_media_set_codec().
void switch_core_session_unset_read_codec | ( | _In_ switch_core_session_t * | session | ) |
Referenced by switch_media_handle_destroy().
void switch_core_session_unset_write_codec | ( | _In_ switch_core_session_t * | session | ) |
Referenced by switch_media_handle_destroy().