QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GstQgcCaps.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#ifdef QGC_UNITTEST_BUILD
5#include <optional>
6#endif
7
8#include "GstQgcGpuBin.h"
10
11namespace GstQgc {
12
15{
16 bool gpuZeroCopy = false;
22 void* dmaBufDisplay = nullptr;
24 bool d3d11OpensD3D12 = false;
26 bool squarePixels = true;
27
28 friend bool operator==(const SinkCapsPolicy&, const SinkCapsPolicy&) = default;
29};
30
41std::string buildSinkCaps(const SinkCapsPolicy& policy);
42
43#ifdef QGC_UNITTEST_BUILD
45struct SinkEnvironment
46{
47 RenderTarget target{};
48 GpuBinPreference gpuBin{};
50 void* dmaBufDisplay = nullptr;
51 bool d3d11OpensD3D12 = false;
52};
53
55class ScopedSinkEnvironmentForTest
56{
57public:
58 explicit ScopedSinkEnvironmentForTest(const SinkEnvironment& environment);
59 ~ScopedSinkEnvironmentForTest();
60 ScopedSinkEnvironmentForTest(const ScopedSinkEnvironmentForTest&) = delete;
61 ScopedSinkEnvironmentForTest& operator=(const ScopedSinkEnvironmentForTest&) = delete;
62
63private:
64 std::optional<SinkEnvironment> _previous;
65};
66
68std::optional<SinkEnvironment> sinkEnvironmentForTest();
69#endif
70
71} // namespace GstQgc
GstVideoSink that pushes decoded frames into a Qt QVideoSink; sole sink in qgcvideosinkbin....
std::string buildSinkCaps(const SinkCapsPolicy &policy)
bool d3d11OpensD3D12() noexcept
Definition HwBuffers.cc:247
Everything qgcqvideosink's caps depend on.
Definition GstQgcCaps.h:15
bool d3d11OpensD3D12
Qt's Direct3D 11 device opens a Direct3D 12 device's resources (HwBuffers::d3d11OpensD3D12()).
Definition GstQgcCaps.h:24
GpuBinMode gpuBin
qgcvideosinkbin's GPU variant in front of the sink; value-initialized, Passthrough (a standalone sink...
Definition GstQgcCaps.h:18
RenderTarget target
Definition GstQgcCaps.h:19
bool squarePixels
Ask for square pixels, in every kind of memory. The bin's converter scales system memory to them.
Definition GstQgcCaps.h:26
friend bool operator==(const SinkCapsPolicy &, const SinkCapsPolicy &)=default