Backend Interface


Data Structures

struct  rte_context
struct  rte_context_class
struct  rte_backend_class

Typedefs

typedef rte_context_class rte_context_class
typedef rte_backend_class rte_backend_class

Enumerations

enum  rte_state {
  RTE_STATE_NEW = 0,
  RTE_STATE_PARAM,
  RTE_STATE_READY,
  RTE_STATE_RUNNING,
  RTE_STATE_PAUSED
}
enum  rte_io_method {
  RTE_CALLBACK_MASTER = 1,
  RTE_CALLBACK_SLAVE,
  RTE_PUSH_MASTER,
  RTE_PUSH_SLAVE,
  RTE_FIFO,
  RTE_FILE,
  RTE_STDIO,
  RTE_DISCARD
}

Functions

void rte_unknown_option (rte_context *context, rte_codec *codec, const char *keyword)
void rte_invalid_option (rte_context *context, rte_codec *codec, const char *keyword,...)
void rte_asprintf (char **errstr, const char *templ,...)
char * rte_strdup (rte_context *context, char **d, const char *s)
unsigned int rte_closest_int (const int *vec, unsigned int len, int val)
unsigned int rte_closest_double (const double *vec, unsigned int len, double val)
rte_bool rte_option_string (rte_context *context, rte_codec *codec, const char *optstr)
static_inline int rte_closest_int_val (const int *vec, unsigned int len, int val)
static_inline double rte_closest_double_val (const double *vec, unsigned int len, double val)
static_inline void rte_error_reset (rte_context *context)

Variables

const char _rte_intl_domainname []

Detailed Description

These, together with the public RTE structures, are the definitions of the RTE backend interface from rtepriv.h. Only backends use this, not RTE clients.

Typedef Documentation

typedef struct rte_context_class rte_context_class
 

Part of the backend interface.


Enumeration Type Documentation

enum rte_state
 

Context or codec state. The state field in rte_context and rte_codec must be set by the context and codec functions as documented below.

Enumerator:
RTE_STATE_NEW  Set on success of: codec_class->_new() codec_class->option_set() context_class->_new() context_class->option_set() context_class->stop()
RTE_STATE_PARAM  On success of: codec_class->parameters_set()
RTE_STATE_READY  On success of: codec_class->set_input() context_class->set_output()
RTE_STATE_RUNNING  On success of: context_class->start() (-> stop, -> pause)
RTE_STATE_PAUSED  On success of: context_class->pause() (-> start, -> stop)

enum rte_io_method
 

I/O mode.

Enumerator:
RTE_CALLBACK_MASTER  rte_set_input_callback_master()
RTE_CALLBACK_SLAVE  rte_set_input_callback_slave()
RTE_PUSH_MASTER  rte_set_input_push_master()
RTE_PUSH_SLAVE  rte_set_input_push_slave()
RTE_FIFO  To be defined
RTE_FILE  Used by frontend only
RTE_STDIO  Used by frontend only
RTE_DISCARD  Used by frontend only


Function Documentation

void rte_unknown_option rte_context context,
rte_codec codec,
const char *  keyword
 

Parameters:
context Initialized rte_context as returned by rte_context_new().
codec Pointer to rte_codec if this refers to a codec option, NULL if context option.
keyword Keyword of the option, can be NULL or "".
RTE internal helper function for backends.

Sets the context error string.

void rte_invalid_option rte_context context,
rte_codec codec,
const char *  keyword,
  ...
 

Parameters:
context Initialized rte_context as returned by rte_context_new().
codec Pointer to rte_codec if this refers to a codec option, NULL if context option.
keyword Keyword of the option, can be NULL or "".
... If the option is known, the invalid data (int, double, char *).
RTE internal helper function for backends.

Sets the context error string.

void rte_asprintf char **  errstr,
const char *  templ,
  ...
 

Parameters:
errstr Place to store the allocated string or NULL.
templ See printf().
... See printf().
RTE internal helper function for backends.

Identical to GNU or BSD libc asprintf().

char* rte_strdup rte_context context,
char **  d,
const char *  s
 

Parameters:
context Initialized rte_context as returned by rte_context_new().
d If non-zero, store pointer to allocated string here. When *d is non-zero, free(*d) the old string first.
s String to be duplicated.
RTE internal helper function for backends.

Same as the libc strdup(), except for d argument and setting the context error string on failure.

Returns:
NULL on failure, pointer to malloc()ed string otherwise.

unsigned int rte_closest_int const int *  vec,
unsigned int  len,
int  val
 

Parameters:
vec Vector of int values.
len Length of the vector.
val Value to be compared.
RTE internal helper function for backends.

Find in a vector of int values the entry closest to val and return its index, 0 ... n.

Returns:
Index. Never fails.

unsigned int rte_closest_double const double *  vec,
unsigned int  len,
double  val
 

Parameters:
vec Vector of double values.
len Length of the vector.
val Value to be compared.
RTE internal helper function for backends.

Find in a vector of double values the entry closest to val and return its index, 0 ... n.

Returns:
Index. Never fails.


Generated on Fri Mar 17 20:30:04 2006 for RTE Library by  doxygen 1.4.6