All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
videoio.h
Go to the documentation of this file.
/*
* videoio.h
*
* Classes to support streaming video input (grabbing) and output.
*
* Portable Windows Library
*
* Copyright (c) 1993-2000 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Portable Windows Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Contributor(s): Mark Cooke (mpc@star.sr.bham.ac.uk)
*
* $Revision: 25752 $
* $Author: rjongbloed $
* $Date: 2011-05-11 21:50:32 -0500 (Wed, 11 May 2011) $
*/
#ifndef PTLIB_PVIDEOIO_H
#define PTLIB_PVIDEOIO_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#include <ptbuildopts.h>
#if P_VIDEO
#include <ptlib/plugin.h>
#include <ptlib/pluginmgr.h>
#include <list>
class PColourConverter;
class PVideoFrameInfo : public PObject
{
PCLASSINFO(PVideoFrameInfo, PObject);
public:
enum ResizeMode
{
eScale,
eCropCentre,
eCropTopLeft,
eMaxResizeMode
};
friend ostream & operator<<(ostream & strm, ResizeMode mode);
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
};
PVideoFrameInfo();
PVideoFrameInfo(
unsigned frameWidth,
unsigned frameHeight,
const PString & colourFormat = "YUV420P",
unsigned frameRate = 15,
ResizeMode resizeMode = eScale
);
virtual void PrintOn(
ostream & strm // Stream to print the object into.
) const;
virtual PBoolean SetFrameSize(
unsigned width,
unsigned height
);
virtual PBoolean GetFrameSize(
unsigned & width,
unsigned & height
) const;
virtual unsigned GetFrameWidth() const;
virtual unsigned GetFrameHeight() const;
virtual PBoolean SetFrameSar(unsigned width, unsigned height);
virtual PBoolean GetSarSize(
unsigned & width,
unsigned & height
) const;
virtual unsigned GetSarWidth() const;
virtual unsigned GetSarHeight() const;
virtual PBoolean SetFrameRate(
unsigned rate
);
virtual unsigned GetFrameRate() const;
virtual PBoolean SetColourFormat(
const PString & colourFormat // New colour format for device.
);
virtual const PString & GetColourFormat() const;
void SetResizeMode(
ResizeMode mode
) { if (resizeMode < eMaxResizeMode) resizeMode = mode; }
ResizeMode GetResizeMode() const { return resizeMode; }
PINDEX CalculateFrameBytes() const { return CalculateFrameBytes(frameWidth, frameHeight, colourFormat); }
static PINDEX CalculateFrameBytes(
unsigned width,
unsigned height,
const PString & colourFormat
);
bool Parse(
const PString & str
);
static bool ParseSize(
const PString & str,
unsigned & width,
unsigned & height
);
static PString AsString(
unsigned width,
unsigned height
);
static PStringArray GetSizeNames();
protected:
unsigned frameWidth;
unsigned frameHeight;
unsigned sarWidth;
unsigned sarHeight;
unsigned frameRate;
PString colourFormat;
ResizeMode resizeMode;
};
class PVideoControlInfo : public PObject
{
PCLASSINFO(PVideoControlInfo, PObject);
public:
typedef enum {
ControlPan,
ControlTilt,
ControlZoom
} InputControlType;
static PString AsString(const InputControlType & type);
InputControlType type;
long min;
long max;
long step;
long def;
long flags;
long current;
};
class PVideoInputControl : public PVideoControlInfo
{
PCLASSINFO(PVideoInputControl, PVideoControlInfo);
public:
~PVideoInputControl();
virtual PBoolean Pan(long value, bool absolute = false );
virtual PBoolean Tilt(long value, bool absolute = false);
virtual PBoolean Zoom(long value, bool absolute = false);
long GetPan();
long GetTilt();
long GetZoom();
void Reset();
void SetCurrentPosition(const InputControlType ctype, long current);
typedef std::list<PVideoControlInfo> InputDeviceControls;
protected:
PBoolean GetVideoControlInfo(const InputControlType ctype, PVideoControlInfo & control);
PBoolean GetDefaultPosition(const InputControlType ctype, long & def);
PBoolean GetCurrentPosition(const InputControlType ctype, long & current);
std::list<PVideoControlInfo> m_info;
PMutex ccmutex;
};
class PVideoInteractionInfo : public PObject
{
PCLASSINFO(PVideoInteractionInfo, PObject);
public:
typedef enum {
InteractKey,
InteractMouse,
InteractNavigate,
InteractRTSP,
InteractOther
} InputInteractType;
static PString AsString(const InputInteractType & type);
InputInteractType type;
};
class PVideoDevice : public PVideoFrameInfo
{
PCLASSINFO(PVideoDevice, PVideoFrameInfo);
protected:
PVideoDevice();
public:
virtual ~PVideoDevice();
enum VideoFormat {
PAL,
NTSC,
SECAM,
Auto,
NumVideoFormats
};
const PString & GetDeviceName() const
{ return deviceName; }
virtual PStringArray GetDeviceNames() const = 0;
struct OpenArgs {
OpenArgs();
PPluginManager * pluginMgr;
PString driverName;
PString deviceName;
VideoFormat videoFormat;
int channelNumber;
PString colourFormat;
bool convertFormat;
unsigned rate;
unsigned width;
unsigned height;
bool convertSize;
ResizeMode resizeMode;
bool flip;
int brightness;
int whiteness;
int contrast;
int colour;
int hue;
};
virtual PBoolean OpenFull(
const OpenArgs & args,
PBoolean startImmediate = true
);
virtual PBoolean Open(
const PString & deviceName,
PBoolean startImmediate = true
) = 0;
virtual PBoolean IsOpen() = 0;
virtual PBoolean Close() = 0;
virtual PBoolean Start() = 0;
virtual PBoolean Stop() = 0;
#if PTRACING
friend ostream & operator<<(ostream &, VideoFormat);
#endif
virtual PBoolean SetVideoFormat(
VideoFormat videoFormat
);
virtual VideoFormat GetVideoFormat() const;
virtual int GetNumChannels();
virtual PBoolean SetChannel(
int channelNumber
);
virtual int GetChannel() const;
virtual PBoolean SetColourFormatConverter(
const PString & colourFormat // New colour format for device.
);
virtual PBoolean GetVFlipState();
virtual PBoolean SetVFlipState(
PBoolean newVFlipState
);
virtual PBoolean GetFrameSizeLimits(
unsigned & minWidth,
unsigned & minHeight,
unsigned & maxWidth,
unsigned & maxHeight
) ;
virtual PBoolean SetFrameSizeConverter(
unsigned width,
unsigned height,
ResizeMode resizeMode = eMaxResizeMode
);
virtual PBoolean SetFrameSizeConverter(
unsigned width,
unsigned height,
PBoolean /*bScaleNotCrop*/
) { return SetFrameSizeConverter(width,height,eScale); }
virtual PBoolean SetNearestFrameSize(
unsigned width,
unsigned height
);
virtual PBoolean SetFrameSize(
unsigned width,
unsigned height
);
virtual PBoolean GetFrameSize(
unsigned & width,
unsigned & height
) const;
virtual PINDEX GetMaxFrameBytes() = 0;
int GetLastError() const { return lastError; }
virtual PBoolean CanCaptureVideo() const = 0;
virtual int GetBrightness();
virtual PBoolean SetBrightness(unsigned newBrightness);
virtual int GetWhiteness();
virtual PBoolean SetWhiteness(unsigned newWhiteness);
virtual int GetColour();
virtual PBoolean SetColour(unsigned newColour);
virtual int GetContrast();
virtual PBoolean SetContrast(unsigned newContrast);
virtual int GetHue();
virtual PBoolean SetHue(unsigned newHue);
virtual PBoolean GetParameters(
int *whiteness,
int *brightness,
int *colour,
int *contrast,
int *hue
);
virtual PBoolean SetVideoChannelFormat (
int channelNumber,
VideoFormat videoFormat
);
void SetPreferredColourFormat(const PString & colourFmt) { preferredColourFormat = colourFmt; }
const PString & GetPreferredColourFormat() { return preferredColourFormat; }
protected:
PINDEX GetMaxFrameBytesConverted(PINDEX rawFrameBytes) const;
PString deviceName;
int lastError;
VideoFormat videoFormat;
int channelNumber;
// Preferred native colour format from video input device, empty == no preference
PString preferredColourFormat;
PBoolean nativeVerticalFlip;
PColourConverter * converter;
PBYTEArray frameStore;
int frameBrightness; // 16 bit entity, -1 is no value
int frameWhiteness;
int frameContrast;
int frameColour;
int frameHue;
};
class PVideoOutputDevice : public PVideoDevice
{
PCLASSINFO(PVideoOutputDevice, PVideoDevice);
public:
PVideoOutputDevice();
virtual ~PVideoOutputDevice() { Close(); };
static PStringArray GetDriverNames(
PPluginManager * pluginMgr = NULL
);
static PStringArray GetDriversDeviceNames(
const PString & driverName,
PPluginManager * pluginMgr = NULL
);
static PVideoOutputDevice * CreateDevice(
const PString & driverName,
PPluginManager * pluginMgr = NULL
);
/* Create the matching video output device that corresponds to the device name.
This is typically used with the return values from GetDriversDeviceNames().
*/
static PVideoOutputDevice *CreateDeviceByName(
const PString & deviceName,
const PString & driverName = PString::Empty(),
PPluginManager * pluginMgr = NULL
);
static PVideoOutputDevice *CreateOpenedDevice(
const PString & driverName,
const PString & deviceName,
PBoolean startImmediate = true,
PPluginManager * pluginMgr = NULL
);
static PVideoOutputDevice *CreateOpenedDevice(
const OpenArgs & args,
PBoolean startImmediate = true
);
virtual PBoolean Close() { return true; }
virtual PBoolean Start() { return true; }
virtual PBoolean Stop() { return true; }
virtual PBoolean CanCaptureVideo() const;
virtual PBoolean SetFrameData(
unsigned x,
unsigned y,
unsigned width,
unsigned height,
const BYTE * data,
PBoolean endFrame = true
) = 0;
virtual PBoolean SetFrameData(
unsigned x,
unsigned y,
unsigned width,
unsigned height,
const BYTE * data,
PBoolean endFrame,
unsigned flags
);
virtual PBoolean SetFrameData(
unsigned x,
unsigned y,
unsigned width,
unsigned height,
unsigned sarwidth,
unsigned sarheight,
const BYTE * data,
PBoolean endFrame,
unsigned flags,
const void * mark
);
virtual PBoolean DisableDecode();
virtual PBoolean GetPosition(
int & x, // X position of device surface
int & y // Y position of device surface
) const;
virtual bool SetPosition(
int x, // X position of device surface
int y // Y position of device surface
);
};
class PVideoOutputDeviceRGB : public PVideoOutputDevice
{
PCLASSINFO(PVideoOutputDeviceRGB, PVideoOutputDevice);
public:
PVideoOutputDeviceRGB();
virtual PBoolean SetColourFormat(
const PString & colourFormat // New colour format for device.
);
virtual PBoolean SetFrameSize(
unsigned width,
unsigned height
);
virtual PINDEX GetMaxFrameBytes();
virtual PBoolean SetFrameData(
unsigned x,
unsigned y,
unsigned width,
unsigned height,
const BYTE * data,
PBoolean endFrame = true
);
virtual PBoolean FrameComplete() = 0;
protected:
PMutex mutex;
PINDEX bytesPerPixel;
PINDEX scanLineWidth;
bool swappedRedAndBlue;
};
#ifdef SHOULD_BE_MOVED_TO_PLUGIN
class PVideoOutputDevicePPM : public PVideoOutputDeviceRGB
{
PCLASSINFO(PVideoOutputDevicePPM, PVideoOutputDeviceRGB);
public:
PVideoOutputDevicePPM();
virtual PBoolean Open(
const PString & deviceName,
PBoolean startImmediate = true
);
virtual PBoolean IsOpen();
virtual PBoolean Close();
virtual PStringArray GetDeviceNames() const;
virtual PBoolean EndFrame();
protected:
unsigned frameNumber;
};
#endif // SHOULD_BE_MOVED_TO_PLUGIN
class PVideoInputDevice : public PVideoDevice
{
PCLASSINFO(PVideoInputDevice, PVideoDevice);
public:
//PVideoInputDevice();
~PVideoInputDevice() { Close(); }
static PStringArray GetDriverNames(
PPluginManager * pluginMgr = NULL
);
static PStringArray GetDriversDeviceNames(
const PString & driverName,
PPluginManager * pluginMgr = NULL
);
static PVideoInputDevice *CreateDevice(
const PString & driverName,
PPluginManager * pluginMgr = NULL
);
/* Create the matching video input device that corresponds to the device name.
So, for "fake" return a device that will generate fake video.
For "Phillips 680 webcam" (eg) will return appropriate grabber.
Note that Phillips will return the appropriate grabber also.
This is typically used with the return values from GetDriversDeviceNames().
*/
static PVideoInputDevice *CreateDeviceByName(
const PString & deviceName,
const PString & driverName = PString::Empty(),
PPluginManager * pluginMgr = NULL
);
static PVideoInputDevice *CreateOpenedDevice(
const PString & driverName,
const PString & deviceName,
PBoolean startImmediate = true,
PPluginManager * pluginMgr = NULL
);
static PVideoInputDevice *CreateOpenedDevice(
const OpenArgs & args,
PBoolean startImmediate = true
);
typedef struct {
std::list<PVideoFrameInfo> framesizes;
std::list<PVideoControlInfo> controls;
std::list<PVideoInteractionInfo> interactions;
} Capabilities;
virtual bool GetDeviceCapabilities(
Capabilities * capabilities
) const { return GetDeviceCapabilities(GetDeviceName(), capabilities); }
static PBoolean GetDeviceCapabilities(
const PString & deviceName,
Capabilities * capabilities,
PPluginManager * pluginMgr = NULL
);
static PBoolean GetDeviceCapabilities(
const PString & deviceName,
const PString & driverName,
Capabilities * caps,
PPluginManager * pluginMgr = NULL
);
virtual PVideoInputControl * GetVideoInputControls();
virtual PBoolean Open(
const PString & deviceName,
PBoolean startImmediate = true
) = 0;
virtual PBoolean Close(
) { return true; }
virtual PBoolean CanCaptureVideo() const;
virtual PBoolean IsCapturing() = 0;
virtual PBoolean SetNearestFrameSize(
unsigned width,
unsigned height
);
virtual PBoolean GetFrame(
PBYTEArray & frame
);
virtual PBoolean GetFrameData(
BYTE * buffer,
PINDEX * bytesReturned,
unsigned int & flags
);
virtual PBoolean GetFrameData(
BYTE * buffer,
PINDEX * bytesReturned = NULL
) = 0;
virtual PBoolean GetFrameDataNoDelay(
BYTE * buffer,
PINDEX * bytesReturned,
unsigned int & flags
);
virtual PBoolean GetFrameDataNoDelay(
BYTE * buffer,
PINDEX * bytesReturned = NULL
) = 0;
virtual bool FlowControl(const void * flowData);
virtual bool SetCaptureMode(unsigned mode);
virtual int GetCaptureMode() const;
};
//
// declare macros and structures needed for video input plugins
//
template <class className> class PVideoInputPluginServiceDescriptor : public PDevicePluginServiceDescriptor
{
public:
virtual PObject * CreateInstance(int /*userData*/) const { return new className; }
virtual PStringArray GetDeviceNames(int /*userData*/) const { return className::GetInputDeviceNames(); }
virtual bool GetDeviceCapabilities(const PString & deviceName, void * caps) const
{ return className::GetDeviceCapabilities(deviceName, (PVideoInputDevice::Capabilities *)caps); }
};
#define PCREATE_VIDINPUT_PLUGIN(name) \
static PVideoInputPluginServiceDescriptor<PVideoInputDevice_##name> PVideoInputDevice_##name##_descriptor; \
PCREATE_PLUGIN(name, PVideoInputDevice, &PVideoInputDevice_##name##_descriptor)
PPLUGIN_STATIC_LOAD(FakeVideo, PVideoInputDevice);
#ifdef P_APPSHARE
PPLUGIN_STATIC_LOAD(Application, PVideoInputDevice);
#endif
#if P_FFVDEV
PPLUGIN_STATIC_LOAD(FFMPEG, PVideoInputDevice);
#endif
#if P_VIDFILE
PPLUGIN_STATIC_LOAD(YUVFile, PVideoInputDevice);
#endif
#ifdef P_DIRECTSHOW
PPLUGIN_STATIC_LOAD(DirectShow, PVideoInputDevice);
#endif
//
// declare macros and structures needed for video output plugins
//
template <class className> class PVideoOutputPluginServiceDescriptor : public PDevicePluginServiceDescriptor
{
public:
virtual PObject * CreateInstance(int /*userData*/) const { return new className; }
virtual PStringArray GetDeviceNames(int /*userData*/) const { return className::GetOutputDeviceNames(); }
};
#define PCREATE_VIDOUTPUT_PLUGIN(name) \
static PVideoOutputPluginServiceDescriptor<PVideoOutputDevice_##name> PVideoOutputDevice_##name##_descriptor; \
PCREATE_PLUGIN(name, PVideoOutputDevice, &PVideoOutputDevice_##name##_descriptor)
#if _WIN32
PPLUGIN_STATIC_LOAD(Window, PVideoOutputDevice);
#endif
#if P_SDL
PPLUGIN_STATIC_LOAD(SDL, PVideoOutputDevice);
#endif
//
// declare classes needed for access to simple video font
//
class PVideoFont : public PObject
{
PCLASSINFO(PVideoFont, PObject);
public:
enum {
MAX_L_HEIGHT = 11
};
struct LetterData {
char ascii;
const char *line[MAX_L_HEIGHT];
};
static const LetterData * GetLetterData(char ascii);
};
#endif // P_VIDEO
#endif // PTLIB_PVIDEOIO_H
// End Of File ///////////////////////////////////////////////////////////////
PVideoOutputDevice::CreateDevice
static PVideoOutputDevice * CreateDevice(const PString &driverName, PPluginManager *pluginMgr=NULL)
Create the video output device that corresponds to the specified driver name.
PVideoDevice::GetColour
virtual int GetColour()
Get the colour of the image.
PVideoFrameInfo::SQCIFWidth
Definition: videoio.h:64
PVideoDevice::OpenArgs::videoFormat
VideoFormat videoFormat
Definition: videoio.h:405
PVideoDevice::SetColour
virtual PBoolean SetColour(unsigned newColour)
Set colour of the image.
PVideoFrameInfo::resizeMode
ResizeMode resizeMode
Definition: videoio.h:256
PVideoControlInfo::current
long current
Definition: videoio.h:280
PVideoOutputDeviceRGB::PVideoOutputDeviceRGB
PVideoOutputDeviceRGB()
Create a new video output device.
PVideoInputDevice::GetDriversDeviceNames
static PStringArray GetDriversDeviceNames(const PString &driverName, PPluginManager *pluginMgr=NULL)
Get video input devices that correspond to the specified driver name.
PVideoDevice::OpenArgs::channelNumber
int channelNumber
Definition: videoio.h:406
PVideoDevice::OpenArgs
Definition: videoio.h:399
PVideoDevice::channelNumber
int channelNumber
Definition: videoio.h:685
PVideoInputDevice::GetFrameData
virtual PBoolean GetFrameData(BYTE *buffer, PINDEX *bytesReturned, unsigned int &flags)
Grab a frame, after a delay as specified by the frame rate.
PVideoControlInfo::ControlTilt
Definition: videoio.h:268
PVideoInputPluginServiceDescriptor::GetDeviceNames
virtual PStringArray GetDeviceNames(int) const
Definition: videoio.h:1159
PVideoDevice::SetContrast
virtual PBoolean SetContrast(unsigned newContrast)
Set contrast of the image.
PVideoFrameInfo::i480Width
Definition: videoio.h:70
PVideoDevice::GetMaxFrameBytesConverted
PINDEX GetMaxFrameBytesConverted(PINDEX rawFrameBytes) const
PVideoFrameInfo::ResizeMode
ResizeMode
Definition: videoio.h:54
PVideoInputControl::GetVideoControlInfo
PBoolean GetVideoControlInfo(const InputControlType ctype, PVideoControlInfo &control)
PVideoOutputDevice::GetDriversDeviceNames
static PStringArray GetDriversDeviceNames(const PString &driverName, PPluginManager *pluginMgr=NULL)
Get video output devices that correspond to the specified driver name.
PVideoFrameInfo::HD480Width
Definition: videoio.h:69
PVideoDevice::frameContrast
int frameContrast
Definition: videoio.h:695
PVideoDevice::GetFrameSize
virtual PBoolean GetFrameSize(unsigned &width, unsigned &height) const
Get the frame size being used.
PVideoFrameInfo::frameWidth
unsigned frameWidth
Definition: videoio.h:250
PVideoFrameInfo::QCIFWidth
Definition: videoio.h:65
PVideoFrameInfo::HD480Height
Definition: videoio.h:69
pluginmgr.h
PVideoInputDevice::GetFrameDataNoDelay
virtual PBoolean GetFrameDataNoDelay(BYTE *buffer, PINDEX *bytesReturned, unsigned int &flags)
Grab a frame.
PCLASSINFO
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
PVideoDevice::frameHue
int frameHue
Definition: videoio.h:697
PVideoDevice::OpenArgs::width
unsigned width
Definition: videoio.h:410
PVideoDevice::OpenArgs::driverName
PString driverName
Definition: videoio.h:403
PVideoDevice::OpenArgs::convertSize
bool convertSize
Definition: videoio.h:412
PVideoFrameInfo::p720Height
Definition: videoio.h:72
PVideoInputControl::Pan
virtual PBoolean Pan(long value, bool absolute=false)
PVideoFrameInfo::MaxHeight
Definition: videoio.h:76
PVideoControlInfo::def
long def
Definition: videoio.h:278
PVideoFrameInfo::CIF16Height
Definition: videoio.h:68
PDevicePluginServiceDescriptor
Definition: plugin.h:109
PVideoInputDevice::GetDriverNames
static PStringArray GetDriverNames(PPluginManager *pluginMgr=NULL)
Get the list of available video input drivers (plug-ins)
PVideoOutputDeviceRGB::FrameComplete
virtual PBoolean FrameComplete()=0
Indicate frame may be displayed.
PVideoFont
Definition: videoio.h:1217
PVideoFrameInfo::i1080Width
Definition: videoio.h:74
PVideoInputControl::m_info
std::list< PVideoControlInfo > m_info
Definition: videoio.h:312
PVideoControlInfo
Definition: videoio.h:260
PPluginManager
Definition: pluginmgr.h:57
PVideoFrameInfo::HDTVHeight
Definition: videoio.h:75
PVideoOutputDeviceRGB::bytesPerPixel
PINDEX bytesPerPixel
Definition: videoio.h:911
PVideoInputDevice::Capabilities::interactions
std::list< PVideoInteractionInfo > interactions
Definition: videoio.h:1034
PVideoInputControl::SetCurrentPosition
void SetCurrentPosition(const InputControlType ctype, long current)
PVideoDevice::SetVFlipState
virtual PBoolean SetVFlipState(PBoolean newVFlipState)
Set the video conversion vertical flip state.
PVideoFrameInfo::MaxWidth
Definition: videoio.h:76
PVideoControlInfo::max
long max
Definition: videoio.h:276
PVideoInputControl::GetZoom
long GetZoom()
PVideoDevice::preferredColourFormat
PString preferredColourFormat
Definition: videoio.h:687
PVideoDevice::Open
virtual PBoolean Open(const PString &deviceName, PBoolean startImmediate=true)=0
Open the device given the device name.
plugin.h
PVideoFrameInfo::GetFrameRate
virtual unsigned GetFrameRate() const
Get the video frame rate used on the device.
PVideoFrameInfo::GetFrameHeight
virtual unsigned GetFrameHeight() const
Get the height of the frame being used.
PVideoFrameInfo::colourFormat
PString colourFormat
Definition: videoio.h:255
PVideoDevice::GetVFlipState
virtual PBoolean GetVFlipState()
Get the video conversion vertical flip state.
PVideoDevice::SetVideoChannelFormat
virtual PBoolean SetVideoChannelFormat(int channelNumber, VideoFormat videoFormat)
Set VideoFormat and VideoChannel in one ioctl.
PVideoControlInfo::type
InputControlType type
Definition: videoio.h:274
PVideoFrameInfo::ParseSize
static bool ParseSize(const PString &str, unsigned &width, unsigned &height)
Parse the standard size string names.
PVideoFrameInfo::SetFrameRate
virtual PBoolean SetFrameRate(unsigned rate)
Set the video frame rate to be used on the device.
PVideoInputControl::~PVideoInputControl
~PVideoInputControl()
PVideoDevice::GetHue
virtual int GetHue()
Get the hue of the image.
PVideoFrameInfo::CIFHeight
Definition: videoio.h:66
PVideoInteractionInfo::InteractMouse
Register remote KeyPresses.
Definition: videoio.h:327
PVideoFrameInfo::SetFrameSize
virtual PBoolean SetFrameSize(unsigned width, unsigned height)
Set the frame size to be used.
PVideoInputControl::Reset
void Reset()
PVideoDevice::frameWhiteness
int frameWhiteness
Definition: videoio.h:694
PVideoFont::GetLetterData
static const LetterData * GetLetterData(char ascii)
PVideoOutputPluginServiceDescriptor::CreateInstance
virtual PObject * CreateInstance(int) const
Definition: videoio.h:1195
PVideoDevice::OpenArgs::height
unsigned height
Definition: videoio.h:411
PVideoFont::LetterData::ascii
char ascii
Definition: videoio.h:1225
PVideoDevice::GetVideoFormat
virtual VideoFormat GetVideoFormat() const
Get the video format being used.
PVideoInputControl::Zoom
virtual PBoolean Zoom(long value, bool absolute=false)
PVideoOutputDeviceRGB::SetColourFormat
virtual PBoolean SetColourFormat(const PString &colourFormat)
Set the colour format to be used.
PVideoFrameInfo::GetColourFormat
virtual const PString & GetColourFormat() const
Get the colour format to be used.
PVideoFrameInfo::SetFrameSar
virtual PBoolean SetFrameSar(unsigned width, unsigned height)
Set the sar size to be used.
PVideoControlInfo::ControlZoom
Definition: videoio.h:269
PVideoFrameInfo::i480Height
Definition: videoio.h:70
PVideoDevice::GetMaxFrameBytes
virtual PINDEX GetMaxFrameBytes()=0
Get the maximum frame size in bytes.
PStringArray
This is an array collection class of PString objects.
Definition: pstring.h:2024
PVideoFrameInfo::eMaxResizeMode
Definition: videoio.h:59
PVideoFrameInfo::SetResizeMode
void SetResizeMode(ResizeMode mode)
Set the resize mode to be used.
Definition: videoio.h:192
PVideoFrameInfo::HDTVWidth
Definition: videoio.h:75
PVideoControlInfo::ControlPan
Definition: videoio.h:267
PVideoDevice::frameBrightness
int frameBrightness
Definition: videoio.h:693
PVideoFont::LetterData
Definition: videoio.h:1224
PVideoInputDevice::Capabilities::framesizes
std::list< PVideoFrameInfo > framesizes
Definition: videoio.h:1032
PVideoInteractionInfo::InputInteractType
InputInteractType
Definition: videoio.h:325
PVideoFrameInfo::PrintOn
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
PVideoOutputDevice::Start
virtual PBoolean Start()
Start the video device I/O display.
Definition: videoio.h:775
PVideoFrameInfo::CIF4Width
Definition: videoio.h:67
PVideoFont::LetterData::line
const char * line[MAX_L_HEIGHT]
Definition: videoio.h:1226
PVideoDevice::Stop
virtual PBoolean Stop()=0
Stop the video device I/O capture.
PVideoDevice::OpenArgs::hue
int hue
Definition: videoio.h:419
PVideoControlInfo::InputControlType
InputControlType
Definition: videoio.h:266
PVideoFont::MAX_L_HEIGHT
Definition: videoio.h:1222
PVideoDevice::VideoFormat
VideoFormat
Definition: videoio.h:382
PVideoInputControl::GetPan
long GetPan()
PVideoInteractionInfo::InteractRTSP
Register remote Navigation commands.
Definition: videoio.h:329
PBoolean
BOOL PBoolean
Definition: object.h:102
PVideoOutputDevice::CreateDeviceByName
static PVideoOutputDevice * CreateDeviceByName(const PString &deviceName, const PString &driverName=PString::Empty(), PPluginManager *pluginMgr=NULL)
PVideoFrameInfo::PVideoFrameInfo
PVideoFrameInfo()
Construct video frame information.
PVideoFrameInfo::GetFrameSize
virtual PBoolean GetFrameSize(unsigned &width, unsigned &height) const
Get the frame size being used.
PVideoInputDevice::GetDeviceCapabilities
virtual bool GetDeviceCapabilities(Capabilities *capabilities) const
Retrieve a list of Device Capabilities.
Definition: videoio.h:1039
PVideoDevice::SetWhiteness
virtual PBoolean SetWhiteness(unsigned newWhiteness)
Set whiteness of the image.
PVideoInputDevice::GetCaptureMode
virtual int GetCaptureMode() const
Returns the current capture mode.
PVideoFrameInfo
Definition: videoio.h:49
PBYTEArray
Array of unsigned characters.
Definition: array.h:670
PVideoInteractionInfo
This class defines a video Input device Interactions (Remote Inputs/Controls)
Definition: videoio.h:319
PVideoFrameInfo::HD720Height
Definition: videoio.h:71
PVideoInputDevice::Close
virtual PBoolean Close()
Close the device.
Definition: videoio.h:1072
PVideoInputDevice::Capabilities
Definition: videoio.h:1031
PVideoDevice::SECAM
Definition: videoio.h:385
PVideoInteractionInfo::InteractOther
Register remote RTSP (Real Time Streaming Protocol) Inputs.
Definition: videoio.h:330
PVideoFrameInfo::AsString
static PString AsString(unsigned width, unsigned height)
Get a width/height as a standard size string name.
PVideoInputDevice::CanCaptureVideo
virtual PBoolean CanCaptureVideo() const
Is the device a camera, and obtain video.
PVideoFrameInfo::CIF16Width
Definition: videoio.h:68
PVideoFrameInfo::SQCIFHeight
Definition: videoio.h:64
PVideoInputDevice::CreateDeviceByName
static PVideoInputDevice * CreateDeviceByName(const PString &deviceName, const PString &driverName=PString::Empty(), PPluginManager *pluginMgr=NULL)
PVideoOutputDevice::Stop
virtual PBoolean Stop()
Stop the video device I/O display.
Definition: videoio.h:779
PVideoInputControl::GetTilt
long GetTilt()
PVideoDevice::IsOpen
virtual PBoolean IsOpen()=0
Determine if the device is currently open.
PVideoInputControl::ccmutex
PMutex ccmutex
Definition: videoio.h:313
PVideoInputDevice::GetFrame
virtual PBoolean GetFrame(PBYTEArray &frame)
Grab a frame.
PVideoDevice::SetBrightness
virtual PBoolean SetBrightness(unsigned newBrightness)
Set brightness of the image.
PVideoInputDevice::CreateDevice
static PVideoInputDevice * CreateDevice(const PString &driverName, PPluginManager *pluginMgr=NULL)
Create the video input device that corresponds to the specified driver name.
PVideoFrameInfo::operator<<
friend ostream & operator<<(ostream &strm, ResizeMode mode)
PVideoDevice::GetNumChannels
virtual int GetNumChannels()
Get the number of video channels available on the device.
PVideoDevice::OpenArgs::resizeMode
ResizeMode resizeMode
Definition: videoio.h:413
PVideoInputControl::GetCurrentPosition
PBoolean GetCurrentPosition(const InputControlType ctype, long &current)
PVideoInputDevice::SetNearestFrameSize
virtual PBoolean SetNearestFrameSize(unsigned width, unsigned height)
Set the nearest available frame size to be used.
PPLUGIN_STATIC_LOAD
PPLUGIN_STATIC_LOAD(FakeVideo, PVideoInputDevice)
PVideoOutputPluginServiceDescriptor
Definition: videoio.h:1192
PVideoDevice::OpenArgs::contrast
int contrast
Definition: videoio.h:417
PVideoFrameInfo::frameRate
unsigned frameRate
Definition: videoio.h:254
PVideoDevice::Start
virtual PBoolean Start()=0
Start the video device I/O capture.
PVideoInteractionInfo::AsString
static PString AsString(const InputInteractType &type)
PVideoDevice::OpenArgs::deviceName
PString deviceName
Definition: videoio.h:404
PVideoFrameInfo::HD720Width
Definition: videoio.h:71
PVideoDevice
This class defines a video device.
Definition: videoio.h:367
PVideoDevice::GetChannel
virtual int GetChannel() const
Get the video channel to be used on the device.
PVideoControlInfo::flags
long flags
Definition: videoio.h:279
PVideoDevice::CanCaptureVideo
virtual PBoolean CanCaptureVideo() const =0
Is the device a camera, and obtain video.
PVideoInputPluginServiceDescriptor::GetDeviceCapabilities
virtual bool GetDeviceCapabilities(const PString &deviceName, void *caps) const
Definition: videoio.h:1160
PVideoDevice::SetNearestFrameSize
virtual PBoolean SetNearestFrameSize(unsigned width, unsigned height)
Set the nearest available frame size to be used.
PVideoDevice::deviceName
PString deviceName
Definition: videoio.h:682
PVideoOutputDevice::DisableDecode
virtual PBoolean DisableDecode()
Allow the outputdevice decide whether the decoder should ignore decode hence not render any output...
PVideoFrameInfo::Parse
bool Parse(const PString &str)
Parse a descriptor string for the video format.
PVideoFrameInfo::StandardSizes
StandardSizes
Definition: videoio.h:63
PVideoDevice::OpenFull
virtual PBoolean OpenFull(const OpenArgs &args, PBoolean startImmediate=true)
Open the device given the device name.
PVideoDevice::SetHue
virtual PBoolean SetHue(unsigned newHue)
Set hue of the image.
PVideoOutputDevice::GetPosition
virtual PBoolean GetPosition(int &x, int &y) const
Get the position of the output device, where relevant.
PVideoFrameInfo::CIF4Height
Definition: videoio.h:67
PVideoOutputDeviceRGB::scanLineWidth
PINDEX scanLineWidth
Definition: videoio.h:912
PString
The character string class.
Definition: pstring.h:108
PVideoOutputDeviceRGB::SetFrameSize
virtual PBoolean SetFrameSize(unsigned width, unsigned height)
Set the frame size to be used.
PVideoInputDevice::Capabilities::controls
std::list< PVideoControlInfo > controls
Definition: videoio.h:1033
PVideoDevice::OpenArgs::pluginMgr
PPluginManager * pluginMgr
Definition: videoio.h:402
PVideoDevice::GetDeviceNames
virtual PStringArray GetDeviceNames() const =0
Get a list of all of the drivers available.
PVideoFrameInfo::QCIFHeight
Definition: videoio.h:65
PVideoOutputDeviceRGB::SetFrameData
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.
PVideoFrameInfo::GetSizeNames
static PStringArray GetSizeNames()
Get all "known" image size names.
PString::Empty
static PString Empty()
Return an empty string.
PVideoDevice::NTSC
Definition: videoio.h:384
PVideoDevice::GetContrast
virtual int GetContrast()
Get the contrast of the image.
PVideoInputDevice::IsCapturing
virtual PBoolean IsCapturing()=0
Determine if the video device I/O capture is in progress.
PVideoDevice::GetLastError
int GetLastError() const
Get the last error code.
Definition: videoio.h:598
PVideoFrameInfo::GetSarSize
virtual PBoolean GetSarSize(unsigned &width, unsigned &height) const
Get the sar size being used.
PVideoDevice::~PVideoDevice
virtual ~PVideoDevice()
Delete structures created by PVideoDevice();.
PVideoDevice::GetPreferredColourFormat
const PString & GetPreferredColourFormat()
Get preferred native colour format from video capture device.
Definition: videoio.h:677
PVideoFrameInfo::p720Width
Definition: videoio.h:72
PVideoDevice::nativeVerticalFlip
PBoolean nativeVerticalFlip
Definition: videoio.h:688
PVideoDevice::converter
PColourConverter * converter
Definition: videoio.h:690
PVideoDevice::videoFormat
VideoFormat videoFormat
Definition: videoio.h:684
PVideoDevice::OpenArgs::convertFormat
bool convertFormat
Definition: videoio.h:408
PVideoInputControl::GetDefaultPosition
PBoolean GetDefaultPosition(const InputControlType ctype, long &def)
PVideoInputDevice
This class defines a video input device.
Definition: videoio.h:962
PVideoDevice::OpenArgs::flip
bool flip
Definition: videoio.h:414
PVideoFrameInfo::eCropCentre
Definition: videoio.h:57
PVideoInputDevice::~PVideoInputDevice
~PVideoInputDevice()
Create a new video input device.
Definition: videoio.h:973
PVideoDevice::SetFrameSize
virtual PBoolean SetFrameSize(unsigned width, unsigned height)
Set the frame size to be used.
PVideoDevice::lastError
int lastError
Definition: videoio.h:683
PVideoInputDevice::GetVideoInputControls
virtual PVideoInputControl * GetVideoInputControls()
Get the devices video Input controls By Default return NULL;.
PVideoFrameInfo::i1080Height
Definition: videoio.h:74
PVideoDevice::SetPreferredColourFormat
void SetPreferredColourFormat(const PString &colourFmt)
Set preferred native colour format from video capture device.
Definition: videoio.h:672
PVideoOutputDeviceRGB
This class defines a video output device for RGB in a frame store.
Definition: videoio.h:851
PVideoDevice::Close
virtual PBoolean Close()=0
Close the device.
PColourConverter
This class defines a means to convert an image from one colour format to another. ...
Definition: vconvert.h:80
PVideoInputDevice::CreateOpenedDevice
static PVideoInputDevice * CreateOpenedDevice(const PString &driverName, const PString &deviceName, PBoolean startImmediate=true, PPluginManager *pluginMgr=NULL)
Create an opened video input device that corresponds to the specified names.
PVideoDevice::SetFrameSizeConverter
virtual PBoolean SetFrameSizeConverter(unsigned width, unsigned height, PBoolean)
Set the frame size to be used, trying converters if available.
Definition: videoio.h:546
PVideoFrameInfo::SetColourFormat
virtual PBoolean SetColourFormat(const PString &colourFormat)
Set the colour format to be used.
PVideoDevice::OpenArgs::colour
int colour
Definition: videoio.h:418
PVideoOutputDevice::~PVideoOutputDevice
virtual ~PVideoOutputDevice()
Close the video output device on destruction.
Definition: videoio.h:714
PVideoDevice::GetWhiteness
virtual int GetWhiteness()
Get the whiteness of the image.
PVideoInputPluginServiceDescriptor
Definition: videoio.h:1155
PVideoOutputDevice::SetPosition
virtual bool SetPosition(int x, int y)
Set the position of the output device, where relevant.
PVideoInteractionInfo::type
InputInteractType type
Definition: videoio.h:335
PVideoFrameInfo::GetFrameWidth
virtual unsigned GetFrameWidth() const
Get the width of the frame being used.
PVideoDevice::OpenArgs::OpenArgs
OpenArgs()
PVideoOutputDevice::Close
virtual PBoolean Close()
Close the device.
Definition: videoio.h:771
PVideoFrameInfo::eScale
Definition: videoio.h:56
PVideoControlInfo::step
long step
Definition: videoio.h:277
PVideoOutputDevice
This class defines a video output device.
Definition: videoio.h:703
PVideoDevice::SetChannel
virtual PBoolean SetChannel(int channelNumber)
Set the video channel to be used on the device.
PVideoDevice::OpenArgs::rate
unsigned rate
Definition: videoio.h:409
PVideoOutputDevice::SetFrameData
virtual PBoolean SetFrameData(unsigned x, unsigned y, unsigned width, unsigned height, const BYTE *data, PBoolean endFrame=true)=0
Set a section of the output frame buffer.
PMutex
Synonym for PTimedMutex.
PVideoFrameInfo::CalculateFrameBytes
PINDEX CalculateFrameBytes() const
Get the number of bytes of an image, given a particular width, height and colour format.
Definition: videoio.h:202
PVideoOutputDevice::PVideoOutputDevice
PVideoOutputDevice()
Create a new video output device.
PVideoControlInfo::AsString
static PString AsString(const InputControlType &type)
PVideoFrameInfo::eCropTopLeft
Definition: videoio.h:58
PVideoDevice::SetColourFormatConverter
virtual PBoolean SetColourFormatConverter(const PString &colourFormat)
Set the colour format to be used, trying converters if available.
PVideoDevice::NumVideoFormats
Definition: videoio.h:387
PVideoFrameInfo::HD1080Width
Definition: videoio.h:73
PVideoDevice::GetDeviceName
const PString & GetDeviceName() const
Get the device name of the open device.
Definition: videoio.h:392
PVideoFrameInfo::sarHeight
unsigned sarHeight
Definition: videoio.h:253
PVideoFrameInfo::GetResizeMode
ResizeMode GetResizeMode() const
Get the resize mode to be used.
Definition: videoio.h:198
PVideoFrameInfo::CIFWidth
Definition: videoio.h:66
PVideoDevice::frameStore
PBYTEArray frameStore
Definition: videoio.h:691
PVideoDevice::Auto
Definition: videoio.h:386
PVideoDevice::SetFrameSizeConverter
virtual PBoolean SetFrameSizeConverter(unsigned width, unsigned height, ResizeMode resizeMode=eMaxResizeMode)
Set the frame size to be used, trying converters if available.
PVideoDevice::OpenArgs::whiteness
int whiteness
Definition: videoio.h:416
PVideoDevice::frameColour
int frameColour
Definition: videoio.h:696
PVideoOutputDevice::CreateOpenedDevice
static PVideoOutputDevice * CreateOpenedDevice(const PString &driverName, const PString &deviceName, PBoolean startImmediate=true, PPluginManager *pluginMgr=NULL)
Create an opened video output device that corresponds to the specified names.
PVideoDevice::GetFrameSizeLimits
virtual PBoolean GetFrameSizeLimits(unsigned &minWidth, unsigned &minHeight, unsigned &maxWidth, unsigned &maxHeight)
Get the minimum & maximum size of a frame on the device.
PVideoDevice::OpenArgs::brightness
int brightness
Definition: videoio.h:415
PVideoOutputDeviceRGB::GetMaxFrameBytes
virtual PINDEX GetMaxFrameBytes()
Get the maximum frame size in bytes.
PVideoInteractionInfo::InteractNavigate
Register remote Mouse Movement Clicks.
Definition: videoio.h:328
PVideoInputDevice::FlowControl
virtual bool FlowControl(const void *flowData)
Pass data to the inputdevice for flowControl determination.
PVideoFrameInfo::GetSarWidth
virtual unsigned GetSarWidth() const
Get the width of the sar being used.
PVideoDevice::PAL
Definition: videoio.h:383
PVideoOutputPluginServiceDescriptor::GetDeviceNames
virtual PStringArray GetDeviceNames(int) const
Definition: videoio.h:1196
PVideoFrameInfo::GetSarHeight
virtual unsigned GetSarHeight() const
Get the height of the sar being used.
PVideoInputPluginServiceDescriptor::CreateInstance
virtual PObject * CreateInstance(int) const
Definition: videoio.h:1158
PVideoDevice::GetBrightness
virtual int GetBrightness()
Get the brightness of the image.
PVideoDevice::SetVideoFormat
virtual PBoolean SetVideoFormat(VideoFormat videoFormat)
Set the video format to be used.
PVideoDevice::PVideoDevice
PVideoDevice()
Create a new video device (input or output).
PVideoOutputDeviceRGB::swappedRedAndBlue
bool swappedRedAndBlue
Definition: videoio.h:913
PObject
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PVideoInputControl::InputDeviceControls
std::list< PVideoControlInfo > InputDeviceControls
Definition: videoio.h:305
PVideoOutputDevice::CanCaptureVideo
virtual PBoolean CanCaptureVideo() const
Is the device a camera, and obtain video.
PVideoDevice::GetParameters
virtual PBoolean GetParameters(int *whiteness, int *brightness, int *colour, int *contrast, int *hue)
Return whiteness, brightness, colour, contrast and hue in one call.
PVideoDevice::OpenArgs::colourFormat
PString colourFormat
Definition: videoio.h:407
PVideoOutputDeviceRGB::mutex
PMutex mutex
Definition: videoio.h:910
PVideoOutputDevice::GetDriverNames
static PStringArray GetDriverNames(PPluginManager *pluginMgr=NULL)
Get the list of available video output drivers (plug-ins)
PVideoInputControl
This class defines a video Input device control (Camera controls PTZ)
Definition: videoio.h:287
PVideoInteractionInfo::InteractKey
Definition: videoio.h:326
PVideoFrameInfo::frameHeight
unsigned frameHeight
Definition: videoio.h:251
PVideoControlInfo::min
long min
Definition: videoio.h:275
PVideoInputControl::Tilt
virtual PBoolean Tilt(long value, bool absolute=false)
PVideoFrameInfo::sarWidth
unsigned sarWidth
Definition: videoio.h:252
PVideoInputDevice::SetCaptureMode
virtual bool SetCaptureMode(unsigned mode)
Set the capture modes for implementations that support them.
PVideoFrameInfo::HD1080Height
Definition: videoio.h:73
PVideoInputDevice::Open
virtual PBoolean Open(const PString &deviceName, PBoolean startImmediate=true)=0
Open the device given the device name.