2 * $Logfile: /Freespace2/include/mvelib.h $
7 * Lib functions for MVE player
10 * Revision 1.2 2005/03/29 07:50:34 taylor
11 * Update to newest movie code with much better video support and audio support from
12 * Pierre Willenbrock. Movies are enabled always now (no longer a build option)
13 * and but can be skipped with the "--nomovies" or "-n" cmdline options.
21 #ifndef INCLUDED_MVELIB_H
22 #define INCLUDED_MVELIB_H
28 // structure for maintaining info on a MVEFILE stream
29 typedef struct MVEFILE
39 MVEFILE *mvefile_open(const char *filename);
42 void mvefile_close(MVEFILE *movie);
44 // get size of next segment in chunk (-1 if no more segments in chunk)
45 int mvefile_get_next_segment_size(MVEFILE *movie);
47 // get type of next segment in chunk (0xff if no more segments in chunk)
48 ubyte mvefile_get_next_segment_major(MVEFILE *movie);
50 // get subtype (version) of next segment in chunk (0xff if no more segments in chunk)
51 ubyte mvefile_get_next_segment_minor(MVEFILE *movie);
53 // see next segment (return NULL if no next segment)
54 ubyte *mvefile_get_next_segment(MVEFILE *movie);
56 // advance to next segment
57 void mvefile_advance_segment(MVEFILE *movie);
59 // fetch the next chunk (return 0 if at end of stream)
60 int mvefile_fetch_next_chunk(MVEFILE *movie);
62 // structure for maintaining an MVE stream
63 typedef struct MVESTREAM
69 MVESTREAM *mve_open(const char *filename);
71 // close an MVE stream
72 void mve_close(MVESTREAM *movie);
75 int mve_play_next_chunk(MVESTREAM *movie);
77 // basic movie playing functions
78 void mve_init(MVESTREAM *mve);
79 void mve_play(MVESTREAM *mve);
83 short mve_get_short(ubyte *data);
84 ushort mve_get_ushort(ubyte *data);
85 int mve_get_int(ubyte *data);
87 // callbacks for data handling
89 void mve_audio_createbuf(ubyte minor, ubyte *data);
90 int mve_audio_data(ubyte major, ubyte *data);
91 void mve_audio_play();
93 int mve_video_createbuf(ubyte minor, ubyte *data);
94 int mve_video_init(ubyte *data);
95 void mve_video_data(ubyte *data, int len);
96 void mve_video_codemap(ubyte *data, int len);
97 void mve_video_display();
100 void mve_end_chunk();
101 int mve_timer_create(ubyte *data);
103 // special audio functions
104 void mveaudio_uncompress(unsigned char *buffer, unsigned char *data, int length);
107 #endif /* INCLUDED_MVELIB_H */