2013-05-04 10:40:05 +00:00
# ifndef FTEPLUGIN
2016-07-12 00:40:13 +00:00
# ifndef VARGS
# define VARGS QDECL
# endif
2012-10-07 19:28:48 +00:00
typedef enum uploadfmt_e
{
TF_INVALID ,
TF_RGBA32 ,
TF_BGRA32 ,
TF_RGBX32 ,
2016-07-12 00:40:13 +00:00
TF_BGRX32 ,
TF_RGB24 ,
TF_BGR24
2012-10-07 19:28:48 +00:00
} uploadfmt_t ;
typedef struct
{
2016-07-12 00:40:13 +00:00
size_t structsize ;
const char * drivername ;
void * ( VARGS * createdecoder ) ( const char * name ) ;
qboolean ( VARGS * decodeframe ) ( void * ctx , qboolean nosound , qboolean forcevideo , double mediatime , void ( QDECL * uploadtexture ) ( void * ectx , uploadfmt_t fmt , int width , int height , void * data , void * palette ) , void * ectx ) ;
void ( VARGS * shutdown ) ( void * ctx ) ;
void ( VARGS * rewind ) ( void * ctx ) ;
2012-10-07 19:28:48 +00:00
//these are any interactivity functions you might want...
2016-07-12 00:40:13 +00:00
void ( VARGS * cursormove ) ( void * ctx , float posx , float posy ) ; //pos is 0-1
void ( VARGS * key ) ( void * ctx , int code , int unicode , int event ) ;
qboolean ( VARGS * setsize ) ( void * ctx , int width , int height ) ;
void ( VARGS * getsize ) ( void * ctx , int * width , int * height ) ;
void ( VARGS * changestream ) ( void * ctx , const char * streamname ) ;
2012-11-27 03:23:19 +00:00
2016-07-12 00:40:13 +00:00
size_t ( VARGS * gettext ) ( void * ctx , const char * field , char * out , size_t outlen ) ; //if out is null, returns required buffer size. returns 0 on failure / buffer too small
} media_decoder_funcs_t ;
2012-11-27 03:23:19 +00:00
typedef struct
{
2016-07-12 00:40:13 +00:00
size_t structsize ;
const char * drivername ;
const char * description ;
const char * defaultextension ;
void * ( VARGS * capture_begin ) ( char * streamname , int videorate , int width , int height , int * sndkhz , int * sndchannels , int * sndbits ) ;
void ( VARGS * capture_video ) ( void * ctx , void * data , int frame , int width , int height , enum uploadfmt fmt ) ;
void ( VARGS * capture_audio ) ( void * ctx , void * data , int bytes ) ;
void ( VARGS * capture_end ) ( void * ctx ) ;
2012-11-27 03:23:19 +00:00
} media_encoder_funcs_t ;
2013-05-04 10:40:05 +00:00
# endif