6 QVideoFrameFormat format)
7 : QHwVideoBuffer(handleType),
8 _sample(sample ? gst_sample_ref(sample) : nullptr),
10 _format(std::move(format))
27 qCWarning(cat) <<
"mapTextures: GstSample is null";
30 if (!rhi.thread()->isCurrentThread()) {
32 qCWarning(cat) <<
"mapTextures: called outside QRhi render thread";
35 if (
static_cast<int>(rhi.backend()) != expectedBackend) {
37 qCWarning(cat) <<
"mapTextures: QRhi backend is" << rhi.backendName() <<
"(backend id" << expectedBackend
41 outBuffer = gst_sample_get_buffer(
_sample);
44 qCWarning(cat) <<
"mapTextures: GstSample has no buffer";
51 QSize frameSize, QVideoFrameFormat::PixelFormat pixelFormat,
int planes)
53 if (!flag.exchange(
true, std::memory_order_relaxed)) {
54 qCInfo(cat) <<
"First" << tag <<
"zero-copy mapTextures success: size=" << frameSize
55 <<
"format=" << int(pixelFormat) <<
"planes=" << planes;
GstHwVideoBuffer(QVideoFrame::HandleType handleType, GstSample *sample, const GstVideoInfo &videoInfo, QVideoFrameFormat format)
~GstHwVideoBuffer() override
static void logFirstSuccess(std::atomic< bool > &flag, const QLoggingCategory &cat, const char *tag, QSize frameSize, QVideoFrameFormat::PixelFormat pixelFormat, int planes)
One-shot "first zero-copy success" info line; silent after flag first flips.
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.
One-shot warning flags per failure cause; paths with extra causes (D3D, IOSurface) derive and add mem...
std::atomic< bool > loggedNullSample
std::atomic< bool > loggedNullBuffer
std::atomic< bool > loggedBadBackend
std::atomic< bool > loggedWrongThread