QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GstCudaVideoBuffer.h
Go to the documentation of this file.
1#pragma once
2
3// CUDA memory handed to the DMABuf path through the fd gst_cuda_memory_export() returns (GStreamer 1.24+), instead of
4// CUDA-GL interop. Never run on NVIDIA hardware, and not expected to import there: the fd is CUDA's shareable handle
5// (cuMemExportToShareableHandle), which the desktop driver's EGL refuses as a dma-buf, so the path checks what it was
6// given and turns itself off when that is no dma-buf. Only memory from a cuMemCreate pool (GST_CUDA_MEMORY_ALLOC_MMAP)
7// can be exported at all, and nothing here asks a decoder for one. Built when HwBuffers/CMakeLists.txt finds gst-cuda
8// and cuda.h.
9
10#if defined(QGC_HAS_GST_CUDA_GPU_PATH)
11
12#include <gst/gst.h>
13#include <gst/video/video-info.h>
14#include <memory>
15
17
19
20namespace GstCudaVideoBuffer {
21
24bool exportSupported() noexcept;
25
28std::unique_ptr<GstHwVideoBuffer> exportToDmaBuf(GstSample* sample, const GstVideoInfo& info, QVideoFrameFormat format,
29 const HwVideoBufferContext& context);
30
31} // namespace GstCudaVideoBuffer
32
33#endif // QGC_HAS_GST_CUDA_GPU_PATH
Common base for GStreamer-backed QHwVideoBuffer subclasses.