Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

File Functions
[Core Library]


Defines

#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.

Functions

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_ uint8_t channels, _In_ uint32_t rate, _In_ unsigned int flags, _In_opt_ switch_memory_pool_t *pool)
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.
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.
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.
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.
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
switch_status_t switch_core_file_close (_In_ switch_file_handle_t *fh)
 Close an open file handle.


Define Documentation

#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.

Parameters:
_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)
Returns:
SWITCH_STATUS_SUCCESS if the file is opened
Note:
the loadable module used is chosen based on the file extension


Function Documentation

switch_status_t switch_core_file_close _In_ switch_file_handle_t fh  ) 
 

Close an open file handle.

Parameters:
fh the file handle to close
Returns:
SWITCH_STATUS_SUCCESS if the file handle was closed

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

Parameters:
fh the file handle to get data from
col the enum of the col name
string pointer to the string to fetch
Returns:
SWITCH_STATUS_SUCCESS with cur_pos adjusted to new position

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.

Parameters:
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
Returns:
SWITCH_STATUS_SUCCESS with len adjusted to the bytes read if successful

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.

Parameters:
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)
Returns:
SWITCH_STATUS_SUCCESS with cur_pos adjusted to new position

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.

Parameters:
fh the file handle to set data to
col the enum of the col name
string the string to add
Returns:
SWITCH_STATUS_SUCCESS with cur_pos adjusted to new position

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.

Parameters:
fh the file handle to write to
data the buffer to write
len the amount of data to write from the buffer
Returns:
SWITCH_STATUS_SUCCESS with len adjusted to the bytes written if successful

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_ uint8_t  channels,
_In_ uint32_t  rate,
_In_ unsigned int  flags,
_In_opt_ switch_memory_pool_t pool
 


Generated on Fri Oct 10 11:24:33 2008 for FreeSWITCH by  doxygen 1.3.9.1