3#include <private/qvideotexturehelper_p.h>
9bool canImportTexture(QRhi& rhi, QRhiTexture::Format fmt,
const QSize& size, QRhiTexture::Flags flags)
11 if (fmt == QRhiTexture::UnknownFormat) {
14 if (!rhi.isTextureFormatSupported(fmt, flags)) {
17 const int maxDim = rhi.resourceLimit(QRhi::TextureSizeMax);
18 if (maxDim > 0 && (size.width() > maxDim || size.height() > maxDim)) {
24bool canImportPlanes(QRhi& rhi, QVideoFrameFormat::PixelFormat pixelFormat,
const QSize& size, QRhiTexture::Flags flags)
26 const auto* desc = QVideoTextureHelper::textureDescription(pixelFormat);
31 using FallbackPolicy = QVideoTextureHelper::TextureDescription::FallbackPolicy;
32 for (
int plane = 0; plane < desc->nplanes; ++plane) {
33 const QRhiTexture::Format fmt = desc->rhiTextureFormat(plane, &rhi, FallbackPolicy::Disable);
34 const QSize planeSize = desc->rhiPlaneSize(size, plane, &rhi);
35 if (!canImportTexture(rhi, fmt, planeSize, flags)) {
47 QRhiTexture::Flags flags)
49 if (canImportPlanes(rhi, pixelFormat, size, flags)) {
HwVideoBufferPath
GPU zero-copy path a frame is imported through; None means the frame takes the CPU path.
bool preflightOrRecord(QRhi &rhi, HwVideoBufferPath path, QVideoFrameFormat::PixelFormat pixelFormat, const QSize &size, QRhiTexture::Flags flags)
void recordFallbackReason(HwVideoBufferPath attemptedPath, HwFallbackReason reason) noexcept
Per-(path,reason) fallback accounting; lets a bug report show why a path demoted to CPU.