Fix QCamera viewfinder capabilities functions..

- Filtering the results for a specific pixel aspect ratio would return
  wrong values.
- Correctly sort the frame rate ranges returned by
  supportedViewfinderFrameRateRanges().

Added missing auto-tests for all viewfinder capabilities functions.

Change-Id: Idfb40d4139cc48a5996ce2ddd98131a2f5be76bb
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
This commit is contained in:
Yoann Lopes
2015-08-13 16:52:57 +02:00
parent e0b9217d27
commit 13e40d522f
5 changed files with 462 additions and 6 deletions

View File

@@ -43,6 +43,48 @@ public:
MockCameraViewfinderSettingsControl(QObject *parent = 0):
QCameraViewfinderSettingsControl2(parent)
{
QCameraViewfinderSettings s;
s.setResolution(640, 480);
s.setMinimumFrameRate(30);
s.setMaximumFrameRate(30);
s.setPixelFormat(QVideoFrame::Format_NV12);
s.setPixelAspectRatio(1, 1);
supportedSettings.append(s);
s.setResolution(1280, 720);
s.setMinimumFrameRate(10);
s.setMaximumFrameRate(10);
s.setPixelFormat(QVideoFrame::Format_NV12);
s.setPixelAspectRatio(1, 1);
supportedSettings.append(s);
s.setResolution(1920, 1080);
s.setMinimumFrameRate(5);
s.setMaximumFrameRate(10);
s.setPixelFormat(QVideoFrame::Format_BGR32);
s.setPixelAspectRatio(2, 1);
supportedSettings.append(s);
s.setResolution(1280, 720);
s.setMinimumFrameRate(10);
s.setMaximumFrameRate(10);
s.setPixelFormat(QVideoFrame::Format_YV12);
s.setPixelAspectRatio(1, 1);
supportedSettings.append(s);
s.setResolution(1280, 720);
s.setMinimumFrameRate(30);
s.setMaximumFrameRate(30);
s.setPixelFormat(QVideoFrame::Format_YV12);
s.setPixelAspectRatio(1, 1);
supportedSettings.append(s);
s.setResolution(320, 240);
s.setMinimumFrameRate(30);
s.setMaximumFrameRate(30);
s.setPixelFormat(QVideoFrame::Format_NV12);
s.setPixelAspectRatio(1, 1);
supportedSettings.append(s);
}
~MockCameraViewfinderSettingsControl() {}
@@ -59,10 +101,11 @@ public:
QList<QCameraViewfinderSettings> supportedViewfinderSettings() const
{
return QList<QCameraViewfinderSettings>();
return supportedSettings;
}
QCameraViewfinderSettings settings;
QList<QCameraViewfinderSettings> supportedSettings;
};
#endif // MOCKCAMERAVIEWFINDERSETTINGSCONTROL_H