~ubuntu-branches/ubuntu/trusty/sflphone/trusty

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (4.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20140128182336-jrsv0k9u6cawc068
Tags: 1.3.0-1
* 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            *
19
19
#define VIDEO_MODEL_H
20
20
//Base
21
21
#include "typedefs.h"
22
 
#include <QtCore/QObject>
 
22
#include <QtCore/QThread>
23
23
 
24
24
//Qt
25
25
#include <QtCore/QHash>
31
31
struct SHMHeader;
32
32
 
33
33
///VideoModel: Video event dispatcher
34
 
class LIB_EXPORT VideoModel : public QObject {
 
34
class LIB_EXPORT VideoModel : public QThread {
 
35
   #pragma GCC diagnostic push
 
36
   #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
35
37
   Q_OBJECT
 
38
   #pragma GCC diagnostic pop
36
39
public:
37
40
   //Singleton
38
 
   static VideoModel* getInstance();
 
41
   static VideoModel* instance();
39
42
 
40
43
   //Getters
41
44
   bool       isPreviewing       ();
42
 
   VideoRenderer* getRenderer(Call* call);
43
 
   VideoRenderer* getPreviewRenderer();
44
 
   
 
45
   VideoRenderer* getRenderer(const Call* call) const;
 
46
   VideoRenderer* previewRenderer();
 
47
 
45
48
   //Setters
46
49
   void       setBufferSize(uint size);
47
50
 
 
51
protected:
 
52
   void run();
 
53
 
48
54
private:
49
55
   //Constructor
50
56
   VideoModel();
51
57
 
52
58
   //Static attributes
53
59
   static VideoModel* m_spInstance;
54
 
   
 
60
 
55
61
   //Attributes
56
 
   bool           m_Attached    ;
57
62
   bool           m_PreviewState;
58
63
   uint           m_BufferSize  ;
59
64
   uint           m_ShmKey      ;
60
65
   uint           m_SemKey      ;
61
 
   int            m_SetSetId    ;
62
 
   void*          m_pBuffer     ;
63
66
   QHash<QString,VideoRenderer*> m_lRenderers;
64
67
 
65
68
public Q_SLOTS:
67
70
   void startPreview();
68
71
 
69
72
private Q_SLOTS:
70
 
   void startedDecoding(QString id, QString shmPath, int width, int height);
71
 
   void stoppedDecoding(QString id, QString shmPath);
 
73
   void startedDecoding(const QString& id, const QString& shmPath, int width, int height);
 
74
   void stoppedDecoding(const QString& id, const QString& shmPath);
72
75
   void deviceEvent();
73
76
 
74
77
Q_SIGNALS: