+++ /dev/null
-#ifndef _IVIDEO_READER_H_
-#define _IVIDEO_READER_H_
-
-#include "SharedPtr.h"
-#include <string>
-#include <opencv2/opencv.hpp>
-
-namespace suanzi {
-
- typedef enum {
- URL,
- File,
- USB
- } VideoSrcType;
-
- TK_DECLARE_PTR(VideoReaderFactory);
- TK_DECLARE_PTR(VideoReader);
- TK_DECLARE_PTR(URLReader);
-
- class VideoReaderFactory
- {
- public:
- static VideoReaderPtr createVideoReader(VideoSrcType type, const std::string& url);
- };
-
- class VideoReader
- {
- public:
- VideoReader(VideoSrcType type, const std::string& url) : type(type), url(url){}
-
- virtual ~VideoReader();
- virtual bool read(cv::Mat& mat){return true;}
-
- private:
- VideoSrcType type;
-
- protected:
- std::string url;
- };
-
- class UrlReader : public VideoReader
- {
- public:
- UrlReader(VideoSrcType type, const std::string& url);
- virtual ~UrlReader();
- bool read(cv::Mat& mat);
- private:
- cv::VideoCapture vcap;
- };
-
- class FileReader : public VideoReader
- {
- public:
- FileReader(VideoSrcType type, const std::string& url):VideoReader(type, url){}
- // void read(){};
- };
-
- class UsbReader : public VideoReader
- {
- public:
- UsbReader(VideoSrcType type, const std::string& url):VideoReader(type, url){}
- // void read(){};
- };
-
-}
-
-
-#endif /* _IVIDEO_READER_H_ */