#include <avcap/DeviceDescriptor.h>
Inheritance diagram for avcap::DeviceDescriptor:
It is used as an system independent description of a capture device. It provides the interface to access information about a device and the device itself. Special devices must inherit this class, e.g. V4L2_DeviceDescriptor or AVC_DeviceDescriptor. A list of objects derived from this class (one for each device) is provided by the DeviceCollector-singleton, which tries to determine all capture devices available on the system, so applications don't have to instantiate objects of these class explicitly. Objects of this class can be used to create a concrete CaptureDevice object by calling DEVICE_COLLECTOR::instance()->createDevice(). The class must be implemented for a concrete capture API/OS.
Public Member Functions | |
DeviceDescriptor () | |
Constructor. | |
virtual | ~DeviceDescriptor ()=0 |
Destructor. | |
virtual int | open ()=0 |
Open the underlying device. | |
virtual int | close ()=0 |
Close the underlying device. | |
virtual const std::string & | getName () const=0 |
Returns the unique identifier of the device. | |
virtual const std::string & | getDriver () const |
Returns the name of the driver. | |
virtual const std::string & | getCard () const |
Returns the name of the device. | |
virtual const std::string & | getInfo () const |
Returns a textual description of the device. | |
virtual int | getVersion () const |
Returns the version number of the driver. | |
virtual const std::string & | getVersionString () const |
Returns the version number of the driver as string. | |
virtual const DEV_HANDLE_T | getHandle () const=0 |
Returns the API-specific device handle used to reference the device. | |
virtual bool | isAVDev () const |
Device is an audio/video device. The default implementation returns false. | |
virtual bool | isVideoCaptureDev () const |
Device is capable to capture some data. The default implementation returns false. | |
virtual bool | isVBIDev () const |
Device is a VBI device. The default implementation returns false. | |
virtual bool | isTuner () const |
Device has a tuner. The default implementation returns false. | |
virtual bool | isAudioDev () const |
Device is an audio device. The default implementation returns false. | |
virtual bool | isRadioDev () const |
Device is a radio device. The default implementation returns false. | |
virtual bool | isOverlayDev () const |
Device supports video overlay. The default implementation returns false. | |
virtual bool | isRWDev () const |
Device supports read/write IO-methods (linux specific, see V4L2 API Docu for further details). | |
virtual bool | isAsyncIODev () const |
Device supports asynchroneous IO-methods (linux specific, see V4L2 API Docu for further details). | |
virtual bool | isStreamingDev () const |
Device supports memory mapping IO-methods (linux specific, see V4L2 API Docu for further details). | |
virtual CaptureDevice * | getDevice ()=0 |
Factory-method to create a API-dependent CaptureDevice-object. |
DeviceDescriptor::DeviceDescriptor | ( | ) |
Constructor.
DeviceDescriptor::~DeviceDescriptor | ( | ) | [pure virtual] |
Destructor.
virtual int avcap::DeviceDescriptor::open | ( | ) | [pure virtual] |
Open the underlying device.
The CaptureDevice-Object returned by getDevice(), which is actually used to perform capturing is not valid before open() is called.
Implemented in avcap::AVC_DeviceDescriptor, avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, avcap::QT_DeviceDescriptor, avcap::QT_DeviceEnumerator, and avcap::DS_DeviceDescriptor.
virtual int avcap::DeviceDescriptor::close | ( | ) | [pure virtual] |
Close the underlying device.
The CaptureDevice-Object returned by getDevice(), which is actually used to perform capturing, is not valid after close() is called.
Implemented in avcap::AVC_DeviceDescriptor, avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, avcap::QT_DeviceDescriptor, avcap::QT_DeviceEnumerator, and avcap::DS_DeviceDescriptor.
virtual const std::string& avcap::DeviceDescriptor::getName | ( | ) | const [pure virtual] |
Returns the unique identifier of the device.
Implemented in avcap::AVC_DeviceDescriptor, avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, avcap::QT_DeviceDescriptor, and avcap::DS_DeviceDescriptor.
virtual const std::string& avcap::DeviceDescriptor::getDriver | ( | ) | const [inline, virtual] |
Returns the name of the driver.
The default implementation returns an empty string.
Reimplemented in avcap::AVC_DeviceDescriptor, avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, and avcap::QT_DeviceDescriptor.
virtual const std::string& avcap::DeviceDescriptor::getCard | ( | ) | const [inline, virtual] |
Returns the name of the device.
The default implementation returns an empty string.
Reimplemented in avcap::AVC_DeviceDescriptor, avcap::V4L1_DeviceDescriptor, and avcap::V4L2_DeviceDescriptor.
virtual const std::string& avcap::DeviceDescriptor::getInfo | ( | ) | const [inline, virtual] |
Returns a textual description of the device.
The default implementation returns an empty string.
Reimplemented in avcap::AVC_DeviceDescriptor, avcap::V4L1_DeviceDescriptor, and avcap::V4L2_DeviceDescriptor.
virtual int avcap::DeviceDescriptor::getVersion | ( | ) | const [inline, virtual] |
Returns the version number of the driver.
The default implementation returns 0.
Reimplemented in avcap::V4L1_DeviceDescriptor, and avcap::V4L2_DeviceDescriptor.
virtual const std::string& avcap::DeviceDescriptor::getVersionString | ( | ) | const [inline, virtual] |
Returns the version number of the driver as string.
The default implementation returns an empty string.
Reimplemented in avcap::V4L1_DeviceDescriptor, and avcap::V4L2_DeviceDescriptor.
virtual const DEV_HANDLE_T avcap::DeviceDescriptor::getHandle | ( | ) | const [pure virtual] |
Returns the API-specific device handle used to reference the device.
Implemented in avcap::AVC_DeviceDescriptor, avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, avcap::QT_DeviceDescriptor, and avcap::DS_DeviceDescriptor.
virtual bool avcap::DeviceDescriptor::isAVDev | ( | ) | const [inline, virtual] |
Device is an audio/video device. The default implementation returns false.
Reimplemented in avcap::AVC_DeviceDescriptor, avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, and avcap::DS_DeviceDescriptor.
virtual bool avcap::DeviceDescriptor::isVideoCaptureDev | ( | ) | const [inline, virtual] |
Device is capable to capture some data. The default implementation returns false.
Reimplemented in avcap::AVC_DeviceDescriptor, avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, avcap::QT_DeviceDescriptor, and avcap::DS_DeviceDescriptor.
virtual bool avcap::DeviceDescriptor::isVBIDev | ( | ) | const [inline, virtual] |
Device is a VBI device. The default implementation returns false.
Reimplemented in avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, and avcap::DS_DeviceDescriptor.
virtual bool avcap::DeviceDescriptor::isTuner | ( | ) | const [inline, virtual] |
Device has a tuner. The default implementation returns false.
Reimplemented in avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, and avcap::DS_DeviceDescriptor.
virtual bool avcap::DeviceDescriptor::isAudioDev | ( | ) | const [inline, virtual] |
Device is an audio device. The default implementation returns false.
Reimplemented in avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, and avcap::DS_DeviceDescriptor.
virtual bool avcap::DeviceDescriptor::isRadioDev | ( | ) | const [inline, virtual] |
Device is a radio device. The default implementation returns false.
Reimplemented in avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, and avcap::DS_DeviceDescriptor.
virtual bool avcap::DeviceDescriptor::isOverlayDev | ( | ) | const [inline, virtual] |
Device supports video overlay. The default implementation returns false.
Reimplemented in avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, and avcap::DS_DeviceDescriptor.
virtual bool avcap::DeviceDescriptor::isRWDev | ( | ) | const [inline, virtual] |
Device supports read/write IO-methods (linux specific, see V4L2 API Docu for further details).
The default implementation returns false.
Reimplemented in avcap::V4L1_DeviceDescriptor, and avcap::V4L2_DeviceDescriptor.
virtual bool avcap::DeviceDescriptor::isAsyncIODev | ( | ) | const [inline, virtual] |
Device supports asynchroneous IO-methods (linux specific, see V4L2 API Docu for further details).
The default implementation returns false.
Reimplemented in avcap::V4L1_DeviceDescriptor, and avcap::V4L2_DeviceDescriptor.
virtual bool avcap::DeviceDescriptor::isStreamingDev | ( | ) | const [inline, virtual] |
Device supports memory mapping IO-methods (linux specific, see V4L2 API Docu for further details).
The default implementation returns false.
Reimplemented in avcap::V4L1_DeviceDescriptor, and avcap::V4L2_DeviceDescriptor.
virtual CaptureDevice* avcap::DeviceDescriptor::getDevice | ( | ) | [pure virtual] |
Factory-method to create a API-dependent CaptureDevice-object.
Applications must not create their own instances of a CaptureDevice but use this method to access the proper API-dependent unique device-object. You can use this object anywhere between successive calls to open() and close(), i.e. it is not valid before open() and not after close(). The ownership of the object remains at the descriptor, so the caller must not delete the object after usage. Only one CaptureDevice-object will be created for each DeviceDescriptor, so multiple calls to getDevice() will always return the same object instance.
Implemented in avcap::AVC_DeviceDescriptor, avcap::V4L1_DeviceDescriptor, avcap::V4L2_DeviceDescriptor, avcap::QT_DeviceDescriptor, and avcap::DS_DeviceDescriptor.