Main Page | Modules | Data Structures | Directories | Data Fields | Related Pages

rte_context_class Struct Reference
[Backend Interface]


Data Fields

rte_context_classnext
rte_context_info_public
rte_context *(* _new )(rte_context_class *, char **errstr)
void(* _delete )(rte_context *)
rte_option_info *(* context_option_enum )(rte_context *, unsigned int)
rte_bool(* context_option_get )(rte_context *, const char *, rte_option_value *)
rte_bool(* context_option_set )(rte_context *, const char *, va_list)
char *(* context_option_print )(rte_context *, const char *, va_list)
rte_codec_info *(* codec_enum )(rte_context *, unsigned int)
rte_codec *(* codec_get )(rte_context *, rte_stream_type, unsigned int)
rte_codec *(* codec_set )(rte_context *, const char *, rte_stream_type, unsigned int)
rte_option_info *(* codec_option_enum )(rte_codec *, unsigned int)
rte_bool(* codec_option_get )(rte_codec *, const char *, rte_option_value *)
rte_bool(* codec_option_set )(rte_codec *, const char *, va_list)
char *(* codec_option_print )(rte_codec *, const char *, va_list)
rte_bool(* parameters_set )(rte_codec *, rte_stream_parameters *)
rte_bool(* parameters_get )(rte_codec *, rte_stream_parameters *)
rte_bool(* set_input )(rte_codec *, rte_io_method, rte_buffer_callback read_cb, rte_buffer_callback unref_cb, unsigned int *queue_length)
rte_bool(* push_buffer )(rte_codec *codec, rte_buffer *buffer, rte_bool blocking)
rte_bool(* set_output )(rte_context *context, rte_buffer_callback write_cb, rte_seek_callback seek_cb)
rte_bool(* start )(rte_context *, double timestamp, rte_codec *sync_ref, rte_bool async)
rte_bool(* pause )(rte_context *, double timestamp)
rte_bool(* stop )(rte_context *, double timestamp)
void(* status )(rte_context *, rte_codec *, rte_status *, unsigned int size)

Detailed Description

Methods of a context. No fields may change while a context->_class is referencing this structure. Part of the backend interface.


Field Documentation

rte_context_class* rte_context_class::next
 

Backend use, list of context classes

rte_context_info* rte_context_class::_public
 

Backends can use this to store rte_context_info. The field is not directly accessed by the frontend.

rte_context*(* rte_context_class::_new)(rte_context_class *, char **errstr)
 

Allocate new rte_context instance. Returns all fields zero except rte_context->_class, ->state (RTE_STATE_NEW) and ->mutex (initialized). Context options are reset by the frontend.

When the allocation fails, return NULL and set errstr to a description of the problem for the user. Use rte_asprintf(). After the initialization of rte_context succeeded, the backend/context module shall call rte_error_printf() et al to store error strings.

void(* rte_context_class::_delete)(rte_context *)
 

Delete context and all data associated with it. Don't forget to uninitialize the mutex.

rte_option_info*(* rte_context_class::context_option_enum)(rte_context *, unsigned int)
 

All the context_option functions behave as their frontend counterparts, and they are collectively optional (NULL).

rte_codec_info*(* rte_context_class::codec_enum)(rte_context *, unsigned int)
 

The codec_enum, codec_get, codec_set functions behave as the frontend versions and are all mandatory.

rte_codec*(* rte_context_class::codec_set)(rte_context *, const char *, rte_stream_type, unsigned int)
 

Note either keyword and index (set/replace) or type and index (remove) are passed. Codec options are reset by the caller. When replacing a codec fails, the old one must remain unchanged.

rte_option_info*(* rte_context_class::codec_option_enum)(rte_codec *, unsigned int)
 

All the codec_option functions behave as the frontend versions. Using these hooks backends can override codec option calls. Individually optional, then the frontend calls the respective codec function directly.

rte_bool(* rte_context_class::parameters_set)(rte_codec *, rte_stream_parameters *)
 

All the parameters_set and parameters_get functions behave as the frontend versions. Using these hooks backends can override codec parameter calls. Individually optional, then the frontend calls the respective codec function directly. When neither the context nor the codec defines a parameters_get function and rte_codec->state is RTE_STATE_PARAM or higher, the frontend will access the rte_codec->params field directly.

rte_bool(* rte_context_class::set_input)(rte_codec *, rte_io_method, rte_buffer_callback read_cb, rte_buffer_callback unref_cb, unsigned int *queue_length)
 

The I/O functions set_input and push_buffer work as the codec versions. Both are optional, then the frontend calls the respective codec function directly.

rte_bool(* rte_context_class::set_output)(rte_context *context, rte_buffer_callback write_cb, rte_seek_callback seek_cb)
 

See rte_set_output_callback_slave().

rte_bool(* rte_context_class::start)(rte_context *, double timestamp, rte_codec *sync_ref, rte_bool async)
 

The start, pause and stop functions behave as their frontend versions. The pause function is not implemented yet, the other are mandatory.

void(* rte_context_class::status)(rte_context *, rte_codec *, rte_status *, unsigned int size)
 

When the codec parameter is NULL poll the context status, else the codec status. Only the first size bytes of rte_status shall be written, size is guaranteed to cover rte_status->valid. This function is optional.


Generated on Mon May 1 10:34:41 2006 for RTE Library by  doxygen 1.4.4