Context


Data Structures

struct  rte_context_info

Typedefs

typedef rte_context rte_context

Functions

rte_context_inforte_context_info_enum (unsigned int index)
rte_context_inforte_context_info_by_keyword (const char *keyword)
rte_context_inforte_context_info_by_context (rte_context *context)
rte_contextrte_context_new (const char *keyword, void *user_data, char **errstr)
void rte_context_delete (rte_context *context)
void * rte_context_user_data (rte_context *context)

Typedef Documentation

typedef struct rte_context rte_context

Opaque rte_context object. You can allocate an rte_context with rte_context_new().


Function Documentation

rte_context_info* rte_context_info_enum ( unsigned int  index  ) 

Parameters:
index Index into the context format table.
Enumerates available contexts (backends/file formats/multiplexers). You should start at index 0, incrementing.

Some codecs may depend on machine features such as SIMD instructions or the presence of certain libraries, thus the list can vary from session to session.

Returns:
Static pointer, data not to be freed, to a rte_context_info structure. NULL if the index is out of bounds.

rte_context_info* rte_context_info_by_keyword ( const char *  keyword  ) 

Parameters:
keyword Context format identifier as in rte_context_info and rte_context_new().
Similar to rte_context_info_enum(), but this function attempts to find a context info by keyword.

Returns:
Static pointer to a rte_context_info structure, NULL if the named context format has not been found.

rte_context_info* rte_context_info_by_context ( rte_context context  ) 

Parameters:
context Initialized rte_context as returned by rte_context_new().
Returns the context info for the given context.

Returns:
Static pointer to a rte_context_info structure, NULL if the context is NULL.

rte_context* rte_context_new ( const char *  keyword,
void *  user_data,
char **  errstr 
)

Parameters:
keyword Context format identifier as in rte_context_info.
user_data Pointer stored in the context, can be retrieved with rte_context_user_data().
errstr If non-zero and the function fails, a pointer to an error description will be stored here. You must free() this string when no longer needed.
Creates a new rte context encoding files in the format specified by keyword. As a special service you can initialize context options by appending to the keyword like this:

 rte_context_new ("keyword; quality=75.5, comment=\"example\"", NULL, NULL);  

RTE is thread aware: Multiple threads can allocate contexts but sharing the same context between threads is not safe unless you implement your own mutual exclusion mechanism.

Returns:
Pointer to a newly allocated rte_context structure, which must be freed by calling rte_context_delete(). NULL is returned when the named context format is unavailable, the option string or option values are incorrect or some other error occurred. See also rte_errstr().

void rte_context_delete ( rte_context context  ) 

Parameters:
context Initialized rte_context previously allocated with rte_context_new().
This function stops encoding if active, then frees all resources associated with the context.

void* rte_context_user_data ( rte_context context  ) 

Parameters:
context Initialized rte_context as returned by rte_context_new().
Retrieves the pointer stored in the user data field of the context.

Returns:
User pointer.


Generated on Wed May 30 20:06:24 2007 for RTE Library by  doxygen 1.5.2