-typedef enum {
- URL,
- File,
- USB
-} VideoSrcType;
-
-class VideoReader;
-
-class VideoReaderFactory
-{
-public:
- static VideoReader* 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(){};
-};
-
+ 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(){};
+ };