4#ifndef QFFMPEGTEXTURECONVERTER_P_H
5#define QFFMPEGTEXTURECONVERTER_P_H
7#include <QtFFmpegMediaPluginImpl/private/qffmpegdefs_p.h>
8#include <QtMultimedia/private/qhwvideobuffer_p.h>
30
31
32
33
34
35
44 QVideoFrameTexturesUPtr & )
56
57
58
59
60
66
67
68
69
74
75
79
80
81
82
83
84
85
86 bool init(AVFrame &hwFrame);
89
90
91
92
96
97
98
100 QVideoFrameTexturesHandlesUPtr oldHandles);
103
104
105
106 bool isNull()
const {
return !m_backend || !m_backend->rhi; }
109
110
111
115
116
120
121
122
123
124
128 void updateBackend(AVPixelFormat format);
The base class for platform-specific implementations of TextureConverter One of two virtual methods,...
TextureConverterBackend(QRhi *rhi)
virtual QVideoFrameTexturesHandlesUPtr createTextureHandles(AVFrame *, QVideoFrameTexturesHandlesUPtr)
virtual ~TextureConverterBackend()
virtual QVideoFrameTexturesUPtr createTextures(AVFrame *, QVideoFrameTexturesUPtr &)
QRhi * rhi
Points to the matching QRhi. If the constructor, createTextures, or createTextureHandles get failed w...
The TextureConverter class implements conversion of AVFrame hw textures to textures for rendering by ...
QVideoFrameTexturesHandlesUPtr createTextureHandles(AVFrame &hwFrame, QVideoFrameTexturesHandlesUPtr oldHandles)
Creates video frame texture handles basing on the current hw frame and the previous texture handles f...
TextureConverter(QRhi &rhi)
Construct uninitialized texture converter for the specified QRhi.
bool isNull() const
Indicates whether the texture converter is not initialized or the initialization failed....
static void applyDecoderPreset(AVPixelFormat format, AVCodecContext &codecContext)
Applies platform-specific hw texture conversion presets for a decoder. The function is supposed to be...
bool init(AVFrame &hwFrame)
Initializes the instance of the texture converter for the frame context associated with the specified...
QVideoFrameTexturesUPtr createTextures(AVFrame &hwFrame, QVideoFrameTexturesUPtr &oldTextures)
Creates video frame textures basing on the current hw frame and the previous textures from the textur...
static bool isBackendAvailable(AVFrame &hwFrame, const QRhi &rhi)
Indicates whether the matching textute converter backend can be created. If isBackendAvailable return...
static bool hwTextureConversionEnabled()
Indicates whether hw texture conversion is enabled for the application.
std::shared_ptr< TextureConverterBackend > TextureConverterBackendPtr
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType