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