Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PVideoChannel Class Reference

#include <video.h>

Inheritance diagram for PVideoChannel:

PChannel PObject

List of all members.


Detailed Description

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.

Definition at line 111 of file video.h.


Comparison functions

enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator>= (const PObject &obj) const

Construction

enum  Directions { Recorder, Player }
 PVideoChannel (const PString &device, Directions dir)
 PVideoChannel ()
 Create a video channel.
 ~PVideoChannel ()

Error functions

enum  ErrorGroup { LastReadError, LastWriteError, LastGeneralError, NumErrorGroups }
enum  Errors {
  NoError, NotFound, FileExists, DiskFull,
  AccessDenied, DeviceInUse, BadParameter, NoMemory,
  NotOpen, Timeout, Interrupted, BufferTooSmall,
  Miscellaneous, ProtocolFailure, NumNormalisedErrors
}
Errors GetErrorCode (ErrorGroup group=NumErrorGroups) const
int GetErrorNumber (ErrorGroup group=NumErrorGroups) const
virtual PString GetErrorText (ErrorGroup group=NumErrorGroups) const
static PString GetErrorText (Errors lastError, int osError=0)

Miscellaneous functions

enum  ShutdownValue { ShutdownRead = 0, ShutdownWrite = 1, ShutdownReadAndWrite = 2 }
void AbortCommandString ()
BOOL SendCommandString (const PString &command)
BOOL SetBufferSize (PINDEX newSize)
virtual BOOL Shutdown (ShutdownValue option)

Scattered read/write functions

typedef std::vector< SliceVectorOfSlice
virtual BOOL Read (const VectorOfSlice &slices)
virtual BOOL Write (const VectorOfSlice &slices)

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
virtual BOOL InternalIsDescendant (const char *clsName) const
BOOL IsClass (const char *cls) const
static const char * Class ()

Open functions

BOOL IsOpen () const
BOOL Open (const PString &device, Directions dir)
static PString GetDefaultDevice (Directions dir)
static PStringList GetDeviceNames (Directions dir)

I/O functions

virtual void PrintOn (ostream &strm) const
virtual void ReadFrom (istream &strm)
ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)

Public Types

enum  PXBlockType { PXReadBlock, PXWriteBlock, PXAcceptBlock, PXConnectBlock }

Public Member Functions

virtual void AttachVideoPlayer (PVideoOutputDevice *device, BOOL keepCurrent=TRUE)
virtual void AttachVideoReader (PVideoInputDevice *device, BOOL keepCurrent=TRUE)
virtual BOOL Close ()
virtual void CloseVideoPlayer ()
virtual void CloseVideoReader ()
BOOL DisplayRawData (void *videoBuffer)
void EnableAccess ()
PString GetErrorText () const
virtual PINDEX GetGrabHeight ()
virtual PINDEX GetGrabWidth ()
virtual PString GetName () const
PINDEX GetRenderHeight ()
PINDEX GetRenderWidth ()
virtual PVideoOutputDeviceGetVideoPlayer ()
virtual PVideoInputDeviceGetVideoReader ()
virtual BOOL IsGrabberOpen ()
virtual BOOL IsRenderOpen ()
virtual BOOL Read (void *buf, PINDEX len)
virtual BOOL Redraw (const void *frame)
void RestrictAccess ()
virtual void SetGrabberFrameSize (int _width, int _height)
virtual void SetRenderFrameSize (int _width, int _height)
BOOL ToggleVFlipInput ()
BOOL Write (const void *buf, PINDEX len)
Miscellaneous functions
virtual PObjectClone () const
Overrides from class PObject
virtual Comparison Compare (const PObject &obj) const
virtual PINDEX HashFunction () const
Information functions
virtual PChannelGetBaseReadChannel () const
virtual PChannelGetBaseWriteChannel () const
int GetHandle () const
Reading functions
virtual PINDEX GetLastReadCount () const
PTimeInterval GetReadTimeout () const
virtual void OnReadComplete (void *buf, PINDEX len)
virtual BOOL ReadAsync (void *buf, PINDEX len)
BOOL ReadBlock (void *buf, PINDEX len)
virtual int ReadChar ()
PString ReadString (PINDEX len)
void SetReadTimeout (const PTimeInterval &time)
Writing functions
virtual PINDEX GetLastWriteCount () const
PTimeInterval GetWriteTimeout () const
virtual void OnWriteComplete (const void *buf, PINDEX len)
void SetWriteTimeout (const PTimeInterval &time)
virtual BOOL WriteAsync (const void *buf, PINDEX len)
BOOL WriteChar (int c)
BOOL WriteString (const PString &str)

Static Public Member Functions

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

Protected Member Functions

virtual BOOL ConvertOSError (int libcReturnValue, ErrorGroup group=LastGeneralError)
int PXClose ()
BOOL PXSetIOBlock (PXBlockType type, const PTimeInterval &timeout)
int ReadCharWithTimeout (PTimeInterval &timeout)
BOOL ReceiveCommandString (int nextChar, const PString &reply, PINDEX &pos, PINDEX start)
BOOL SetErrorValues (Errors errorCode, int osError, ErrorGroup group=LastGeneralError)

Protected Attributes

PMutex accessMutex
 For displaying video on the screen.
PString channelName
PString deviceName
Directions direction
Errors lastErrorCode [NumErrorGroups+1]
 The platform independant error code.
int lastErrorNumber [NumErrorGroups+1]
 The operating system error number (eg as returned by errno).
PINDEX lastReadCount
 Number of byte last read by the Read() function.
PINDEX lastWriteCount
 Number of byte last written by the Write() function.
PVideoInputDevicempInput
 Specified video device name, eg /dev/video0.
PVideoOutputDevicempOutput
 For grabbing video from the camera.
int os_handle
 The operating system file handle return by standard open() function.
PXBlockType px_lastBlockType
PThreadpx_readThread
PMutex px_selectMutex
PThreadpx_selectThread
PMutex px_threadMutex
PMutex px_writeMutex
PThreadpx_writeThread
PTimeInterval readTimeout
 Timeout for read operations.
PTimeInterval writeTimeout
 Timeout for write operations.

Static Protected Attributes

static PMutex dictMutex

Private Member Functions

void Construct ()
 PCLASSINFO (PVideoChannel, PChannel)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index