QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GstQtDmaBufImport.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/qglobal.h>
4
5#if defined(QGC_HAS_GST_DMABUF_GPU_PATH)
6
7#include <array>
8#include <memory>
9#include <private/qhwvideobuffer_p.h>
10#include <span>
11
12#include <QtCore/QSize>
13#include <QtMultimedia/QVideoFrameFormat>
14
15#include <EGL/egl.h>
16
17class QRhi;
18
21namespace GstQtDmaBufImport {
22
24inline constexpr quint64 kImplicitModifier = (1ULL << 56) - 1; // DRM_FORMAT_MOD_INVALID
25
27struct Plane
28{
29 int fd = -1;
30 quint32 offset = 0;
31 quint32 pitch = 0;
32 quint32 drmFourcc = 0;
33 quint64 modifier = kImplicitModifier;
34};
35
37struct PlaneFourccs
38{
39 std::array<quint32, 4> fourcc{};
40 int count = 0;
41};
42
43PlaneFourccs planeFourccs(QVideoFrameFormat::PixelFormat pixelFormat);
44
47EGLDisplay importDisplay(QRhi& rhi);
48
49struct ImportResult
50{
51 QVideoFrameTexturesUPtr textures;
53 bool unrecoverable = false;
54};
55
58ImportResult importTextures(QRhi& rhi, std::span<const Plane> planes, QVideoFrameFormat::PixelFormat pixelFormat,
59 QSize frameSize, std::shared_ptr<void> keepAlive);
60
61} // namespace GstQtDmaBufImport
62
63#endif // QGC_HAS_GST_DMABUF_GPU_PATH