#pragma once #ifdef _WIN32 #ifdef LIBVIDEOQUEUE_EXPORTS #define LIBVIDEOQUEUE_API __declspec(dllexport) #else #define LIBVIDEOQUEUE_API __declspec(dllimport) #endif # elif ( defined(__GNUC__) && __GNUC__ >= 4 ) #define LIBVIDEOQUEUE_API __attribute__((visibility("default"))) #else // RVC_OS_WIN #define LIBVIDEOQUEUE_API #endif // RVC_OS_WIN //using namespace std ; #define VIDEOQ_FORMAT_I420 0x01 #define VIDEOQ_FORMAT_RGB24 0x02 #define VIDEOQ_FORMAT_YUY2 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(const char* 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(); };