class PFakeVideoInputDevice

This class defines a video input device that generates fictitous image data

Inheritance:


Public Methods

[more] PFakeVideoInputDevice ()
Create a new (fake) video input device
[more]BOOL Open ( const PString & deviceName, BOOL startImmediate = TRUE )
Open the device given the device name.
[more]BOOL IsOpen ()
Determine of the device is currently open
[more]BOOL Close ()
Close the device
[more]BOOL Start ()
Start the video device I/O
[more]BOOL Stop ()
Stop the video device I/O capture
[more]BOOL IsCapturing ()
Determine if the video device I/O capture is in progress
[more]static PStringList GetInputDeviceNames ()
Get a list of all of the drivers available
[more]virtual PINDEX GetMaxFrameBytes ()
Get the maximum frame size in bytes.
[more]virtual BOOL GetFrameData ( BYTE* buffer, PINDEX* bytesReturned = NULL )
Grab a frame.
[more]virtual BOOL GetFrameDataNoDelay ( BYTE* buffer, PINDEX* bytesReturned = NULL )
Grab a frame.
[more]void GrabMovingBlocksTestFrame (BYTE* resFrame)
A test image that contains area of low and high resolution.
[more]void GrabMovingLineTestFrame (BYTE* resFrame)
a test image consisting of a horizontal line moving down the image, with a constantly varying background.
[more]void GrabNTSCTestFrame (BYTE* resFrame)
Generate a constant image, which contains the colours for a NTSC test frame
[more]void GrabBouncingBoxes (BYTE* resFrame)
Generate three bouncing boxes, which bounce from a different height
[more]void GrabBlankImage (BYTE* resFrame)
Generate a static image, containing a constant field of grey
[more]void GrabOriginalMovingBlocksFrame (BYTE* resFrame)
Generate the original form of the moving blocks test frame
[more]void GrabTextVideoFrame (BYTE* resFrame)
Generate a textual output on the fake video image
[more]OneVFakeLetterData* FindLetter (char ascii)
Get the stucture holding required letter for GetTextVideoFrame()
[more]void FillRect (BYTE* frame, unsigned width, unsigned height, int x, int y, int rectWidth, int rectHeight, int r, int g, int b)
Fills a region of the image with a constant colour
[more]virtual void WaitFinishPreviousFrame ()
Given a preset interval of n milliseconds, this function returns n msecs after the previous frame capture was initiated
[more]virtual BOOL SetVideoFormat ( VideoFormat videoFormat )
Set the video format to be used.
[more]virtual int GetNumChannels ()
Get the number of video channels available on the device.
[more]virtual BOOL SetChannel ( int channelNumber )
Set the video channel to be used on the device.
[more]virtual BOOL SetColourFormat ( const PString & colourFormat )
Set the colour format to be used.
[more]virtual BOOL SetFrameRate ( unsigned rate )
Set the video frame rate to be used on the device.
[more]virtual BOOL GetFrameSizeLimits ( unsigned & minWidth, unsigned & minHeight, unsigned & maxWidth, unsigned & maxHeight )
Get the minimum & maximum size of a frame on the device.
[more]virtual BOOL SetFrameSize ( unsigned width, unsigned height )
Set the frame size to be used.
[more]virtual BOOL TestAllFormats ()
Try all known video formats & see which ones are accepted by the video driver


Inherited from PVideoInputDevice:

Public Methods

ovirtual BOOL CanCaptureVideo() const
ovirtual PStringList GetDeviceNames() const
ovirtual BOOL GetFrame( PBYTEArray & frame )

Protected Methods

ovirtual BOOL VerifyHardwareFrameSize(unsigned width, unsigned height)


Inherited from PVideoDevice:

Public Methods

ovirtual BOOL OpenFull( const OpenArgs & args, BOOL startImmediate = TRUE )
oconst PString& GetDeviceName() const
ovirtual VideoFormat GetVideoFormat() const
ovirtual int GetChannel() const
ovirtual BOOL SetColourFormatConverter( const PString & colourFormat )
oconst PString& GetColourFormat() const
ovirtual unsigned GetFrameRate() const
ovirtual BOOL SetFrameSizeConverter( unsigned width, unsigned height, BOOL bScaleNotCrop )
ovirtual BOOL GetFrameSize( unsigned & width, unsigned & height )
ovirtual unsigned GetFrameWidth() const
ovirtual unsigned GetFrameHeight() const
ostatic unsigned CalculateFrameBytes( unsigned width, unsigned height, const PString & colourFormat )
oint GetLastError() const
ovirtual int GetBrightness()
ovirtual BOOL SetBrightness(unsigned newBrightness)
ovirtual int GetWhiteness()
ovirtual BOOL SetWhiteness(unsigned newWhiteness)
ovirtual int GetColour()
ovirtual BOOL SetColour(unsigned newColour)
ovirtual int GetContrast()
ovirtual BOOL SetContrast(unsigned newContrast)
ovirtual int GetHue()
ovirtual BOOL SetHue(unsigned newHue)
ovirtual BOOL GetParameters( int* whiteness, int* brightness, int* colour, int* contrast, int* hue )
ovirtual BOOL SetVideoChannelFormat( int channelNumber, VideoFormat videoFormat )
ovirtual BOOL GetVFlipState()
ovirtual BOOL SetVFlipState( BOOL newVFlipState )
ovoid SetPreferredColourFormat(const PString & colourFmt)
oconst PString& GetPreferredColourFormat()


Inherited from PObject:

Public Methods

Run Time Type functions

I/O functions

Miscellaneous functions

Public Members

Comparison functions


Documentation

This class defines a video input device that generates fictitous image data
o PFakeVideoInputDevice()
Create a new (fake) video input device

oBOOL Open( const PString & deviceName, BOOL startImmediate = TRUE )
Open the device given the device name.
Parameters:
deviceName - Device name to open
startImmediate - Immediately start device

oBOOL IsOpen()
Determine of the device is currently open

oBOOL Close()
Close the device

oBOOL Start()
Start the video device I/O

oBOOL Stop()
Stop the video device I/O capture

oBOOL IsCapturing()
Determine if the video device I/O capture is in progress

ostatic PStringList GetInputDeviceNames()
Get a list of all of the drivers available

ovirtual PINDEX GetMaxFrameBytes()
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.

ovirtual BOOL GetFrameData( BYTE* buffer, PINDEX* bytesReturned = NULL )
Grab a frame.

There will be a delay in returning, as specified by frame rate.

Parameters:
- buffer Buffer to receive frame
bytesReturned - Optional bytes returned.

ovirtual BOOL GetFrameDataNoDelay( BYTE* buffer, PINDEX* bytesReturned = NULL )
Grab a frame.

Do not delay according to the current frame rate.

Parameters:
- buffer Buffer to receive frame
bytesReturned - OPtional bytes returned.

ovoid GrabMovingBlocksTestFrame(BYTE* resFrame)
A test image that contains area of low and high resolution. The picture changes every second

ovoid GrabMovingLineTestFrame(BYTE* resFrame)
a test image consisting of a horizontal line moving down the image, with a constantly varying background.

ovoid GrabNTSCTestFrame(BYTE* resFrame)
Generate a constant image, which contains the colours for a NTSC test frame

ovoid GrabBouncingBoxes(BYTE* resFrame)
Generate three bouncing boxes, which bounce from a different height

ovoid GrabBlankImage(BYTE* resFrame)
Generate a static image, containing a constant field of grey

ovoid GrabOriginalMovingBlocksFrame(BYTE* resFrame)
Generate the original form of the moving blocks test frame

ovoid GrabTextVideoFrame(BYTE* resFrame)
Generate a textual output on the fake video image

oOneVFakeLetterData* FindLetter(char ascii)
Get the stucture holding required letter for GetTextVideoFrame()

ovoid FillRect(BYTE* frame, unsigned width, unsigned height, int x, int y, int rectWidth, int rectHeight, int r, int g, int b)
Fills a region of the image with a constant colour

ovirtual void WaitFinishPreviousFrame()
Given a preset interval of n milliseconds, this function returns n msecs after the previous frame capture was initiated

ovirtual BOOL SetVideoFormat( VideoFormat videoFormat )
Set the video format to be used.

Default behaviour sets the value of the videoFormat variable and then returns the IsOpen() status.

Parameters:
videoFormat - New video format

ovirtual int GetNumChannels()
Get the number of video channels available on the device.

Default behaviour returns 1.

ovirtual BOOL SetChannel( int channelNumber )
Set the video channel to be used on the device.

Default behaviour sets the value of the channelNumber variable and then returns the IsOpen() status.

Parameters:
channelNumber - New channel number for device.

ovirtual BOOL SetColourFormat( const PString & colourFormat )
Set the colour format to be used.

Default behaviour sets the value of the colourFormat variable and then returns the IsOpen() status.

ovirtual BOOL SetFrameRate( unsigned rate )
Set the video frame rate to be used on the device.

Default behaviour sets the value of the frameRate variable and then return the IsOpen() status.

Parameters:
rate - Frames per second

ovirtual BOOL GetFrameSizeLimits( unsigned & minWidth, unsigned & minHeight, unsigned & maxWidth, unsigned & maxHeight )
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.

Parameters:
minWidth - Variable to receive minimum width
minHeight - Variable to receive minimum height
maxWidth - Variable to receive maximum width
maxHeight - Variable to receive maximum height

ovirtual BOOL SetFrameSize( unsigned width, unsigned height )
Set the frame size to be used.

Default behaviour sets the frameWidth and frameHeight variables and returns the IsOpen() status.

Parameters:
width - New width of frame
height - New height of frame

ovirtual BOOL TestAllFormats()
Try all known video formats & see which ones are accepted by the video driver


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.