mmfile.h

Go to the documentation of this file.
00001 #ifndef _MM_FILE_H
00002 #define _MM_FILE_H
00003 
00004 #include <stdio.h>
00005 #include <ogg/ogg.h>
00006 #include <vorbis/codec.h>
00007 #include <theora/theora.h>
00008 #include <SDL.h>
00009 
00010 #define MM_AUDIO_FORMAT AUDIO_U16SYS
00011 
00012 enum stream_type
00013 {
00014     MEDIA_AUDIO = 1,
00015     MEDIA_VIDEO = 2
00016 };
00017 
00018 typedef struct
00019 {
00020     FILE *file;
00021     ogg_sync_state sync;
00022     ogg_stream_state *audio;
00023     vorbis_info *audio_info;
00024     vorbis_dsp_state *audio_ctx;
00025     vorbis_block *audio_blk;
00026     ogg_stream_state *video;
00027     theora_info *video_info;
00028     theora_state *video_ctx;
00029     unsigned end_of_stream;
00030     unsigned drop_packets;
00031 } mm_file;
00032 
00033 extern int mm_open(mm_file * mf, const char *fname);
00034 extern int mm_open_fp(mm_file * mf, FILE *file);
00035 extern unsigned mm_ignore(mm_file * mf, unsigned mask);
00036 extern int mm_close(mm_file * mf);
00037 extern int mm_video_info(const mm_file * mf, unsigned *width, unsigned *height, float *fps);
00038 extern int mm_audio_info(const mm_file * mf, unsigned *channels, unsigned *rate);
00039 extern int mm_decode_video(mm_file * mf, SDL_Overlay * ovl);
00040 extern int mm_decode_audio(mm_file * mf, void *buf, int buflen);
00041 #if 0
00042 extern int mm_convert_audio(mm_file * mf, void *buf, int buflen, SDL_AudioSpec *spec);
00043 #endif
00044 
00045 #endif /* _MM_FILE_H */

Generated on Fri Sep 28 00:35:45 2007 for raceintospace by  doxygen 1.5.3