Media Foundation grabber adapted to V4L2 change

This commit is contained in:
Paulchen Panther 2021-02-05 22:17:54 +01:00
parent c5065e76b5
commit a4b307e43c
2 changed files with 5 additions and 8 deletions

View File

@ -63,7 +63,7 @@ public:
QString getDeviceName(const QString& devicePath) const override { return devicePath; }
QMultiMap<QString, int> 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<int, int> 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;

View File

@ -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<int, int> MFGrabber::getAvailableDeviceResolutions(const QString& devicePath, const int& /*device input not used on windows*/, const PixelFormat& encFormat) const
{
QStringList result = QStringList();
QMultiMap<int, int> result = QMultiMap<int, int>();
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;
}