summaryrefslogtreecommitdiffstats
path: root/src/multimedia/platform
diff options
context:
space:
mode:
authorJøger Hansegård <joger.hansegard@qt.io>2024-05-02 14:50:20 +0200
committerJøger Hansegård <joger.hansegard@qt.io>2024-05-10 13:47:59 +0200
commit6eacc4847923d77d019d9dff7ba1fa88b1980edb (patch)
treebeb441f2aefc10abba006d5c33c8b87aa3890b86 /src/multimedia/platform
parent00140209034cb9dac000d7a11c09f60408153c7e (diff)
Simplify color management tests by using FFmpeg color conversion
This patch replaces custom conversion RGB to YUV conversion code used only for tests with FFmpeg libswscale code. This makes it easier to extend the tests with more pixel formats, and allow us to generate realistic output images with correct color space and transfer. The idea of this is that all reference images should now be equal, apart from quantization errors from full vs limited range signals. In truth, they are not exactly the same, and some color discrepancy remains. Comments are added to the tests to address this. Note that the maximum pixel diff threshold had to be adjusted because of numerical inaccuracies on some platforms. Also, the reference image has been reduced in size to reduce amount of space required for the reference images. In addition, the image is now even width and height because odd width/height images are not supported with chroma subsampling. Task-number: QTBUG-124537 Task-number: QTBUG-124534 Task-number: QTBUG-123749 Pick-to: 6.7 6.5 Change-Id: I0a36255de4acd75e61df0bb934d65ccff0ead063 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Diffstat (limited to 'src/multimedia/platform')
-rw-r--r--src/multimedia/platform/qplatformmediaintegration.cpp6
-rw-r--r--src/multimedia/platform/qplatformmediaintegration_p.h4
2 files changed, 10 insertions, 0 deletions
diff --git a/src/multimedia/platform/qplatformmediaintegration.cpp b/src/multimedia/platform/qplatformmediaintegration.cpp
index dda00de61..4bacc488f 100644
--- a/src/multimedia/platform/qplatformmediaintegration.cpp
+++ b/src/multimedia/platform/qplatformmediaintegration.cpp
@@ -207,6 +207,12 @@ QLatin1String QPlatformMediaIntegration::name()
return m_backendName;
}
+QVideoFrame QPlatformMediaIntegration::convertVideoFrame(QVideoFrame &,
+ const QVideoFrameFormat &)
+{
+ return {};
+}
+
QPlatformMediaIntegration::QPlatformMediaIntegration(QLatin1String name) : m_backendName(name) { }
QPlatformMediaIntegration::~QPlatformMediaIntegration() = default;
diff --git a/src/multimedia/platform/qplatformmediaintegration_p.h b/src/multimedia/platform/qplatformmediaintegration_p.h
index 19fa40baf..b949af02a 100644
--- a/src/multimedia/platform/qplatformmediaintegration_p.h
+++ b/src/multimedia/platform/qplatformmediaintegration_p.h
@@ -53,6 +53,7 @@ class QPlatformAudioOutput;
class QPlatformVideoDevices;
class QCapturableWindow;
class QPlatformCapturableWindows;
+class QVideoFrame;
class Q_MULTIMEDIA_EXPORT QPlatformMediaIntegration : public QObject
{
@@ -96,6 +97,9 @@ public:
static QStringList availableBackends();
QLatin1String name(); // for unit tests
+ // Convert a QVideoFrame to the destination format
+ virtual QVideoFrame convertVideoFrame(QVideoFrame &, const QVideoFrameFormat &);
+
protected:
virtual QPlatformMediaFormatInfo *createFormatInfo();