Common base for GStreamer-backed QHwVideoBuffer subclasses. More...
#include <GstHwVideoBuffer.h>
Public Member Functions | |
| GstHwVideoBuffer (GstSample *sample, const GstVideoInfo &videoInfo, QVideoFrameFormat format) | |
| ~GstHwVideoBuffer () override | |
| QVideoFrameFormat | format () const override |
| MapData | map (QVideoFrame::MapMode mode) override |
| void | unmap () override |
| virtual bool | validatePlaneHandles () const |
| Streaming-thread sanity check on per-plane handles; failure routes to CPU memcpy. | |
| GstSample * | refSample () noexcept |
Protected Member Functions | |
| template<class PlanePred> | |
| bool | validatePlanes (PlanePred &&planePred) const |
Validate each plane satisfies planePred; predicate runs once per plane on the streaming thread. | |
| bool | checkMapPreconditions (const QRhi &rhi, int expectedBackend, const QLoggingCategory &cat, GstHw::MapDiagnostics &diag, GstBuffer *&outBuffer) const |
Shared mapTextures preamble; warns once per cause via diag flags, returns false on first failure. | |
Protected Attributes | |
| GstSample * | _sample = nullptr |
| GstVideoInfo | _videoInfo = {} |
| QVideoFrameFormat | _format |
Common base for GStreamer-backed QHwVideoBuffer subclasses.
Definition at line 70 of file GstHwVideoBuffer.h.
| GstHwVideoBuffer::GstHwVideoBuffer | ( | GstSample * | sample, |
| const GstVideoInfo & | videoInfo, | ||
| QVideoFrameFormat | format ) |
Definition at line 19 of file GstHwVideoBuffer.cc.
References _format, _sample, _videoInfo, and format().
|
override |
Definition at line 29 of file GstHwVideoBuffer.cc.
|
protected |
Shared mapTextures preamble; warns once per cause via diag flags, returns false on first failure.
Definition at line 54 of file GstHwVideoBuffer.cc.
References _sample, GstHw::MapDiagnostics::loggedBadBackend, GstHw::MapDiagnostics::loggedNullBuffer, GstHw::MapDiagnostics::loggedNullSample, GstHw::MapDiagnostics::loggedWrongThread, and QGC_HW_WARN_ONCE.
|
inlineoverride |
Definition at line 76 of file GstHwVideoBuffer.h.
References _format.
Referenced by GstHwVideoBuffer().
|
override |
CPU view of the sample through gst_video_frame_map (e.g. GL memory downloads, DMABuf mmaps). Qt's createTextures() uploads this whenever mapTextures() fails, so a failed GPU import still shows the frame. ReadOnly only. Refused when format() advertises another pixel format than the memory holds: Qt would upload it in the wrong format or read past it.
Definition at line 37 of file GstHwVideoBuffer.cc.
References _format, _sample, and _videoInfo.
|
inlinenoexcept |
New sample ref for the texture bundle built in mapTextures(). The buffer keeps its own ref so map() and a repeated mapTextures() (another window, QRhi re-creation) still find the sample; Qt keeps this frame alive alongside the bundle anyway (QVideoFrameTextures::setSourceFrame), so no buffer is held longer.
Definition at line 91 of file GstHwVideoBuffer.h.
References _sample.
Referenced by GstHwFrameTexturesBase::finishMap().
|
override |
Definition at line 49 of file GstHwVideoBuffer.cc.
Referenced by ~GstHwVideoBuffer().
|
inlinevirtual |
Streaming-thread sanity check on per-plane handles; failure routes to CPU memcpy.
Definition at line 86 of file GstHwVideoBuffer.h.
|
inlineprotected |
Validate each plane satisfies planePred; predicate runs once per plane on the streaming thread.
Definition at line 96 of file GstHwVideoBuffer.h.
References _sample, and GstHw::kMaxPlanes.
|
protected |
Definition at line 120 of file GstHwVideoBuffer.h.
Referenced by format(), GstHwVideoBuffer(), and map().
|
protected |
Definition at line 118 of file GstHwVideoBuffer.h.
Referenced by checkMapPreconditions(), GstHwVideoBuffer(), map(), refSample(), validatePlanes(), and ~GstHwVideoBuffer().
|
protected |
Definition at line 119 of file GstHwVideoBuffer.h.
Referenced by GstHwVideoBuffer(), and map().