[Home]Export Modules/API

Difference (from prior minor revision) (no other diffs)

Changed: 8c8

Data exchange structure for modules



Data exchange structures




Changed: 16,18c16,25
int flag; // specifies context: TC_VIDEO for video
TC_AUDIO for audio
// or passes an integer to the module
int flag; /* specifies context: TC_VIDEO for video
* TC_AUDIO for audio
*
* or passes an integer to the module
*/

FILE *fd; /* file handle for input stream
* NULL if import module performs reading
* unused in export module
*/

Changed: 20,22c27
FILE *fd; // file handle for input stream
// NULL if import module performs reading
// unused in export module
int size; /* total amount of bytes in the buffer */

Changed: 24,26c29
int size; // total amount of bytes in the buffer

char *buffer; // pointer to data array with frame data
char *buffer; /* pointer to data array with frame data */

Changed: 32,43c35,38

int tc_export(int option, void *para1, void *para2);

exit codes: all handled by transcode
TC_EXPORT_UNKNOWN option not supported
TC_EXPORT_OK no error, hopefully the default
TC_EXPORT_ERROR a critical error occured

Input parameter



* option contains the requested action id
* para1/2 its actually meaning depends on option
tc_export
* Parameters int option, void *para1, void *para2
** option : contains the requested action id
** *para1/2 : its actually meaning depends on option

Changed: 45c40

Requested method



Requested method




Changed: 48,60c43,51

[1]



* option=TC_EXPORT_NAME
* para1=_transfer_t
* para2=NULL
; Requested action : Print out some general modules infos to stderr
:: and inherit transcode verbosity flag
:: (optional return capability flag)
; Status : Optional

[2]



* option=TC_EXPORT_INIT
* para1=_transfer_t
* para2=_vob_t

[1] option=TC_EXPORT_NAME



para1=_transfer_t
para2=NULL
; Requested action : Print out some general modules infos to stderr and inherit transcode verbosity flag (optional return capability flag)
; Status : Optional

[2] option=TC_EXPORT_INIT



para1=_transfer_t
para2=_vob_t

Changed: 62c53
; Status : Required
; Status : Required

Changed: 65,68c56,58

[3]



* option=TC_EXPORT_OPEN
* para1=_transfer_t
* para2=_vob_t

[3] option=TC_EXPORT_OPEN



para1=_transfer_t
para2=_vob_t

Changed: 70c60
; Status : Required
; Status : Required

Changed: 73,76c63,65

[4]



* option=TC_EXPORT_ENCODE
* para1=_transfer_t
* para2=NULL

[4] option=TC_EXPORT_ENCODE



para1=_transfer_t
para2=NULL

Changed: 78c67
; Status : Required
; Status : Required

Changed: 81,84c70,72

[5]



* option:TC_EXPORT_CLOSE
* para1=_transfer_t
* para2=NULL

[5] option:TC_EXPORT_CLOSE



para1=_transfer_t
para2=NULL

Changed: 86c74
; Status : Required
; Status : Required

Changed: 89,92c77,79

[6]



* option=TC_EXPORT_STOP
* para1=_transfer_t
* para2=NULL

[6] option=TC_EXPORT_STOP



para1=_transfer_t
para2=NULL

Changed: 94c81,93
; Status : Required
; Status : Required

Exit codes



The following are all handled by transcode, and should be used when returning from the above core function.

TC_EXPORT_UNKNOWN
option not supported

TC_EXPORT_OK
no error, hopefully the default

TC_EXPORT_ERROR
a critical error occured

EXPORT MODULE WRITING HOWTO

Some very short documentation on writing export modules for transcode

Include this

 #include "transcode.h"       //definition of vob_t and transfer_t structure

Data exchange structures

 typedef struct _vob_t {
 //see transcode.h for details
 } vob_t;
 
 typedef struct _transfer_t {
 
   int flag;            /* specifies context: TC_VIDEO for video 
                         *                    TC_AUDIO for audio
                         *
                         * or passes an integer to the module
                         */
 
   FILE *fd;            /* file handle for input stream   
                         * NULL if import module performs reading
                         * unused in export module
                         */
 
   int size;            /* total amount of bytes in the buffer */
 
   char *buffer;        /* pointer to data array with frame data */
 
 } transfer_t;

Single function interface

 tc_export

Requested method

transcode calls the following routines in this order for both export modules, i.e., first for video and then for the audio context flag set. An export module should in general be able to deal with audio and video and write it to a common file. But the interface is more general.

[1] option=TC_EXPORT_NAME

 para1=_transfer_t
 para2=NULL
Requested action
Print out some general modules infos to stderr and inherit transcode verbosity flag (optional return capability flag)
Status
Optional

[2] option=TC_EXPORT_INIT

 para1=_transfer_t
 para2=_vob_t
Requested action
Initialize the encoder
Status
Required

[3] option=TC_EXPORT_OPEN

 para1=_transfer_t
 para2=_vob_t
Requested action
Open outputfile
Status
Required

[4] option=TC_EXPORT_ENCODE

 para1=_transfer_t
 para2=NULL
Requested action
Use this frame data to encode the next frame in the sequence
Status
Required

[5] option:TC_EXPORT_CLOSE

 para1=_transfer_t
 para2=NULL
Requested action
Close open files
Status
Required

[6] option=TC_EXPORT_STOP

 para1=_transfer_t
 para2=NULL
Requested action
Stop the encoder, free memory and prepare for module removal
Status
Required

Exit codes

The following are all handled by transcode, and should be used when returning from the above core function.

 TC_EXPORT_UNKNOWN
option not supported

 TC_EXPORT_OK
no error, hopefully the default

 TC_EXPORT_ERROR
a critical error occured


Transcode Wiki | Export Modules | Recent Changes | Preferences
Password required to edit | View other revisions
Last edited September 3, 2005 12:50 pm by Monroe (diff)
Search: