rte.c
RTE consists of four layers:
- Frontend
- Backend
- Context
- Codec
The frontend code implements the interface to RTE clients, hiding all implementation details. It does some housekeeping, sanity checking on client input, and provides helper functions for backends.
The frontend maintains multiple backends, possibly through use of plugins, which implement most of the actual RTE functionality on top of the respective compression library or program. That includes for example missing UI functions or backend specific implementation of the RTE i/o functions.
Context and codec definitions are cleanly separated, so the code can be kept in isolated modules or merged into context or backend modules.
The rte_context and rte_codec structure are inaccessible to the client and shall be used by the backend as documented. The rte_backend_class, rte_context_class and rte_codec_class define the interface of the respective layer to higher layers.
- Each backend must support at least one class of context (i. e. file format) and one codec.
- The backend must be able to allocate multiple instances of contexts and codecs, although no more than one context needs to encode at a time.
- Context and codec options are optional.
- Each codec must implement input stream parameter negotiation, even if the parameters are constant.
- Each codec must implement at least the callback-master input method.
- Status report is optional.
- All functions which can fail should leave an error description with rte_error_printf() or other helper functions, in a language suitable for a user interface.
- Labels, tooltips, menu items and error messages should be internationalized with GNU gettext. Use the _() etc. macros defined in rtepriv.h.
Put each backend into a separate directory under rte/. The directory name goes into rte/Makefile.am. A backend switch, the Makefile.am's to be built and environment checks go into rte/configure.in. Take ffmpeg as example. In rte/src, add any backend object libs to Makefile.am, extend the backends[] array in context.c.
Backend files #include "config.h"
to get configure definitions and #include "rtepriv.h"
to get all RTE definitions.
For test code see the rte/test directory. Support is available at zapping-misc@lists.sourceforge.net.
Generated on Wed Apr 27 17:00:25 2005 for RTE Library by
1.4.2