_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
movie.h
Go to the documentation of this file.
1 // _________ __ __
2 // / _____// |_____________ _/ |______ ____ __ __ ______
3 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
4 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
5 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
6 // \/ \/ \//_____/ \/
7 // ______________________ ______________________
8 // T H E W A R B E G I N S
9 // Stratagus - A free fantasy real time strategy game engine
10 //
12 //
13 // (c) Copyright 2002-2005 by Lutz Sammer
14 //
15 // This program is free software; you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation; only version 2 of the License.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 // 02111-1307, USA.
28 //
29 
30 #ifndef __MOVIE_H__
31 #define __MOVIE_H__
32 
34 
35 #ifdef USE_VORBIS
36 
37 /*----------------------------------------------------------------------------
38 -- Documentation
39 ----------------------------------------------------------------------------*/
40 
41 /*----------------------------------------------------------------------------
42 -- Includes
43 ----------------------------------------------------------------------------*/
44 
45 #include "ogg/ogg.h"
46 #include "vorbis/codec.h"
47 #ifdef USE_THEORA
48 #include "theora/theora.h"
49 #endif
50 
51 /*----------------------------------------------------------------------------
52 -- Declarations
53 ----------------------------------------------------------------------------*/
54 
55 class CFile;
56 
60 struct OggData {
62  ogg_sync_state sync;
63  ogg_page page;
64 
65  ogg_stream_state astream;
66  vorbis_info vinfo;
67  vorbis_comment vcomment;
68  vorbis_block vblock;
69  vorbis_dsp_state vdsp;
70 
71 #ifdef USE_THEORA
72  ogg_stream_state vstream;
73  theora_info tinfo;
74  theora_comment tcomment;
75  theora_state tstate;
76 #endif
77 
78  int audio : 1;
79 #ifdef USE_THEORA
80  int video : 1;
81 #endif
82 };
83 
84 /*----------------------------------------------------------------------------
85 -- Variables
86 ----------------------------------------------------------------------------*/
87 
88 /*----------------------------------------------------------------------------
89 -- Functions
90 ----------------------------------------------------------------------------*/
91 
92 extern int OggInit(CFile *f, OggData *data);
93 extern void OggFree(OggData *data);
94 extern int OggGetNextPage(ogg_page *page, ogg_sync_state *sync, CFile *f);
95 
96 extern int VorbisProcessData(OggData *data, char *buffer);
97 
98 #endif // USE_VORBIS
99 
101 extern int PlayMovie(const std::string &name);
102 
104 
105 #endif // !__MOVIE_H__
int PlayMovie(const std::string &name)
Play a movie file.
Definition: movie.cpp:174
vorbis_comment vcomment
Definition: movie.h:67
ogg_sync_state sync
Ogg file handle.
Definition: movie.h:62
int OggGetNextPage(ogg_page *page, ogg_sync_state *sync, CFile *f)
Definition: ogg.cpp:81
int OggInit(CFile *f, OggData *data)
Definition: ogg.cpp:151
void OggFree(OggData *data)
Definition: ogg.cpp:297
CFile * File
Definition: movie.h:61
int audio
Definition: movie.h:78
theora_state tstate
Definition: movie.h:75
theora_comment tcomment
Definition: movie.h:74
Definition: iolib.h:101
ogg_stream_state vstream
Definition: movie.h:72
vorbis_block vblock
Definition: movie.h:68
Definition: movie.h:60
ogg_stream_state astream
Definition: movie.h:65
vorbis_dsp_state vdsp
Definition: movie.h:69
int video
Definition: movie.h:80
vorbis_info vinfo
Definition: movie.h:66
int VorbisProcessData(OggData *data, char *buffer)
Definition: ogg.cpp:98
theora_info tinfo
Definition: movie.h:73
ogg_page page
Definition: movie.h:63
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.