00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #ifndef QVYUV4MPEG2CAMERAWORKER_H
00026 #define QVYUV4MPEG2CAMERAWORKER_H
00027
00028 #include <QTimer>
00029
00030 #include <QVVideoReaderBlock>
00031 #include <qvio.h>
00032
00111 class QVYUV4MPEG2ReaderBlock: public QVVideoReaderBlock
00112 {
00113 public:
00117 QVYUV4MPEG2ReaderBlock(QString name = QString("")) : QVVideoReaderBlock(name) { };
00118
00120 ~QVYUV4MPEG2ReaderBlock() { close(); };
00121
00122 private:
00123 QFile videoFile;
00124 unsigned int inp_cols,inp_rows,out_cols,out_rows;
00125 unsigned int out_fps;
00126 bool rescale,realTime;
00127 int total_frames,header_size;
00128 double total_time,current_time;
00129
00130 protected:
00131 bool open(QString urlName, int &cols, int &rows, int &fps);
00132 void close();
00133 bool grab(QVImage<uChar,1> &imgY, QVImage<uChar,1> &imgU, QVImage<uChar,1> &imgV);
00134 double lengthOfVideo();
00135 double currentPos();
00136
00137 private slots:
00138 void setCurrentPos(double time_pos);
00139 };
00140
00141 #endif