~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to kde/src/lib/videorenderer.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 *   Copyright (C) 2012-2013 by Savoir-Faire Linux                          *
 
2
 *   Copyright (C) 2012-2014 by Savoir-Faire Linux                          *
3
3
 *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
4
4
 *                                                                          *
5
5
 *   This library is free software; you can redistribute it and/or          *
24
24
 
25
25
//Qt
26
26
class QTimer;
 
27
class QMutex;
27
28
 
28
29
//SFLPhone
29
30
#include "videodevice.h"
31
32
 
32
33
///Manage shared memory and convert it to QByteArray
33
34
class LIB_EXPORT VideoRenderer : public QObject {
 
35
   #pragma GCC diagnostic push
 
36
   #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
34
37
   Q_OBJECT
 
38
   #pragma GCC diagnostic pop
35
39
 
36
40
   public:
37
41
      //Constructor
38
 
      VideoRenderer (QString shmPath,Resolution res);
 
42
      VideoRenderer (const QString& id, const QString& shmPath, const Resolution res);
39
43
      ~VideoRenderer();
40
44
 
41
45
      //Mutators
44
48
      bool startShm ();
45
49
 
46
50
      //Getters
47
 
      QByteArray  renderToBitmap(QByteArray& data, bool& ok);
48
 
      const char* rawData            ();
49
 
      bool        isRendering        ();
50
 
      QByteArray  getCurrentFrame    ();
51
 
      Resolution  getActiveResolution();
 
51
      const char* rawData         ();
 
52
      bool        isRendering     ();
 
53
      QByteArray  currentFrame    ();
 
54
      Resolution  activeResolution();
 
55
      QMutex*     mutex           ();
52
56
 
53
57
      //Setters
54
58
      void setResolution(QSize   size);
67
71
      QTimer*    m_pTimer     ;
68
72
      QByteArray m_Frame      ;
69
73
      Resolution m_Res        ;
 
74
      QMutex*    m_pMutex     ;
 
75
      QString    m_Id         ;
70
76
 
71
77
      //Constants
72
78
      static const int TIMEOUT_SEC = 1; // 1 second
75
81
      timespec createTimeout();
76
82
      bool     shmLock      ();
77
83
      void     shmUnlock    ();
 
84
      bool     renderToBitmap(QByteArray& data);
78
85
 
79
86
   private Q_SLOTS:
80
87
      void timedEvents();
86
93
   Q_SIGNALS:
87
94
      ///Emitted when a new frame is ready
88
95
      void frameUpdated();
 
96
      void stopped();
 
97
      void started();
89
98
 
90
99
};
91
100