]> icculus.org git repositories - taylor/freespace2.git/blob - include/mvelib.h
rendering functions mostly done; more complete shader setup
[taylor/freespace2.git] / include / mvelib.h
1 /*
2  * $Logfile: /Freespace2/include/mvelib.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Lib functions for MVE player
8  *
9  * $Log$
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.
14  *
15  *
16  *
17  * $NoKeywords: $
18  *
19  */
20  
21 #ifndef INCLUDED_MVELIB_H
22 #define INCLUDED_MVELIB_H
23
24 #include "pstypes.h"
25
26 struct CFILE;
27
28 // structure for maintaining info on a MVEFILE stream
29 typedef struct MVEFILE
30 {
31         CFILE   *stream;
32         ubyte   *cur_chunk;
33         int             buf_size;
34         int             cur_fill;
35         int             next_segment;
36 } MVEFILE;
37
38 // open a .MVE file
39 MVEFILE *mvefile_open(const char *filename);
40
41 // close a .MVE file
42 void mvefile_close(MVEFILE *movie);
43
44 // get size of next segment in chunk (-1 if no more segments in chunk)
45 int mvefile_get_next_segment_size(MVEFILE *movie);
46
47 // get type of next segment in chunk (0xff if no more segments in chunk)
48 ubyte mvefile_get_next_segment_major(MVEFILE *movie);
49
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);
52
53 // see next segment (return NULL if no next segment)
54 ubyte *mvefile_get_next_segment(MVEFILE *movie);
55
56 // advance to next segment
57 void mvefile_advance_segment(MVEFILE *movie);
58
59 // fetch the next chunk (return 0 if at end of stream)
60 int mvefile_fetch_next_chunk(MVEFILE *movie);
61
62 // structure for maintaining an MVE stream
63 typedef struct MVESTREAM
64 {
65         MVEFILE         *movie;
66 } MVESTREAM;
67
68 // open an MVE stream
69 MVESTREAM *mve_open(const char *filename);
70
71 // close an MVE stream
72 void mve_close(MVESTREAM *movie);
73
74 // play next chunk
75 int mve_play_next_chunk(MVESTREAM *movie);
76
77 // basic movie playing functions
78 void mve_init(MVESTREAM *mve);
79 void mve_play(MVESTREAM *mve);
80 void mve_shutdown();
81
82 // utility functions
83 short mve_get_short(ubyte *data);
84 ushort mve_get_ushort(ubyte *data);
85 int mve_get_int(ubyte *data);
86
87 // callbacks for data handling
88 // audio
89 void mve_audio_createbuf(ubyte minor, ubyte *data);
90 int mve_audio_data(ubyte major, ubyte *data);
91 void mve_audio_play();
92 // video
93 int mve_video_createbuf(ubyte minor, ubyte *data);
94 void mve_video_data(ubyte *data, int len);
95 void mve_video_codemap(ubyte *data, int len);
96 void mve_video_display();
97 // misc
98 void mve_end_movie();
99 void mve_end_chunk();
100 int mve_timer_create(ubyte *data);
101
102 // special audio functions
103 void mveaudio_uncompress(unsigned char *buffer, unsigned char *data, int length);
104 typedef short mves;
105
106 #endif /* INCLUDED_MVELIB_H */