1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- // 下列 ifdef 块是创建使从 DLL 导出更简单的
- // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 LIBVIDEOQUEUE_EXPORTS
- // 符号编译的。在使用此 DLL 的
- // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
- // LIBVIDEOQUEUE_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
- // 符号视为是被导出的。
- #ifndef LIBVIDEOQUEUE
- #define LIBVIDEOQUEUE
- #ifdef LIBVIDEOQUEUE_EXPORTS
- #define LIBVIDEOQUEUE_API __declspec(dllexport)
- #else
- #define LIBVIDEOQUEUE_API __declspec(dllimport)
- #endif
- //using namespace std ;
- #define VIDEOQ_FORMAT_RGB24 0x01
- #define VIDEOQ_FORMAT_OPENCV 0x02
- #define VIDEOQ_FORMAT_I420 0x03
- #define MAX_VIDEOQUEUE_LENS 1 //视频队列最大节点数量
- #define MAX_VIDEOQNODE_SIZE 640*360*3 //视频队列单个节点默认最大长度
- #define VIDEOQUEUE_FLAG_VERTICAL_FLIP 0x01
- #define VIDEOQUEUE_FLAG_HORIZONTAL_FLIP 0x02
- typedef struct videoq_frame
- {
- unsigned char *data;
- int width;
- int height;
- int framesize;
- int format; /* VIDEO_FORMAT_xxx */
- int iframeid;
- }videoq_frame;
- class libvideoqueue_impl; //桥接
- struct video_frame;
- // 此类是从 libvideoqueue.dll 导出的
- class LIBVIDEOQUEUE_API Clibvideoqueue
- {
- public:
- //videoqueuename:用于访问视频共享内存的共享内存文件名。framesize:默认最大长度,一般使用默认值即可
- Clibvideoqueue(LPCTSTR videoqueuename,int framesize=MAX_VIDEOQNODE_SIZE);
- ~Clibvideoqueue();
- // TODO: 在此添加您的方法。
- private:
- libvideoqueue_impl*m_pImpl;
- public:
- //插入图像到队头
- bool InsertVideo(videoq_frame* Video, int flags,unsigned int nowtime);
- //读取队头图像
- bool GetVideo(videoq_frame* Video, int flags);
- //读取队头图像,使用video_frame结构
- bool GetVideo2(video_frame* Video, int flags);
- //按行拷贝,用于横向摄像头图像的拼接
- bool GetVideo3(videoq_frame* Video, int flags);
- //读取队头图像并删除
- bool GetVideoAndDel(videoq_frame* Video, int flags);
- //获取最后的帧时间
- unsigned int GetLastFrameTime();
- //获取视频队列的长度
- int GetVideoLens(void);
- //获取单个视频帧的大小
- int GetFrameSize(int&width,int&height);
- //清空视频队列
- void ClearVideoQueue();
- //删除头部节点
- void DeleteHeadVideo();
- };
- #endif
|