📄 videoinput.h
字号:
#pragma once
#include <vector>
#include <string>
#include "VideoManInputFormat.h"
#include "VideoManInputController.h"
enum VIDEO_INPUT_TYPE { CAMERA, VIDEOFILE, IMAGE };
class VideoInput
{
public:
//type must be intialized in the constructor
//format must be completed when the input is initialized
VideoInput( void ){ pixelBuffer = NULL; }
virtual ~VideoInput( void ){};
/** \brief Get the format of the video input
*/
VideoManInputFormat getVideoManInputFormat(){ return format; }
/** \brief Get a new frame
\param wait [in] if it must wait for next sample or not
\return the frame of the video
*/
virtual inline char *getFrame( bool wait = false) = 0;
virtual VideoManInputController *getController(){ return NULL; }
virtual void releaseFrame(){}
VIDEO_INPUT_TYPE getType(){ return type; }
static void getAvailableDevices( std::vector<inputIdentification> &deviceList ){}
char* pixelBuffer; //The last captured frame
inputIdentification getIdentification()
{
return identification;
}
protected:
VIDEO_INPUT_TYPE type; //type of the video input: camera, video file ...
VideoManInputFormat format; //The internal format of the frames
inputIdentification identification; //The information about the input
bool frameCaptured; //if a frame was already captured
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -