videoio.h
来自「安装 H323需要的pwlib库」· C头文件 代码 · 共 1,005 行 · 第 1/2 页
H
1,005 行
/**Get the brightness of the image. 0xffff-Very bright. -1 is unknown. */ virtual int GetBrightness(); /**Set brightness of the image. 0xffff-Very bright. */ virtual BOOL SetBrightness(unsigned newBrightness); /**Get the whiteness of the image. 0xffff-Very white. -1 is unknown. */ virtual int GetWhiteness(); /**Set whiteness of the image. 0xffff-Very white. */ virtual BOOL SetWhiteness(unsigned newWhiteness); /**Get the colour of the image. 0xffff-lots of colour. -1 is unknown. */ virtual int GetColour(); /**Set colour of the image. 0xffff-lots of colour. */ virtual BOOL SetColour(unsigned newColour); /**Get the contrast of the image. 0xffff-High contrast. -1 is unknown. */ virtual int GetContrast(); /**Set contrast of the image. 0xffff-High contrast. */ virtual BOOL SetContrast(unsigned newContrast); /**Get the hue of the image. 0xffff-High hue. -1 is unknown. */ virtual int GetHue(); /**Set hue of the image. 0xffff-High hue. */ virtual BOOL SetHue(unsigned newHue); /**Return whiteness, brightness, colour, contrast and hue in one call. */ virtual BOOL GetParameters( int *whiteness, int *brightness, int *colour, int *contrast, int *hue ); /** Set VideoFormat and VideoChannel in one ioctl */ virtual BOOL SetVideoChannelFormat ( int channelNumber, VideoFormat videoFormat ); /**Get the video conversion vertical flip state. Default action is to return FALSE. */ virtual BOOL GetVFlipState(); /**Set the video conversion vertical flip state. Default action is to return FALSE. */ virtual BOOL SetVFlipState( BOOL newVFlipState /// New vertical flip state ); /**Set preferred native colour format from video capture device. Note empty == no preference. */ void SetPreferredColourFormat(const PString & colourFmt) { preferredColourFormat = colourFmt; } /**Get preferred native colour format from video capture device. Returns empty == no preference */ const PString & GetPreferredColourFormat() { return preferredColourFormat; } protected: PString deviceName; int lastError; VideoFormat videoFormat; int channelNumber; PString colourFormat; // Preferred native colour format from video input device, empty == no preference PString preferredColourFormat; unsigned frameRate; unsigned frameWidth; unsigned frameHeight; BOOL doVFlip; PColourConverter * converter; int frameBrightness; // 16 bit entity, -1 is no value int frameWhiteness; int frameContrast; int frameColour; int frameHue; PTime previousFrameTime; // Time of the last frame. int msBetweenFrames; // msBetween subsequent frames. int frameTimeError; // determines when this frame should happen.};/**This class defines a video output device.- typically, a window. */class PVideoOutputDevice : public PVideoDevice{ PCLASSINFO(PVideoOutputDevice, PVideoDevice); public: /** Create a new video output device. */ PVideoOutputDevice(); /**Close the video output device on destruction. */ virtual ~PVideoOutputDevice() { Close(); }; /** Return the list of available video input drivers */ static PStringList GetDriverNames(PPluginManager * pluginMgr = NULL); /** Return video devices that correspond to the specified name */ static PStringList GetDriversDeviceNames( const PString &driverName, PPluginManager * pluginMgr = NULL ); /** Return the video output device that corresponds to the specified name */ static PVideoOutputDevice *CreateDevice( const PString &driverName, PPluginManager * pluginMgr = NULL ); /** Return opened video output device that corresponds to the specified name */ static PVideoOutputDevice *CreateOpenedDevice( const PString & driverName, const PString & deviceName, BOOL startImmediate = TRUE, PPluginManager * pluginMgr = NULL ); /**Close the device. */ virtual BOOL Close() { return TRUE; } /** Is the device a camera, and obtain video */ virtual BOOL CanCaptureVideo() const; /**Set a section of the output frame buffer. */ virtual BOOL SetFrameData( unsigned x, unsigned y, unsigned width, unsigned height, const BYTE * data, BOOL endFrame = TRUE ) = 0; /**Indicate frame may be displayed. */ /**Start the video device I/O display. */ virtual BOOL Start() { return TRUE; } /**Stop the video device I/O display. */ virtual BOOL Stop() { return TRUE; }};#ifdef SHOULD_BE_MOVED_TO_PLUGIN/**This class defines a video output device for RGB in a frame store. */class PVideoOutputDeviceRGB : public PVideoOutputDevice{ PCLASSINFO(PVideoOutputDeviceRGB, PVideoOutputDevice); public: /** Create a new video output device. */ PVideoOutputDeviceRGB(); /**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. */ virtual BOOL SetColourFormat( const PString & colourFormat // New colour format for device. ); /**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. */ virtual BOOL SetFrameSize( unsigned width, /// New width of frame unsigned height /// New height of frame ); /**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. */ virtual PINDEX GetMaxFrameBytes(); /**Set a section of the output frame buffer. */ virtual BOOL SetFrameData( unsigned x, unsigned y, unsigned width, unsigned height, const BYTE * data, BOOL endFrame = TRUE ); /**Indicate frame may be displayed. */ virtual BOOL EndFrame() = 0; protected: PBYTEArray frameStore; PINDEX bytesPerPixel;};#endif // SHOULD_BE_MOVED_TO_PLUGIN#ifdef SHOULD_BE_MOVED_TO_PLUGIN/**This class defines a video output device which outputs to a series of PPM files. */class PVideoOutputDevicePPM : public PVideoOutputDeviceRGB{ PCLASSINFO(PVideoOutputDevicePPM, PVideoOutputDeviceRGB); public: /** Create a new video output device. */ PVideoOutputDevicePPM(); /**Open the device given the device name. */ virtual BOOL Open( const PString & deviceName, /// Device name (filename base) to open BOOL startImmediate = TRUE /// Immediately start device ); /**Determine if the device is currently open. */ virtual BOOL IsOpen(); /**Close the device. */ virtual BOOL Close(); /**Get a list of all of the drivers available. */ virtual PStringList GetDeviceNames() const; /**Indicate frame may be displayed. */ virtual BOOL EndFrame(); protected: unsigned frameNumber;};#endif // SHOULD_BE_MOVED_TO_PLUGIN/**This class defines a video input device. */class PVideoInputDevice : public PVideoDevice{ PCLASSINFO(PVideoInputDevice, PVideoDevice); public: /** Create a new video input device. */ //PVideoInputDevice(); /**Close the video input device on destruction. */ ~PVideoInputDevice() { Close(); } /** Return the list of available video input drivers */ static PStringList GetDriverNames(PPluginManager * pluginMgr = NULL); /** Return video devices that correspond to the specified name */ static PStringList GetDriversDeviceNames( const PString &driverName, PPluginManager * pluginMgr = NULL ); /** Return the video input device that corresponds to the specified name. */ static PVideoInputDevice *CreateDevice( const PString &driverName, PPluginManager * pluginMgr = NULL ); /* Return the matching video input device that corresponds to the devicename. 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. */ static PVideoInputDevice *CreateDeviceByName(const PString &deviceName, PPluginManager * pluginMgr = NULL ); /** Return opened video input device that corresponds to the specified name */ static PVideoInputDevice *CreateOpenedDevice( const PString & driverName, const PString & deviceName, BOOL startImmediate = TRUE, PPluginManager * pluginMgr = NULL ); /** Is the device a camera, and obtain video */ virtual BOOL CanCaptureVideo() const; /**Open the device given the device name. */ virtual BOOL Open( const PString & deviceName, /// Device name to open BOOL startImmediate = TRUE /// Immediately start device ) = 0; virtual BOOL Close( ) { return TRUE; } /**Determine if the video device I/O capture is in progress. */ virtual BOOL IsCapturing() = 0; /**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. */ virtual PINDEX GetMaxFrameBytes() = 0; /**Grab a frame. */ virtual BOOL GetFrame( PBYTEArray & frame ) = 0; /**Grab a frame, after a delay as specified by the frame rate. */ virtual BOOL GetFrameData( BYTE * buffer, /// Buffer to receive frame PINDEX * bytesReturned = NULL /// OPtional bytes returned. ) = 0; /**Grab a frame. Do not delay according to the current frame rate parameter. */ virtual BOOL GetFrameDataNoDelay( BYTE * buffer, /// Buffer to receive frame PINDEX * bytesReturned = NULL /// OPtional bytes returned. ) = 0; /**Try all known video formats & see which ones are accepted by the video driver */ virtual BOOL TestAllFormats() = 0;};//////////////////////////////////////////////////////////// declare macros and structures needed for video input plugins//class PVideoInputDevicePluginServiceDescriptor : public PPluginServiceDescriptor{ public: PVideoInputDevicePluginServiceDescriptor( unsigned (*_GetVersion)(), PVideoInputDevice *(*_CreateInstance)(), PStringList (*_GetDeviceNames)() ) : PPluginServiceDescriptor(_GetVersion), CreateInstance(_CreateInstance), GetDeviceNames(_GetDeviceNames) { } PVideoInputDevice *(*CreateInstance)(); PStringList (*GetDeviceNames) ();};#define PCREATE_VIDINPUT_SERVICE_DESCRIPTOR(className, versionFn) \PVideoInputDevice * className##_CreateInstance () \{ \ return new className; \} \\PStringList className##_GetDeviceNames () \{ \ return className::GetInputDeviceNames(); \} \\PVideoInputDevicePluginServiceDescriptor className##_descriptor(\ versionFn, \ className##_CreateInstance, \ className##_GetDeviceNames \); \#define PCREATE_VIDINPUT_PLUGIN(name, className) \PCREATE_PLUGIN_VERSION_FN(name, PVideoInputDevice) \PCREATE_VIDINPUT_SERVICE_DESCRIPTOR(className, PPLUGIN_VERSION_FN(name, PVideoInputDevice)) \PCREATE_PLUGIN(name, PVideoInputDevice, &className##_descriptor)//////////////////////////////////////////////////////////// declare macros and structures needed for video output plugins//class PVideoOutputDevicePluginServiceDescriptor : public PPluginServiceDescriptor{ public: PVideoOutputDevicePluginServiceDescriptor( unsigned (*_GetVersion)(), PVideoOutputDevice *(*_CreateInstance)(), PStringList (*_GetDeviceNames)() ) : PPluginServiceDescriptor(_GetVersion), CreateInstance(_CreateInstance), GetDeviceNames(_GetDeviceNames) { } PVideoOutputDevice *(*CreateInstance)(); PStringList (*GetDeviceNames) ();};#define PCREATE_VIDOUTPUT_SERVICE_DESCRIPTOR(className, versionFn) \PVideoOutputDevice * className##_CreateInstance () \{ \ return new className; \} \\PStringList className##_GetDeviceNames () \{ \ return className::GetOutputDeviceNames(); \} \\PVideoOutputDevicePluginServiceDescriptor className##_descriptor(\ versionFn, \ className##_CreateInstance, \ className##_GetDeviceNames \); \#define PCREATE_VIDOUTPUT_PLUGIN(name, className) \PCREATE_PLUGIN_VERSION_FN(name, PVideoOutputDevice) \PCREATE_VIDOUTPUT_SERVICE_DESCRIPTOR(className, PPLUGIN_VERSION_FN(name, PVideoOutputDevice)) \PCREATE_PLUGIN(name, PVideoOutputDevice, &className##_descriptor)#endif // _PVIDEOIO// End Of File ///////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?