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(const char *filename);
23 MVEFILE *mvefile_open_filehandle(int filehandle);
28 void mvefile_close(MVEFILE *movie);
29 void mvefile_close_filehandle(MVEFILE *movie);
32 * get size of next segment in chunk (-1 if no more segments in chunk)
34 int mvefile_get_next_segment_size(MVEFILE *movie);
37 * get type of next segment in chunk (0xff if no more segments in chunk)
39 unsigned char mvefile_get_next_segment_major(MVEFILE *movie);
42 * get subtype (version) of next segment in chunk (0xff if no more segments in
45 unsigned char mvefile_get_next_segment_minor(MVEFILE *movie);
48 * see next segment (return NULL if no next segment)
50 unsigned char *mvefile_get_next_segment(MVEFILE *movie);
53 * advance to next segment
55 void mvefile_advance_segment(MVEFILE *movie);
58 * fetch the next chunk (return 0 if at end of stream)
60 int mvefile_fetch_next_chunk(MVEFILE *movie);
63 * callback for segment type
65 typedef int (*MVESEGMENTHANDLER)(unsigned char major, unsigned char minor, unsigned char *data, int len, void *context);
68 * structure for maintaining an MVE stream
70 typedef struct MVESTREAM
74 MVESEGMENTHANDLER handlers[32];
80 MVESTREAM *mve_open(const char *filename);
81 MVESTREAM *mve_open_filehandle(int filehandle);
86 void mve_close(MVESTREAM *movie);
87 void mve_close_filehandle(MVESTREAM *movie);
92 void mve_reset(MVESTREAM *movie);
95 * set segment type handler
97 void mve_set_handler(MVESTREAM *movie, unsigned char major, MVESEGMENTHANDLER handler);
100 * set segment handler context
102 void mve_set_handler_context(MVESTREAM *movie, void *context);
107 int mve_play_next_chunk(MVESTREAM *movie);
109 #endif /* INCLUDED_MVELIB_H */