FreeSWITCH API Documentation
1.7.0
|
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 1865 of file switch_core.h.
Referenced by main(), setup_ringback(), switch_ivr_displace_session(), switch_ivr_insert_file(), switch_ivr_play_file(), switch_ivr_record_file(), switch_ivr_record_session(), 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(), setup_ringback(), switch_ivr_displace_session(), switch_ivr_insert_file(), switch_ivr_originate(), switch_ivr_play_file(), switch_ivr_record_file(), switch_ivr_record_session(), 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 743 of file switch_core_file.c.
References 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().
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 switch_ivr_play_file().
switch_bool_t switch_core_file_has_video | ( | switch_file_handle_t * | fh, |
switch_bool_t | CHECK_OPEN | ||
) |
Definition at line 503 of file switch_core_file.c.
References SWITCH_FALSE, SWITCH_FILE_FLAG_VIDEO, SWITCH_FILE_OPEN, switch_test_flag, and SWITCH_TRUE.
Referenced by recording_thread(), switch_core_media_set_video_file(), switch_ivr_play_file(), switch_ivr_record_file(), and switch_ivr_record_session().
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_insert_file(), switch_ivr_originate(), switch_ivr_play_file(), switch_ivr_record_file(), 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 606 of file switch_core_file.c.
References 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(), 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(), and switch_ivr_record_session().
switch_status_t switch_core_file_truncate | ( | switch_file_handle_t * | fh, |
int64_t | offset | ||
) |
Definition at line 713 of file switch_core_file.c.
References 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(), 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 | ||
) |