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

(77c6fd0d22e5a87a3b94ad8e6795d4d26c8f3fde)

#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 216 of file qvideoframeconverter.cpp.

References rasterTransform().

Here is the call graph for this function:

◆ convertJPEG()

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

Definition at line 166 of file qvideoframeconverter.cpp.

References rasterTransform().

Here is the call graph for this function:

◆ 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.

Referenced by qImageFromVideoFrame().

Here is the caller graph for this function:

◆ 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 237 of file qvideoframeconverter.cpp.

◆ qImageFromVideoFrame() [2/2]

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

Definition at line 244 of file qvideoframeconverter.cpp.

References imageCleanupHandler().

Here is the call graph for this function:

◆ rasterTransform()

void rasterTransform ( QImage & image,
VideoTransformation transformation )
static

Definition at line 85 of file qvideoframeconverter.cpp.

Referenced by convertCPU(), and convertJPEG().

Here is the caller graph for this function:

◆ 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 396 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.