Image Component Library (ICL)
ICLVideoSurface.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2015 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLQt/src/ICLQt/ICLVideoSurface.h **
10 ** Module : ICLQt **
11 ** Authors: Matthias Esau **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <QtCore>
34 
35 #if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
36 
37 #include <QtMultimedia/QVideoSurfaceFormat>
38 #include <QtMultimedia/QAbstractVideoSurface>
39 #include <QFileInfo>
40 #include <ICLQt/Common.h>
41 #include <ICLUtils/FPSLimiter.h>
42 #include <ICLCore/CCFunctions.h>
43 #include <QtCore/QMutex>
44 #include <QtCore/QWaitCondition>
45 #include <QtCore/QAtomicInt>
46 //#include <boost/thread/mutex.hpp>
47 //#include <boost/thread/condition_variable.hpp>
48 //#include <boost/atomic.hpp>
49 
50 namespace icl{
51  namespace qt{
52 
53  class ICLQt_API ICLVideoSurface : public QAbstractVideoSurface
54  {
56  bool newImage;
63  volatile bool nextFrameReady;
64  QMutex waitMutex;
65  QWaitCondition waitCondition;
66  QAtomicInt useLocking;
67  //boost::mutex waitMutex; // QMutex then ...
68  //boost::condition_variable waitCondition; // !QWaitCondition (maybe?)
69  //boost::atomic<bool> useLocking; // !use QAtomicInt
70 
71  public:
73  ~ICLVideoSurface();
74  QList<QVideoFrame::PixelFormat> supportedPixelFormats(
75  QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
76 
77  bool start(const QVideoSurfaceFormat &format);
78 
79  void stop();
80 
81  bool present(const QVideoFrame &frame);
82 
83  const Img8u* getImage();
84  private:
85  void init();
86  };
87  }
88 }
89 
90 #endif
undocument this line if you encounter any issues!
Definition: Any.h:37
Definition: ICLVideoSurface.h:53
volatile bool nextFrameReady
Definition: ICLVideoSurface.h:63
bool newImage
Definition: ICLVideoSurface.h:56
format
determines the color-format, that is associated with the images channels
Definition: Types.h:70
core::Img8u img0
Definition: ICLVideoSurface.h:57
core::Img8u * imgDisplay
Definition: ICLVideoSurface.h:61
core::Img8u img1
Definition: ICLVideoSurface.h:58
QWaitCondition waitCondition
Definition: ICLVideoSurface.h:65
#define ICLQt_API
Definition: CompatMacros.h:178
core::Img8u * imgNextDisplay
Definition: ICLVideoSurface.h:62
core::Img8u * imgWork
Definition: ICLVideoSurface.h:60
Mutex class of the ICL.
Definition: Mutex.h:54
Mutex lock
Definition: ICLVideoSurface.h:55
QMutex waitMutex
Definition: ICLVideoSurface.h:64
QAtomicInt useLocking
Definition: ICLVideoSurface.h:66
core::Img8u img2
Definition: ICLVideoSurface.h:59