Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qvideotexturehelper.cpp File Reference

(ab289ee959e171d352472671f2efa8d7f71623b4)

#include "qabstractvideobuffer.h"
#include "qvideotexturehelper_p.h"
#include "qvideoframeconverter_p.h"
#include "qvideoframe_p.h"
#include "qvideoframetexturefromsource_p.h"
#include "private/qmultimediautils_p.h"
#include <QtCore/qfile.h>
#include <qpainter.h>
#include <qloggingcategory.h>
Include dependency graph for qvideotexturehelper.cpp:

Go to the source code of this file.

Namespaces

namespace  QVideoTextureHelper

Enumerations

enum class  QVideoTextureHelper::UpdateTextureWithMapResult : uint8_t {
  QVideoTextureHelper::Failed , QVideoTextureHelper::UpdatedWithDataCopy , QVideoTextureHelper::UpdatedWithDataReference , QVideoTextureHelper::Failed ,
  QVideoTextureHelper::UpdatedWithDataCopy , QVideoTextureHelper::UpdatedWithDataReference
}
enum class  QVideoTextureHelper::UpdateTextureWithMapResult : uint8_t {
  QVideoTextureHelper::Failed , QVideoTextureHelper::UpdatedWithDataCopy , QVideoTextureHelper::UpdatedWithDataReference , QVideoTextureHelper::Failed ,
  QVideoTextureHelper::UpdatedWithDataCopy , QVideoTextureHelper::UpdatedWithDataReference
}

Functions

Q_MULTIMEDIA_EXPORT bool QVideoTextureHelper::forceGlTextureExternalOesIsSet ()
static bool QVideoTextureHelper::isRhiTextureFormatSupported (const QRhi *rhi, QRhiTexture::Format format)
Q_MULTIMEDIA_EXPORT QRhiTexture::Format QVideoTextureHelper::resolvedRhiTextureFormat (QRhiTexture::Format format, QRhi *rhi)
 Returns a QRhiTexture::Format taking into account rhi capabilities and explicitly excluded formats using a chain of pre-defined fallback texture formats. If no valid fallback is determined, will return the format argument.
Q_MULTIMEDIA_EXPORT void QVideoTextureHelper::setExcludedRhiTextureFormats (QList< QRhiTexture::Format > formats)
Q_MULTIMEDIA_EXPORT const TextureDescriptionQVideoTextureHelper::textureDescription (QVideoFrameFormat::PixelFormat format)
Q_MULTIMEDIA_EXPORT QString QVideoTextureHelper::vertexShaderFileName (const QVideoFrameFormat &format)
Q_MULTIMEDIA_EXPORT QString QVideoTextureHelper::fragmentShaderFileName (const QVideoFrameFormat &format, QRhi *rhi, QRhiSwapChain::Format surfaceFormat=QRhiSwapChain::SDR)
static QMatrix4x4 QVideoTextureHelper::colorMatrix (const QVideoFrameFormat &format)
static float QVideoTextureHelper::convertPQFromLinear (float sig)
float QVideoTextureHelper::convertHLGFromLinear (float sig)
static float QVideoTextureHelper::convertSDRFromLinear (float sig)
Q_MULTIMEDIA_EXPORT void QVideoTextureHelper::updateUniformData (QByteArray *dst, QRhi *rhi, const QVideoFrameFormat &format, const QVideoFrame &frame, const QMatrix4x4 &transform, float opacity, float maxNits=100)
static UpdateTextureWithMapResult QVideoTextureHelper::updateTextureWithMap (const QVideoFrame &frame, QRhi &rhi, QRhiResourceUpdateBatch &rub, int plane, std::unique_ptr< QRhiTexture > &tex)
static std::unique_ptr< QRhiTextureQVideoTextureHelper::createTextureFromHandle (QVideoFrameTexturesHandles &texturesSet, QRhi &rhi, QVideoFrameFormat::PixelFormat pixelFormat, QSize size, int plane)
template<typename TexturesType, typename... Args>
static QVideoFrameTexturesUPtr QVideoTextureHelper::createTexturesArray (QRhi &rhi, QVideoFrameTexturesHandles &texturesSet, QVideoFrameFormat::PixelFormat pixelFormat, QSize size, Args &&...args)
Q_MULTIMEDIA_EXPORT QVideoFrameTexturesUPtr QVideoTextureHelper::createTexturesFromHandles (QVideoFrameTexturesHandlesUPtr handles, QRhi &rhi, QVideoFrameFormat::PixelFormat pixelFormat, QSize size)
 Creates plane textures from texture handles set by the specified rhi. The result owns the specified handles set; the QRhiTexture(s), exposed by the result refer to the owned handles set. If the specified size is empty or pixelFormat is invalid, null is returned.
static QVideoFrameTexturesUPtr QVideoTextureHelper::createTexturesFromMemory (QVideoFrame frame, QRhi &rhi, QRhiResourceUpdateBatch &rub, QVideoFrameTexturesUPtr &oldTextures)
Q_MULTIMEDIA_EXPORT QVideoFrameTexturesUPtr QVideoTextureHelper::createTextures (const QVideoFrame &frame, QRhi &rhi, QRhiResourceUpdateBatch &rub, QVideoFrameTexturesUPtr &oldTextures)
 Creates plane textures from a video frame by the specified rhi. If possible, the function modifies 'oldTextures', which is the texture from the pool, and returns the specified one or a new one with any taken data.

Variables

static const TextureDescription QVideoTextureHelper::descriptions [QVideoFrameFormat::NPixelFormats]