![]() |
Qt 6.x
The Qt SDK
|
#include "qvideoframeconverter_p.h"
#include "qvideoframeconversionhelper_p.h"
#include "qvideoframeformat.h"
#include <QtCore/qcoreapplication.h>
#include <QtCore/qsize.h>
#include <QtCore/qhash.h>
#include <QtCore/qfile.h>
#include <QtCore/qthreadstorage.h>
#include <QtGui/qimage.h>
#include <QtGui/qoffscreensurface.h>
#include <qpa/qplatformintegration.h>
#include <private/qvideotexturehelper_p.h>
#include <private/qabstractvideobuffer_p.h>
#include <private/qguiapplication_p.h>
#include <rhi/qrhi.h>
Go to the source code of this file.
Functions | |
static QT_BEGIN_NAMESPACE | Q_LOGGING_CATEGORY (qLcVideoFrameConverter, "qt.multimedia.video.frameconverter") namespace |
static bool | pixelFormatHasAlpha (QVideoFrameFormat::PixelFormat format) |
static QShader | vfcGetShader (const QString &name) |
static void | rasterTransform (QImage &image, QVideoFrame::RotationAngle rotation, bool mirrorX, bool mirrorY) |
static void | imageCleanupHandler (void *info) |
static QRhi * | initializeRHI (QRhi *videoFrameRhi) |
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 std::unique_ptr< QVideoFrameTextures > &videoFrameTextures) |
static QImage | convertJPEG (const QVideoFrame &frame, QVideoFrame::RotationAngle rotation, bool mirrorX, bool mirrorY) |
static QImage | convertCPU (const QVideoFrame &frame, QVideoFrame::RotationAngle rotation, bool mirrorX, bool mirrorY) |
QImage | qImageFromVideoFrame (const QVideoFrame &frame, QVideoFrame::RotationAngle rotation, bool mirrorX, bool mirrorY) |
Variables | |
static QThreadStorage< State > | g_state |
static QHash< QString, QShader > | g_shaderCache |
static const float | g_quad [] |
|
static |
Definition at line 246 of file qvideoframeconverter.cpp.
References convert(), QImage::Format_ARGB32_Premultiplied, QImage::Format_RGB32, frame, QVideoFrame::height(), QVideoFrame::map(), QVideoFrame::pixelFormat(), pixelFormatHasAlpha(), Q_FUNC_INFO, qCDebug, qConverterForFormat(), rasterTransform(), QVideoFrame::ReadOnly, QVideoFrame::unmap(), and QVideoFrame::width().
Referenced by qImageFromVideoFrame().
|
static |
Definition at line 232 of file qvideoframeconverter.cpp.
References QVideoFrame::bits(), frame, QVideoFrame::map(), QVideoFrame::mappedBytes(), Q_FUNC_INFO, qCDebug, rasterTransform(), QVideoFrame::ReadOnly, and QVideoFrame::unmap().
Referenced by qImageFromVideoFrame().
Definition at line 121 of file qvideoframeconverter.cpp.
Definition at line 127 of file qvideoframeconverter.cpp.
References Qt::AA_ForceRasterWidgets, QRhi::backend(), context, QRhi::create(), QRhi::D3D11, g_state, QRhi::Metal, QRhi::nativeHandles(), QRhi::Null, QPlatformIntegration::OpenGL, QRhi::OpenGLES2, QGuiApplicationPrivate::platformIntegration(), Q_FUNC_INFO, qWarning, QPlatformIntegration::RasterGLSurface, QPlatformIntegration::RhiBasedRendering, and QCoreApplication::testAttribute().
Referenced by qImageFromVideoFrame().
|
static |
Definition at line 74 of file qvideoframeconverter.cpp.
References QVideoFrameFormat::Format_ABGR8888, QVideoFrameFormat::Format_ARGB8888, QVideoFrameFormat::Format_ARGB8888_Premultiplied, QVideoFrameFormat::Format_AYUV, QVideoFrameFormat::Format_AYUV_Premultiplied, QVideoFrameFormat::Format_BGRA8888, QVideoFrameFormat::Format_BGRA8888_Premultiplied, and QVideoFrameFormat::Format_RGBA8888.
Referenced by convertCPU().
|
static |
Definition at line 27 of file qvideoframeconverter.cpp.
QImage qImageFromVideoFrame | ( | const QVideoFrame & | frame, |
QVideoFrame::RotationAngle | rotation, | ||
bool | mirrorX, | ||
bool | mirrorY | ||
) |
Definition at line 267 of file qvideoframeconverter.cpp.
References QRhiSampler::ClampToEdge, convertCPU(), convertJPEG(), QThread::currentThread(), QRhiBuffer::Dynamic, QVideoFrameFormat::Format_Invalid, QVideoFrameFormat::Format_Jpeg, frame, frameSize(), g_quad, g_state, QRhiBuffer::Immutable, initializeRHI(), QSize::isEmpty(), QRhi::isRecordingFrame(), QRhiSampler::Linear, QRhi::newBuffer(), QRhi::newSampler(), QRhi::newShaderResourceBindings(), QRhi::newTexture(), QRhi::newTextureRenderTarget(), QRhiSampler::None, qCDebug, QRhiTexture::RenderTarget, QRhiTexture::RGBA8, QWidget::size, QRhi::thread(), QSize::transpose(), QRhiBuffer::UniformBuffer, and QRhiBuffer::VertexBuffer.
Referenced by AndroidTextureVideoBuffer::map(), and QVideoFrame::toImage().
|
static |
Definition at line 107 of file qvideoframeconverter.cpp.
References QVideoFrame::Rotation0.
Referenced by convertCPU(), and convertJPEG().
|
static |
Definition at line 175 of file qvideoframeconverter.cpp.
References QRhiVertexInputAttribute::Float2, QRhiShaderStage::Fragment, QVideoTextureHelper::fragmentShaderFileName(), QRhiShaderResourceBinding::FragmentStage, frame, i, QShader::isValid(), QRhi::newGraphicsPipeline(), QRhiShaderResourceBinding::sampledTexture(), QRhiVertexInputLayout::setAttributes(), QRhiVertexInputLayout::setBindings(), QVideoTextureHelper::textureDescription(), QRhiGraphicsPipeline::TriangleStrip, QRhiShaderResourceBinding::uniformBuffer(), QRhiShaderStage::Vertex, QVideoTextureHelper::vertexShaderFileName(), QRhiShaderResourceBinding::VertexStage, and vfcGetShader().
Definition at line 91 of file qvideoframeconverter.cpp.
References QShader::fromSerialized(), g_shaderCache, and QIODeviceBase::ReadOnly.
Referenced by updateTextures().
|
static |
Definition at line 51 of file qvideoframeconverter.cpp.
Referenced by qImageFromVideoFrame().
Definition at line 49 of file qvideoframeconverter.cpp.
Referenced by vfcGetShader().
|
static |
Definition at line 48 of file qvideoframeconverter.cpp.
Referenced by initializeRHI(), and qImageFromVideoFrame().