#include <avcap/FormatManager.h>
Inheritance diagram for avcap::FormatManager:

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 ListType & | getFormatList () 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 Format * | getFormat () |
| 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 VideoStandardList & | getVideoStandardList () const |
| Get the STL-list of avaliable video standards described by VideoStandard objects. | |
| virtual const VideoStandard * | getVideoStandard () |
| 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 |
| typedef std::list<VideoStandard*> avcap::FormatManager::VideoStandardList |
| FormatManager::FormatManager | ( | DeviceDescriptor * | dd | ) |
The constructor. */.
| FormatManager::~FormatManager | ( | ) | [virtual] |
The destructor. */.
| virtual const ListType& avcap::FormatManager::getFormatList | ( | ) | const [inline, virtual] |
| int FormatManager::setFormat | ( | Format * | fmt | ) | [virtual] |
Set the format to capture.
| fmt | The new format. |
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.
| fourcc | The four character code of the new format. |
Reimplemented in avcap::QT_FormatManager.
| Format * FormatManager::getFormat | ( | ) | [virtual] |
Get the current 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.
| w | : width | |
| h | : height |
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.
| bpl |
Reimplemented in avcap::V4L1_FormatManager, and avcap::V4L2_FormatManager.
| int FormatManager::getWidth | ( | ) | [virtual] |
Returns the image with.
Reimplemented in avcap::V4L1_FormatManager, avcap::V4L2_FormatManager, avcap::QT_FormatManager, and avcap::DS_FormatManager.
| int FormatManager::getHeight | ( | ) | [virtual] |
Returns the image 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.
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.
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.
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
| fps | : the number of frames per second. |
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 /*!
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.
| const VideoStandard * FormatManager::getVideoStandard | ( | ) | [virtual] |
Get the currently used video standard.
The default implementation returns 0
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
| std | The new video standard. |
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.
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] |
1.5.1