diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-04-21 11:42:33 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-04-28 07:11:25 +0000 |
commit | 0a6a1883b6dde64b195a564a0c02a949d7718b25 (patch) | |
tree | 52179cd2a8bd526dd006faef3a6d9324efb69e42 /src/multimedia/video/qvideotexturehelper_p.h | |
parent | 02cb4fc0b53cc934c920c156bd10d17a91148034 (diff) |
Fix tst_qvideoframe test failures
Change-Id: I25bceb948518ba49053ae87484bdd8375b616b20
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimedia/video/qvideotexturehelper_p.h')
-rw-r--r-- | src/multimedia/video/qvideotexturehelper_p.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/multimedia/video/qvideotexturehelper_p.h b/src/multimedia/video/qvideotexturehelper_p.h index e0b72243a..a984101e5 100644 --- a/src/multimedia/video/qvideotexturehelper_p.h +++ b/src/multimedia/video/qvideotexturehelper_p.h @@ -57,11 +57,14 @@ struct TextureDescription int x; int y; }; - using BytesForSize = int(*)(QSize s); + using BytesRequired = int(*)(int stride, int height); + + inline int strideForWidth(int width) const { return (width*strideFactor + 15) & ~15; } + inline int bytesForSize(QSize s) const { return bytesRequired(strideForWidth(s.width()), s.height()); } int nplanes; - int stride; - BytesForSize bytesForSize; + int strideFactor; + BytesRequired bytesRequired; QRhiTexture::Format textureFormat[maxPlanes]; SizeScale sizeScale[maxPlanes]; }; |