Logo Search packages:      
Sourcecode: freecraft version File versions

avi.h

//   ___________             _________                _____  __
//   \_       _____/______   ____   ____ \_   ___ \____________ _/ ____\/  |_
//    |    __) \_  __ \_/ __ \_/ __ \/    \  \/\_  __ \__  \\   __\\   __|
//    |     \   |  | \/\  ___/\  ___/\     \____|  | \// __ \|  |   |  |
//    \___  /   |__|    \___  >\___  >\______  /|__|  (____  /__|   |__|
//      \/            \/         \/      \/              \/
//  ______________________                           ______________________
//                  T H E   W A R   B E G I N S
//       FreeCraft - A free fantasy real time strategy game engine
//
/**@name avi.h                -     avi support */
//
//    (c) Copyright 2002 by Lutz Sammer.
//
//    FreeCraft 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.
//
//    FreeCraft 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.
//
//    $Id: avi.h,v 1.3 2002/12/17 06:40:43 nehalmistry Exp $

//@{

/*----------------------------------------------------------------------------
--    Includes
----------------------------------------------------------------------------*/

#include "iolib.h"

/*----------------------------------------------------------------------------
--    Declaration
----------------------------------------------------------------------------*/

/**
**    Avi frame buffer typedef
*/
typedef struct _avi_frame_buffer_ AviFrameBuffer;

/**
**    Avi frame buffer structure
**
**    Used to stored read and used frames.
*/
00048 struct _avi_frame_buffer_ {
    AviFrameBuffer* Next;           /// Next buffer
00050     int               Length;       /// Buffer length
00051     unsigned char   Data[1];        /// Buffer data
};

/**
**    Avi file handle structure
*/
00057 typedef struct _avi_file_ {
    CLFile* FileHandle;       /// File handle
    // Video streams
00060     char    VideoCodec[8];          /// Video codec
00061     int           Width;                  /// Video frame width
00062     int           Height;                 /// Video frame height
00063     int           FPS100;                 /// Frames per second * 100
00064     long    NumFrames;        /// Number of video frames
00065     int           VideoStream;            /// Video stream number
00066     unsigned long VideoTag;         /// Video stream tag
00067     AviFrameBuffer* VideoFrames;    /// Video frames
00068     AviFrameBuffer** VideoFramesTail;     /// Video frames tail pointer
00069     AviFrameBuffer* VideoBuffer;    /// Current video frame buffer
    // Audio streams
00071     int           AudioStream;            /// Audio stream number
00072     unsigned long AudioTag;         /// Audio stream tag
00073     AviFrameBuffer* AudioFrames;    /// Audio frames
00074     AviFrameBuffer** AudioFramesTail;     /// Audio frames tail pointer
00075     AviFrameBuffer* AudioBuffer;    /// Current audio frame buffer
00076     int     AudioRemain;                  /// Remaining bytes in buffer
} AviFile;

/*----------------------------------------------------------------------------
--    Functions
----------------------------------------------------------------------------*/

    /// Open an avi file
extern AviFile* AviOpen(const char* name);
    /// Close an avi file
extern void AviClose(AviFile* avi);

    /// Read next video frame
extern int AviReadNextVideoFrame(AviFile* avi,unsigned char** frame);
    /// Read next audio frame
extern int AviReadNextAudioFrame(AviFile* avi,unsigned char** frame);

    /// Play the sound of an avi movie
extern void PlayAviOgg(AviFile* avi);

//@}

Generated by  Doxygen 1.6.0   Back to index