PTLib  Version 2.10.4
PVideoInputDevice Class Reference

This class defines a video input device. More...

#include <videoio.h>

Inheritance diagram for PVideoInputDevice:
PVideoDevice PVideoFrameInfo PObject PVideoInput1394DcDevice

List of all members.

Classes

struct  Capabilities

Public Member Functions

 ~PVideoInputDevice ()
 Create a new video input device.
virtual bool GetDeviceCapabilities (Capabilities *capabilities) const
 Retrieve a list of Device Capabilities.
virtual PVideoInputControlGetVideoInputControls ()
 Get the devices video Input controls By Default return NULL;.
virtual PBoolean Open (const PString &deviceName, PBoolean startImmediate=true)=0
 Open the device given the device name.
virtual PBoolean Close ()
 Close the device.
virtual PBoolean CanCaptureVideo () const
 Is the device a camera, and obtain video.
virtual PBoolean IsCapturing ()=0
 Determine if the video device I/O capture is in progress.
virtual PBoolean SetNearestFrameSize (unsigned width, unsigned height)
 Set the nearest available frame size to be used.
virtual PBoolean GetFrame (PBYTEArray &frame)
 Grab a frame.
virtual PBoolean GetFrameData (BYTE *buffer, PINDEX *bytesReturned, unsigned int &flags)
 Grab a frame, after a delay as specified by the frame rate.
virtual PBoolean GetFrameData (BYTE *buffer, PINDEX *bytesReturned=NULL)=0
virtual PBoolean GetFrameDataNoDelay (BYTE *buffer, PINDEX *bytesReturned, unsigned int &flags)
 Grab a frame.
virtual PBoolean GetFrameDataNoDelay (BYTE *buffer, PINDEX *bytesReturned=NULL)=0
virtual bool FlowControl (const void *flowData)
 Pass data to the inputdevice for flowControl determination.
virtual bool SetCaptureMode (unsigned mode)
 Set the capture modes for implementations that support them.
virtual int GetCaptureMode () const
 Returns the current capture mode.

Static Public Member Functions

static PStringArray GetDriverNames (PPluginManager *pluginMgr=NULL)
 Get the list of available video input drivers (plug-ins)
static PStringArray GetDriversDeviceNames (const PString &driverName, PPluginManager *pluginMgr=NULL)
 Get video input devices that correspond to the specified driver name.
static PVideoInputDeviceCreateDevice (const PString &driverName, PPluginManager *pluginMgr=NULL)
 Create the video input device that corresponds to the specified driver name.
static PVideoInputDeviceCreateDeviceByName (const PString &deviceName, const PString &driverName=PString::Empty(), PPluginManager *pluginMgr=NULL)
static PVideoInputDeviceCreateOpenedDevice (const PString &driverName, const PString &deviceName, PBoolean startImmediate=true, PPluginManager *pluginMgr=NULL)
 Create an opened video input device that corresponds to the specified names.
static PVideoInputDeviceCreateOpenedDevice (const OpenArgs &args, PBoolean startImmediate=true)
 Create an opened video output device that corresponds to the specified arguments.
static PBoolean GetDeviceCapabilities (const PString &deviceName, Capabilities *capabilities, PPluginManager *pluginMgr=NULL)
 Retrieve a list of Device Capabilities for particular device.
static PBoolean GetDeviceCapabilities (const PString &deviceName, const PString &driverName, Capabilities *caps, PPluginManager *pluginMgr=NULL)
 Retrieve a list of Device Capabilities for a particular driver.

Detailed Description

This class defines a video input device.


Constructor & Destructor Documentation

Create a new video input device.

Close the video input device on destruction.

References Close().


Member Function Documentation

virtual PBoolean PVideoInputDevice::CanCaptureVideo ( ) const [virtual]

Is the device a camera, and obtain video.

Implements PVideoDevice.

virtual PBoolean PVideoInputDevice::Close ( ) [inline, virtual]

Close the device.

Implements PVideoDevice.

Reimplemented in PVideoInput1394DcDevice.

Referenced by ~PVideoInputDevice().

static PVideoInputDevice* PVideoInputDevice::CreateDevice ( const PString driverName,
PPluginManager pluginMgr = NULL 
) [static]

Create the video input device that corresponds to the specified driver name.

Parameters:
driverNameName of driver
pluginMgrPlug in manager, use default if NULL
static PVideoInputDevice* PVideoInputDevice::CreateDeviceByName ( const PString deviceName,
const PString driverName = PString::Empty(),
PPluginManager pluginMgr = NULL 
) [static]
Parameters:
deviceNameName of device
driverNameName of driver (if any)
pluginMgrPlug in manager, use default if NULL
static PVideoInputDevice* PVideoInputDevice::CreateOpenedDevice ( const PString driverName,
const PString deviceName,
PBoolean  startImmediate = true,
PPluginManager pluginMgr = NULL 
) [static]

Create an opened video input device that corresponds to the specified names.

If the driverName parameter is an empty string or "*" then CreateDeviceByName is used with the deviceName parameter which is assumed to be a value returned from GetDriversDeviceNames().

Parameters:
driverNameName of driver
deviceNameName of device
startImmediateImmediately start grabbing
pluginMgrPlug in manager, use default if NULL
static PVideoInputDevice* PVideoInputDevice::CreateOpenedDevice ( const OpenArgs args,
PBoolean  startImmediate = true 
) [static]

Create an opened video output device that corresponds to the specified arguments.

Parameters:
argsParameters to set on opened device
startImmediateImmediately start display
virtual bool PVideoInputDevice::FlowControl ( const void *  flowData) [virtual]

Pass data to the inputdevice for flowControl determination.

virtual int PVideoInputDevice::GetCaptureMode ( ) const [virtual]

Returns the current capture mode.

See SetCaptureMode() for more details. A return value of -1 indicates an error or the mode is not supported.

virtual bool PVideoInputDevice::GetDeviceCapabilities ( Capabilities capabilities) const [inline, virtual]

Retrieve a list of Device Capabilities.

Parameters:
capabilitiesList of supported capabilities

References GetDeviceCapabilities(), and PVideoDevice::GetDeviceName().

Referenced by GetDeviceCapabilities().

static PBoolean PVideoInputDevice::GetDeviceCapabilities ( const PString deviceName,
Capabilities capabilities,
PPluginManager pluginMgr = NULL 
) [static]

Retrieve a list of Device Capabilities for particular device.

Parameters:
deviceNameName of device
capabilitiesList of supported capabilities
pluginMgrPlug in manager, use default if NULL
static PBoolean PVideoInputDevice::GetDeviceCapabilities ( const PString deviceName,
const PString driverName,
Capabilities caps,
PPluginManager pluginMgr = NULL 
) [static]

Retrieve a list of Device Capabilities for a particular driver.

Parameters:
deviceNameName of device
driverNameDevice Driver
capsList of supported capabilities
pluginMgrPlug in manager, use default if NULL
static PStringArray PVideoInputDevice::GetDriverNames ( PPluginManager pluginMgr = NULL) [static]

Get the list of available video input drivers (plug-ins)

Parameters:
pluginMgrPlug in manager, use default if NULL
static PStringArray PVideoInputDevice::GetDriversDeviceNames ( const PString driverName,
PPluginManager pluginMgr = NULL 
) [static]

Get video input devices that correspond to the specified driver name.

If driverName is an empty string or the value "*" then this will return a list of unique device names across all of the available drivers. If two drivers have identical names for devices, then the string returned will be of the form driver+'\t'+device.

Parameters:
driverNameName of driver
pluginMgrPlug in manager, use default if NULL
virtual PBoolean PVideoInputDevice::GetFrame ( PBYTEArray frame) [virtual]

Grab a frame.

virtual PBoolean PVideoInputDevice::GetFrameData ( BYTE *  buffer,
PINDEX *  bytesReturned,
unsigned int &  flags 
) [virtual]

Grab a frame, after a delay as specified by the frame rate.

Parameters:
bufferBuffer to receive frame
bytesReturnedOptional bytes returned.
flagsoptional flags returned
virtual PBoolean PVideoInputDevice::GetFrameData ( BYTE *  buffer,
PINDEX *  bytesReturned = NULL 
) [pure virtual]
Parameters:
bufferBuffer to receive frame
bytesReturnedOptional bytes returned.

Implemented in PVideoInput1394DcDevice.

virtual PBoolean PVideoInputDevice::GetFrameDataNoDelay ( BYTE *  buffer,
PINDEX *  bytesReturned,
unsigned int &  flags 
) [virtual]

Grab a frame.

Do not delay according to the current frame rate parameter.

Parameters:
bufferBuffer to receive frame
bytesReturnedOptional bytes returned.
flagsoptional flags returned
virtual PBoolean PVideoInputDevice::GetFrameDataNoDelay ( BYTE *  buffer,
PINDEX *  bytesReturned = NULL 
) [pure virtual]
Parameters:
bufferBuffer to receive frame
bytesReturnedOptional bytes returned.

Implemented in PVideoInput1394DcDevice.

Get the devices video Input controls By Default return NULL;.

virtual PBoolean PVideoInputDevice::IsCapturing ( ) [pure virtual]

Determine if the video device I/O capture is in progress.

Implemented in PVideoInput1394DcDevice.

virtual PBoolean PVideoInputDevice::Open ( const PString deviceName,
PBoolean  startImmediate = true 
) [pure virtual]

Open the device given the device name.

Parameters:
deviceNameDevice name to open
startImmediateImmediately start device

Implements PVideoDevice.

Implemented in PVideoInput1394DcDevice.

virtual bool PVideoInputDevice::SetCaptureMode ( unsigned  mode) [virtual]

Set the capture modes for implementations that support them.

For example with Video For Windows, this is used to select picture (0) or video (1) modes.

In picture-mode the implementation requests a single frame from the connected camera device. The camera device then does nothing until the frame has been processed and the next is requested.

In video-mode the camera continuously sends new frames.

The default implementation does nothing but returns PFalse.

virtual PBoolean PVideoInputDevice::SetNearestFrameSize ( unsigned  width,
unsigned  height 
) [virtual]

Set the nearest available frame size to be used.

Note that devices may not be able to produce the requested size, so this function picks the nearest available size.

Default behaviour simply calls SetFrameSize().

Parameters:
widthNew width of frame
heightNew height of frame

Reimplemented from PVideoDevice.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines