4#ifndef QCACHEDVALUE_P_H
5#define QCACHEDVALUE_P_H
18#include <QReadWriteLock>
21#include <unordered_map>
29 QCachedValue() =
default;
31 Q_DISABLE_COPY(QCachedValue)
33 template <
typename Creator>
34 T ensure(Creator &&creator)
37 QReadLocker locker(&m_lock);
43 QWriteLocker locker(&m_lock);
52 QWriteLocker locker(&m_lock);
53 if (value == m_cached)
55 auto temp = std::exchange(m_cached, std::move(value));
62 QWriteLocker locker(&m_lock);
63 auto temp = std::exchange(m_cached, std::nullopt);
68 QReadWriteLock m_lock;
69 std::optional<T> m_cached;
72template <
typename Key,
typename Value>
99 std::unordered_map<Key, Value> m_map;
QCachedValueMap()=default
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
static QVideoFramePrivate * handle(QVideoFrame &frame)
static bool updateTextures(QRhi *rhi, std::unique_ptr< QRhiBuffer > &uniformBuffer, std::unique_ptr< QRhiSampler > &textureSampler, std::unique_ptr< QRhiShaderResourceBindings > &shaderResourceBindings, std::unique_ptr< QRhiGraphicsPipeline > &graphicsPipeline, std::unique_ptr< QRhiRenderPassDescriptor > &renderPass, QVideoFrame &frame, const QVideoFrameTexturesUPtr &videoFrameTextures)
static QImage convertJPEG(const QVideoFrame &frame, const VideoTransformation &transform)
QImage qImageFromVideoFrame(const QVideoFrame &frame, const VideoTransformation &transformation, bool forceCpu)
QImage qImageFromVideoFrame(const QVideoFrame &frame, bool forceCpu)
static QShader ensureShader(const QString &name)
static bool pixelFormatHasAlpha(QVideoFrameFormat::PixelFormat format)
static QImage convertCPU(const QVideoFrame &frame, const VideoTransformation &transform)
static void rasterTransform(QImage &image, VideoTransformation transformation)
QImage videoFramePlaneAsImage(QVideoFrame &frame, int plane, QImage::Format targetFormat, QSize targetSize)
Maps the video frame and returns an image having a shared ownership for the video frame and referenci...
static void imageCleanupHandler(void *info)