Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VidFile Class Reference

#include <vid_file.h>

Classes

class  EndOfStreamException
 
class  Exception
 
class  FileOpenException
 
class  FrameDecodeException
 
class  UnsupportedCodecException
 

Public Member Functions

 VidFile () throw ()
 
 ~VidFile ()
 
bool isOpen () const throw ()
 
void open (const std::string &path, size_t maxDimension=65535, bool forcePOT=false) throw (Exception)
 
void close () throw ()
 
bool seek (float time) throw (Exception)
 
float getFrameRate () const throw ()
 
float getDuration () const throw ()
 
int getWidth () const throw ()
 
int getHeight () const throw ()
 
void * getFrameBuffer () const throw ()
 
int getFrameBufferStride () const throw ()
 

Detailed Description

Definition at line 13 of file vid_file.h.

Constructor & Destructor Documentation

VidFile::VidFile ( )
throw (
)

Definition at line 380 of file vid_file.cpp.

380  :
381  impl( NULL )
382 {}
VidFile::~VidFile ( )

Definition at line 384 of file vid_file.cpp.

385 {
386  if (impl)
387  delete impl;
388 }

Member Function Documentation

void VidFile::close ( )
throw (
)

Definition at line 405 of file vid_file.cpp.

406 {
407  if (impl) {
408  delete impl;
409  impl = 0;
410  }
411 }
float VidFile::getDuration ( ) const
throw (
)

Definition at line 418 of file vid_file.cpp.

Referenced by AnimatedTexture::LoadVideoSource().

419 {
420  return impl ? impl->duration : 0;
421 }
void * VidFile::getFrameBuffer ( ) const
throw (
)

Definition at line 433 of file vid_file.cpp.

Referenced by AnimatedTexture::LoadVideoSource().

434 {
435  return impl ? impl->frameBuffer : 0;
436 }
int VidFile::getFrameBufferStride ( ) const
throw (
)

Definition at line 438 of file vid_file.cpp.

439 {
440  return impl ? impl->frameBufferStride : 0;
441 }
float VidFile::getFrameRate ( ) const
throw (
)

Definition at line 413 of file vid_file.cpp.

Referenced by AnimatedTexture::LoadVideoSource().

414 {
415  return impl ? impl->frameRate : 0;
416 }
int VidFile::getHeight ( ) const
throw (
)

Definition at line 428 of file vid_file.cpp.

Referenced by AnimatedTexture::LoadVideoSource().

429 {
430  return impl ? impl->height : 0;
431 }
int VidFile::getWidth ( ) const
throw (
)

Definition at line 423 of file vid_file.cpp.

Referenced by AnimatedTexture::LoadVideoSource().

424 {
425  return impl ? impl->width : 0;
426 }
bool VidFile::isOpen ( ) const
throw (
)

Definition at line 390 of file vid_file.cpp.

391 {
392  return impl != NULL;
393 }
void VidFile::open ( const std::string &  path,
size_t  maxDimension = 65535,
bool  forcePOT = false 
)
throw (Exception
)

Definition at line 395 of file vid_file.cpp.

Referenced by AnimatedTexture::LoadVideoSource().

396 {
397 #ifdef HAVE_FFMPEG
398  if (!impl)
399  impl = new VidFileImpl( maxDimension, forcePOT );
400  if (impl)
401  impl->open( path );
402 #endif
403 }
bool VidFile::seek ( float  time)
throw (Exception
)

Seeks to the specified time true if frame changed, false otherwise. EndOfStreamException when time lays past the end. FrameDecodeException when an error occurs during frame decode.

Definition at line 443 of file vid_file.cpp.

Referenced by AnimatedTexture::MakeActive().

444 {
445  return (impl != 0) && impl->seek( time );
446 }

The documentation for this class was generated from the following files: