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
qvideoframeconverter.cpp File Reference

(7f98bb6a3a9da30cded752b14acd574a3ad151d4)

#include "qvideoframeconverter_p.h"
#include "qvideoframeconversionhelper_p.h"
#include "qvideoframeformat.h"
#include "qvideoframe_p.h"
#include "qmultimediautils_p.h"
#include "qthreadlocalrhi_p.h"
#include "qcachedvalue_p.h"
#include <QtCore/qcoreapplication.h>
#include <QtCore/qsize.h>
#include <QtCore/qhash.h>
#include <QtCore/qfile.h>
#include <QtGui/qimage.h>
#include <QtCore/qloggingcategory.h>
#include <QtMultimedia/private/qmultimedia_ranges_p.h>
#include <QtMultimedia/private/qvideotexturehelper_p.h>
#include <rhi/qrhi.h>
Include dependency graph for qvideoframeconverter.cpp:

Go to the source code of this file.

Functions

static bool pixelFormatHasAlpha (QVideoFrameFormat::PixelFormat format)
static QShader ensureShader (const QString &name)
static void rasterTransform (QImage &image, VideoTransformation transformation)
static void imageCleanupHandler (void *info)
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)
static QImage convertCPU (const QVideoFrame &frame, const VideoTransformation &transform)
QImage qImageFromVideoFrame (const QVideoFrame &frame, bool forceCpu)
QImage qImageFromVideoFrame (const QVideoFrame &frame, const VideoTransformation &transformation, bool forceCpu)
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 referencing to its mapped data.

Variables

static QT_BEGIN_NAMESPACE constexpr float g_quad []

Function Documentation

◆ convertCPU()

QImage convertCPU ( const QVideoFrame & frame,
const VideoTransformation & transform )
static

Definition at line 209 of file qvideoframeconverter.cpp.

◆ convertJPEG()

QImage convertJPEG ( const QVideoFrame & frame,
const VideoTransformation & transform )
static

Definition at line 159 of file qvideoframeconverter.cpp.

◆ ensureShader()

QShader ensureShader ( const QString & name)
static

Definition at line 75 of file qvideoframeconverter.cpp.

◆ imageCleanupHandler()

void imageCleanupHandler ( void * info)
static

Definition at line 96 of file qvideoframeconverter.cpp.

◆ pixelFormatHasAlpha()

bool pixelFormatHasAlpha ( QVideoFrameFormat::PixelFormat format)
static

Definition at line 58 of file qvideoframeconverter.cpp.

◆ qImageFromVideoFrame() [1/2]

QImage qImageFromVideoFrame ( const QVideoFrame & frame,
bool forceCpu )

Definition at line 230 of file qvideoframeconverter.cpp.

◆ qImageFromVideoFrame() [2/2]

QImage qImageFromVideoFrame ( const QVideoFrame & frame,
const VideoTransformation & transformation,
bool forceCpu )

Definition at line 237 of file qvideoframeconverter.cpp.

◆ rasterTransform()

void rasterTransform ( QImage & image,
VideoTransformation transformation )
static

Definition at line 85 of file qvideoframeconverter.cpp.

◆ updateTextures()

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

Definition at line 102 of file qvideoframeconverter.cpp.

◆ videoFramePlaneAsImage()

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 referencing to its mapped data.

Definition at line 376 of file qvideoframeconverter.cpp.

References QVideoFramePrivate::handle().

Here is the call graph for this function:

Variable Documentation

◆ g_quad

QT_BEGIN_NAMESPACE constexpr float g_quad
staticconstexpr
Initial value:
= {
1.f, -1.f, 1.f, 1.f,
1.f, 1.f, 1.f, 0.f,
-1.f, -1.f, 0.f, 1.f,
-1.f, 1.f, 0.f, 0.f,
1.f, -1.f, 1.f, 0.f,
1.f, 1.f, 0.f, 0.f,
-1.f, -1.f, 1.f, 1.f,
-1.f, 1.f, 0.f, 1.f,
1.f, -1.f, 0.f, 0.f,
1.f, 1.f, 0.f, 1.f,
-1.f, -1.f, 1.f, 0.f,
-1.f, 1.f, 1.f, 1.f,
1.f, -1.f, 0.f, 1.f,
1.f, 1.f, 1.f, 1.f,
-1.f, -1.f, 0.f, 0.f,
-1.f, 1.f, 1.f, 0.f,
}

Definition at line 34 of file qvideoframeconverter.cpp.