From a5ec34042a3f0554731d2c8a5d0b20f64bd6d1c6 Mon Sep 17 00:00:00 2001 From: Awawa Date: Wed, 10 Aug 2022 01:10:57 +0200 Subject: [PATCH] Fix a segfault crash related to JSON-API grabber control (fixes #318) --- include/base/GrabberWrapper.h | 3 ++- sources/base/GrabberWrapper.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/base/GrabberWrapper.h b/include/base/GrabberWrapper.h index 7f2631ae7..a76be295f 100644 --- a/include/base/GrabberWrapper.h +++ b/include/base/GrabberWrapper.h @@ -80,6 +80,7 @@ private slots: void StateChanged(QString device, QString videoMode); void cecKeyPressed(int key); void benchmarkUpdate(int status, QString message); + void setBrightnessContrastSaturationHue(int brightness, int contrast, int saturation, int hue); public: int getHdrToneMappingEnabled(); @@ -93,7 +94,7 @@ public slots: void setFpsSoftwareDecimation(int decimation); void setHdrToneMappingEnabled(int mode); void setEncoding(QString enc); - void setBrightnessContrastSaturationHue(int brightness, int contrast, int saturation, int hue); + void setBrightnessContrastSaturationHueHandler(int brightness, int contrast, int saturation, int hue); void setQFrameDecimation(int setQframe); void handleSettingsUpdate(settings::type type, const QJsonDocument& config); diff --git a/sources/base/GrabberWrapper.cpp b/sources/base/GrabberWrapper.cpp index 36c330e79..eeacd67f8 100644 --- a/sources/base/GrabberWrapper.cpp +++ b/sources/base/GrabberWrapper.cpp @@ -61,7 +61,9 @@ GrabberWrapper::GrabberWrapper(const QString& grabberName, Grabber* ggrabber) // listen for source requests connect(GlobalSignals::getInstance(), &GlobalSignals::requestSource, this, &GrabberWrapper::handleSourceRequest); - connect(this, &GrabberWrapper::cecKeyPressed, this, &GrabberWrapper::cecKeyPressedHandler); + connect(this, &GrabberWrapper::cecKeyPressed, this, &GrabberWrapper::cecKeyPressedHandler); + + connect(this, &GrabberWrapper::setBrightnessContrastSaturationHue, this, &GrabberWrapper::setBrightnessContrastSaturationHueHandler); } @@ -347,7 +349,7 @@ void GrabberWrapper::setEncoding(QString enc) _grabber->setEncoding(enc); } -void GrabberWrapper::setBrightnessContrastSaturationHue(int brightness, int contrast, int saturation, int hue) +void GrabberWrapper::setBrightnessContrastSaturationHueHandler(int brightness, int contrast, int saturation, int hue) { if (_grabber != nullptr) _grabber->setBrightnessContrastSaturationHue(brightness, contrast, saturation, hue);