#include <videoio1394dc.h>
Public Member Functions | |
PVideoInput1394DcDevice () | |
~PVideoInput1394DcDevice () | |
BOOL | Open (const PString &deviceName, BOOL startImmediate=TRUE) |
BOOL | IsOpen () |
BOOL | Close () |
BOOL | Start () |
BOOL | Stop () |
BOOL | IsCapturing () |
PINDEX | GetMaxFrameBytes () |
BOOL | GetFrameData (BYTE *buffer, PINDEX *bytesReturned=NULL) |
BOOL | GetFrameDataNoDelay (BYTE *buffer, PINDEX *bytesReturned=NULL) |
int | GetBrightness () |
BOOL | SetBrightness (unsigned newBrightness) |
int | GetWhiteness () |
BOOL | SetWhiteness (unsigned newWhiteness) |
int | GetColour () |
BOOL | SetColour (unsigned newColour) |
int | GetContrast () |
BOOL | SetContrast (unsigned newContrast) |
int | GetHue () |
BOOL | SetHue (unsigned newHue) |
BOOL | GetParameters (int *whiteness, int *brightness, int *colour, int *contrast, int *hue) |
BOOL | GetFrameSizeLimits (unsigned &minWidth, unsigned &minHeight, unsigned &maxWidth, unsigned &maxHeight) |
void | ClearMapping () |
int | GetNumChannels () |
BOOL | SetChannel (int channelNumber) |
BOOL | SetFrameRate (unsigned rate) |
BOOL | SetVideoFormat (VideoFormat videoFormat) |
BOOL | SetFrameSize (unsigned width, unsigned height) |
BOOL | SetColourFormat (const PString &colourFormat) |
BOOL | TestAllFormats () |
BOOL | SetFrameSizeConverter (unsigned width, unsigned height, BOOL bScaleNotCrop) |
BOOL | SetColourFormatConverter (const PString &colourFormat) |
Static Public Member Functions | |
static PStringList | GetInputDeviceNames () |
Protected Attributes | |
raw1394handle_t | handle |
BOOL | is_capturing |
BOOL | UseDMA |
nodeid_t * | camera_nodes |
int | numCameras |
dc1394_cameracapture | camera |
int | capturing_duration |
PString | desiredColourFormat |
unsigned | desiredFrameWidth |
unsigned | desiredFrameHeight |
PVideoInput1394DcDevice::PVideoInput1394DcDevice | ( | ) |
Create a new video input device.
PVideoInput1394DcDevice::~PVideoInput1394DcDevice | ( | ) |
Close the video input device on destruction.
BOOL PVideoInput1394DcDevice::Open | ( | const PString & | deviceName, | |
BOOL | startImmediate = TRUE | |||
) | [virtual] |
Open the device given the device name.
startImmediate | Device name to open Immediately start device |
Implements PVideoInputDevice.
BOOL PVideoInput1394DcDevice::IsOpen | ( | ) | [virtual] |
Determine of the device is currently open.
Implements PVideoDevice.
BOOL PVideoInput1394DcDevice::Close | ( | ) | [virtual] |
Close the device.
Reimplemented from PVideoInputDevice.
BOOL PVideoInput1394DcDevice::Start | ( | ) | [virtual] |
Start the video device I/O.
Implements PVideoDevice.
BOOL PVideoInput1394DcDevice::Stop | ( | ) | [virtual] |
Stop the video device I/O capture.
Implements PVideoDevice.
BOOL PVideoInput1394DcDevice::IsCapturing | ( | ) | [virtual] |
Determine if the video device I/O capture is in progress.
Implements PVideoInputDevice.
static PStringList PVideoInput1394DcDevice::GetInputDeviceNames | ( | ) | [static] |
Get a list of all of the drivers available.
PINDEX PVideoInput1394DcDevice::GetMaxFrameBytes | ( | ) | [virtual] |
Get the maximum frame size in bytes.
Note a particular device may be able to provide variable length frames (eg motion JPEG) so will be the maximum size of all frames.
Implements PVideoDevice.
BOOL PVideoInput1394DcDevice::GetFrameData | ( | BYTE * | buffer, | |
PINDEX * | bytesReturned = NULL | |||
) | [virtual] |
Grab a frame, after a delay as specified by the frame rate.
bytesReturned | Buffer to receive frame OPtional bytes returned. |
Implements PVideoInputDevice.
BOOL PVideoInput1394DcDevice::GetFrameDataNoDelay | ( | BYTE * | buffer, | |
PINDEX * | bytesReturned = NULL | |||
) | [virtual] |
Grab a frame. Do not delay according to the current frame rate parameter.
bytesReturned | Buffer to receive frame OPtional bytes returned. |
Implements PVideoInputDevice.
int PVideoInput1394DcDevice::GetBrightness | ( | ) | [virtual] |
Get the brightness of the image. 0xffff-Very bright.
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::SetBrightness | ( | unsigned | newBrightness | ) | [virtual] |
Set brightness of the image. 0xffff-Very bright.
Reimplemented from PVideoDevice.
int PVideoInput1394DcDevice::GetWhiteness | ( | ) | [virtual] |
Get the whiteness of the image. 0xffff-Very white.
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::SetWhiteness | ( | unsigned | newWhiteness | ) | [virtual] |
Set whiteness of the image. 0xffff-Very white.
Reimplemented from PVideoDevice.
int PVideoInput1394DcDevice::GetColour | ( | ) | [virtual] |
Get the colour of the image. 0xffff-lots of colour.
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::SetColour | ( | unsigned | newColour | ) | [virtual] |
Set colour of the image. 0xffff-lots of colour.
Reimplemented from PVideoDevice.
int PVideoInput1394DcDevice::GetContrast | ( | ) | [virtual] |
Get the contrast of the image. 0xffff-High contrast.
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::SetContrast | ( | unsigned | newContrast | ) | [virtual] |
Set contrast of the image. 0xffff-High contrast.
Reimplemented from PVideoDevice.
int PVideoInput1394DcDevice::GetHue | ( | ) | [virtual] |
Get the hue of the image. 0xffff-High hue.
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::SetHue | ( | unsigned | newHue | ) | [virtual] |
Set hue of the image. 0xffff-High hue.
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::GetParameters | ( | int * | whiteness, | |
int * | brightness, | |||
int * | colour, | |||
int * | contrast, | |||
int * | hue | |||
) | [virtual] |
Return whiteness, brightness, colour, contrast and hue in one call.
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::GetFrameSizeLimits | ( | unsigned & | minWidth, | |
unsigned & | minHeight, | |||
unsigned & | maxWidth, | |||
unsigned & | maxHeight | |||
) | [virtual] |
Get the minimum & maximum size of a frame on the device.
minHeight | Variable to receive minimum width |
maxWidth | Variable to receive minimum height |
maxHeight | Variable to receive maximum width Variable to receive maximum height |
Reimplemented from PVideoDevice.
void PVideoInput1394DcDevice::ClearMapping | ( | ) |
int PVideoInput1394DcDevice::GetNumChannels | ( | ) | [virtual] |
Get the number of video channels available on the device.
Default behaviour returns 1.
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::SetChannel | ( | int | channelNumber | ) | [virtual] |
Set the video channel to be used on the device. The channel number is an integer from 0 to GetNumChannels()-1. The special value of -1 will find the first working channel number.
Default behaviour sets the value of the channelNumber variable and then returns TRUE.
channelNumber | New channel number for device. |
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::SetFrameRate | ( | unsigned | rate | ) | [virtual] |
Set the video frame rate to be used on the device.
Default behaviour sets the value of the frameRate variable and then returns TRUE.
rate | Frames per second |
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::SetVideoFormat | ( | VideoFormat | videoFormat | ) | [virtual] |
Set the video format to be used.
Default behaviour sets the value of the videoFormat variable and then returns TRUE.
videoFormat | New video format |
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::SetFrameSize | ( | unsigned | width, | |
unsigned | height | |||
) | [virtual] |
Set the frame size to be used.
Note that devices may not be able to produce the requested size, and this function will fail. See SetFrameSizeConverter().
Default behaviour sets the frameWidth and frameHeight variables and returns TRUE.
height | New width of frame New height of frame |
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::SetColourFormat | ( | const PString & | colourFormat | ) | [virtual] |
Set the colour format to be used. Note that this function does not do any conversion. If it returns TRUE then the video device does the colour format in native mode.
To utilise an internal converter use the SetColourFormatConverter() function.
Default behaviour sets the value of the colourFormat variable and then returns TRUE.
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::TestAllFormats | ( | ) | [virtual] |
Try all known video formats & see which ones are accepted by the video driver
Implements PVideoInputDevice.
BOOL PVideoInput1394DcDevice::SetFrameSizeConverter | ( | unsigned | width, | |
unsigned | height, | |||
BOOL | bScaleNotCrop | |||
) | [virtual] |
Set the frame size to be used, trying converters if available.
If the device does not support the size, a set of alternate resolutions are attempted. A converter is setup if possible.
height | New width of frame |
bScaleNotCrop | New height of frame Scale or crop/pad preference |
Reimplemented from PVideoDevice.
BOOL PVideoInput1394DcDevice::SetColourFormatConverter | ( | const PString & | colourFormat | ) | [virtual] |
Set the colour format to be used, trying converters if available.
This function will set the colour format on the device to one that is compatible with a registered converter, and install that converter so that the correct format is used.
Reimplemented from PVideoDevice.
raw1394handle_t PVideoInput1394DcDevice::handle [protected] |
BOOL PVideoInput1394DcDevice::is_capturing [protected] |
BOOL PVideoInput1394DcDevice::UseDMA [protected] |
nodeid_t* PVideoInput1394DcDevice::camera_nodes [protected] |
int PVideoInput1394DcDevice::numCameras [protected] |
dc1394_cameracapture PVideoInput1394DcDevice::camera [protected] |
int PVideoInput1394DcDevice::capturing_duration [protected] |
PString PVideoInput1394DcDevice::desiredColourFormat [protected] |
unsigned PVideoInput1394DcDevice::desiredFrameWidth [protected] |
unsigned PVideoInput1394DcDevice::desiredFrameHeight [protected] |