RTS API Documentation
1.10.11
|
Macros | |
#define | switch_core_file_open(_fh, _file_path, _channels, _rate, _flags, _pool) switch_core_perform_file_open(__FILE__, __SWITCH_FUNC__, __LINE__, _fh, _file_path, _channels, _rate, _flags, _pool) |
Open a media file using file format modules. More... | |
#define switch_core_file_open | ( | _fh, | |
_file_path, | |||
_channels, | |||
_rate, | |||
_flags, | |||
_pool | |||
) | switch_core_perform_file_open(__FILE__, __SWITCH_FUNC__, __LINE__, _fh, _file_path, _channels, _rate, _flags, _pool) |
Open a media file using file format modules.
_fh | a file handle to use |
_file_path | the path to the file |
_channels | the number of channels |
_rate | the sample rate |
_flags | read/write flags |
_pool | the pool to use (NULL for new pool) |
Definition at line 1963 of file switch_core.h.
Referenced by main(), setup_ringback(), switch_ivr_detect_audio(), switch_ivr_detect_silence(), switch_ivr_displace_session(), switch_ivr_insert_file(), switch_ivr_play_file(), switch_ivr_record_file_event(), switch_ivr_record_session_event(), switch_ivr_wait_for_answer(), and switch_ivr_wait_for_silence().
switch_status_t switch_core_file_close | ( | _In_ switch_file_handle_t * | fh | ) |
Close an open file handle.
fh | the file handle to close |
Referenced by main(), read_displace_callback(), record_callback(), record_helper_destroy(), setup_ringback(), switch_ivr_detect_audio(), switch_ivr_detect_silence(), switch_ivr_displace_session(), switch_ivr_insert_file(), switch_ivr_originate(), switch_ivr_play_file(), switch_ivr_record_file_event(), switch_ivr_record_session_event(), switch_ivr_wait_for_answer(), switch_ivr_wait_for_silence(), and write_displace_callback().
switch_status_t switch_core_file_command | ( | switch_file_handle_t * | fh, |
switch_file_command_t | command | ||
) |
Definition at line 906 of file switch_core_file.c.
References switch_file_interface::file_command, switch_file_handle::file_interface, switch_file_handle::flag_mutex, switch_file_handle::pre_buffer, SCFC_FLUSH_AUDIO, switch_assert, switch_buffer_zero(), SWITCH_FILE_OPEN, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, and switch_test_flag.
Referenced by switch_ivr_process_fh(), and switch_ivr_record_file_event().
switch_status_t switch_core_file_get_string | ( | _In_ switch_file_handle_t * | fh, |
switch_audio_col_t | col, | ||
const char ** | string | ||
) |
get metadata of the desired string
fh | the file handle to get data from |
col | the enum of the col name |
string | pointer to the string to fetch |
Referenced by record_callback(), switch_ivr_play_file(), and switch_ivr_record_file_event().
switch_status_t switch_core_file_handle_dup | ( | switch_file_handle_t * | oldfh, |
switch_file_handle_t ** | newfh, | ||
switch_memory_pool_t * | pool | ||
) |
Duplicates a file handle using another pool.
oldfh | the file handle to duplicate |
newfh | pointer to assign new file handle to |
pool | the pool to use (NULL for new pool) |
Definition at line 982 of file switch_core_file.c.
References switch_file_handle::channels, DUP_CHECK, switch_file_handle::flag_mutex, switch_file_handle::memory_pool, pool, switch_file_handle::pre_buffer_data, switch_file_handle::pre_buffer_datalen, switch_assert, switch_clear_flag, switch_core_alloc, switch_core_destroy_memory_pool, switch_core_new_memory_pool, SWITCH_FILE_FLAG_FREE_POOL, switch_goto_status, switch_mutex_init(), SWITCH_MUTEX_NESTED, switch_set_flag, SWITCH_STATUS_MEMERR, and SWITCH_STATUS_SUCCESS.
Referenced by switch_ivr_record_session_event().
switch_bool_t switch_core_file_has_video | ( | switch_file_handle_t * | fh, |
switch_bool_t | CHECK_OPEN | ||
) |
Definition at line 619 of file switch_core_file.c.
References SWITCH_FALSE, SWITCH_FILE_FLAG_VIDEO, SWITCH_FILE_OPEN, switch_test_flag, and SWITCH_TRUE.
Referenced by record_callback(), recording_thread(), switch_core_media_set_video_file(), switch_ivr_play_file(), switch_ivr_record_file_event(), and switch_ivr_record_session_event().
switch_status_t switch_core_file_pre_close | ( | _In_ switch_file_handle_t * | fh | ) |
Pre close an open file handle, then can get file size etc., no more wirte to the file.
fh | the file handle to close |
Referenced by record_callback(), and switch_ivr_record_file_event().
switch_status_t switch_core_file_read | ( | _In_ switch_file_handle_t * | fh, |
void * | data, | ||
switch_size_t * | len | ||
) |
Read media from a file handle.
fh | the file handle to read from (must be initilized by you memset all 0 for read, fill in channels and rate for write) |
data | the buffer to read the data to |
len | the max size of the buffer |
Referenced by main(), read_displace_callback(), switch_ivr_detect_audio(), switch_ivr_detect_silence(), switch_ivr_insert_file(), switch_ivr_originate(), switch_ivr_play_file(), switch_ivr_record_file_event(), switch_ivr_wait_for_answer(), switch_ivr_wait_for_silence(), and write_displace_callback().
switch_status_t switch_core_file_read_video | ( | switch_file_handle_t * | fh, |
switch_frame_t * | frame, | ||
switch_video_read_flag_t | flags | ||
) |
Definition at line 755 of file switch_core_file.c.
References switch_file_handle::file_interface, switch_file_interface::file_read_video, switch_assert, switch_cond_next(), SWITCH_FILE_OPEN, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, and switch_test_flag.
Referenced by video_write_thread().
switch_status_t switch_core_file_seek | ( | _In_ switch_file_handle_t * | fh, |
unsigned int * | cur_pos, | ||
int64_t | samples, | ||
int | whence | ||
) |
Seek a position in a file.
fh | the file handle to seek |
cur_pos | the current position in the file |
samples | the amount of samples to seek from the beginning of the file |
whence | the indicator (see traditional seek) |
Referenced by read_displace_callback(), switch_ivr_insert_file(), switch_ivr_originate(), switch_ivr_play_file(), switch_ivr_process_fh(), switch_ivr_record_file_event(), switch_ivr_wait_for_answer(), and write_displace_callback().
switch_status_t switch_core_file_set_string | ( | _In_ switch_file_handle_t * | fh, |
switch_audio_col_t | col, | ||
const char * | string | ||
) |
Set metadata to the desired string.
fh | the file handle to set data to |
col | the enum of the col name |
string | the string to add |
Referenced by switch_ivr_record_file_event(), and switch_ivr_record_session_event().
switch_status_t switch_core_file_truncate | ( | switch_file_handle_t * | fh, |
int64_t | offset | ||
) |
Definition at line 876 of file switch_core_file.c.
References switch_file_handle::buffer, switch_file_handle::file_interface, switch_file_interface::file_truncate, switch_file_handle::pos, switch_file_handle::pre_buffer, switch_file_handle::samples_out, switch_assert, switch_buffer_zero(), SWITCH_FILE_FLAG_WRITE, SWITCH_FILE_OPEN, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_test_flag.
Referenced by switch_ivr_process_fh().
switch_status_t switch_core_file_write | ( | _In_ switch_file_handle_t * | fh, |
void * | data, | ||
switch_size_t * | len | ||
) |
Write media to a file handle.
fh | the file handle to write to |
data | the buffer to write |
len | the amount of data to write from the buffer |
Referenced by main(), record_callback(), recording_thread(), switch_ivr_insert_file(), switch_ivr_record_file_event(), and teletone_handler().
switch_status_t switch_core_file_write_video | ( | _In_ switch_file_handle_t * | fh, |
switch_frame_t * | frame | ||
) |
Write media to a file handle.
fh | the file handle to write to |
data | the buffer to write |
len | the amount of data to write from the buffer |
Referenced by record_callback(), and video_helper_thread().
switch_status_t switch_core_perform_file_open | ( | const char * | file, |
const char * | func, | ||
int | line, | ||
_In_ switch_file_handle_t * | fh, | ||
_In_opt_z_ const char * | file_path, | ||
_In_ uint32_t | channels, | ||
_In_ uint32_t | rate, | ||
_In_ unsigned int | flags, | ||
_In_opt_ switch_memory_pool_t * | pool | ||
) |