Updates on Grabber fps setting

This commit is contained in:
LordGrey 2023-02-13 18:13:17 +01:00
parent 1063eadec5
commit 79e9e0cf67
4 changed files with 15 additions and 8 deletions

View File

@ -147,10 +147,7 @@ private slots:
void handleSourceRequest(hyperion::Components component, int hyperionInd, bool listen);
///
/// @brief Update Update capture rate
/// @param type interval between frames in milliseconds
///
void updateTimer(int interval);
protected:
@ -168,6 +165,11 @@ protected:
///
virtual bool close() { return true; }
/// @brief Update Update capture rate
/// @param type interval between frames in milliseconds
///
void updateTimer(int interval);
QString _grabberName;

View File

@ -74,9 +74,6 @@ void VideoWrapper::handleSettingsUpdate(settings::type type, const QJsonDocument
// Device resolution
_grabber.setWidthHeight(obj["width"].toInt(0), obj["height"].toInt(0));
// Device framerate
_grabber.setFramerate(obj["fps"].toInt(15));
// Device encoding format
_grabber.setEncoding(obj["encoding"].toString("NO_CHANGE"));
@ -124,6 +121,11 @@ void VideoWrapper::handleSettingsUpdate(settings::type type, const QJsonDocument
obj["blueSignalThreshold"].toDouble(0.0)/100.0,
obj["noSignalCounterThreshold"].toInt(50));
// Device framerate
_grabber.setFramerate(obj["fps"].toInt(15));
updateTimer(_ggrabber->getUpdateInterval());
// Reload the Grabber if any settings have been changed that require it
_grabber.reload(getV4lGrabberState());
}

View File

@ -149,6 +149,8 @@ bool Grabber::setWidthHeight(int width, int height)
bool Grabber::setFramerate(int fps)
{
Debug(_log,"Set new frames per second to: %i fps, current fps: %i", fps, _fps);
if((fps > 0) && (_fps != fps))
{
Info(_log,"Set new frames per second to: %i fps", fps);

View File

@ -186,7 +186,8 @@ void GrabberWrapper::updateTimer(int interval)
}
void GrabberWrapper::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ if(type == settings::SYSTEMCAPTURE && !_grabberName.startsWith("V4L"))
{
if(type == settings::SYSTEMCAPTURE && !_grabberName.startsWith("V4L"))
{
// extract settings
const QJsonObject& obj = config.object();