libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
ntv2capabilities.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_NTV2
13
14#include <promeki/list.h>
15#include <promeki/namespace.h>
16#include <promeki/pixelformat.h>
18#include <promeki/string.h>
19
20class CNTV2Card;
21
22PROMEKI_NAMESPACE_BEGIN
23
53class Ntv2Capabilities {
54 public:
63 Ntv2Capabilities() = default;
64
73 bool probe(CNTV2Card &card);
74
76 bool isValid() const { return _valid; }
77
78 // ---- Connector counts ----
79
81 int sdiInputCount() const { return _sdiInputs; }
82
84 int sdiOutputCount() const { return _sdiOutputs; }
85
87 int hdmiInputCount() const { return _hdmiInputs; }
88
90 int hdmiOutputCount() const { return _hdmiOutputs; }
91
93 int audioSystemCount() const { return _audioSystems; }
94
96 int channelCount() const { return _channels; }
97
108 int cscCount() const { return _cscs; }
109
110 // ---- Feature flags ----
111
116 bool canDoMultiFormat() const { return _canDoMultiFormat; }
117
122 bool hasBiDirectionalSdi() const { return _hasBiDirectionalSdi; }
123
128 bool canDoCustomAnc() const { return _canDoCustomAnc; }
129
131 bool canCapture() const { return _canCapture; }
132
134 bool canPlayout() const { return _canPlayout; }
135
136 // ---- Derived ----
137
152 bool hasAudioCounter() const { return _audioSystems > 0; }
153
163 bool supportsLinkStandard(const SdiLinkStandard &standard) const;
164
173 bool supportsPixelFormat(PixelFormat::ID pixelFormat) const;
174
182 String toString() const;
183
197 static Ntv2Capabilities createForTest(int channelCount, int audioSystemCount,
198 int sdiInputs, int sdiOutputs,
199 bool canMultiFormat = true,
200 bool hasBiSdi = true,
201 bool canDoAnc = true,
202 int cscCount = 4);
203
204 private:
205 bool _valid = false;
206 int _sdiInputs = 0;
207 int _sdiOutputs = 0;
208 int _hdmiInputs = 0;
209 int _hdmiOutputs = 0;
210 int _audioSystems = 0;
211 int _channels = 0;
212 int _cscs = 0;
213 bool _canDoMultiFormat = false;
214 bool _hasBiDirectionalSdi = false;
215 bool _canDoCustomAnc = false;
216 bool _canCapture = false;
217 bool _canPlayout = false;
218
219 // Per-frame-buffer-format support bitmap (indexed by
220 // NTV2FrameBufferFormat). Sized to cover the entire
221 // NTV2_FBF_* range with comfortable headroom; missed
222 // formats hash to "not supported", which is the safe
223 // default — the open path returns Error::NotSupported
224 // and the planner splices a CSC bridge.
225 static constexpr int kFbfMapSize = 128;
226 bool _fbfSupported[kFbfMapSize] = {};
227};
228
229PROMEKI_NAMESPACE_END
230
231#endif // PROMEKI_ENABLE_NTV2