1 #ifndef INCLUDED_MVELIB_H
2 #define INCLUDED_MVELIB_H
9 extern mve_cb_Read mve_read;
10 extern mve_cb_Alloc mve_alloc;
11 extern mve_cb_Free mve_free;
12 extern mve_cb_ShowFrame mve_showframe;
13 extern mve_cb_SetPalette mve_setpalette;
16 * structure for maintaining info on a MVEFILE stream
18 typedef struct MVEFILE
21 unsigned char *cur_chunk;
30 MVEFILE *mvefile_open(void *stream);
35 void mvefile_close(MVEFILE *movie);
38 * get size of next segment in chunk (-1 if no more segments in chunk)
40 int mvefile_get_next_segment_size(MVEFILE *movie);
43 * get type of next segment in chunk (0xff if no more segments in chunk)
45 unsigned char mvefile_get_next_segment_major(MVEFILE *movie);
48 * get subtype (version) of next segment in chunk (0xff if no more segments in
51 unsigned char mvefile_get_next_segment_minor(MVEFILE *movie);
54 * see next segment (return NULL if no next segment)
56 unsigned char *mvefile_get_next_segment(MVEFILE *movie);
59 * advance to next segment
61 void mvefile_advance_segment(MVEFILE *movie);
64 * fetch the next chunk (return 0 if at end of stream)
66 int mvefile_fetch_next_chunk(MVEFILE *movie);
69 * callback for segment type
71 typedef int (*MVESEGMENTHANDLER)(unsigned char major, unsigned char minor, unsigned char *data, int len, void *context);
74 * structure for maintaining an MVE stream
76 typedef struct MVESTREAM
80 MVESEGMENTHANDLER handlers[32];
86 MVESTREAM *mve_open(void *stream);
91 void mve_close(MVESTREAM *movie);
96 void mve_reset(MVESTREAM *movie);
99 * set segment type handler
101 void mve_set_handler(MVESTREAM *movie, unsigned char major, MVESEGMENTHANDLER handler);
104 * set segment handler context
106 void mve_set_handler_context(MVESTREAM *movie, void *context);
111 int mve_play_next_chunk(MVESTREAM *movie);
113 #endif /* INCLUDED_MVELIB_H */