Skip to content
Snippets Groups Projects
Commit 433318cc authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

[ #44118 ] Fix rotate left/right buttons

parent 39f2e1b1
No related branches found
No related tags found
No related merge requests found
...@@ -608,6 +608,17 @@ AbstractHistoryBackend* Call::backend() const ...@@ -608,6 +608,17 @@ AbstractHistoryBackend* Call::backend() const
} }
///Does this call currently has video
bool Call::hasVideo() const
{
#ifdef ENABLE_VIDEO
return VideoModel::instance()->getRenderer(this) != nullptr;
#else
return false;
#endif
}
///Get the current state ///Get the current state
Call::State Call::state() const Call::State Call::state() const
{ {
......
...@@ -279,6 +279,7 @@ public: ...@@ -279,6 +279,7 @@ public:
Q_PROPERTY( QString toHumanStateName READ toHumanStateName ) Q_PROPERTY( QString toHumanStateName READ toHumanStateName )
Q_PROPERTY( bool missed READ isMissed ) Q_PROPERTY( bool missed READ isMissed )
Q_PROPERTY( Direction direction READ direction ) Q_PROPERTY( Direction direction READ direction )
Q_PROPERTY( bool hasVideo READ hasVideo )
Q_PROPERTY( Call::LegacyHistoryState historyState READ historyState ) Q_PROPERTY( Call::LegacyHistoryState historyState READ historyState )
//Read/write properties //Read/write properties
...@@ -329,6 +330,7 @@ public: ...@@ -329,6 +330,7 @@ public:
bool isMissed () const; bool isMissed () const;
Call::Direction direction () const; Call::Direction direction () const;
AbstractHistoryBackend* backend () const; AbstractHistoryBackend* backend () const;
bool hasVideo () const;
//Automated function //Automated function
Call::State stateChanged(const QString & newState); Call::State stateChanged(const QString & newState);
......
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
#include <sys/mman.h> #include <sys/mman.h>
#include <semaphore.h> #include <semaphore.h>
#include <errno.h> #include <errno.h>
// #include <linux/time.h>
#include <time.h>
#ifndef CLOCK_REALTIME #ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0 #define CLOCK_REALTIME 0
...@@ -265,6 +264,15 @@ void VideoRenderer::timedEvents() ...@@ -265,6 +264,15 @@ void VideoRenderer::timedEvents()
bool ok = renderToBitmap(); bool ok = renderToBitmap();
if (ok == true) { if (ok == true) {
//Compute the FPS shown to the client
if (m_CurrentTime.second() != QTime::currentTime().second()) {
m_Fps = m_fpsC;
m_fpsC=0;
m_CurrentTime = QTime::currentTime();
}
m_fpsC++;
emit frameUpdated(); emit frameUpdated();
} }
else { else {
...@@ -349,6 +357,12 @@ QMutex* VideoRenderer::mutex() ...@@ -349,6 +357,12 @@ QMutex* VideoRenderer::mutex()
return m_pMutex; return m_pMutex;
} }
///Get the current frame rate of this renderer
int VideoRenderer::fps() const
{
return m_Fps;
}
/***************************************************************************** /*****************************************************************************
* * * *
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
//Base //Base
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QTime>
#include "typedefs.h" #include "typedefs.h"
#include <time.h> #include <time.h>
...@@ -54,6 +55,7 @@ class LIB_EXPORT VideoRenderer : public QObject { ...@@ -54,6 +55,7 @@ class LIB_EXPORT VideoRenderer : public QObject {
QByteArray currentFrame () ; QByteArray currentFrame () ;
Resolution activeResolution() ; Resolution activeResolution() ;
QMutex* mutex () ; QMutex* mutex () ;
int fps () const;
//Setters //Setters
void setResolution(QSize size); void setResolution(QSize size);
...@@ -76,6 +78,9 @@ class LIB_EXPORT VideoRenderer : public QObject { ...@@ -76,6 +78,9 @@ class LIB_EXPORT VideoRenderer : public QObject {
QMutex* m_pMutex ; QMutex* m_pMutex ;
QMutex* m_pSSMutex ; QMutex* m_pSSMutex ;
QString m_Id ; QString m_Id ;
int m_fpsC ;
int m_Fps ;
QTime m_CurrentTime;
//Constants //Constants
static const int TIMEOUT_SEC = 1; // 1 second static const int TIMEOUT_SEC = 1; // 1 second
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment