avcap::FormatManager Class Reference

#include <avcap/FormatManager.h>

Inheritance diagram for avcap::FormatManager:

Inheritance graph
[legend]

Detailed Description

Abstract base for classes that query and manage available formats, video-standards and resolutions of a capture device.

This class queries the formats, video-standards and resolutions provided by the device and allows applications to set them. The class provides a STL-list of Format-objects. Actualy changing the format may be deferred by the concrete implementation until it is really necessary, e.g. the capture begins, because advising the driver to change the format can be a quite time-consuming operation. Most of the methods in this class are implemented as a noop and are reimplemented by the derived class for a concrete capture API/OS, if the method is applicable.


Public Types

typedef std::list< VideoStandard * > VideoStandardList

Public Member Functions

 FormatManager (DeviceDescriptor *dd)
 The constructor. */.
virtual ~FormatManager ()
 The destructor. */.
virtual const ListTypegetFormatList () const
 Returns the STL-list of Format objects describing the available formats.
virtual int setFormat (Format *fmt)
 Set the format to capture.
virtual int setFormat (uint32_t fourcc)
 Set the format to capture.
virtual FormatgetFormat ()
 Get the current format.
virtual int setResolution (int w, int h)
 Set the image with and height.
virtual int setBytesPerLine (int bpl)
 Set the number of used bytes per scanline, if possible.
virtual int getWidth ()
 Returns the image with.
virtual int getHeight ()
 Returns the image height.
virtual int getBytesPerLine ()
 Returns the bytes per line.
virtual int flush ()
 Flushes the format, i.e. the driver is advised to apply the current format settings.
virtual size_t getImageSize ()
 The number of bytes that an image of the current size requires to be stored in memory, including padding.
virtual int setFramerate (int fps)
 Set the framerate.
virtual int getFramerate ()
 Get the current framerate.
virtual const VideoStandardListgetVideoStandardList () const
 Get the STL-list of avaliable video standards described by VideoStandard objects.
virtual const VideoStandardgetVideoStandard ()
 Get the currently used video standard.
virtual int setVideoStandard (const VideoStandard *std)
 Set the video standard to use.
virtual void query ()=0

Protected Attributes

ListType mFormats
int mWidth
int mHeight
int mBytesPerLine
unsigned long mImageSize
bool mModified
VideoStandardList mStandards


Member Typedef Documentation

typedef std::list<VideoStandard*> avcap::FormatManager::VideoStandardList


Constructor & Destructor Documentation

FormatManager::FormatManager ( DeviceDescriptor dd  ) 

The constructor. */.

FormatManager::~FormatManager (  )  [virtual]

The destructor. */.


Member Function Documentation

virtual const ListType& avcap::FormatManager::getFormatList (  )  const [inline, virtual]

Returns the STL-list of Format objects describing the available formats.

Returns:
The format list.

int FormatManager::setFormat ( Format fmt  )  [virtual]

Set the format to capture.

Parameters:
fmt The new format.
Returns:
0, if successful, -1 else

Reimplemented in avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, avcap::QT_FormatManager, and avcap::DS_FormatManager.

int FormatManager::setFormat ( uint32_t  fourcc  )  [virtual]

Set the format to capture.

Parameters:
fourcc The four character code of the new format.
Returns:
0, if successful, -1 else

Reimplemented in avcap::QT_FormatManager.

Format * FormatManager::getFormat (  )  [virtual]

Get the current format.

Returns:
The format.

Reimplemented in avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, avcap::QT_FormatManager, and avcap::DS_FormatManager.

int FormatManager::setResolution ( int  w,
int  h 
) [virtual]

Set the image with and height.

Parameters:
w : width
h : height
Returns:
0, if successful, -1 else

Reimplemented in avcap::AVC_FormatManager, avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, avcap::QT_FormatManager, and avcap::DS_FormatManager.

int FormatManager::setBytesPerLine ( int  bpl  )  [virtual]

Set the number of used bytes per scanline, if possible.

Parameters:
bpl 
Returns:
0, if successful, -1 else

Reimplemented in avcap::V4L1_FormatManager, and avcap::V4L2_FormatManager.

int FormatManager::getWidth (  )  [virtual]

Returns the image with.

Returns:
width

Reimplemented in avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, avcap::QT_FormatManager, and avcap::DS_FormatManager.

int FormatManager::getHeight (  )  [virtual]

Returns the image height.

Returns:
height

Reimplemented in avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, avcap::QT_FormatManager, and avcap::DS_FormatManager.

int FormatManager::getBytesPerLine (  )  [virtual]

Returns the bytes per line.

Returns:
bpl

Reimplemented in avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, and avcap::DS_FormatManager.

int FormatManager::flush (  )  [virtual]

Flushes the format, i.e. the driver is advised to apply the current format settings.

Returns:
0, if successful, -1 else

Reimplemented in avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, and avcap::DS_FormatManager.

size_t FormatManager::getImageSize (  )  [virtual]

The number of bytes that an image of the current size requires to be stored in memory, including padding.

Returns:
size

Reimplemented in avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, avcap::QT_FormatManager, and avcap::DS_FormatManager.

int FormatManager::setFramerate ( int  fps  )  [virtual]

Set the framerate.

The default implementation returns -1

Parameters:
fps : the number of frames per second.
Returns:
0 if successful, -1 on failure

Reimplemented in avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, avcap::QT_FormatManager, and avcap::DS_FormatManager.

int FormatManager::getFramerate (  )  [virtual]

Get the current framerate.

The default implementation returns -1 /*!

Returns:
the frames per second

Reimplemented in avcap::AVC_FormatManager, avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, avcap::QT_FormatManager, and avcap::DS_FormatManager.

virtual const VideoStandardList& avcap::FormatManager::getVideoStandardList (  )  const [inline, virtual]

Get the STL-list of avaliable video standards described by VideoStandard objects.

Returns:
standards list

const VideoStandard * FormatManager::getVideoStandard (  )  [virtual]

Get the currently used video standard.

The default implementation returns 0

Returns:
the current standard or 0, if not applicable

Reimplemented in avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, and avcap::DS_FormatManager.

int FormatManager::setVideoStandard ( const VideoStandard std  )  [virtual]

Set the video standard to use.

Attention: not all video standards can be set in conjunction with each connector and format. The default implementation returns -1

Parameters:
std The new video standard.
Returns:
0, if successful, -1 else

Reimplemented in avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, and avcap::DS_FormatManager.

virtual void avcap::FormatManager::query (  )  [pure virtual]

Called during initialisation by the CaptureDevice to query for the objects that the implementation of this class manages.

Implements avcap::Manager< T >.

Implemented in avcap::AVC_FormatManager, avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, avcap::QT_FormatManager, and avcap::DS_FormatManager.


Field Documentation

ListType avcap::FormatManager::mFormats [protected]

int avcap::FormatManager::mWidth [protected]

int avcap::FormatManager::mHeight [protected]

int avcap::FormatManager::mBytesPerLine [protected]

unsigned long avcap::FormatManager::mImageSize [protected]

bool avcap::FormatManager::mModified [protected]

VideoStandardList avcap::FormatManager::mStandards [protected]


The documentation for this class was generated from the following files:
Generated on Mon Nov 30 11:10:32 2009 for avcap-0.1 by  doxygen 1.5.1