From a4b307e43cec15f301698c7ed6cc7b125dbcb6e7 Mon Sep 17 00:00:00 2001 From: Paulchen Panther Date: Fri, 5 Feb 2021 22:17:54 +0100 Subject: [PATCH] Media Foundation grabber adapted to V4L2 change --- include/grabber/MFGrabber.h | 2 +- libsrc/grabber/mediafoundation/MFGrabber.cpp | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/grabber/MFGrabber.h b/include/grabber/MFGrabber.h index 7ad2094b..68cc7823 100644 --- a/include/grabber/MFGrabber.h +++ b/include/grabber/MFGrabber.h @@ -63,7 +63,7 @@ public: QString getDeviceName(const QString& devicePath) const override { return devicePath; } QMultiMap getDeviceInputs(const QString& devicePath) const override { return {{ devicePath, 0}}; } QStringList getAvailableEncodingFormats(const QString& devicePath, const int& /*deviceInput*/) const override; - QStringList getAvailableDeviceResolutions(const QString& devicePath, const int& /*deviceInput*/, const PixelFormat& encFormat) const override; + QMultiMap getAvailableDeviceResolutions(const QString& devicePath, const int& /*deviceInput*/, const PixelFormat& encFormat) const override; QStringList getAvailableDeviceFramerates(const QString& devicePath, const int& /*deviceInput*/, const PixelFormat& encFormat, const unsigned width, const unsigned height) const override; void setSignalThreshold(double redSignalThreshold, double greenSignalThreshold, double blueSignalThreshold, int noSignalCounterThreshold) override; void setSignalDetectionOffset( double verticalMin, double horizontalMin, double verticalMax, double horizontalMax) override; diff --git a/libsrc/grabber/mediafoundation/MFGrabber.cpp b/libsrc/grabber/mediafoundation/MFGrabber.cpp index 8f7afafc..11037b79 100644 --- a/libsrc/grabber/mediafoundation/MFGrabber.cpp +++ b/libsrc/grabber/mediafoundation/MFGrabber.cpp @@ -707,16 +707,13 @@ QStringList MFGrabber::getAvailableEncodingFormats(const QString& devicePath, co return result; } -QStringList MFGrabber::getAvailableDeviceResolutions(const QString& devicePath, const int& /*device input not used on windows*/, const PixelFormat& encFormat) const +QMultiMap MFGrabber::getAvailableDeviceResolutions(const QString& devicePath, const int& /*device input not used on windows*/, const PixelFormat& encFormat) const { - QStringList result = QStringList(); + QMultiMap result = QMultiMap(); for(int i = 0; i < _deviceProperties[devicePath].count(); ++i ) - { - QString displayResolutions = QString::number(_deviceProperties[devicePath][i].width) +"x"+ QString::number(_deviceProperties[devicePath][i].height); - if(!result.contains(displayResolutions, Qt::CaseInsensitive) && _deviceProperties[devicePath][i].pf == encFormat) - result << displayResolutions; - } + if(!result.contains(_deviceProperties[devicePath][i].width, _deviceProperties[devicePath][i].height) && _deviceProperties[devicePath][i].pf == encFormat) + result.insert(_deviceProperties[devicePath][i].width, _deviceProperties[devicePath][i].height); return result; }