#include <videoio.h>
Inheritance diagram for PVideoDevice:
Public Types | |
enum | VideoFormat { PAL, NTSC, SECAM, Auto, NumVideoFormats } |
enum | StandardSizes { CIF16Width = 1408, CIF16Height = 1152, CIF4Width = 704, CIF4Height = 576, CIFWidth = 352, CIFHeight = 288, QCIFWidth = 176, QCIFHeight = 144, SQCIFWidth = 144, SQCIFHeight = 96 } |
Public Member Functions | |
virtual | ~PVideoDevice () |
const PString & | GetDeviceName () const |
virtual PStringList | GetDeviceNames () const =0 |
virtual BOOL | OpenFull (const OpenArgs &args, BOOL startImmediate=TRUE) |
virtual BOOL | Open (const PString &deviceName, BOOL startImmediate=TRUE)=0 |
virtual BOOL | IsOpen ()=0 |
virtual BOOL | Close ()=0 |
virtual BOOL | Start ()=0 |
virtual BOOL | Stop ()=0 |
virtual BOOL | SetVideoFormat (VideoFormat videoFormat) |
virtual VideoFormat | GetVideoFormat () const |
virtual int | GetNumChannels () |
virtual BOOL | SetChannel (int channelNumber) |
virtual int | GetChannel () const |
virtual BOOL | SetColourFormatConverter (const PString &colourFormat) |
virtual BOOL | SetColourFormat (const PString &colourFormat) |
const PString & | GetColourFormat () const |
virtual BOOL | GetVFlipState () |
virtual BOOL | SetVFlipState (BOOL newVFlipState) |
virtual BOOL | SetFrameRate (unsigned rate) |
virtual unsigned | GetFrameRate () const |
virtual BOOL | GetFrameSizeLimits (unsigned &minWidth, unsigned &minHeight, unsigned &maxWidth, unsigned &maxHeight) |
virtual BOOL | SetFrameSizeConverter (unsigned width, unsigned height, BOOL bScaleNotCrop) |
virtual BOOL | SetFrameSize (unsigned width, unsigned height) |
virtual BOOL | GetFrameSize (unsigned &width, unsigned &height) |
virtual unsigned | GetFrameWidth () const |
virtual unsigned | GetFrameHeight () const |
virtual PINDEX | GetMaxFrameBytes ()=0 |
int | GetLastError () const |
virtual BOOL | CanCaptureVideo () const =0 |
virtual int | GetBrightness () |
virtual BOOL | SetBrightness (unsigned newBrightness) |
virtual int | GetWhiteness () |
virtual BOOL | SetWhiteness (unsigned newWhiteness) |
virtual int | GetColour () |
virtual BOOL | SetColour (unsigned newColour) |
virtual int | GetContrast () |
virtual BOOL | SetContrast (unsigned newContrast) |
virtual int | GetHue () |
virtual BOOL | SetHue (unsigned newHue) |
virtual BOOL | GetParameters (int *whiteness, int *brightness, int *colour, int *contrast, int *hue) |
virtual BOOL | SetVideoChannelFormat (int channelNumber, VideoFormat videoFormat) |
void | SetPreferredColourFormat (const PString &colourFmt) |
const PString & | GetPreferredColourFormat () |
Static Public Member Functions | |
static unsigned | CalculateFrameBytes (unsigned width, unsigned height, const PString &colourFormat) |
Protected Member Functions | |
PVideoDevice () | |
PINDEX | GetMaxFrameBytesConverted (PINDEX rawFrameBytes) const |
Protected Attributes | |
PString | deviceName |
int | lastError |
VideoFormat | videoFormat |
int | channelNumber |
PString | colourFormat |
PString | preferredColourFormat |
unsigned | frameRate |
unsigned | frameWidth |
unsigned | frameHeight |
BOOL | nativeVerticalFlip |
PColourConverter * | converter |
int | frameBrightness |
int | frameWhiteness |
int | frameContrast |
int | frameColour |
int | frameHue |
PTime | previousFrameTime |
int | msBetweenFrames |
int | frameTimeError |
Classes | |
struct | OpenArgs |
Example colour formats are:
"Grey" Simple 8 bit linear grey scale "Gray" Synonym for Grey "RGB32" 32 bit RGB "RGB24" 24 bit RGB "RGB565" 16 bit RGB (6 bit green) "RGB555" 15 bit RGB "YUV422" YUV 4:2:2 packed "YUV422P" YUV 4:2:2 planar "YUV411" YUV 4:1:1 packed "YUV411P" YUV 4:1:1 planar "YUV420" YUV 4:2:0 packed "YUV420P" YUV 4:2:0 planar "YUV410" YUV 4:1:0 packed "YUV410P" YUV 4:1:0 planar "MJPEG" Motion JPEG "UYVY422" YUV 4:2:2 packed as U Y V Y U Y V Y ... "UYV444 YUV 4:4:4 packed as U Y V U Y V ... They are used in IEEE 1394 digital cameras. The specification is found at http://www.1394ta.org/Download/Technology/Specifications/2000/IIDC_Spec_v1_30.pdf
|
|
|
|
|
Create a new video device (input or output). |
|
Delete structures created by PVideoDevice(); |
|
Get the number of bytes of an image, given a particular width, height and colour format. |
|
Is the device a camera, and obtain video Implemented in PVideoOutputDevice, and PVideoInputDevice. |
|
Close the device. Implemented in PVideoOutputDevice, PVideoInputDevice, and PVideoInput1394DcDevice. |
|
Get the brightness of the image. 0xffff-Very bright. -1 is unknown. Reimplemented in PVideoInput1394DcDevice. |
|
Get the video channel to be used on the device. Default behaviour returns the value of the channelNumber variable. |
|
Get the colour of the image. 0xffff-lots of colour. -1 is unknown. Reimplemented in PVideoInput1394DcDevice. |
|
Get the colour format to be used. Default behaviour returns the value of the colourFormat variable. |
|
Get the contrast of the image. 0xffff-High contrast. -1 is unknown. Reimplemented in PVideoInput1394DcDevice. |
|
Get the device name of the open device. |
|
Get a list of all of the drivers available. |
|
Get the height of the frame being used. Default behaviour returns the value of the frameHeight variable |
|
Get the video frame rate used on the device. Default behaviour returns the value of the frameRate variable. |
|
Get the frame size being used. Default behaviour returns the value of the frameWidth and frameHeight variable and returns TRUE. |
|
Get the minimum & maximum size of a frame on the device. Default behaviour returns the value 1 to UINT_MAX for both and returns FALSE.
Reimplemented in PVideoInput1394DcDevice. |
|
Get the width of the frame being used. Default behaviour returns the value of the frameWidth variable |
|
Get the hue of the image. 0xffff-High hue. -1 is unknown. Reimplemented in PVideoInput1394DcDevice. |
|
Get the last error code. This is a platform dependent number. |
|
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. Implemented in PVideoOutputDeviceRGB, and PVideoInput1394DcDevice. |
|
|
|
Get the number of video channels available on the device. Default behaviour returns 1. Reimplemented in PVideoInput1394DcDevice. |
|
Return whiteness, brightness, colour, contrast and hue in one call. Reimplemented in PVideoInput1394DcDevice. |
|
Get preferred native colour format from video capture device. Returns empty == no preference |
|
Get the video conversion vertical flip state. Default action is to return FALSE. |
|
Get the video format being used. Default behaviour returns the value of the videoFormat variable. |
|
Get the whiteness of the image. 0xffff-Very white. -1 is unknown. Reimplemented in PVideoInput1394DcDevice. |
|
Determine if the device is currently open. Implemented in PVideoInput1394DcDevice. |
|
Open the device given the device name.
Implemented in PVideoInputDevice, and PVideoInput1394DcDevice. |
|
Open the device given the device name.
|
|
Set brightness of the image. 0xffff-Very bright. Reimplemented in PVideoInput1394DcDevice. |
|
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.
Reimplemented in PVideoInput1394DcDevice. |
|
Set colour of the image. 0xffff-lots of colour. Reimplemented in PVideoInput1394DcDevice. |
|
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 in PVideoOutputDeviceRGB, and PVideoInput1394DcDevice. |
|
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 in PVideoInput1394DcDevice. |
|
Set contrast of the image. 0xffff-High contrast. Reimplemented in PVideoInput1394DcDevice. |
|
Set the video frame rate to be used on the device. Default behaviour sets the value of the frameRate variable and then returns TRUE.
Reimplemented in PVideoInput1394DcDevice. |
|
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.
Reimplemented in PVideoOutputDeviceRGB, and PVideoInput1394DcDevice. |
|
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.
Reimplemented in PVideoInput1394DcDevice. |
|
Set hue of the image. 0xffff-High hue. Reimplemented in PVideoInput1394DcDevice. |
|
Set preferred native colour format from video capture device. Note empty == no preference. |
|
Set the video conversion vertical flip state. Default action is to return FALSE.
|
|
Set VideoFormat and VideoChannel in one ioctl |
|
Set the video format to be used. Default behaviour sets the value of the videoFormat variable and then returns TRUE.
Reimplemented in PVideoInput1394DcDevice. |
|
Set whiteness of the image. 0xffff-Very white. Reimplemented in PVideoInput1394DcDevice. |
|
Start the video device I/O capture. Implemented in PVideoOutputDevice, and PVideoInput1394DcDevice. |
|
Stop the video device I/O capture. Implemented in PVideoOutputDevice, and PVideoInput1394DcDevice. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|