#include <GstHwFrameTexturesBase.h>
Public Member Functions | |
| ~GstHwFrameTexturesBase () override | |
| QRhiTexture * | texture (uint plane) const override |
| bool | allPlanesValid () const noexcept |
| True when the bundle has planes and every one of them wrapped its native handle. | |
| void | setSourceSample (GstSample *s) noexcept |
| Transfers a ref into the bundle. Caller must have a fresh ref. | |
| template<class Handles> | |
| bool | matchesImport (const QRhi *rhi, QSize size, QVideoFrameFormat::PixelFormat pixelFormat, const Handles &handles) const noexcept |
Static Public Member Functions | |
| template<class FT> | |
| static FT * | reusableBundle (QVideoFrameTexturesUPtr &old) |
| template<class FT, class Reuse, class Make> | |
| static QVideoFrameTexturesUPtr | finishMap (GstHwVideoBuffer &source, QRhi &rhi, QVideoFrameTexturesUPtr &old, const GstHwMapTail &tail, Reuse &&reuse, Make &&make) |
Protected Member Functions | |
| template<class Handles> | |
| void | wrapPlanes (QRhi *rhi, QSize size, QVideoFrameFormat::PixelFormat pixelFormat, const Handles &handles, int layout=0, QRhiTexture::Flags flags={}) |
Protected Attributes | |
| QRhi * | _rhi = nullptr |
| int | _count = 0 |
| std::unique_ptr< QRhiTexture > | _textures [GstHw::kMaxPlanes] |
| GstSample * | _srcSample = nullptr |
Common base for per-platform FrameTextures : QVideoFrameTextures from *VideoBuffer::mapTextures(). Qt invokes onFrameEndInvoked() on the current bundle after every window frame and keeps sampling it until its pool slot is reused, so the source sample and every native resource must live until destruction — never release them from onFrameEndInvoked().
Definition at line 44 of file GstHwFrameTexturesBase.h.
|
inlineoverride |
Definition at line 47 of file GstHwFrameTexturesBase.h.
References _srcSample.
|
inlinenoexcept |
True when the bundle has planes and every one of them wrapped its native handle.
Definition at line 55 of file GstHwFrameTexturesBase.h.
References _count, and _textures.
Referenced by matchesImport().
|
inlinestatic |
Shared mapTextures() tail: hands source's sample to old when it is an FT bundle that reuse accepts (typically through matchesImport(); reuse may refresh per-frame state on it; pass nullptr for paths without reuse). Otherwise preflights the format, builds a bundle with make and keeps it only when every plane wrapped.
Definition at line 98 of file GstHwFrameTexturesBase.h.
References GstHwMapTail::diag, GstHwPathTelemetry::fail(), GstHwMapTail::frameSize, GstHwMapTail::log, GstHw::MapDiagnostics::loggedFirstSuccess, GstHw::MapDiagnostics::loggedTextureCreateFail, GstHwPathTelemetry::MapFailed, GstHwMapTail::path, GstHwMapTail::pixelFormat, GstHwMapTail::preflight, GstHwImportPreflight::preflightOrRecord(), QGC_HW_WARN_ONCE, GstHwPathTelemetry::record(), GstHwPathTelemetry::recordFallbackReason(), GstHwVideoBuffer::refSample(), reusableBundle(), GstHwMapTail::successTag, GstHwMapTail::textureFlags, and GstHwPathTelemetry::TextureReuse.
|
inlinenoexcept |
True when this bundle wrapped handles for the same QRhi, size and format and every plane wrapped: its QRhiTexture views then sample a recycled native resource's new contents unchanged.
Definition at line 70 of file GstHwFrameTexturesBase.h.
References _count, _rhi, and allPlanesValid().
|
inlinestatic |
old as an FT bundle, else nullptr. Each path's bundle type is distinct, and Qt's texture pool can also pass CPU-fallback or Qt-owned bundles here.
Definition at line 88 of file GstHwFrameTexturesBase.h.
Referenced by finishMap().
|
inlinenoexcept |
Transfers a ref into the bundle. Caller must have a fresh ref.
Definition at line 61 of file GstHwFrameTexturesBase.h.
References _srcSample.
|
inlineoverride |
Definition at line 49 of file GstHwFrameTexturesBase.h.
|
inlineprotected |
Wraps one native handle per plane (GL name, VkImage, ID3D1x resource, MTLTexture) as a QRhiTexture and records the import for matchesImport(). Fallback formats are disabled: a substituted format would misread the native layout. Planes QRhi rejects stay null, as do zero handles (a plane the source never produced), whatever the QRhi backend's createFrom() accepts.
Definition at line 135 of file GstHwFrameTexturesBase.h.
|
protected |
Definition at line 164 of file GstHwFrameTexturesBase.h.
Referenced by allPlanesValid(), matchesImport(), and texture().
|
protected |
Definition at line 163 of file GstHwFrameTexturesBase.h.
Referenced by matchesImport().
|
protected |
Definition at line 166 of file GstHwFrameTexturesBase.h.
Referenced by setSourceSample(), and ~GstHwFrameTexturesBase().
|
protected |
Definition at line 165 of file GstHwFrameTexturesBase.h.
Referenced by allPlanesValid(), and texture().