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
Branches
No related tags found
No related merge requests found
......@@ -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
Call::State Call::state() const
{
......
......@@ -279,6 +279,7 @@ public:
Q_PROPERTY( QString toHumanStateName READ toHumanStateName )
Q_PROPERTY( bool missed READ isMissed )
Q_PROPERTY( Direction direction READ direction )
Q_PROPERTY( bool hasVideo READ hasVideo )
Q_PROPERTY( Call::LegacyHistoryState historyState READ historyState )
//Read/write properties
......@@ -329,6 +330,7 @@ public:
bool isMissed () const;
Call::Direction direction () const;
AbstractHistoryBackend* backend () const;
bool hasVideo () const;
//Automated function
Call::State stateChanged(const QString & newState);
......
......@@ -29,8 +29,7 @@
#include <sys/mman.h>
#include <semaphore.h>
#include <errno.h>
// #include <linux/time.h>
#include <time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
......@@ -265,6 +264,15 @@ void VideoRenderer::timedEvents()
bool ok = renderToBitmap();
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();
}
else {
......@@ -349,6 +357,12 @@ QMutex* VideoRenderer::mutex()
return m_pMutex;
}
///Get the current frame rate of this renderer
int VideoRenderer::fps() const
{
return m_Fps;
}
/*****************************************************************************
* *
......
......@@ -20,6 +20,7 @@
//Base
#include <QtCore/QObject>
#include <QtCore/QTime>
#include "typedefs.h"
#include <time.h>
......@@ -54,6 +55,7 @@ class LIB_EXPORT VideoRenderer : public QObject {
QByteArray currentFrame () ;
Resolution activeResolution() ;
QMutex* mutex () ;
int fps () const;
//Setters
void setResolution(QSize size);
......@@ -76,6 +78,9 @@ class LIB_EXPORT VideoRenderer : public QObject {
QMutex* m_pMutex ;
QMutex* m_pSSMutex ;
QString m_Id ;
int m_fpsC ;
int m_Fps ;
QTime m_CurrentTime;
//Constants
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