mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
f22def5a19
commit
db7ee65d0e
|
@ -1984,13 +1984,13 @@ void Settings::setCamVideoRes(QRect newValue)
|
|||
}
|
||||
}
|
||||
|
||||
unsigned short Settings::getCamVideoFPS() const
|
||||
float Settings::getCamVideoFPS() const
|
||||
{
|
||||
QMutexLocker locker{&bigLock};
|
||||
return camVideoFPS;
|
||||
}
|
||||
|
||||
void Settings::setCamVideoFPS(unsigned short newValue)
|
||||
void Settings::setCamVideoFPS(float newValue)
|
||||
{
|
||||
QMutexLocker locker{&bigLock};
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ class Settings : public QObject, public ICoreSettings, public IAudioSettings, pu
|
|||
Q_PROPERTY(QRect camVideoRes READ getCamVideoRes WRITE setCamVideoRes NOTIFY camVideoResChanged FINAL)
|
||||
Q_PROPERTY(QRect screenRegion READ getScreenRegion WRITE setScreenRegion NOTIFY screenRegionChanged FINAL)
|
||||
Q_PROPERTY(bool screenGrabbed READ getScreenGrabbed WRITE setScreenGrabbed NOTIFY screenGrabbedChanged FINAL)
|
||||
Q_PROPERTY(quint16 camVideoFPS READ getCamVideoFPS WRITE setCamVideoFPS NOTIFY camVideoFPSChanged FINAL)
|
||||
Q_PROPERTY(float camVideoFPS READ getCamVideoFPS WRITE setCamVideoFPS NOTIFY camVideoFPSChanged FINAL)
|
||||
|
||||
public:
|
||||
enum class StyleType
|
||||
|
@ -394,8 +394,8 @@ public:
|
|||
QRect getCamVideoRes() const override;
|
||||
void setCamVideoRes(QRect newValue) override;
|
||||
|
||||
unsigned short getCamVideoFPS() const override;
|
||||
void setCamVideoFPS(unsigned short newValue) override;
|
||||
float getCamVideoFPS() const override;
|
||||
void setCamVideoFPS(float newValue) override;
|
||||
|
||||
SIGNAL_IMPL(Settings, videoDevChanged, const QString& device)
|
||||
SIGNAL_IMPL(Settings, screenRegionChanged, const QRect& region)
|
||||
|
@ -658,7 +658,7 @@ private:
|
|||
QRect camVideoRes;
|
||||
QRect screenRegion;
|
||||
bool screenGrabbed;
|
||||
unsigned short camVideoFPS;
|
||||
float camVideoFPS;
|
||||
|
||||
struct friendProp
|
||||
{
|
||||
|
|
|
@ -153,9 +153,11 @@ CameraDevice* CameraDevice::open(QString devName, VideoMode mode)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
int FPS = 5;
|
||||
if (mode.FPS) {
|
||||
float FPS = 5;
|
||||
if (mode.FPS > 0.0f) {
|
||||
FPS = mode.FPS;
|
||||
} else {
|
||||
qWarning() << "VideoMode could be invalid!";
|
||||
}
|
||||
|
||||
const std::string videoSize = QStringLiteral("%1x%2").arg(mode.width).arg(mode.height).toStdString();
|
||||
|
|
|
@ -20,8 +20,8 @@ public:
|
|||
virtual QRect getCamVideoRes() const = 0;
|
||||
virtual void setCamVideoRes(QRect newValue) = 0;
|
||||
|
||||
virtual unsigned short getCamVideoFPS() const = 0;
|
||||
virtual void setCamVideoFPS(unsigned short newValue) = 0;
|
||||
virtual float getCamVideoFPS() const = 0;
|
||||
virtual void setCamVideoFPS(float newValue) = 0;
|
||||
|
||||
DECLARE_SIGNAL(videoDevChanged, const QString& device);
|
||||
DECLARE_SIGNAL(screenRegionChanged, const QRect& region);
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* @brief Frames per second supported by the device at this resolution
|
||||
*/
|
||||
|
||||
VideoMode::VideoMode(int width, int height, int x, int y, int FPS, int format)
|
||||
VideoMode::VideoMode(int width, int height, int x, int y, float FPS, int format)
|
||||
: width(width)
|
||||
, height(height)
|
||||
, x(x)
|
||||
|
|
|
@ -30,7 +30,7 @@ struct VideoMode
|
|||
float FPS;
|
||||
uint32_t pixel_format;
|
||||
|
||||
VideoMode(int width = 0, int height = 0, int x = 0, int y = 0, int FPS = 0, int format = 0);
|
||||
VideoMode(int width = 0, int height = 0, int x = 0, int y = 0, float FPS = 0.0f, int format = 0);
|
||||
|
||||
explicit VideoMode(QRect rect);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user