PTLib  Version 2.14.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PVideoOutputDeviceRGB Class Referenceabstract

This class defines a video output device for RGB in a frame store. More...

#include <videoio.h>

Inheritance diagram for PVideoOutputDeviceRGB:
Collaboration diagram for PVideoOutputDeviceRGB:

Public Member Functions

 PVideoOutputDeviceRGB ()
 Create a new video output device. More...
 
virtual PBoolean SetColourFormat (const PString &colourFormat)
 Set the colour format to be used. More...
 
virtual PBoolean SetFrameSize (unsigned width, unsigned height)
 Set the frame size to be used. More...
 
virtual PINDEX GetMaxFrameBytes ()
 Get the maximum frame size in bytes. More...
 
virtual PBoolean SetFrameData (unsigned x, unsigned y, unsigned width, unsigned height, const BYTE *data, PBoolean endFrame=true)
 Set a section of the output frame buffer. More...
 
virtual PBoolean FrameComplete ()=0
 Indicate frame may be displayed. More...
 
- Public Member Functions inherited from PVideoOutputDevice
 PVideoOutputDevice ()
 Create a new video output device. More...
 
virtual ~PVideoOutputDevice ()
 Close the video output device on destruction. More...
 
virtual PBoolean Close ()
 Close the device. More...
 
virtual PBoolean Start ()
 Start the video device I/O display. More...
 
virtual PBoolean Stop ()
 Stop the video device I/O display. More...
 
virtual PBoolean CanCaptureVideo () const
 Is the device a camera, and obtain video. More...
 
virtual PBoolean SetFrameData (unsigned x, unsigned y, unsigned width, unsigned height, const BYTE *data, PBoolean endFrame, bool &keyFrameNeeded)
 
virtual PBoolean SetFrameData (unsigned x, unsigned y, unsigned width, unsigned height, unsigned sarWidth, unsigned sarHeight, const BYTE *data, PBoolean endFrame, bool &keyFrameNeeded, const void *mark)
 
virtual PBoolean DisableDecode ()
 Allow the outputdevice decide whether the decoder should ignore decode hence not render any output. More...
 
virtual PBoolean GetPosition (int &x, int &y) const
 Get the position of the output device, where relevant. More...
 
virtual bool SetPosition (int x, int y)
 Set the position of the output device, where relevant. More...
 
- Public Member Functions inherited from PVideoDevice
virtual ~PVideoDevice ()
 Delete structures created by PVideoDevice();. More...
 
 P_DECLARE_STREAMABLE_ENUM (VideoFormat, PAL, NTSC, SECAM, Auto)
 
const PStringGetDeviceName () const
 Get the device name of the open device. More...
 
virtual PStringArray GetDeviceNames () const =0
 Get a list of all of the drivers available. More...
 
virtual PBoolean OpenFull (const OpenArgs &args, PBoolean startImmediate=true)
 Open the device given the device name. More...
 
virtual PBoolean Open (const PString &deviceName, PBoolean startImmediate=true)=0
 Open the device given the device name. More...
 
virtual PBoolean IsOpen ()=0
 Determine if the device is currently open. More...
 
virtual PBoolean SetVideoFormat (VideoFormat videoFormat)
 Set the video format to be used. More...
 
virtual VideoFormat GetVideoFormat () const
 Get the video format being used. More...
 
virtual int GetNumChannels ()
 Get the number of video channels available on the device. More...
 
virtual PStringArray GetChannelNames ()
 Get the names of video channels available on the device. More...
 
virtual PBoolean SetChannel (int channelNumber)
 Set the video channel to be used on the device. More...
 
virtual int GetChannel () const
 Get the video channel to be used on the device. More...
 
virtual bool SetFrameInfoConverter (const PVideoFrameInfo &info)
 Set the frame info to be used, trying converters if available. More...
 
virtual PBoolean SetColourFormatConverter (const PString &colourFormat)
 Set the colour format to be used, trying converters if available. More...
 
virtual PBoolean GetVFlipState ()
 Get the video conversion vertical flip state. More...
 
virtual PBoolean SetVFlipState (PBoolean newVFlipState)
 Set the video conversion vertical flip state. More...
 
virtual PBoolean GetFrameSizeLimits (unsigned &minWidth, unsigned &minHeight, unsigned &maxWidth, unsigned &maxHeight)
 Get the minimum & maximum size of a frame on the device. More...
 
virtual PBoolean SetFrameSizeConverter (unsigned width, unsigned height, ResizeMode resizeMode=eMaxResizeMode)
 Set the frame size to be used, trying converters if available. More...
 
virtual PBoolean SetFrameSizeConverter (unsigned width, unsigned height, PBoolean)
 Set the frame size to be used, trying converters if available. More...
 
virtual PBoolean SetNearestFrameSize (unsigned width, unsigned height)
 Set the nearest available frame size to be used. More...
 
virtual PBoolean GetFrameSize (unsigned &width, unsigned &height) const
 Get the frame size being used. More...
 
virtual const PStringGetColourFormat () const
 Get the colour format being used. More...
 
int GetLastError () const
 Get the last error code. More...
 
virtual bool GetAttributes (Attributes &attributes)
 Get video attributes. More...
 
virtual bool SetAttributes (const Attributes &attributes)
 Set video attributes. More...
 
virtual PBoolean SetVideoChannelFormat (int channelNumber, VideoFormat videoFormat)
 Set VideoFormat and VideoChannel in one ioctl. More...
 
void SetPreferredColourFormat (const PString &colourFmt)
 Set preferred native colour format from video capture device. More...
 
const PStringGetPreferredColourFormat ()
 Get preferred native colour format from video capture device. More...
 
- Public Member Functions inherited from PVideoFrameInfo
 P_DECLARE_ENUM_EX (ResizeMode, eMaxResizeMode, eScale, 0, eCropCentre, eCropTopLeft)
 
 PVideoFrameInfo ()
 Construct video frame information. More...
 
 PVideoFrameInfo (unsigned frameWidth, unsigned frameHeight, const PString &colourFormat="YUV420P", unsigned frameRate=15, ResizeMode resizeMode=eScale)
 
virtual Comparison Compare (const PObject &obj) const
 Compare the two PVideoFrameInfo and return their relative rank. More...
 
virtual void PrintOn (ostream &strm) const
 Output the contents of the object to the stream. More...
 
virtual unsigned GetFrameWidth () const
 Get the width of the frame being used. More...
 
virtual unsigned GetFrameHeight () const
 Get the height of the frame being used. More...
 
virtual PBoolean SetFrameSar (unsigned width, unsigned height)
 Set the Storage Aspect Ratio size to be used. More...
 
virtual PBoolean GetSarSize (unsigned &width, unsigned &height) const
 Get the Storage Aspect Ratio size being used. More...
 
virtual unsigned GetSarWidth () const
 Get the width of the Storage Aspect Ratio being used. More...
 
virtual unsigned GetSarHeight () const
 Get the height of the Storage Aspect Ratio being used. More...
 
virtual PBoolean SetFrameRate (unsigned rate)
 Set the video frame rate to be used on the device. More...
 
virtual unsigned GetFrameRate () const
 Get the video frame rate used on the device. More...
 
void SetResizeMode (ResizeMode mode)
 Set the resize mode to be used. More...
 
ResizeMode GetResizeMode () const
 Get the resize mode to be used. More...
 
PINDEX CalculateFrameBytes () const
 Get the number of bytes of an image, given a particular width, height and colour format. More...
 
bool Parse (const PString &str)
 Parse a descriptor string for the video format. More...
 
- Public Member Functions inherited from PObject
unsigned GetTraceContextIdentifier () const
 Get PTRACE context identifier. More...
 
void SetTraceContextIdentifier (unsigned id)
 
void GetTraceContextIdentifier (PObject &obj)
 
void GetTraceContextIdentifier (PObject *obj)
 
void SetTraceContextIdentifier (const PObject &obj)
 
void SetTraceContextIdentifier (const PObject *obj)
 
virtual ~PObject ()
 
virtual PObjectClone () const
 Create a copy of the class on the heap. More...
 
template<class CLS >
CLS * CloneAs () const
 As for Clone() but converts to specified type. More...
 
virtual PINDEX HashFunction () const
 This function yields a hash value required by the PDictionary class. More...
 
virtual const char * GetClass (unsigned ancestor=0) const
 Get the current dynamic type of the object instance. More...
 
PBoolean IsClass (const char *cls) const
 
virtual PBoolean InternalIsDescendant (const char *clsName) const
 Determine if the dynamic type of the current instance is a descendent of the specified class. More...
 
__inline const PObjectPTraceObjectInstance () const
 
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
 Determine the byte wise comparison of two objects. More...
 
bool operator== (const PObject &obj) const
 Compare the two objects. More...
 
bool operator!= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator< (const PObject &obj) const
 Compare the two objects. More...
 
bool operator> (const PObject &obj) const
 Compare the two objects. More...
 
bool operator<= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator>= (const PObject &obj) const
 Compare the two objects. More...
 
virtual void PrintOn (ostream &strm) const
 Output the contents of the object to the stream. More...
 
virtual void ReadFrom (istream &strm)
 Input the contents of the object from the stream. More...
 

Protected Attributes

PMutex mutex
 
PINDEX bytesPerPixel
 
PINDEX scanLineWidth
 
bool swappedRedAndBlue
 

Additional Inherited Members

- Public Types inherited from PVideoFrameInfo
enum  StandardSizes {
  SQCIFWidth = 128, SQCIFHeight = 96, QCIFWidth = 176, QCIFHeight = 144,
  CIFWidth = 352, CIFHeight = 288, CIF4Width = 704, CIF4Height = 576,
  CIF16Width = 1408, CIF16Height = 1152, HD480Width = 704, HD480Height = 480,
  i480Width = 704, i480Height = 480, HD720Width = 1280, HD720Height = 720,
  p720Width = 1280, p720Height = 720, HD1080Width = 1920, HD1080Height = 1080,
  i1080Width = 1920, i1080Height = 1080, HDTVWidth = 1920, HDTVHeight = 1080,
  MaxWidth = 1920, MaxHeight = 1200
}
 
- Static Public Member Functions inherited from PVideoOutputDevice
static PStringArray GetDriverNames (PPluginManager *pluginMgr=NULL)
 Get the list of available video output drivers (plug-ins) More...
 
static PStringArray GetDriversDeviceNames (const PString &driverName, PPluginManager *pluginMgr=NULL)
 Get video output devices that correspond to the specified driver name. More...
 
static PVideoOutputDeviceCreateDevice (const PString &driverName, PPluginManager *pluginMgr=NULL)
 Create the video output device that corresponds to the specified driver name. More...
 
static PVideoOutputDeviceCreateDeviceByName (const PString &deviceName, const PString &driverName=PString::Empty(), PPluginManager *pluginMgr=NULL)
 
static PVideoOutputDeviceCreateOpenedDevice (const PString &driverName, const PString &deviceName, PBoolean startImmediate=true, PPluginManager *pluginMgr=NULL)
 Create an opened video output device that corresponds to the specified names. More...
 
static PVideoOutputDeviceCreateOpenedDevice (const OpenArgs &args, PBoolean startImmediate=true)
 Create an opened video output device that corresponds to the specified arguments. More...
 
- Protected Member Functions inherited from PVideoDevice
 PVideoDevice ()
 Create a new video device (input or output). More...
 
PINDEX GetMaxFrameBytesConverted (PINDEX rawFrameBytes) const
 
PString GetDeviceNameFromOpenArgs (const OpenArgs &args) const
 
- Friends inherited from PObject

Detailed Description

This class defines a video output device for RGB in a frame store.

Constructor & Destructor Documentation

PVideoOutputDeviceRGB::PVideoOutputDeviceRGB ( )

Create a new video output device.

Member Function Documentation

virtual PBoolean PVideoOutputDeviceRGB::FrameComplete ( )
pure virtual

Indicate frame may be displayed.

virtual PINDEX PVideoOutputDeviceRGB::GetMaxFrameBytes ( )
virtual

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.

Implements PVideoDevice.

virtual PBoolean PVideoOutputDeviceRGB::SetColourFormat ( const PString colourFormat)
virtual

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 from PVideoFrameInfo.

virtual PBoolean PVideoOutputDeviceRGB::SetFrameData ( unsigned  x,
unsigned  y,
unsigned  width,
unsigned  height,
const BYTE *  data,
PBoolean  endFrame = true 
)
virtual

Set a section of the output frame buffer.

Implements PVideoOutputDevice.

virtual PBoolean PVideoOutputDeviceRGB::SetFrameSize ( unsigned  width,
unsigned  height 
)
virtual

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.

Parameters
widthNew width of frame
heightNew height of frame

Reimplemented from PVideoDevice.

Member Data Documentation

PINDEX PVideoOutputDeviceRGB::bytesPerPixel
protected
PMutex PVideoOutputDeviceRGB::mutex
protected
PINDEX PVideoOutputDeviceRGB::scanLineWidth
protected
bool PVideoOutputDeviceRGB::swappedRedAndBlue
protected

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