PARP Research Group University of Murcia, Spain


src/qvio/qvmplayercamera.h

Go to the documentation of this file.
00001 /*
00002  *      Copyright (C) 2007, 2008, 2009. PARP Research Group.
00003  *      <http://perception.inf.um.es>
00004  *      University of Murcia, Spain.
00005  *
00006  *      This file is part of the QVision library.
00007  *
00008  *      QVision is free software: you can redistribute it and/or modify
00009  *      it under the terms of the GNU Lesser General Public License as
00010  *      published by the Free Software Foundation, version 3 of the License.
00011  *
00012  *      QVision is distributed in the hope that it will be useful,
00013  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *      GNU Lesser General Public License for more details.
00016  *
00017  *      You should have received a copy of the GNU Lesser General Public
00018  *      License along with QVision. If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00024 
00025 #ifndef QVMPLAYERCAMERA_H
00026 #define QVMPLAYERCAMERA_H
00027 
00028 #include <QVMPlayerProxy>
00029 
00043 class QVMPlayerCamera : public QVCamera
00044         {
00045         Q_OBJECT
00046         public:
00048                 QVMPlayerCamera(QString name = QString());
00050                 ~QVMPlayerCamera();
00051 
00052                 #ifndef DOXYGEN_IGNORE_THIS
00071                 bool openCam();
00072                 #endif
00073 
00077                 const QString getUrlBase() const { return mplayerProxy.getUrlBase(); }
00078 
00081                 QVMPlayerProxy::OpenOptions getOptions() const          { return mplayerProxy.getOptions(); };
00082 
00085                 unsigned int getFramesUpdated() const                   { return mplayerProxy.getFramesUpdated(); }
00086 
00089                 unsigned int getRows() const                            { return mplayerProxy.getRows(); };
00090 
00093                 unsigned int getCols() const                            { return mplayerProxy.getCols(); };
00094 
00097                 double getFPS() const                                   { return mplayerProxy.getFPS(); };
00098 
00101                 double getTimeLength() const                            { return mplayerProxy.getTimeLength(); };
00102 
00105                 double getTimePos() const                               { return mplayerProxy.getTimePos(); };
00106 
00109                 double getSpeed() const                                 { return mplayerProxy.getSpeed(); };
00110 
00113                 unsigned int getFramesGrabbed() const                   { return mplayerProxy.getFramesGrabbed(); };
00114 
00117                 unsigned int getFramesRead() const                      { return mplayerProxy.getFramesRead(); };
00118 
00121                 bool isLiveCamera() const                               { return mplayerProxy.isLiveCamera(); };
00122 
00123         public slots:
00130                 bool grab();
00131 
00133                 void pauseCam()                                         { mplayerProxy.pauseCam(); }
00134 
00136                 void unpauseCam()                                       { mplayerProxy.unpauseCam(); }
00137 
00139                 void nextFrameCam()                                     { mplayerProxy.nextFrameCam(); }
00140 
00143                 void setSpeedCam(double d)                              { mplayerProxy.setSpeedCam(d); }
00144 
00151                 void seekCam(QVCamera::TSeekType type, double pos)      { mplayerProxy.seekCam(type, pos); }
00152 
00154                 void closeCam();
00155 
00156                 bool linkProperty(QString sourcePropertyName, QVPropertyContainer *destinyContainer, QString destinyPropertyName, LinkType linkType = AsynchronousLink);
00157                 bool linkProperty(QString sourcePropertyName, QVPropertyContainer &destinyContainer, QString destinyPropertyName, LinkType linkType = AsynchronousLink);
00158                 bool linkProperty(QVPropertyContainer *destinyContainer, QString destinyPropertyName, LinkType linkType = AsynchronousLink);
00159                 bool linkProperty(QVPropertyContainer &destinyContainer, QString destinyPropertyName, LinkType linkType = AsynchronousLink);
00160                 bool linkProperty(QString sourcePropertyName, QVPropertyContainer *destinyContainer, LinkType linkType = AsynchronousLink);
00161                 bool linkProperty(QString sourcePropertyName, QVPropertyContainer &destinyContainer, LinkType linkType = AsynchronousLink);
00162                 void linkProperty(QVPropertyContainer *container, LinkType linkType = AsynchronousLink);
00163                 void linkProperty(QVPropertyContainer &container, LinkType linkType = AsynchronousLink);
00164                 bool unlinkProperty(QString origName, QVPropertyContainer *destCont, QString destName);
00165                 bool unlinkProperty(QString origName, QVPropertyContainer &destCont, QString destName);
00166                 void unlink();
00167 
00168                 bool link(QVWorker *worker, const QString imageY, const QString imageU, const QString imageV);
00169                 bool link(QVWorker &worker, const QString imageY, const QString imageU, const QString imageV);
00170                 bool unlink(QVWorker *worker, const QString imageName);
00171                 bool unlink(QVWorker &worker, const QString imageName);
00172 
00173         private:
00174                 // this boolean value becomes true if any RGB image is linked to the camera, from a worker.
00175                 bool rgbMode;
00176                 QVMPlayerProxy mplayerProxy;
00177 
00179                 QStringList mplayer_args;               // MPlayer arguments
00180                 QString path, schema;                   // path and schema extracted from the URL
00181         };
00182 
00183 #endif
00184 
00185 
00186 
00187 



QVision framework. PARP research group, copyright 2007, 2008.