class PVideoChannel

A class representing a video channel.

Inheritance:


Public Methods

[more] Construction
[more] Open functions
[more]virtual PINDEX GetGrabWidth ()
Return the width of the currently selected grabbing device
[more]virtual PINDEX GetGrabHeight ()
Return the height of the currently selected grabbing device
[more]BOOL Write (const void* buf, PINDEX len)
Low level write to the channel, which is data to be rendered to the local video display device
[more]virtual BOOL Redraw (const void* frame)
Cause the referenced data to be drawn to the previously defined media
[more]PINDEX GetRenderWidth ()
Return the previously specified width
[more]PINDEX GetRenderHeight ()
Return the previously specified height
[more]virtual void SetRenderFrameSize (int _width, int _height)
Specifiy the width and height of the video stream, which is to be rendered onto the previously specified device
[more]virtual void SetGrabberFrameSize (int _width, int _height)
Specifiy the width and height of the video stream, which is to be extracted from the previously specified device
[more]virtual void AttachVideoPlayer (PVideoOutputDevice* device, BOOL keepCurrent = TRUE)
Attach a user specific class for rendering video
[more]virtual void AttachVideoReader (PVideoInputDevice* device, BOOL keepCurrent = TRUE)
Attach a user specific class for acquiring video
[more]virtual PVideoInputDevice* GetVideoReader ()
Return a pointer to the class for acquiring video
[more]virtual PVideoOutputDevice* GetVideoPlayer ()
Return a pointer to the class for displaying video
[more]virtual BOOL IsGrabberOpen ()
See if the grabber is open
[more]virtual BOOL IsRenderOpen ()
See if the rendering device is open
[more]BOOL DisplayRawData (void* videoBuffer)
Get data from the attached inputDevice, and display on the attached ouptutDevice
[more]virtual void CloseVideoReader ()
Destroy the attached grabber class
[more]virtual void CloseVideoPlayer ()
Destroy the attached video display class
[more]void RestrictAccess ()
Restrict others from using this video channel
[more]void EnableAccess ()
Allow free access to this video channel
[more]BOOL ToggleVFlipInput ()
Toggle the vertical flip state of the video grabber

Protected Fields

[more]PVideoInputDevice* mpInput
Specified video device name, eg /dev/video0
[more]PVideoOutputDevice* mpOutput
For grabbing video from the camera
[more]PMutex accessMutex
For displaying video on the screen


Inherited from PChannel:

Public Methods

Overrides from class PObject

Information functions

Reading functions

Writing functions

Miscellaneous functions

ostatic BOOL ConvertOSError( int libcReturnValue, Errors & lastError, int & osError )

Public Members

Error functions

Protected Fields

oint os_handle
oErrors lastErrorCode[NumErrorGroups+1]
oint lastErrorNumber[NumErrorGroups+1]
oPINDEX lastReadCount
oPINDEX lastWriteCount
oPTimeInterval readTimeout
oPTimeInterval writeTimeout

Protected Methods

ovirtual BOOL ConvertOSError( int libcReturnValue, ErrorGroup group = LastGeneralError )
oBOOL SetErrorValues( Errors errorCode, int osError, ErrorGroup group = LastGeneralError )
oint ReadCharWithTimeout( PTimeInterval & timeout )


Inherited from PObject:

Public Methods

Run Time Type functions

I/O functions

Public Members

Comparison functions


Documentation

A class representing a video channel. This class is provided mainly for the playback or recording of video on the system.

Note that this video channel is implicitly a series of frames in YUV411P format. No conversion is performed on data to/from the channel.

o Construction

o PVideoChannel()
Create a video channel

o PVideoChannel( const PString & device, Directions dir )
Create a video channel. Create a reference to the video drivers for the platform.
Parameters:
- device Name of video driver/device
dir - Video I/O direction

o Open functions

oBOOL Open( const PString & device, Directions dir )
Open the specified device for playing or recording. The device name is platform specific and is as returned in the GetDevices() function.

Parameters:
- device Name of video driver/device
dir - Video I/O direction
Returns:
TRUE if the video device is valid for playing/recording.

oBOOL IsOpen() const
return True if one (or both) of the video device class pointers is non NULL. If either pointer is non NULL, then a device is ready to be written to, which indicates this channel is open.

ostatic PStringList GetDeviceNames( Directions dir )
Get all of the names for video devices/drivers that are available on this platform. Note that a named device may not necessarily do both playing and recording so the arrays returned with the dir parameter in each value is not necessarily the same.

Returns:
An array of platform dependent strings for each video player/recorder.

ostatic PString GetDefaultDevice( Directions dir )
Get the name for the default video devices/driver that is on this platform. Note that a named device may not necessarily do both playing and recording so the arrays returned with the dir parameter in each value is not necessarily the same.

Returns:
A platform dependent string for the video player/recorder.

ovirtual PINDEX GetGrabWidth()
Return the width of the currently selected grabbing device

ovirtual PINDEX GetGrabHeight()
Return the height of the currently selected grabbing device

oBOOL Write(const void* buf, PINDEX len)
Low level write to the channel, which is data to be rendered to the local video display device

ovirtual BOOL Redraw(const void* frame)
Cause the referenced data to be drawn to the previously defined media

oPINDEX GetRenderWidth()
Return the previously specified width

oPINDEX GetRenderHeight()
Return the previously specified height

ovirtual void SetRenderFrameSize(int _width, int _height)
Specifiy the width and height of the video stream, which is to be rendered onto the previously specified device

ovirtual void SetGrabberFrameSize(int _width, int _height)
Specifiy the width and height of the video stream, which is to be extracted from the previously specified device

ovirtual void AttachVideoPlayer(PVideoOutputDevice* device, BOOL keepCurrent = TRUE)
Attach a user specific class for rendering video

If keepCurrent is true, an abort is caused when the program attempts to attach a new player when there is already a video player attached.

If keepCurrent is false, the existing video player is deleted before attaching the new player.

ovirtual void AttachVideoReader(PVideoInputDevice* device, BOOL keepCurrent = TRUE)
Attach a user specific class for acquiring video

If keepCurrent is true, an abort is caused when the program attempts to attach a new reader when there is already a video reader attached.

If keepCurrent is false, the existing video reader is deleted before attaching the new reader.

ovirtual PVideoInputDevice* GetVideoReader()
Return a pointer to the class for acquiring video

ovirtual PVideoOutputDevice* GetVideoPlayer()
Return a pointer to the class for displaying video

ovirtual BOOL IsGrabberOpen()
See if the grabber is open

ovirtual BOOL IsRenderOpen()
See if the rendering device is open

oBOOL DisplayRawData(void* videoBuffer)
Get data from the attached inputDevice, and display on the attached ouptutDevice

ovirtual void CloseVideoReader()
Destroy the attached grabber class

ovirtual void CloseVideoPlayer()
Destroy the attached video display class

ovoid RestrictAccess()
Restrict others from using this video channel

ovoid EnableAccess()
Allow free access to this video channel

oBOOL ToggleVFlipInput()
Toggle the vertical flip state of the video grabber

oPVideoInputDevice* mpInput
Specified video device name, eg /dev/video0

oPVideoOutputDevice* mpOutput
For grabbing video from the camera

oPMutex accessMutex
For displaying video on the screen


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



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