1 #ifndef INCLUDED_MVELIB_H
2 #define INCLUDED_MVELIB_H
8 * structure for maintaining info on a MVEFILE stream
10 typedef struct MVEFILE
13 unsigned char *cur_chunk;
22 MVEFILE *mvefile_open(int filehandle);
27 void mvefile_close(MVEFILE *movie);
30 * get size of next segment in chunk (-1 if no more segments in chunk)
32 int mvefile_get_next_segment_size(MVEFILE *movie);
35 * get type of next segment in chunk (0xff if no more segments in chunk)
37 unsigned char mvefile_get_next_segment_major(MVEFILE *movie);
40 * get subtype (version) of next segment in chunk (0xff if no more segments in
43 unsigned char mvefile_get_next_segment_minor(MVEFILE *movie);
46 * see next segment (return NULL if no next segment)
48 unsigned char *mvefile_get_next_segment(MVEFILE *movie);
51 * advance to next segment
53 void mvefile_advance_segment(MVEFILE *movie);
56 * fetch the next chunk (return 0 if at end of stream)
58 int mvefile_fetch_next_chunk(MVEFILE *movie);
61 * callback for segment type
63 typedef int (*MVESEGMENTHANDLER)(unsigned char major, unsigned char minor, unsigned char *data, int len, void *context);
66 * structure for maintaining an MVE stream
68 typedef struct MVESTREAM
72 MVESEGMENTHANDLER handlers[32];
78 MVESTREAM *mve_open(int filehandle);
83 void mve_close(MVESTREAM *movie);
86 * set segment type handler
88 void mve_set_handler(MVESTREAM *movie, unsigned char major, MVESEGMENTHANDLER handler);
91 * set segment handler context
93 void mve_set_handler_context(MVESTREAM *movie, void *context);
98 int mve_play_next_chunk(MVESTREAM *movie);
100 #endif /* INCLUDED_MVELIB_H */