#include <videoDevice.h>
This devices accesses the attached hardware through the appropriate interfaces and simplifies interaction through a smaller, unified API.
Public Member Functions | |
| videoDevice (string) | |
| ~videoDevice () | |
| void | init () |
| Initialize the device. | |
| void | getFrame (vdFrame &) |
| Get a frame from the device. | |
| bool | getIntegerControlUsed (const vdIntegerControl) |
| Gets whether the control is used on the device. | |
| int | getIntegerControlValue (const vdIntegerControl) |
| Get the current setting of an integer control, if possible. | |
| int | getIntegerControlMinimum (const vdIntegerControl) |
| Get the minimum setting of an integer control, if possible. | |
| int | getIntegerControlMaximum (const vdIntegerControl) |
| Get the maximum setting of an integer control, if possible. | |
| int | getIntegerControlStep (const vdIntegerControl) |
| Get the minimum effective interval for an integer control, if possible. | |
| void | setIntegerControlValue (const vdIntegerControl, const int) |
| Sets an integer control on the device, if possible. | |
| vector < vdIntegerControl > | getValidIntegerControls () |
| Gets all integer controls that "should" work on this device. | |
| string | getCardName () |
| Get the card name. | |
| bool | setDimensions (unsigned int, unsigned int) |
| Attempts to set the device to the specified dimensions. | |
| vector< pair< int, int > > | getValidDimensions () |
| Get the dimensions that the device is capable of capturing in. | |
| pair< int, int > | getDimensions () |
Static Public Member Functions | |
| static string | getIntegerControlString (const vdIntegerControl) |
| Get what an integer control represents as a "string". | |
| static vector< string > | enumerateDevices () |
| Attempts to enumerate the devices attached to the system. | |
Public Attributes | |
| sigc::signal< void, int, string > | sig_progress |
Private Member Functions | |
| void | v2_init () |
| Initialize V4L2 devices. | |
| void | v1_init () |
| Initialize V4L1 devices. | |
| string | v1_paletteName (int) |
| void | setBufferSize () |
| Set the buffer size for frames. | |
| void | fmt_VIDEO_PALETTE_RGB24 (vdFrame &) |
| Convert the palette to the default format. | |
Private Attributes | |
| string | deviceName |
| bool | live |
| int | fd |
| bool | isV4L2 |
| v4l2_capability | v2_capabilities |
| v4l2_input | v2_inputs [MAX_INPUTS] |
| int | inputCount |
| int | currentInput |
| v4l2_queryctrl | brightness |
| v4l2_queryctrl | contrast |
| v4l2_queryctrl | saturation |
| v4l2_queryctrl | hue |
| video_capability | v1_capabilities |
| video_channel | v1_inputs [MAX_INPUTS] |
| video_picture | v1_controls |
| video_window | v1_window |
| vector< pair< int, int > > | capableDimensions |
| unsigned int | bufferSize |
| vc::videoDevice::videoDevice | ( | string | _deviceName | ) |
| vc::videoDevice::~videoDevice | ( | ) |
| void vc::videoDevice::init | ( | ) |
| void vc::videoDevice::getFrame | ( | vdFrame & | frame | ) |
Get a frame from the device.
| string | If device is not initialized. | |
| string | If it is a V4L2 device. | |
| string | If camera uses an unsupported format. |
| frame | The vdFrame struct to store into. |
| bool vc::videoDevice::getIntegerControlUsed | ( | const | vdIntegerControl | ) |
Gets whether the control is used on the device.
| string | If device not started. | |
| string | If an invalid control is specified. |
| controlType | The type of integer control to check. |
| int vc::videoDevice::getIntegerControlValue | ( | const | vdIntegerControl | ) |
Get the current setting of an integer control, if possible.
| string | If device not started. | |
| string | If an invalid control is specified. | |
| string | If that control is not used on this device. | |
| string | If it can't retrieve the value. |
| controlType | The type of integer control to get. |
| int vc::videoDevice::getIntegerControlMinimum | ( | const | vdIntegerControl | ) |
Get the minimum setting of an integer control, if possible.
| string | If device not started. | |
| string | If an invalid control is specified. | |
| string | If that control is not used on this device. | |
| string | If it can't retrieve the value. |
| controlType | The type of integer control to get. |
| int vc::videoDevice::getIntegerControlMaximum | ( | const | vdIntegerControl | ) |
Get the maximum setting of an integer control, if possible.
| string | If device not started. | |
| string | If an invalid control is specified. | |
| string | If that control is not used on this device. | |
| string | If it can't retrieve the value. |
| controlType | The type of integer control to get. |
| int vc::videoDevice::getIntegerControlStep | ( | const | vdIntegerControl | ) |
Get the minimum effective interval for an integer control, if possible.
| string | If device not started. | |
| string | If an invalid control is specified. | |
| string | If that control is not used on this device. | |
| string | If it can't retrieve the value. |
| controlType | The type of integer control to get. |
| void vc::videoDevice::setIntegerControlValue | ( | const | vdIntegerControl, | |
| const | int | |||
| ) |
Sets an integer control on the device, if possible.
| string | If device not started. | |
| string | If an invalid control is specified. | |
| string | If that control is not used on this device. | |
| string | If it can't setthe value. |
| controlType | The integer control to set. | |
| value | The new brightness value. |
| string vc::videoDevice::getIntegerControlString | ( | const | vdIntegerControl | ) | [static] |
Get what an integer control represents as a "string".
| string | On invalid control type. |
| vector< vdIntegerControl > vc::videoDevice::getValidIntegerControls | ( | ) |
Gets all integer controls that "should" work on this device.
No promises though.
| string | If device not initialized. | |
| string | If V4L2 - Not yet supported. |
| string vc::videoDevice::getCardName | ( | ) |
Get the card name.
| string | If device is not initialized. |
| bool vc::videoDevice::setDimensions | ( | unsigned int | width, | |
| unsigned int | height | |||
| ) |
Attempts to set the device to the specified dimensions.
| string | If V4L2 device. |
| width | The width to set. | |
| height | The height to set. |
| vector< pair< int, int > > vc::videoDevice::getValidDimensions | ( | ) |
Get the dimensions that the device is capable of capturing in.
| string | If device is not initialized. |
| pair<int,int> vc::videoDevice::getDimensions | ( | ) |
| vector< string > vc::videoDevice::enumerateDevices | ( | ) | [static] |
Attempts to enumerate the devices attached to the system.
Checks for devices named "video#" in the /dev directory.
| string | When it cannot open the /dev directory. |
| void vc::videoDevice::v2_init | ( | ) | [private] |
| void vc::videoDevice::v1_init | ( | ) | [private] |
| string vc::videoDevice::v1_paletteName | ( | int | p | ) | [private] |
| void vc::videoDevice::setBufferSize | ( | ) | [private] |
Set the buffer size for frames.
This should change on capture size change, capture mode change.
| string | If this is a V4L2 device, we don't have an implementation yet. |
| void vc::videoDevice::fmt_VIDEO_PALETTE_RGB24 | ( | vdFrame & | frame | ) | [private] |
Convert the palette to the default format.
| frame | The frame to operate on. Must be filled correctly. |
| sigc::signal<void,int,string> vc::videoDevice::sig_progress |
string vc::videoDevice::deviceName [private] |
bool vc::videoDevice::live [private] |
int vc::videoDevice::fd [private] |
bool vc::videoDevice::isV4L2 [private] |
v4l2_capability vc::videoDevice::v2_capabilities [private] |
v4l2_input vc::videoDevice::v2_inputs[MAX_INPUTS] [private] |
int vc::videoDevice::inputCount [private] |
int vc::videoDevice::currentInput [private] |
v4l2_queryctrl vc::videoDevice::brightness [private] |
v4l2_queryctrl vc::videoDevice::contrast [private] |
v4l2_queryctrl vc::videoDevice::saturation [private] |
v4l2_queryctrl vc::videoDevice::hue [private] |
video_capability vc::videoDevice::v1_capabilities [private] |
video_channel vc::videoDevice::v1_inputs[MAX_INPUTS] [private] |
video_picture vc::videoDevice::v1_controls [private] |
video_window vc::videoDevice::v1_window [private] |
vector< pair <int,int> > vc::videoDevice::capableDimensions [private] |
unsigned int vc::videoDevice::bufferSize [private] |
1.5.3