Functions | |
| GstBusSyncReply | onBusSyncMessage (GstMessage *msg) noexcept |
| void | onPipelineRestart () |
| void | resetCachedGpuResources () |
| void | onGraphicsDeviceRemoved () |
| bool | graphicsDeviceLost () noexcept |
| void | configureQtGraphics (bool softwareRendering) |
| bool | softwareRenderingRequested () noexcept |
| What configureQtGraphics() was told: the user asked for software rendering (–swrast). Safe off the GUI thread. | |
| void | connectMainWindow (QQuickWindow *window) |
| HwVideoBufferContext | makeAdapterContext (bool gpuEnabled) noexcept |
| void * | dmaBufImportDisplay () noexcept |
| qint64 | graphicsAdapterLuid () noexcept |
| void | setGraphicsDevicePublishedHandler (void(*handler)()) noexcept |
| bool | d3d11OpensD3D12 () noexcept |
| bool | answerSinkBinContextQuery (GstQuery *query, GstElement *sink) noexcept |
| bool | proposeDeviceBoundPool (GstQuery *query, GstCaps *caps, const GstVideoInfo *vinfo, gsize size, guint minBuffers) noexcept |
| QString | extraPathStatsSince (const GstHwPathTelemetry::Snapshot &baseline) |
Variables | |
| constexpr char | kGraphicsDeviceServedMessage [] = "qgc-graphics-device-served" |
| constexpr char | kGraphicsDeviceLostMessage [] = "qgc-graphics-device-lost" |
|
noexcept |
Synchronously answer GST_QUERY_CONTEXT through the GPU paths' context bridges; false -> let bus NEED_CONTEXT run. sink, the element the query reached, names the pipeline that gets the device this way.
Definition at line 261 of file HwBuffers.cc.
References GstHwPathRegistry::paths().
Referenced by gst_qgc_q_video_sink_query().
| void HwBuffers::configureQtGraphics | ( | bool | softwareRendering | ) |
Qt graphics setup the GPU paths need, which Qt reads at startup: call before the QGuiApplication exists. On desktop Linux it pins the scene graph to OpenGL, unless softwareRendering (–swrast) or QSG_RHI_BACKEND chose one, and Qt's xcb platform to EGL; with the GL or DMABuf path it shares Qt's OpenGL contexts, and with the DMABuf import under Vulkan it asks for the device extensions that takes, should Qt Quick render with Vulkan. No-op otherwise.
Definition at line 141 of file HwBuffers.cc.
Referenced by GStreamerVideoBackend::configureQtGraphics().
| void HwBuffers::connectMainWindow | ( | QQuickWindow * | window | ) |
Wire the main QQuickWindow into the RHI-capture path so snapshots, and the EGLDisplay Qt renders with, follow its QRhi. GUI thread; no-op without GPU.
Definition at line 173 of file HwBuffers.cc.
References QGCRhiCapture::connectWindow().
Referenced by GStreamer::onMainWindowReady().
|
noexcept |
True when the Direct3D 11 device Qt Quick renders with is known to open a Direct3D 12 device's resources as textures, which is how the D3D12 path shows a frame there. False until the scene graph publishes that device, and in builds without both D3D paths. Safe off the GUI thread.
Definition at line 247 of file HwBuffers.cc.
References QGCRhiCapture::DeviceSnapshot::d3d11OpensD3D12, and QGCRhiCapture::deviceSnapshot().
|
noexcept |
What the DMABuf path imports with now, as HwVideoBufferContext::dmaBufImporter stores it: Qt's EGLDisplay (QGCRhiCapture::qtEglDisplay()), or, once Qt Quick renders with Vulkan, its VkPhysicalDevice when that device imports dma-bufs. Null when Qt renders without either or that isn't known yet, an import failure disabled the path (until resetCachedGpuResources()), or no DMABuf path is compiled. Safe off the GUI thread.
Definition at line 206 of file HwBuffers.cc.
References QGCRhiCapture::deviceSnapshot(), and QGCRhiCapture::qtEglDisplay().
| QString HwBuffers::extraPathStatsSince | ( | const GstHwPathTelemetry::Snapshot & | baseline | ) |
Process-wide render-time counters no sink can attribute (map failures, texture reuse, producer waits, fallback reasons, ...) accumulated since baseline, each printed only when nonzero. Reading never resets them, so every receiver can report its own window.
Definition at line 294 of file HwBuffers.cc.
References GstHwPathTelemetry::Snapshot::count(), GstHwPathTelemetry::EglBadMatch, GstHwPathTelemetry::ImportUnsupported, GstHwPathTelemetry::MapFailed, GstHwPathTelemetry::NoExt, None, GstHwPathTelemetry::peekMapDurationUsEwma(), GstHwPathTelemetry::snapshot(), GstHw::toString(), GstHwPathTelemetry::UnknownMemType, GstHwPathTelemetry::ValidateFailed, and GstHwPathTelemetry::VulkanNoSync.
Referenced by DecodingBranch::sinkPathStats().
|
noexcept |
The DXGI adapter of the Direct3D device Qt Quick renders with, as the decoders' "adapter-luid" names theirs; 0 until the scene graph publishes that device, and for any other renderer. Safe off the GUI thread.
Definition at line 231 of file HwBuffers.cc.
References QGCRhiCapture::DeviceSnapshot::adapterLuid, and QGCRhiCapture::deviceSnapshot().
|
noexcept |
True from when a context bridge's device is reported removed until that bridge has a device again: a decoder that fails meanwhile isn't at fault. Always false when no GPU path is compiled. Safe off the GUI thread.
Definition at line 129 of file HwBuffers.cc.
References GstHwPathRegistry::paths().
|
noexcept |
Populate the per-pipeline HwVideoBufferContext (gpu-enabled flag, AHardwareBuffer EGL display) the factory needs; the sink adds dmaBufImportDisplay() per frame. GPU stays disabled in builds without a GPU path. Safe off the GUI thread.
Definition at line 182 of file HwBuffers.cc.
References HwVideoBufferContext::gpuEnabled, GstHwPathRegistry::paths(), and GstHw::toString().
Referenced by gst_qgc_q_video_sink_start().
|
noexcept |
For a receiver's bus sync handler: the context bridges answer NEED_CONTEXT. GST_BUS_DROP means msg was consumed (and unreffed); always GST_BUS_PASS when no GPU path is compiled.
Definition at line 59 of file HwBuffers.cc.
References GstHwPathRegistry::paths().
| void HwBuffers::onGraphicsDeviceRemoved | ( | ) |
For a context bridge whose device was reported removed: resetCachedGpuResources(), then kGraphicsDeviceLostMessage on every pipeline a bridge had given its device. GUI thread.
Definition at line 102 of file HwBuffers.cc.
References kGraphicsDeviceLostMessage, GstHwPathRegistry::paths(), and resetCachedGpuResources().
| void HwBuffers::onPipelineRestart | ( | ) |
Pipeline-restart hook; clears exhausted prime-retry latches (GL, Vulkan) so a restart can prime on the next NEED_CONTEXT. Never drops shared GPU objects: other streams may still be using them.
Definition at line 74 of file HwBuffers.cc.
References GstHwPathRegistry::paths().
Referenced by GStreamer::setupQVideoSinkElement().
|
noexcept |
Add a buffer pool on Qt's D3D11/D3D12 device to an ALLOCATION query for caps in that memory, so the decoder allocates on the device the importer samples from. False for any other memory, or before the device bridge is primed.
Definition at line 275 of file HwBuffers.cc.
References GstHwPathRegistry::paths().
Referenced by GstQgc::populateAllocationQuery().
| void HwBuffers::resetCachedGpuResources | ( | ) |
Drop process-wide native GPU handles tied to the current Qt scene-graph device/context. Affects every running stream, so only for scene-graph teardown, window swaps and device loss.
Definition at line 85 of file HwBuffers.cc.
References GstHwPathRegistry::paths().
Referenced by onGraphicsDeviceRemoved().
|
noexcept |
Has handler called each time the scene graph publishes the device Qt Quick renders with, on its render thread: what depends on that device (the decoder ranks) follows it then. Null for none. No-op when no GPU path is compiled.
Definition at line 240 of file HwBuffers.cc.
References QGCRhiCapture::setPublishedHandler().
Referenced by GStreamer::onMainWindowReady().
|
noexcept |
What configureQtGraphics() was told: the user asked for software rendering (–swrast). Safe off the GUI thread.
Definition at line 168 of file HwBuffers.cc.
|
inlineconstexpr |
Name of the element message onGraphicsDeviceRemoved() posts on the pipelines a context bridge gave its device, once that device is reported removed (a driver reset or update): their GPU elements can't go on, and they hold references that keep the device's successor from being created.
Definition at line 27 of file HwBuffers.h.
Referenced by onGraphicsDeviceRemoved().
|
inlineconstexpr |
Name of the element message a context bridge posts on a pipeline it gives the device Qt renders with after an element of the pipeline had asked for one in vain: what was built meanwhile works on another device, and keeps it.
Definition at line 22 of file HwBuffers.h.