Download Source Code

CWinAvi Class Reference

Simple wrapper for the windows AVI API. More...

#include <WinAvi.h>

List of all members.

Public Member Functions

void Close ()
 Closes AVI file.
BOOL OpenExisting (LPCTSTR pFile)
 Opens an existing AVI file.
BOOL AddFrame (CWinDc *pDC)
 Adds a frame of video to the AVI file.
void Destroy ()
 Closes AVI and releases all resources.
BOOL OpenNew (LPCTSTR pFile, LPRECT pRect, DWORD dwFrames, DWORD dwSeconds, DWORD fourCC, LPVOID pCompData, DWORD dwCompDataSize, BOOL bCreateDIBSection)
 Creates a new AVI file, over-writes any existing file.
 CWinAvi ()
 Constructor.
virtual ~CWinAvi ()
 Destructor.
BOOL IsOpen ()
 Returns non-zero if AVI file is open.
void GetRect (LPRECT pRect)
 Returns the dimensions of a single video frame.
DWORD GetFrameRate ()
 Returns the video frame rate.
DWORD GetScale ()
 Returns the video frame rate scale.
DWORD GetFccType ()
 Returns the Four Character Code of the compressor.
LPCTSTR GetFileName ()
 Returns a pointer to the currently open filename.
long GetCurFrame ()
 Returns the current frame index.
DWORD GetError ()
 Returns the last error code.
LPCTSTR GetErrorStr ()
 Returns a pointer to a string describing the last error.

Static Public Member Functions

static LPCTSTR GetErrorStr (DWORD dwError)
 Returns an error string for AVI errors.


Detailed Description

Simple wrapper for the windows AVI API.

Use this class to read / write video frames from an AVI file.


Member Function Documentation

BOOL CWinAvi::AddFrame CWinDc *  pDC  ) 
 

Adds a frame of video to the AVI file.

Parameters:
[in] pDC - CWinDc object encapsulating the video frame
Returns:
Non-zero if added successfully
See also:

LPCTSTR CWinAvi::GetErrorStr DWORD  dwError  )  [static]
 

Returns an error string for AVI errors.

Parameters:
[in] dwError - AVI error code
Returns:
Pointer to error code string
See also:

void CWinAvi::GetRect LPRECT  pRect  )  [inline]
 

Returns the dimensions of a single video frame.

Parameters:
[in] pRect - Receives video frame dimensions.

BOOL CWinAvi::OpenExisting LPCTSTR  pFile  ) 
 

Opens an existing AVI file.

Parameters:
[in] pFile - AVI filename
Returns:
Non-zero if success
See also:

BOOL CWinAvi::OpenNew LPCTSTR  pFile,
LPRECT  pRect,
DWORD  dwFrames,
DWORD  dwSeconds,
DWORD  fourCC,
LPVOID  pCompData,
DWORD  dwCompDataSize,
BOOL  bCreateDIBSection
 

Creates a new AVI file, over-writes any existing file.

Parameters:
[in] pFile - AVI filename
[in] pRect - Video frame size
[in] dwFrames - Number of frames in dwSeconds seconds.
[in] dwSeconds - Number of seconds overwhich there are dwFrames frames.
[in] fourCC - Four Character Code identifying the encoder to use.
[in] pCompData - Compressor initialization data.
[in] dwCompDataSize - Number of bytes in pCompData.
[in] bCreateDIBSection - True to create internal DIB section for frame copy.
Returns:
Non-zero if success
See also:


The documentation for this class was generated from the following files:
  • inc/WinAvi.h
  • WinAvi.cpp
Copyright Robert Umbehant
This documentation is covered by the LGPL