| 1 |
// ____ _ __ |
| 2 |
// / __ )____ _____ | | / /___ ___________ |
| 3 |
// / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/ |
| 4 |
// / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ ) |
| 5 |
// /_____/\____/____/ |__/|__/\__,_/_/ /____/ |
| 6 |
// |
| 7 |
// A futuristic real-time strategy game. |
| 8 |
// This file is part of Bos Wars. |
| 9 |
// |
| 10 |
/**@name movie.h - The movie header file. */ |
| 11 |
// |
| 12 |
// (c) Copyright 2002-2007 by Lutz Sammer |
| 13 |
// |
| 14 |
// This program is free software; you can redistribute it and/or modify |
| 15 |
// it under the terms of the GNU General Public License as published by |
| 16 |
// the Free Software Foundation; only version 2 of the License. |
| 17 |
// |
| 18 |
// This program is distributed in the hope that it will be useful, |
| 19 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 |
// GNU General Public License for more details. |
| 22 |
// |
| 23 |
// You should have received a copy of the GNU General Public License |
| 24 |
// along with this program; if not, write to the Free Software |
| 25 |
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 26 |
// 02111-1307, USA. |
| 27 |
|
| 28 |
#ifndef __MOVIE_H__ |
| 29 |
#define __MOVIE_H__ |
| 30 |
|
| 31 |
//@{ |
| 32 |
|
| 33 |
#ifdef USE_VORBIS |
| 34 |
|
| 35 |
/*---------------------------------------------------------------------------- |
| 36 |
-- Documentation |
| 37 |
----------------------------------------------------------------------------*/ |
| 38 |
|
| 39 |
/*---------------------------------------------------------------------------- |
| 40 |
-- Includes |
| 41 |
----------------------------------------------------------------------------*/ |
| 42 |
|
| 43 |
#include "ogg/ogg.h" |
| 44 |
#include "vorbis/codec.h" |
| 45 |
#ifdef USE_THEORA |
| 46 |
#include "theora/theora.h" |
| 47 |
#endif |
| 48 |
|
| 49 |
/*---------------------------------------------------------------------------- |
| 50 |
-- Declarations |
| 51 |
----------------------------------------------------------------------------*/ |
| 52 |
|
| 53 |
class CFile; |
| 54 |
|
| 55 |
/** |
| 56 |
** Ogg data structure to handle vorbis/theora streaming. |
| 57 |
*/ |
| 58 |
struct OggData { |
| 59 |
CFile *File; /// Ogg file handle |
| 60 |
ogg_sync_state sync; |
| 61 |
ogg_page page; |
| 62 |
|
| 63 |
ogg_stream_state astream; |
| 64 |
vorbis_info vinfo; |
| 65 |
vorbis_comment vcomment; |
| 66 |
vorbis_block vblock; |
| 67 |
vorbis_dsp_state vdsp; |
| 68 |
|
| 69 |
#ifdef USE_THEORA |
| 70 |
ogg_stream_state vstream; |
| 71 |
theora_info tinfo; |
| 72 |
theora_comment tcomment; |
| 73 |
theora_state tstate; |
| 74 |
#endif |
| 75 |
|
| 76 |
int audio : 1; |
| 77 |
#ifdef USE_THEORA |
| 78 |
int video : 1; |
| 79 |
#endif |
| 80 |
}; |
| 81 |
|
| 82 |
/*---------------------------------------------------------------------------- |
| 83 |
-- Variables |
| 84 |
----------------------------------------------------------------------------*/ |
| 85 |
|
| 86 |
/*---------------------------------------------------------------------------- |
| 87 |
-- Functions |
| 88 |
----------------------------------------------------------------------------*/ |
| 89 |
|
| 90 |
extern int OggInit(CFile *f, OggData *data); |
| 91 |
extern void OggFree(OggData *data); |
| 92 |
extern int OggGetNextPage(ogg_page *page, ogg_sync_state *sync, CFile *f); |
| 93 |
|
| 94 |
extern int VorbisProcessData(OggData *data, char *buffer); |
| 95 |
|
| 96 |
#endif // USE_VORBIS |
| 97 |
|
| 98 |
/// Play a movie file |
| 99 |
extern int PlayMovie(const std::string &name); |
| 100 |
|
| 101 |
//@} |
| 102 |
|
| 103 |
#endif // !__MOVIE_H__ |