AJA NTV2 SDK  18.1.0.2262
NTV2 SDK 18.1.0.2262
ntv2democommon.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ntv2democommon.h"
9 #include "ntv2devicescanner.h"
10 #include "ntv2devicefeatures.h"
11 #include "ntv2testpatterngen.h"
12 #include "ntv2debug.h"
13 #include "ntv2utils.h"
14 #include "ajabase/common/common.h"
15 #include <algorithm>
16 #include <map>
17 #include <iomanip>
18 #if defined (AJAMac) || defined (AJALinux)
19  #include <unistd.h>
20  #include <termios.h>
21 #endif
22 
23 using namespace std;
24 
25 typedef multimap <string, NTV2VideoFormat> String2VideoFormatMMap;
26 typedef String2VideoFormatMMap::const_iterator String2VideoFormatMMapCI;
27 
28 typedef map <string, NTV2FrameBufferFormat> String2PixelFormatMap;
29 typedef String2PixelFormatMap::const_iterator String2PixelFormatMapConstIter;
30 
31 typedef map <string, NTV2AudioSystem> String2AudioSystemMap;
32 typedef String2AudioSystemMap::const_iterator String2AudioSystemMapConstIter;
33 
34 typedef map <string, NTV2VANCMode> String2VANCModeMap;
35 typedef String2VANCModeMap::const_iterator String2VANCModeMapConstIter;
36 
37 typedef map <string, NTV2InputSource> String2InputSourceMap;
38 typedef String2InputSourceMap::const_iterator String2InputSourceMapConstIter;
39 
40 typedef map <string, NTV2OutputDestination> String2OutputDestMap;
41 typedef String2OutputDestMap::const_iterator String2OutputDestMapConstIter;
42 
43 typedef map <string, NTV2TCIndex> String2TCIndexMap;
44 typedef pair <string, NTV2TCIndex> String2TCIndexPair;
45 typedef String2TCIndexMap::const_iterator String2TCIndexMapConstIter;
46 
47 typedef map <string, string> String2TPNamesMap;
48 typedef pair <string, string> String2TPNamePair;
49 typedef String2TPNamesMap::const_iterator String2TPNamesMapConstIter;
50 
51 
52 static const string gGlobalMutexName ("com.aja.ntv2.mutex.demo");
88 
89 
91 {
92  public:
94  {
95  typedef pair <string, NTV2VideoFormat> String2VideoFormatPair;
96  typedef pair <string, NTV2FrameBufferFormat> String2PixelFormatPair;
97  typedef pair <string, NTV2AudioSystem> String2AudioSystemPair;
98  typedef pair <string, NTV2VANCMode> String2VANCModePair;
99  typedef pair <string, NTV2InputSource> String2InputSourcePair;
100  typedef pair <string, NTV2OutputDestination> String2OutputDestPair;
101 
102  NTV2_ASSERT (gSDHDFormats.empty());
103  for (NTV2VideoFormat legalFormat(NTV2_FORMAT_UNKNOWN); legalFormat < NTV2_MAX_NUM_VIDEO_FORMATS; legalFormat = NTV2VideoFormat(legalFormat + 1))
104  {
105  if (!NTV2_IS_VALID_VIDEO_FORMAT(legalFormat))
106  continue;
107  string str(::NTV2VideoFormatToString (legalFormat));
108 
109  if (NTV2_IS_QUAD_QUAD_FORMAT(legalFormat))
110  g8KFormats.insert(legalFormat);
111  else if (NTV2_IS_4K_VIDEO_FORMAT(legalFormat))
112  g4KFormats.insert(legalFormat);
113  else
114  gSDHDFormats.insert(legalFormat);
115  gAllFormats.insert(legalFormat);
116 
117  if (legalFormat == NTV2_FORMAT_525_5994) str = "525i2997";
118  else if (legalFormat == NTV2_FORMAT_625_5000) str = "625i25";
119  else if (legalFormat == NTV2_FORMAT_525_2398) str = "525i2398";
120  else if (legalFormat == NTV2_FORMAT_525_2400) str = "525i24";
121  else
122  {
123  if (str.at (str.length() - 1) == 'a') // If it ends in "a"...
124  str.erase (str.length() - 1); // ...lop off the "a"
125 
126  if (str.find(".00") != string::npos) // If it ends in ".00"...
127  str.erase (str.find(".00"), 3); // ...lop off the ".00" (but keep the "b", if any)
128 
129  while (str.find(" ") != string::npos)
130  str.erase (str.find(" "), 1); // Remove all spaces
131 
132  if (str.find(".") != string::npos)
133  str.erase (str.find("."), 1); // Remove "."
134 
135  str = CNTV2DemoCommon::ToLower(str); // Fold to lower case
136  }
137  gString2VideoFormatMMap.insert (String2VideoFormatPair (str, legalFormat));
138  gString2VideoFormatMMap.insert (String2VideoFormatPair (ULWordToString(legalFormat), legalFormat));
139  } // for each video format supported in demo apps
140 
141  // Add popular format names...
142  gString2VideoFormatMMap.insert (String2VideoFormatPair ("sd", NTV2_FORMAT_525_5994));
143  gString2VideoFormatMMap.insert (String2VideoFormatPair ("525i", NTV2_FORMAT_525_5994));
144  gString2VideoFormatMMap.insert (String2VideoFormatPair ("625i", NTV2_FORMAT_625_5000));
145  gString2VideoFormatMMap.insert (String2VideoFormatPair ("720p", NTV2_FORMAT_720p_5994));
146  gString2VideoFormatMMap.insert (String2VideoFormatPair ("hd", NTV2_FORMAT_1080i_5994));
147  gString2VideoFormatMMap.insert (String2VideoFormatPair ("1080i", NTV2_FORMAT_1080i_5994));
148  gString2VideoFormatMMap.insert (String2VideoFormatPair ("1080i50", NTV2_FORMAT_1080i_5000));
149  gString2VideoFormatMMap.insert (String2VideoFormatPair ("1080p", NTV2_FORMAT_1080p_5994_B));
150  gString2VideoFormatMMap.insert (String2VideoFormatPair ("1080p50", NTV2_FORMAT_1080p_5000_B));
151 
152  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd", NTV2_FORMAT_4x1920x1080p_6000));
153  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd", NTV2_FORMAT_3840x2160p_6000));
154  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd2398", NTV2_FORMAT_4x1920x1080p_2398));
155  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd2398", NTV2_FORMAT_3840x2160p_2398));
156  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd24", NTV2_FORMAT_4x1920x1080p_2400));
157  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd24", NTV2_FORMAT_3840x2160p_2400));
158  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd25", NTV2_FORMAT_4x1920x1080p_2500));
159  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd25", NTV2_FORMAT_3840x2160p_2500));
160  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd50", NTV2_FORMAT_4x1920x1080p_5000));
161  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd50", NTV2_FORMAT_3840x2160p_5000));
162  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd5994", NTV2_FORMAT_4x1920x1080p_5994));
163  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd5994", NTV2_FORMAT_3840x2160p_5994));
164  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd60", NTV2_FORMAT_4x1920x1080p_6000));
165  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd60", NTV2_FORMAT_3840x2160p_6000));
166 
167  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k", NTV2_FORMAT_4x2048x1080p_6000));
168  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k", NTV2_FORMAT_4096x2160p_6000));
169  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k2398", NTV2_FORMAT_4x2048x1080p_2398));
170  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k2398", NTV2_FORMAT_4096x2160p_2398));
171  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k24", NTV2_FORMAT_4x2048x1080p_2400));
172  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k24", NTV2_FORMAT_4096x2160p_2400));
173  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k25", NTV2_FORMAT_4x2048x1080p_2500));
174  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k25", NTV2_FORMAT_4096x2160p_2500));
175  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k4795", NTV2_FORMAT_4x2048x1080p_4795));
176  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k4795", NTV2_FORMAT_4096x2160p_4795));
177  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k48", NTV2_FORMAT_4x2048x1080p_4800));
178  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k48", NTV2_FORMAT_4096x2160p_4800));
179  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k50", NTV2_FORMAT_4x2048x1080p_5000));
180  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k50", NTV2_FORMAT_4096x2160p_5000));
181  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k5994", NTV2_FORMAT_4x2048x1080p_5994));
182  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k5994", NTV2_FORMAT_4096x2160p_5994));
183  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k60", NTV2_FORMAT_4x2048x1080p_6000));
184  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k60", NTV2_FORMAT_4096x2160p_6000));
185  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k11988", NTV2_FORMAT_4x2048x1080p_11988));
186  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k11988", NTV2_FORMAT_4096x2160p_11988));
187  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k120", NTV2_FORMAT_4x2048x1080p_12000));
188  gString2VideoFormatMMap.insert (String2VideoFormatPair ("4k120", NTV2_FORMAT_4096x2160p_12000));
189 
190  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd2", NTV2_FORMAT_4x3840x2160p_2398));
191  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd22398", NTV2_FORMAT_4x3840x2160p_2398));
192  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd224", NTV2_FORMAT_4x3840x2160p_2400));
193  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd225", NTV2_FORMAT_4x3840x2160p_2500));
194  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd250", NTV2_FORMAT_4x3840x2160p_5000));
195  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd25994", NTV2_FORMAT_4x3840x2160p_5994));
196  gString2VideoFormatMMap.insert (String2VideoFormatPair ("uhd260", NTV2_FORMAT_4x3840x2160p_6000));
197 
198  gString2VideoFormatMMap.insert (String2VideoFormatPair ("8k", NTV2_FORMAT_4x4096x2160p_6000));
199  gString2VideoFormatMMap.insert (String2VideoFormatPair ("8k2398", NTV2_FORMAT_4x4096x2160p_2398));
200  gString2VideoFormatMMap.insert (String2VideoFormatPair ("8k24", NTV2_FORMAT_4x4096x2160p_2400));
201  gString2VideoFormatMMap.insert (String2VideoFormatPair ("8k25", NTV2_FORMAT_4x4096x2160p_2500));
202  gString2VideoFormatMMap.insert (String2VideoFormatPair ("8k4795", NTV2_FORMAT_4x4096x2160p_4795));
203  gString2VideoFormatMMap.insert (String2VideoFormatPair ("8k48", NTV2_FORMAT_4x4096x2160p_4800));
204  gString2VideoFormatMMap.insert (String2VideoFormatPair ("8k50", NTV2_FORMAT_4x4096x2160p_5000));
205  gString2VideoFormatMMap.insert (String2VideoFormatPair ("8k5994", NTV2_FORMAT_4x4096x2160p_5994));
206  gString2VideoFormatMMap.insert (String2VideoFormatPair ("8k60", NTV2_FORMAT_4x4096x2160p_6000));
207 
208  NTV2_ASSERT (gPixelFormats.empty ());
209  for (NTV2FrameBufferFormat legalFormat (NTV2_FBF_10BIT_YCBCR); legalFormat < NTV2_FBF_NUMFRAMEBUFFERFORMATS; legalFormat = NTV2FrameBufferFormat (legalFormat + 1))
210  {
211  string str;
212  if (!NTV2_IS_VALID_FRAME_BUFFER_FORMAT (legalFormat))
213  continue;
214 
215  gPixelFormats.insert (legalFormat);
216  if (NTV2_IS_FBF_PLANAR (legalFormat))
217  gFBFsPlanar.insert (legalFormat);
218  if (NTV2_IS_FBF_RGB (legalFormat))
219  gFBFsRGB.insert (legalFormat);
220  if (NTV2_IS_FBF_PRORES (legalFormat))
221  gFBFsProRes.insert (legalFormat);
222  if (NTV2_FBF_HAS_ALPHA (legalFormat))
223  gFBFsAlpha.insert (legalFormat);
224  if (NTV2_FBF_IS_RAW (legalFormat))
225  gFBFsRaw.insert (legalFormat);
226 
227  str = ::NTV2FrameBufferFormatToString (legalFormat, true);
228  while (str.find (" ") != string::npos)
229  str.erase (str.find (" "), 1); // Remove all spaces
230 
231  while (str.find ("-") != string::npos)
232  str.erase (str.find ("-"), 1); // Remove all "-"
233 
234  if (str.find ("compatible") != string::npos)
235  str.erase (str.find ("compatible"), 10); // Remove "compatible"
236 
237  if (str.find ("ittle") != string::npos)
238  str.erase (str.find ("ittle"), 5); // Remove "ittle"
239 
240  if (str.find ("ndian") != string::npos)
241  str.erase (str.find ("ndian"), 5); // Remove "ndian"
242 
243  str = CNTV2DemoCommon::ToLower (str); // Fold to lower case
244 
245  gString2PixelFormatMap.insert (String2PixelFormatPair (str, legalFormat));
246 
247  str = ::NTV2FrameBufferFormatToString (legalFormat, false);
248  if (str.find ("NTV2_FBF_") == 0) // If it starts with "NTV2_FBF_"...
249  str.erase (0, 9); // ...lop it off
250 
251  while (str.find (" ") != string::npos)
252  str.erase (str.find (" "), 1); // Remove all spaces
253 
254  while (str.find ("_") != string::npos)
255  str.erase (str.find ("_"), 1); // Remove all "_"
256 
257  str = CNTV2DemoCommon::ToLower (str); // Fold to lower case
258 
259  gString2PixelFormatMap.insert (String2PixelFormatPair (str, legalFormat));
260  gString2PixelFormatMap.insert (String2PixelFormatPair (::NTV2FrameBufferFormatToString (legalFormat, false), legalFormat));
261  gString2PixelFormatMap.insert (String2PixelFormatPair (ULWordToString (legalFormat), legalFormat));
262  } // for each pixel format supported in demo apps
263 
264  // Add popular pixel format names...
265  gString2PixelFormatMap.insert (String2PixelFormatPair ("v210", NTV2_FBF_10BIT_YCBCR));
266  gString2PixelFormatMap.insert (String2PixelFormatPair ("yuv10", NTV2_FBF_10BIT_YCBCR));
267  gString2PixelFormatMap.insert (String2PixelFormatPair ("2vuy", NTV2_FBF_8BIT_YCBCR));
268  gString2PixelFormatMap.insert (String2PixelFormatPair ("uyvy", NTV2_FBF_8BIT_YCBCR));
269  gString2PixelFormatMap.insert (String2PixelFormatPair ("argb", NTV2_FBF_ARGB));
270  gString2PixelFormatMap.insert (String2PixelFormatPair ("argb8", NTV2_FBF_ARGB));
271  gString2PixelFormatMap.insert (String2PixelFormatPair ("bgra", NTV2_FBF_RGBA));
272  gString2PixelFormatMap.insert (String2PixelFormatPair ("bgra8", NTV2_FBF_RGBA));
273  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgba", NTV2_FBF_RGBA));
274  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgba8", NTV2_FBF_RGBA));
275  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb10", NTV2_FBF_10BIT_RGB));
276  gString2PixelFormatMap.insert (String2PixelFormatPair ("yuy2", NTV2_FBF_8BIT_YCBCR_YUY2));
277  gString2PixelFormatMap.insert (String2PixelFormatPair ("abgr", NTV2_FBF_ABGR));
278  gString2PixelFormatMap.insert (String2PixelFormatPair ("abgr8", NTV2_FBF_ABGR));
279  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb10dpx", NTV2_FBF_10BIT_DPX));
280  gString2PixelFormatMap.insert (String2PixelFormatPair ("yuv10dpx", NTV2_FBF_10BIT_YCBCR_DPX));
281  gString2PixelFormatMap.insert (String2PixelFormatPair ("ycbcr10dpx", NTV2_FBF_10BIT_YCBCR_DPX));
282  gString2PixelFormatMap.insert (String2PixelFormatPair ("dvcpro8", NTV2_FBF_8BIT_DVCPRO));
283  gString2PixelFormatMap.insert (String2PixelFormatPair ("i420", NTV2_FBF_8BIT_YCBCR_420PL3));
284  gString2PixelFormatMap.insert (String2PixelFormatPair ("hdv", NTV2_FBF_8BIT_HDV));
285  gString2PixelFormatMap.insert (String2PixelFormatPair ("hdv8", NTV2_FBF_8BIT_HDV));
286  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb24", NTV2_FBF_24BIT_RGB));
287  gString2PixelFormatMap.insert (String2PixelFormatPair ("bgr24", NTV2_FBF_24BIT_BGR));
288  gString2PixelFormatMap.insert (String2PixelFormatPair ("ycbcra10", NTV2_FBF_10BIT_YCBCRA));
289  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb10dpxle", NTV2_FBF_10BIT_DPX_LE));
290  gString2PixelFormatMap.insert (String2PixelFormatPair ("proresdvcpro", NTV2_FBF_PRORES_DVCPRO));
291  gString2PixelFormatMap.insert (String2PixelFormatPair ("proreshdv", NTV2_FBF_PRORES_HDV));
292  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb10packed", NTV2_FBF_10BIT_RGB_PACKED));
293  gString2PixelFormatMap.insert (String2PixelFormatPair ("argb10", NTV2_FBF_10BIT_ARGB));
294  gString2PixelFormatMap.insert (String2PixelFormatPair ("argb16", NTV2_FBF_16BIT_ARGB));
295  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb10raw", NTV2_FBF_10BIT_RAW_RGB));
296  gString2PixelFormatMap.insert (String2PixelFormatPair ("ycbcr10raw", NTV2_FBF_10BIT_RAW_YCBCR));
297  gString2PixelFormatMap.insert (String2PixelFormatPair ("yuv10raw", NTV2_FBF_10BIT_RAW_YCBCR));
298 
299  // Audio systems...
300  for (uint8_t ndx (0); ndx < 8; ndx++)
301  gString2AudioSystemMap.insert (String2AudioSystemPair(ULWordToString (ndx + 1), NTV2AudioSystem(ndx)));
302 
303  // VANC Modes...
305  {
306  gString2VANCModeMap.insert (String2VANCModePair(aja::to_string(vm), vm));
307 // gString2VANCModeMap.insert (String2VANCModePair(::NTV2VANCModeToString(vm, false), vm));
308  gString2VANCModeMap.insert (String2VANCModePair(::NTV2VANCModeToString(vm, true), vm));
309  }
310 
311  // Input Sources...
316  for (NTV2InputSourceSetConstIter it(gInputSources.begin()); it != gInputSources.end(); ++it)
317  {
318  const NTV2InputSource src(*it);
319  string sSmall(::NTV2InputSourceToString(src, true)), sBig(::NTV2InputSourceToString(src, false));
320  gString2InputSourceMap.insert(String2InputSourcePair(sBig, src));
321  gString2InputSourceMap.insert(String2InputSourcePair(sSmall, src));
322  gString2InputSourceMap.insert(String2InputSourcePair(CNTV2DemoCommon::ToLower(sSmall), src));
323  if (NTV2_INPUT_SOURCE_IS_SDI(src))
324  {
325  sSmall.erase(0, 3); // Erase first 3 chars to leave just the number (e.g. "SDI3" becomes "3")
326  gString2InputSourceMap.insert(String2InputSourcePair(sSmall, src));
327  }
328  } // for each input source
329  gString2InputSourceMap.insert(String2InputSourcePair(string("hdmi"),NTV2_INPUTSOURCE_HDMI1));
330 
331  // Output Destinations...
336  for (NTV2OutputDestinationsConstIter it(gOutputDestinations.begin()); it != gOutputDestinations.end(); ++it)
337  {
338  const NTV2OutputDest dst(*it);
339  string sSmall(::NTV2OutputDestinationToString(dst, true)), sBig(::NTV2OutputDestinationToString(dst, false));
340  gString2OutputDestMap.insert(String2OutputDestPair(sBig, dst));
341  gString2OutputDestMap.insert(String2OutputDestPair(sSmall, dst));
342  gString2OutputDestMap.insert(String2OutputDestPair(CNTV2DemoCommon::ToLower(sSmall), dst));
343  if (NTV2_OUTPUT_DEST_IS_SDI(dst))
344  {
345  const string str(aja::to_string(UWord(::NTV2OutputDestinationToChannel(dst)+1)));
346  gString2OutputDestMap.insert(String2OutputDestPair(str, dst));
347  }
348  } // for each output dest
349  gString2OutputDestMap.insert(String2OutputDestPair(string("hdmi1"), NTV2_OUTPUTDESTINATION_HDMI1));
350 
351  // TCIndexes...
352  for (uint16_t ndx (0); ndx < NTV2_MAX_NUM_TIMECODE_INDEXES; ndx++)
353  {
354  const NTV2TCIndex tcIndex (NTV2TCIndex(ndx+0));
355  if (tcIndex == NTV2_TCINDEX_DEFAULT)
356  continue; // Skip NTV2_TCINDEX_DEFAULT
357  gTCIndexes.insert (tcIndex);
358  gString2TCIndexMap.insert (String2TCIndexPair(ULWordToString(ndx), tcIndex));
359  gString2TCIndexMap.insert (String2TCIndexPair(::NTV2TCIndexToString(tcIndex, false), tcIndex));
361  if (NTV2_IS_ANALOG_TIMECODE_INDEX(tcIndex))
362  gTCIndexesAnalog.insert (tcIndex);
363  else
364  gTCIndexesSDI.insert (tcIndex);
365  if (NTV2_IS_ATC_LTC_TIMECODE_INDEX(tcIndex))
366  gTCIndexesATCLTC.insert (tcIndex);
368  gTCIndexesVITC1.insert (tcIndex);
370  gTCIndexesVITC2.insert (tcIndex);
371  }
372 
373  { // Test Patterns...
377  {
378  string tpName(tpNames.at(tp));
379  aja::replace(aja::replace(aja::replace(tpName, " ", ""), "%", ""), "_", "");
380  gString2TPNamesMap.insert(String2TPNamePair(aja::lower(tpName), tpNames.at(tp)));
381  ostringstream oss; oss << DEC(tp);
382  gString2TPNamesMap.insert(String2TPNamePair(oss.str(), tpNames.at(tp)));
383  }
384  for (NTV2StringListConstIter it(colorNames.begin()); it != colorNames.end(); ++it)
385  {
386  string colorName(*it);
387  aja::replace(aja::replace(aja::replace(colorName, " ", ""), "%", ""), "_", "");
388  gString2TPNamesMap.insert(String2TPNamePair(aja::lower(colorName), *it));
389  }
390  }
391  } // constructor
392  private:
393  string ULWordToString (const ULWord inNum)
394  {
395  ostringstream oss;
396  oss << inNum;
397  return oss.str ();
398  }
399 }; // constructor
400 
402 
403 
405 {
406  NTV2TimeCodesConstIter it(fTimecodes.find(inTCNdx));
407  if (it != fTimecodes.end())
408  return it->second;
409  return NTV2_RP188();
410 }
411 
413 {
414  size_t errorCount(0);
415  if (fVideoBuffer)
416  if (!inDevice.DMABufferLock(fVideoBuffer, true))
417  errorCount++;
418  if (fVideoBuffer2)
419  if (!inDevice.DMABufferLock(fVideoBuffer2, true))
420  errorCount++;
421  if (fAudioBuffer)
422  if (!inDevice.DMABufferLock(fAudioBuffer, true))
423  errorCount++;
424  if (fAncBuffer)
425  if (!inDevice.DMABufferLock(fAncBuffer, true))
426  errorCount++;
427  if (fAncBuffer2)
428  if (!inDevice.DMABufferLock(fAncBuffer2, true))
429  errorCount++;
430  return !errorCount;
431 }
432 
434 {
435  size_t errorCount(0);
436  if (fVideoBuffer)
437  if (!inDevice.DMABufferUnlock(fVideoBuffer))
438  errorCount++;
439  if (fVideoBuffer2)
440  if (!inDevice.DMABufferUnlock(fVideoBuffer2))
441  errorCount++;
442  if (fAudioBuffer)
443  if (!inDevice.DMABufferUnlock(fAudioBuffer))
444  errorCount++;
445  if (fAncBuffer)
446  if (!inDevice.DMABufferUnlock(fAncBuffer))
447  errorCount++;
448  if (fAncBuffer2)
449  if (!inDevice.DMABufferUnlock(fAncBuffer2))
450  errorCount++;
451  return !errorCount;
452 }
453 
455 {
456  fTimeStampAud = inXferInfo.GetFrameInfo().acAudioClockTimeStamp; // Grab VBI timestamp (audio clock)
457  fTimeStampOS = inXferInfo.GetFrameInfo().acFrameTime; // Grab VBI timestamp (OS clock)
458  if (acStatus.WithRP188() || acStatus.WithLTC())
459  inXferInfo.GetInputTimeCodes (fTimecodes, acStatus.GetChannel(), /*ValidOnly*/ true);
460  if (acStatus.WithAudio())
461  {
462  fNumAudioBytes = inXferInfo.GetCapturedAudioByteCount();
463  NTV2Buffer zero (fAudioBuffer.GetHostAddress(fNumAudioBytes),
464  fAudioBuffer.GetByteCount() - fNumAudioBytes);
465  zero.Fill(uint32_t(0));
466  }
467  if (acStatus.WithCustomAnc() && AncBuffer())
468  {
469  fNumAncBytes = inXferInfo.GetCapturedAncByteCount(/*isF2*/false);
470  // Clear stale anc data from the anc buffers...
471  NTV2Buffer stale (fAncBuffer.GetHostAddress(fNumAncBytes),
472  fAncBuffer.GetByteCount() - fNumAncBytes);
473  stale.Fill(uint8_t(0));
474  }
475  if (acStatus.WithCustomAnc() && AncBuffer2())
476  {
477  fNumAnc2Bytes = inXferInfo.GetCapturedAncByteCount(/*isF2*/true);
478  // Clear stale anc data from the anc buffers...
479  NTV2Buffer stale (fAncBuffer2.GetHostAddress(fNumAnc2Bytes),
480  fAncBuffer2.GetByteCount() - fNumAnc2Bytes);
481  stale.Fill(uint8_t(0));
482  }
483  return true;
484 }
485 
486 #if !defined(NTV2_DEPRECATE_18_1)
487  bool CNTV2DemoCommon::IsValidDevice (const string & inDeviceSpec)
488  {
489  CNTV2Card device;
490  const string deviceSpec (inDeviceSpec.empty() ? "0" : inDeviceSpec);
491  if (! CNTV2DeviceScanner::GetFirstDeviceFromArgument (deviceSpec, device))
492  {
493  if (deviceSpec != "LIST" && deviceSpec != "list" && deviceSpec != "?")
494  cerr << "## ERROR: Failed to open device spec '" << deviceSpec << "'" << endl;
495  return false;
496  }
497  return true;
498  }
499 #endif
500 
501 
503 {
504  if ((inKinds & VIDEO_FORMATS_ALL) == VIDEO_FORMATS_ALL)
505  return gAllFormats;
506 
507  NTV2VideoFormatSet result;
508  if (inKinds & VIDEO_FORMATS_SDHD)
509  result += gSDHDFormats;
510  if (inKinds & VIDEO_FORMATS_4KUHD)
511  result += g4KFormats;
512  if (inKinds & VIDEO_FORMATS_8KUHD2)
513  result += g8KFormats;
514  return result;
515 }
516 
517 
518 string CNTV2DemoCommon::GetVideoFormatStrings (const NTV2VideoFormatKinds inKinds, const string inDevSpec)
519 {
520  const NTV2VideoFormatSet & formatSet(GetSupportedVideoFormats(inKinds));
521  ostringstream oss;
522  CNTV2Card dev;
523  if (!inDevSpec.empty())
524  dev.Open(inDevSpec);
525 
526  oss << setw(25) << left << "Supported Video Format" << "\t" << setw(16) << left << "Legal -v Values" << endl
527  << setw(25) << left << "------------------------" << "\t" << setw(16) << left << "----------------" << endl;
528  for (NTV2VideoFormatSetConstIter iter(formatSet.begin()); iter != formatSet.end(); ++iter)
529  { const NTV2VideoFormat vf(*iter);
530  const string vfName (::NTV2VideoFormatToString(vf, true));
531  if (vfName == "Unknown")
532  continue;
533  NTV2StringList vfNames;
535  if (vf == it->second)
536  {
537  if (!inDevSpec.empty() && dev.IsOpen() && !dev.features().CanDoVideoFormat(vf))
538  continue;
539  vfNames.push_back(it->first);
540  }
541  if (!vfNames.empty())
542  oss << setw(25) << left << vfName << "\t" << aja::join(vfNames,", ") << endl;
543  }
544  return oss.str();
545 }
546 
547 
548 NTV2VideoFormat CNTV2DemoCommon::GetVideoFormatFromString (const string & inStr, const NTV2VideoFormatKinds inKinds, const string & inDevSpec)
549 {
551  if (iter == gString2VideoFormatMMap.end())
552  return NTV2_FORMAT_UNKNOWN;
553 
554  CNTV2Card dev;
555  if (!inDevSpec.empty())
556  dev.Open(inDevSpec);
557 
558  // If a device was specifed, look for the first name-matching format it supports...
559  NTV2VideoFormat vf(iter->second);
560  while (dev.IsOpen() && !dev.features().CanDoVideoFormat(vf))
561  {
562  if (++iter == gString2VideoFormatMMap.end())
563  return NTV2_FORMAT_UNKNOWN;
564  if (inStr != iter->first)
565  return NTV2_FORMAT_UNKNOWN;
566  vf = iter->second;
567  }
568  if ((inKinds & VIDEO_FORMATS_ALL) == VIDEO_FORMATS_ALL)
569  return vf;
570  if (inKinds & VIDEO_FORMATS_4KUHD && NTV2_IS_4K_VIDEO_FORMAT(vf))
571  return vf;
572  if (inKinds & VIDEO_FORMATS_8KUHD2 && NTV2_IS_QUAD_QUAD_FORMAT(vf))
573  return vf;
574  if (inKinds & VIDEO_FORMATS_SDHD && !NTV2_IS_4K_VIDEO_FORMAT(vf))
575  return vf;
576  return NTV2_FORMAT_UNKNOWN;
577 }
578 
579 
581 {
582  if (inKinds == PIXEL_FORMATS_ALL)
583  return gPixelFormats;
584 
586  if (inKinds & PIXEL_FORMATS_RGB)
587  result += gFBFsRGB;
588  if (inKinds & PIXEL_FORMATS_PLANAR)
589  result += gFBFsPlanar;
590  if (inKinds & PIXEL_FORMATS_RAW)
591  result += gFBFsRaw;
592  if (inKinds & PIXEL_FORMATS_PACKED)
593  result += gFBFsPacked;
594  if (inKinds & PIXEL_FORMATS_ALPHA)
595  result += gFBFsAlpha;
596  return result;
597 }
598 
599 
600 string CNTV2DemoCommon::GetPixelFormatStrings (const NTV2PixelFormatKinds inKinds, const string inDevSpec)
601 {
602  const NTV2FrameBufferFormatSet & formatSet (GetSupportedPixelFormats(inKinds));
603  CNTV2Card dev;
604  ostringstream oss;
605 
606  if (!inDevSpec.empty())
607  dev.Open(inDevSpec);
608 
609  oss << setw(34) << left << "Frame Buffer Format" << "\t" << setw(32) << left << "Legal -p Values" << endl
610  << setw(34) << left << "----------------------------------" << "\t" << setw(32) << left << "--------------------------------" << endl;
611  for (NTV2FrameBufferFormatSetConstIter iter(formatSet.begin()); iter != formatSet.end(); ++iter)
612  {
613  const NTV2PixelFormat pf(*iter);
614  const string pfName (::NTV2FrameBufferFormatToString (pf, true));
615  if (pfName.empty())
616  continue;
617  NTV2StringList pfNames;
619  if (pf == it->second)
620  {
621  if (!inDevSpec.empty() && dev.IsOpen() && !dev.features().CanDoFrameBufferFormat(pf))
622  continue;
623  pfNames.push_back(it->first);
624  }
625  if (!pfNames.empty())
626  oss << setw(35) << left << pfName << "\t" << aja::join(pfNames, ", ") << endl;
627  }
628  return oss.str();
629 }
630 
631 
632 NTV2PixelFormat CNTV2DemoCommon::GetPixelFormatFromString (const string & inStr, const NTV2PixelFormatKinds inKinds, const string inDevSpec)
633 {
635  if (iter == gString2PixelFormatMap.end())
636  return NTV2_FBF_INVALID;
637 
638  CNTV2Card dev;
639  if (!inDevSpec.empty())
640  dev.Open(inDevSpec);
641 
642  // If a device was specifed, look for the first name-matching format it supports...
643  NTV2PixelFormat pf(iter->second);
644  while (dev.IsOpen() && !dev.features().CanDoPixelFormat(pf))
645  {
646  if (++iter == gString2PixelFormatMap.end())
647  return NTV2_FBF_INVALID;
648  if (inStr != iter->first)
649  return NTV2_FBF_INVALID;
650  pf = iter->second;
651  }
652  if ((inKinds & PIXEL_FORMATS_ALL) == PIXEL_FORMATS_ALL)
653  return pf;
654  if (inKinds & PIXEL_FORMATS_RGB && NTV2_IS_FBF_RGB(pf))
655  return pf;
656  if (inKinds & PIXEL_FORMATS_PLANAR && NTV2_IS_FBF_PLANAR(pf))
657  return pf;
658  if (inKinds & PIXEL_FORMATS_RAW && !NTV2_FBF_IS_RAW(pf))
659  return pf;
660  if (inKinds & PIXEL_FORMATS_PACKED && !NTV2_IS_FBF_PRORES(pf))
661  return pf;
662  if (inKinds & PIXEL_FORMATS_ALPHA && !NTV2_FBF_HAS_ALPHA(pf))
663  return pf;
664  return NTV2_FBF_INVALID;
665 }
666 
667 
669 {
670  if (inKinds == NTV2_IOKINDS_ALL)
671  return gInputSources;
672 
673  NTV2InputSourceSet result;
674  if (inKinds & NTV2_IOKINDS_SDI)
675  result += gInputSourcesSDI;
676  if (inKinds & NTV2_IOKINDS_HDMI)
677  result += gInputSourcesHDMI;
678  if (inKinds & NTV2_IOKINDS_ANALOG)
679  result += gInputSourcesAnalog;
680  return result;
681 }
682 
683 
684 string CNTV2DemoCommon::GetInputSourceStrings (const NTV2IOKinds inKinds, const string inDevSpec)
685 {
686  const NTV2InputSourceSet & sourceSet (GetSupportedInputSources(inKinds));
687  CNTV2Card dev;
688  ostringstream oss;
689 
690  if (!inDevSpec.empty())
691  dev.Open(inDevSpec);
692 
693  oss << setw(25) << left << "Input Source" << "\t" << setw(16) << left << "Legal -i Values" << endl
694  << setw(25) << left << "------------------------" << "\t" << setw(16) << left << "----------------" << endl;
695  for (NTV2InputSourceSetConstIter iter(sourceSet.begin()); iter != sourceSet.end(); ++iter)
696  {
697  const NTV2InputSource src(*iter);
698  const string srcName (::NTV2InputSourceToString(src));
699  if (srcName.empty())
700  continue;
701  NTV2StringList srcNames;
703  if (src == it->second)
704  {
705  if (!inDevSpec.empty() && dev.IsOpen() && !dev.features().CanDoInputSource(src))
706  continue;
707  srcNames.push_back(it->first);
708  }
709  if (!srcNames.empty())
710  oss << setw(25) << left << srcName << "\t" << aja::join(srcNames, ", ") << endl;
711  }
712  return oss.str();
713 }
714 
715 
716 NTV2InputSource CNTV2DemoCommon::GetInputSourceFromString (const string & inStr, const NTV2IOKinds inKinds, const string inDevSpec)
717 {
719  if (iter == gString2InputSourceMap.end())
721 
722  CNTV2Card dev;
723  if (!inDevSpec.empty())
724  dev.Open(inDevSpec);
725 
726  // If a device was specifed, look for the first name-matching input source it supports...
727  NTV2InputSource src(iter->second);
728  while (dev.IsOpen() && !dev.features().CanDoInputSource(src))
729  {
730  if (++iter == gString2InputSourceMap.end())
732  if (inStr != iter->first)
734  src = iter->second;
735  }
736  if ((inKinds & NTV2_IOKINDS_ALL) == NTV2_IOKINDS_ALL)
737  return src;
738  if (inKinds & NTV2_IOKINDS_SDI && NTV2_INPUT_SOURCE_IS_SDI(src))
739  return src;
740  if (inKinds & NTV2_IOKINDS_HDMI && NTV2_INPUT_SOURCE_IS_HDMI(src))
741  return src;
742  if (inKinds & NTV2_IOKINDS_ANALOG && NTV2_INPUT_SOURCE_IS_ANALOG(src))
743  return src;
745 }
746 
747 
749 {
750  if (inKinds == NTV2_IOKINDS_ALL)
751  return gOutputDestinations;
752 
753  NTV2OutputDestinations result;
754  if (inKinds & NTV2_IOKINDS_SDI)
755  result += gOutputDestsSDI;
756  if (inKinds & NTV2_IOKINDS_HDMI)
757  result += gOutputDestsHDMI;
758  if (inKinds & NTV2_IOKINDS_ANALOG)
759  result += gOutputDestsAnalog;
760  return result;
761 }
762 
763 
764 string CNTV2DemoCommon::GetOutputDestinationStrings (const NTV2IOKinds inKinds, const string inDevSpec)
765 {
766  const NTV2OutputDestinations & dests (GetSupportedOutputDestinations(inKinds));
767  CNTV2Card dev;
768  ostringstream oss;
769 
770  if (!inDevSpec.empty())
771  dev.Open(inDevSpec);
772 
773  oss << setw(25) << left << "Output Destination" << "\t" << setw(16) << left << "Legal -o Values" << endl
774  << setw(25) << left << "------------------------" << "\t" << setw(16) << left << "----------------" << endl;
775  for (NTV2OutputDestinationsConstIter iter(dests.begin()); iter != dests.end(); ++iter)
776  {
777  const NTV2OutputDest dest(*iter);
778  const string destName(::NTV2OutputDestinationToString(dest));
779  if (destName.empty())
780  continue;
781  NTV2StringList destNames;
783  if (*iter == it->second)
784  {
785  if (!inDevSpec.empty() && dev.IsOpen() && !dev.features().CanDoOutputDestination(dest))
786  continue;
787  destNames.push_back(it->first);
788  }
789  if (!destNames.empty())
790  oss << setw(25) << left << destName << "\t" << aja::join(destNames, ", ") << endl;
791  }
792  return oss.str();
793 }
794 
795 
796 NTV2OutputDestination CNTV2DemoCommon::GetOutputDestinationFromString (const string & inStr, const NTV2IOKinds inKinds, const string inDevSpec)
797 {
799  if (iter == gString2OutputDestMap.end())
801 
802  CNTV2Card dev;
803  if (!inDevSpec.empty())
804  dev.Open(inDevSpec);
805 
806  // If a device was specifed, look for the first name-matching output destination it supports...
807  NTV2OutputDest dst(iter->second);
808  while (dev.IsOpen() && !dev.features().CanDoOutputDestination(dst))
809  {
810  if (++iter == gString2OutputDestMap.end())
812  if (inStr != iter->first)
814  dst = iter->second;
815  }
816  if ((inKinds & NTV2_IOKINDS_ALL) == NTV2_IOKINDS_ALL)
817  return dst;
818  if (inKinds & NTV2_IOKINDS_SDI && NTV2_OUTPUT_DEST_IS_SDI(dst))
819  return dst;
820  if (inKinds & NTV2_IOKINDS_HDMI && NTV2_OUTPUT_DEST_IS_HDMI(dst))
821  return dst;
822  if (inKinds & NTV2_IOKINDS_ANALOG && NTV2_OUTPUT_DEST_IS_ANALOG(dst))
823  return dst;
825 }
826 
827 
829 {
830  if (inKinds == TC_INDEXES_ALL)
831  return gTCIndexes;
832 
833  NTV2TCIndexes result;
834  if (inKinds & TC_INDEXES_SDI)
835  result += gTCIndexesSDI;
836  if (inKinds & TC_INDEXES_ANALOG)
837  result += gTCIndexesAnalog;
838  if (inKinds & TC_INDEXES_ATCLTC)
839  result += gTCIndexesATCLTC;
840  if (inKinds & TC_INDEXES_VITC1)
841  result += gTCIndexesVITC1;
842  if (inKinds & TC_INDEXES_VITC2)
843  result += gTCIndexesVITC2;
844  return result;
845 }
846 
848  const string inDevSpec,
849  const bool inIsInputOnly)
850 {
851  const NTV2TCIndexes & tcIndexes (GetSupportedTCIndexes(inKinds));
852  CNTV2Card dev;
853  ostringstream oss;
854 
855  if (!inDevSpec.empty())
856  dev.Open(inDevSpec);
857 
858  oss << setw(25) << left << "Timecode Index" << "\t" << setw(16) << left << "Legal Values" << endl
859  << setw(25) << left << "------------------------" << "\t" << setw(16) << left << "----------------" << endl;
860  for (NTV2TCIndexesConstIter iter (tcIndexes.begin()); iter != tcIndexes.end(); ++iter)
861  {
862  const NTV2TCIndex tcNdx(*iter);
863  const string tcNdxName (::NTV2TCIndexToString(tcNdx));
864  if (tcNdxName.empty())
865  continue;
866  NTV2StringList tcNdxNames;
867  for (String2TCIndexMapConstIter it (gString2TCIndexMap.begin()); it != gString2TCIndexMap.end(); ++it)
868  if (tcNdx == it->second)
869  {
870  if (!inDevSpec.empty() && dev.IsOpen())
871  if (!(inIsInputOnly ? dev.features().CanDoInputTCIndex(tcNdx) : dev.features().CanDoOutputTCIndex(tcNdx)))
872  continue;
873  tcNdxNames.push_back(it->first);
874  }
875  if (!tcNdxNames.empty())
876  oss << setw(25) << left << tcNdxName << "\t" << aja::join(tcNdxNames, ", ") << endl;
877  }
878  return oss.str();
879 }
880 
881 
882 NTV2TCIndex CNTV2DemoCommon::GetTCIndexFromString (const string & inStr, const NTV2TCIndexKinds inKinds, const string inDevSpec)
883 {
885  if (iter == gString2TCIndexMap.end())
886  return NTV2_TCINDEX_INVALID;
887 
888  CNTV2Card dev;
889  if (!inDevSpec.empty())
890  dev.Open(inDevSpec);
891 
892  // If a device was specifed, look for the first name-matching format it supports...
893  NTV2TCIndex tcNdx(iter->second);
895  while (dev.IsOpen() && !dev.features().CanDoInputSource(tcInpSrc))
896  {
897  if (++iter == gString2TCIndexMap.end())
898  return NTV2_TCINDEX_INVALID;
899  if (inStr != iter->first)
900  return NTV2_TCINDEX_INVALID;
901  tcNdx = iter->second;
902  tcInpSrc = ::NTV2TimecodeIndexToInputSource(tcNdx);
903  }
904  if ((inKinds & TC_INDEXES_ALL) == TC_INDEXES_ALL)
905  return tcNdx;
907  return tcNdx;
908  if (inKinds & TC_INDEXES_ANALOG && NTV2_IS_ANALOG_TIMECODE_INDEX(tcNdx))
909  return tcNdx;
910  if (inKinds & TC_INDEXES_ATCLTC && NTV2_IS_ATC_LTC_TIMECODE_INDEX(tcNdx))
911  return tcNdx;
912  if (inKinds & TC_INDEXES_VITC1 && NTV2_IS_ATC_VITC1_TIMECODE_INDEX(tcNdx))
913  return tcNdx;
914  if (inKinds & TC_INDEXES_VITC2 && NTV2_IS_ATC_VITC2_TIMECODE_INDEX(tcNdx))
915  return tcNdx;
916  return NTV2_TCINDEX_INVALID;
917 }
918 
919 
920 string CNTV2DemoCommon::GetAudioSystemStrings (const string inDeviceSpecifier)
921 {
922  CNTV2Card device;
923  string displayName;
924  ostringstream oss;
925 
926  if (!inDeviceSpecifier.empty())
927  {
928  CNTV2DeviceScanner::GetFirstDeviceFromArgument (inDeviceSpecifier, device);
929  if (device.IsOpen())
930  displayName = device.GetDisplayName();
931  }
932 
933  const UWord numAudioSystems (device.features().GetNumAudioSystems());
934  oss << setw(12) << left << "Audio System" << endl
935  << setw(12) << left << "------------" << endl;
936  for (UWord ndx(0); ndx < 8; ndx++)
937  {
938  oss << setw(12) << left << (ndx+1);
939  if (!displayName.empty() && ndx >= numAudioSystems)
940  oss << "\t## Incompatible with " << displayName;
941  oss << endl;
942  }
943  return oss.str();
944 }
945 
946 
948 {
950  return iter != gString2AudioSystemMap.end() ? iter->second : NTV2_AUDIOSYSTEM_INVALID;
951 }
952 
954 {
955  typedef map<string,string> NTV2StringMap;
956  NTV2StringSet keys;
957  for (String2VANCModeMapConstIter it(gString2VANCModeMap.begin()); it != gString2VANCModeMap.end(); ++it)
958  {
959  const string val(aja::to_string(it->second));
960  if (keys.find(val) == keys.end())
961  keys.insert(val);
962  }
963 
964  NTV2StringMap legals;
965  for (NTV2StringSet::const_iterator kit(keys.begin()); kit != keys.end(); ++kit)
966  {
967  NTV2VANCMode officialVM(NTV2VANCMode(aja::stoul(*kit)));
968  NTV2StringList legalValues;
969  for (String2VANCModeMapConstIter it(gString2VANCModeMap.begin()); it != gString2VANCModeMap.end(); ++it)
970  if (it->second == officialVM)
971  legalValues.push_back(it->first);
972  legals[aja::to_string(officialVM)] = aja::join(legalValues, ", ");
973  }
974 
975  ostringstream oss;
976  oss << setw(12) << left << "VANC Mode" << "\t" << setw(32) << left << "Legal --vanc Values " << endl
977  << setw(12) << left << "---------" << "\t" << setw(32) << left << "--------------------------------" << endl;
978  for (NTV2StringMap::const_iterator it(legals.begin()); it != legals.end(); ++it)
979  oss << setw(12) << left << it->first << "\t" << setw(32) << left << it->second << endl;
980  return oss.str();
981 }
982 
983 
985 {
987  return iter != gString2VANCModeMap.end() ? iter->second : NTV2_VANCMODE_INVALID;
988 }
989 
990 
992 {
993  typedef map<string,string> NTV2StringMap;
994  NTV2StringSet keys;
995  for (String2TPNamesMapConstIter it(gString2TPNamesMap.begin()); it != gString2TPNamesMap.end(); ++it)
996  if (keys.find(it->second) == keys.end())
997  keys.insert(it->second);
998 
999  NTV2StringMap legals;
1000  for (NTV2StringSet::const_iterator kit(keys.begin()); kit != keys.end(); ++kit)
1001  {
1002  const string & officialPatName(*kit);
1003  NTV2StringList legalValues;
1004  for (String2TPNamesMapConstIter it(gString2TPNamesMap.begin()); it != gString2TPNamesMap.end(); ++it)
1005  if (it->second == officialPatName)
1006  legalValues.push_back(it->first);
1007  legals[officialPatName] = aja::join(legalValues, ", ");
1008  }
1009 
1010  ostringstream oss;
1011  oss << setw(25) << left << "Test Pattern or Color " << "\t" << setw(22) << left << "Legal --pattern Values" << endl
1012  << setw(25) << left << "------------------------" << "\t" << setw(22) << left << "----------------------" << endl;
1013  for (NTV2StringMap::const_iterator it(legals.begin()); it != legals.end(); ++it)
1014  oss << setw(25) << left << it->first << "\t" << setw(22) << left << it->second << endl;
1015  return oss.str();
1016 }
1017 
1018 
1020 {
1021  string tpName(inStr);
1022  aja::lower(aja::strip(aja::replace(tpName, " ", "")));
1024  return (it != gString2TPNamesMap.end()) ? it->second : "";
1025 }
1026 
1027 
1028 string CNTV2DemoCommon::ToLower (const string & inStr)
1029 {
1030  string result(inStr);
1031  return aja::lower(result);
1032 }
1033 
1034 
1035 string CNTV2DemoCommon::StripFormatString (const std::string & inStr)
1036 {
1037  string result (inStr);
1038  while (result.find (" ") != string::npos)
1039  result.erase (result.find (" "), 1);
1040  while (result.find ("00") != string::npos)
1041  result.erase (result.find ("00"), 2);
1042  while (result.find (".") != string::npos)
1043  result.erase (result.find ("."), 1);
1044  return result;
1045 }
1046 
1047 
1049 {
1050  char result (0);
1051  #if defined (AJAMac) || defined (AJALinux)
1052  struct termios terminalStatus;
1053  ::memset (&terminalStatus, 0, sizeof (terminalStatus));
1054  if (::tcgetattr (0, &terminalStatus) < 0)
1055  cerr << "tcsetattr()";
1056  terminalStatus.c_lflag &= ~uint32_t(ICANON);
1057  terminalStatus.c_lflag &= ~uint32_t(ECHO);
1058  terminalStatus.c_cc[VMIN] = 1;
1059  terminalStatus.c_cc[VTIME] = 0;
1060  if (::tcsetattr (0, TCSANOW, &terminalStatus) < 0)
1061  cerr << "tcsetattr ICANON";
1062  if (::read (0, &result, 1) < 0)
1063  cerr << "read()" << endl;
1064  terminalStatus.c_lflag |= ICANON;
1065  terminalStatus.c_lflag |= ECHO;
1066  if (::tcsetattr (0, TCSADRAIN, &terminalStatus) < 0)
1067  cerr << "tcsetattr ~ICANON" << endl;
1068  #elif defined (MSWindows) || defined (AJAWindows)
1069  HANDLE hdl (GetStdHandle (STD_INPUT_HANDLE));
1070  DWORD nEvents (0);
1071  INPUT_RECORD buffer;
1072  PeekConsoleInput (hdl, &buffer, 1, &nEvents);
1073  if (nEvents > 0)
1074  {
1075  ReadConsoleInput (hdl, &buffer, 1, &nEvents);
1076  result = char (buffer.Event.KeyEvent.wVirtualKeyCode);
1077  }
1078  #endif
1079  return result;
1080 }
1081 
1082 
1084 {
1085  cout << "## Press Enter/Return key to exit: ";
1086  cout.flush();
1087  cin.get();
1088 }
1089 
1090 
1092 {
1094  switch (inFrameRate)
1095  {
1096  case NTV2_FRAMERATE_6000: result = kTCFormat60fps; break;
1097  case NTV2_FRAMERATE_5994: result = kTCFormat60fpsDF; break;
1098  case NTV2_FRAMERATE_4800: result = kTCFormat48fps; break;
1099  case NTV2_FRAMERATE_4795: result = kTCFormat48fps; break;
1100  case NTV2_FRAMERATE_3000: result = kTCFormat30fps; break;
1101  case NTV2_FRAMERATE_2997: result = kTCFormat30fpsDF; break;
1102  case NTV2_FRAMERATE_2500: result = kTCFormat25fps; break;
1103  case NTV2_FRAMERATE_2400: result = kTCFormat24fps; break;
1104  case NTV2_FRAMERATE_2398: result = kTCFormat24fps; break;
1105  case NTV2_FRAMERATE_5000: result = kTCFormat50fps; break;
1106  default: break;
1107  }
1108  return result;
1109 
1110 } // NTV2FrameRate2TimecodeFormat
1111 
1112 
1114 {
1115  switch (inFrameRate)
1116  {
1119 #if !defined(NTV2_DEPRECATE_16_0)
1124 #endif
1125  case NTV2_FRAMERATE_5000: return AJA_FrameRate_5000;
1137 
1138  case NTV2_NUM_FRAMERATES:
1139  case NTV2_FRAMERATE_UNKNOWN: break;
1140  }
1141  return AJA_FrameRate_Unknown;
1142 } // GetAJAFrameRate
1143 
1144 
1146 {
1147  switch (inFormat)
1148  {
1151  case NTV2_FBF_ARGB: return AJA_PixelFormat_ARGB8;
1152  case NTV2_FBF_RGBA: return AJA_PixelFormat_RGBA8;
1155  case NTV2_FBF_ABGR: return AJA_PixelFormat_ABGR8;
1169 
1174 
1179 
1182  case NTV2_FBF_10BIT_ARGB:
1183  case NTV2_FBF_16BIT_ARGB:
1184  case NTV2_FBF_INVALID: break;
1185  }
1186  return AJA_PixelFormat_Unknown;
1187 } // GetAJAPixelFormat
1188 
1189 
1191 {
1192  static struct VideoFormatPair
1193  {
1194  NTV2VideoFormat vIn;
1195  NTV2VideoFormat vOut;
1196  } VideoFormatPairs[] = { // vIn vOut
1215 
1219 
1223  };
1224  for (size_t formatNdx(0); formatNdx < sizeof(VideoFormatPairs) / sizeof(VideoFormatPair); formatNdx++)
1225  if (VideoFormatPairs[formatNdx].vIn == inOutVideoFormat)
1226  {
1227  inOutVideoFormat = VideoFormatPairs[formatNdx].vOut;
1228  return true;
1229  }
1230  return false;
1231 
1232 } // get4KInputFormat
1233 
1235 {
1236  static struct VideoFormatPair
1237  {
1238  NTV2VideoFormat vIn;
1239  NTV2VideoFormat vOut;
1240  } VideoFormatPairs[] = { // vIn vOut
1267  };
1268  for (size_t formatNdx(0); formatNdx < sizeof(VideoFormatPairs) / sizeof(VideoFormatPair); formatNdx++)
1269  if (VideoFormatPairs[formatNdx].vIn == inOutVideoFormat)
1270  {
1271  inOutVideoFormat = VideoFormatPairs[formatNdx].vOut;
1272  return true;
1273  }
1274  return false;
1275 
1276 } // get8KInputFormat
1277 
1278 
1280 {
1281  return gGlobalMutexName.c_str();
1282 }
1283 
1285 {
1286  UWord totFrameStores(inDevice.features().GetNumFrameStores());
1287  UWord totTSIMuxers(inDevice.features().GetNumTSIMuxers());
1288  UWord firstFramestoreIndex = UWord(::GetIndexForNTV2Channel(in1stFrameStore));
1289  UWord tsiMux(firstFramestoreIndex);
1290  NTV2ChannelList result;
1291  if (totFrameStores > totTSIMuxers)
1292  tsiMux = firstFramestoreIndex/2;
1293  else if (totFrameStores < totTSIMuxers)
1294  tsiMux = firstFramestoreIndex*2;
1295  for (UWord num(0); num < inCount; num++)
1296  result.push_back(NTV2Channel(tsiMux + num));
1297  return result;
1298 }
1299 
1300 
1302  const CaptureConfig & inConfig,
1303  const bool isInputRGB)
1304 {
1305  const bool isFrameRGB (::IsRGBFormat(inConfig.fPixelFormat));
1307  const NTV2OutputXptID inputOXpt (::GetInputSourceOutputXpt(inConfig.fInputSource, false, isInputRGB));
1308  const NTV2InputXptID cscVidIXpt (::GetCSCInputXptFromChannel(inConfig.fInputChannel));
1309  NTV2OutputXptID cscOXpt (::GetCSCOutputXptFromChannel(inConfig.fInputChannel, /*key?*/false, /*RGB?*/isFrameRGB));
1310 
1311  conns.clear();
1312  if (isInputRGB && !isFrameRGB)
1313  {
1314  conns.insert(NTV2Connection(fbIXpt, cscOXpt)); // FB <== CSC
1315  conns.insert(NTV2Connection(cscVidIXpt, inputOXpt)); // CSC <== SDIIn/HDMIin
1316  }
1317  else if (!isInputRGB && isFrameRGB)
1318  {
1319  conns.insert(NTV2Connection(fbIXpt, cscOXpt)); // FB <== CSC
1320  conns.insert(NTV2Connection(cscVidIXpt, inputOXpt)); // CSC <== SDIIn/HDMIIn
1321  }
1322  else
1323  conns.insert(NTV2Connection(fbIXpt, inputOXpt)); // FB <== SDIIn/HDMIin
1324 
1325  return !conns.empty();
1326 
1327 } // GetRoutingCapture
1328 
1329 
1331  const CaptureConfig & inConfig,
1332  const NTV2DeviceID devID,
1333  const bool isInputRGB)
1334 {
1335  UWord sdi(0), mux(0), csc(0), fb(0), path(0);
1338  const bool isFrameRGB (::IsRGBFormat(inConfig.fPixelFormat));
1339  conns.clear();
1341  { // HDMI
1342  if (inConfig.fInputChannel == NTV2_CHANNEL1)
1343  { // HDMI CH1234
1344  if (isInputRGB == isFrameRGB)
1345  { // HDMI CH1234 RGB SIGNAL AND RGB FBF OR YUV SIGNAL AND YUV FBF
1346  for (path = 0; path < 4; path++)
1347  { // MUX <== HDMIIn
1348  in = ::GetTSIMuxInputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1);
1349  out = ::GetInputSourceOutputXpt(inConfig.fInputSource, /*DS2*/false, isInputRGB, /*quadrant*/path);
1350  conns.insert(NTV2Connection(in, out));
1351  // FB <== MUX
1352  in = ::GetFrameStoreInputXptFromChannel(NTV2Channel(fb+path/2), /*Binput*/path & 1);
1353  out = ::GetTSIMuxOutputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1, /*RGB*/isInputRGB);
1354  conns.insert(NTV2Connection(in, out));
1355  }
1356  } // HDMI CH1234 RGB SIGNAL AND RGB FBF
1357  else if (isInputRGB && !isFrameRGB)
1358  { // HDMI CH1234 RGB SIGNAL AND YUV FBF
1359  for (path = 0; path < 4; path++)
1360  {
1361  // CSC <== HDMIIn
1362  in = ::GetCSCInputXptFromChannel(NTV2Channel(csc+path));
1363  out = ::GetInputSourceOutputXpt(inConfig.fInputSource, /*DS2*/false, isInputRGB, /*quadrant*/path);
1364  conns.insert(NTV2Connection(in, out));
1365  // MUX <== CSC
1366  in = ::GetTSIMuxInputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1);
1367  out = ::GetCSCOutputXptFromChannel(NTV2Channel(csc+path), /*key*/false, /*rgb*/isFrameRGB);
1368  conns.insert(NTV2Connection(in, out));
1369  // FB <== MUX
1370  in = ::GetFrameStoreInputXptFromChannel(NTV2Channel(fb+path/2), /*DS2*/path & 1);
1371  out = ::GetTSIMuxOutputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1, /*rgb*/isFrameRGB);
1372  conns.insert(NTV2Connection(in, out));
1373  }
1374  } // HDMI CH1234 RGB SIGNAL AND YUV FBF
1375  else // !isInputRGB && isFrameRGB
1376  { // HDMI CH1234 YUV SIGNAL AND RGB FBF
1377  for (path = 0; path < 4; path++)
1378  {
1379  // CSC <== HDMIIn
1380  in = ::GetCSCInputXptFromChannel(NTV2Channel(csc+path));
1381  out = ::GetInputSourceOutputXpt(inConfig.fInputSource, /*DS2*/false, isInputRGB, /*quadrant*/path);
1382  conns.insert(NTV2Connection(in, out));
1383  // MUX <== CSC
1384  in = ::GetTSIMuxInputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1);
1385  out = ::GetCSCOutputXptFromChannel(NTV2Channel(csc+path), /*key*/false, /*rgb*/isFrameRGB);
1386  conns.insert(NTV2Connection(in, out));
1387  // FB <== MUX
1388  in = ::GetFrameStoreInputXptFromChannel(NTV2Channel(fb+path/2), /*DS2*/path & 1);
1389  out = ::GetTSIMuxOutputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1, /*rgb*/isFrameRGB);
1390  conns.insert(NTV2Connection(in, out));
1391  }
1392  } // HDMI CH1234 YUV SIGNAL AND RGB FBF
1393  } // HDMI CH1234
1394  else
1395  { // HDMI CH5678
1396  cerr << "## ERROR: Ch5678 must be for Corvid88, but no HDMI on that device" << endl;
1397  } // HDMI CH5678
1398  } // HDMI
1399  else
1400  { // SDI
1401  if (::NTV2DeviceCanDo12gRouting(devID))
1402  { // FB <== SDIIn
1404  out = ::GetInputSourceOutputXpt(inConfig.fInputSource);
1405  conns.insert(NTV2Connection(in, out));
1406  }
1407  else
1408  { // SDI CH1234 or CH5678
1409  if (inConfig.fInputChannel != NTV2_CHANNEL1)
1410  {fb = 4; sdi = fb; mux = fb / 2; csc = fb;}
1411  if (isFrameRGB)
1412  { // RGB FB
1413  if (inConfig.fDoTSIRouting)
1414  { // SDI CH1234 RGB TSI
1415  for (path = 0; path < 4; path++)
1416  {
1417  // CSC <== SDIIn
1418  in = ::GetCSCInputXptFromChannel(NTV2Channel(csc+path));
1420  conns.insert(NTV2Connection(in, out));
1421  // MUX <== CSC
1422  in = ::GetTSIMuxInputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1);
1423  out = ::GetCSCOutputXptFromChannel(NTV2Channel(csc+path), /*key*/false, /*rgb*/isFrameRGB);
1424  conns.insert(NTV2Connection(in, out));
1425  // FB <== MUX
1426  in = ::GetFrameStoreInputXptFromChannel(NTV2Channel(fb+path/2), /*DS2*/path & 1);
1427  out = ::GetTSIMuxOutputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1, /*rgb*/isFrameRGB);
1428  conns.insert(NTV2Connection(in, out));
1429  } // for each spigot
1430  } // SDI CH1234 RGB TSI
1431  else
1432  { // SDI CH1234 RGB SQUARES
1433  for (path = 0; path < 4; path++)
1434  {
1435  // CSC <== SDIIn
1436  in = ::GetCSCInputXptFromChannel(NTV2Channel(csc+path));
1438  conns.insert(NTV2Connection(in, out));
1439  // FB <== CSC
1441  out = ::GetCSCOutputXptFromChannel(NTV2Channel(csc+path), /*key*/false, /*rgb*/isFrameRGB);
1442  conns.insert(NTV2Connection(in, out));
1443  } // for each spigot
1444  } // SDI CH1234 RGB SQUARES
1445  } // SDI CH1234 RGB FBF
1446  else // YUV FBF
1447  {
1448  if (inConfig.fDoTSIRouting)
1449  { // SDI CH1234 YUV TSI
1450  for (path = 0; path < 4; path++)
1451  {
1452  // MUX <== SDIIn
1453  in = ::GetTSIMuxInputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1);
1455  conns.insert(NTV2Connection(in, out));
1456  // FB <== MUX
1457  in = ::GetFrameStoreInputXptFromChannel(NTV2Channel(fb+path/2), /*DS2*/path & 1);
1458  out = ::GetTSIMuxOutputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1, /*rgb*/isFrameRGB);
1459  conns.insert(NTV2Connection(in, out));
1460  } // for each spigot
1461  } // SDI CH1234 YUV TSI
1462  else
1463  {
1464  for (path = 0; path < 4; path++)
1465  { // FB <== SDIIn
1468  conns.insert(NTV2Connection(in, out));
1469  } // for each path
1470  } // SDI CH1234 YUV SQUARES
1471  } // YUV FBF
1472  } // 3G SDI CH1234 or CH5678
1473  } // SDI
1474  return !conns.empty();
1475 } // GetRoutingCapture4K
1476 
1477 
1479  const CaptureConfig & inConfig,
1480  const NTV2VideoFormat inVideoFormat,
1481  const NTV2DeviceID devID,
1482  const bool isInputRGB)
1483 { (void)isInputRGB; (void) devID;
1484  UWord fb(0), path(0);
1487  const bool isFrameRGB (::IsRGBFormat(inConfig.fPixelFormat));
1488  const bool isQuadQuadHFR (NTV2_IS_QUAD_QUAD_HFR_VIDEO_FORMAT(inVideoFormat));
1489  conns.clear();
1490  if (inConfig.fInputChannel % 2)
1491  return false; // Input channel cannot be Ch2/Ch4/Ch6/etc
1492  if (inConfig.fInputChannel > 3)
1493  return false; // Input channel cannot be Ch5 or greater
1494  if (::NTV2InputSourceToChannel(inConfig.fInputSource) % 2)
1495  return false; // Input source cannot be SDIIn2/4/6/etc
1496  if (::NTV2InputSourceToChannel(inConfig.fInputSource) > 3)
1497  return false; // Input source cannot be SDIIn5 or greater
1498 
1499  if (inConfig.fDoTSIRouting)
1500  { // TSI
1501  if (inConfig.fInputChannel)
1502  fb = 2;
1503  for (path = 0; path < 4; path++)
1504  if (isFrameRGB) // Uses 2 FBs, 4 SDIs
1505  { // RGB
1506  // DLInDS1 <== SDIInDS1
1507  in = ::GetDLInInputXptFromChannel (NTV2Channel(path), /*B*/false);
1508  out = ::GetSDIInputOutputXptFromChannel (NTV2Channel(path), /*DS2*/false);
1509  conns.insert(NTV2Connection(in, out));
1510  // DLInDS2 <== SDIInDS2
1511  in = ::GetDLInInputXptFromChannel (NTV2Channel(path), /*B*/true);
1512  out = ::GetSDIInputOutputXptFromChannel (NTV2Channel(path), /*DS2*/true);
1513  conns.insert(NTV2Connection(in, out));
1514  // FB <== DLIn
1515  in = ::GetFrameStoreInputXptFromChannel (NTV2Channel(fb+path/2), /*B*/path & 1);
1517  conns.insert(NTV2Connection(in, out));
1518  } // if RGB
1519  else if (isQuadQuadHFR) // Uses 2 FBs, 4 SDIs
1520  { // FB <== SDIIn, FBDS2 <== SDIIn
1521  in = ::GetFrameStoreInputXptFromChannel (NTV2Channel(fb+path/2), /*DS2?*/path & 1);
1523  conns.insert(NTV2Connection(in, out));
1524  } // else if YUV QuadQuad
1525  else // Uses 2 FBs, 2 SDIs
1526  { // FB <== SDIIn, FBDS2 <== SDIInDS2
1527  in = ::GetFrameStoreInputXptFromChannel (NTV2Channel(fb+path/2), /*DS2?*/path & 1);
1528  out = ::GetSDIInputOutputXptFromChannel (NTV2Channel(fb+path/2), /*DS2?*/path & 1);
1529  conns.insert(NTV2Connection(in, out));
1530  } // else YUV non-QuadQuad
1531  } // if TSI
1532  else
1533  { // Square-division routing
1534  if (inConfig.fInputChannel)
1535  return false; // Sorry, Ch1 only
1536  if (inConfig.fInputSource != NTV2_INPUTSOURCE_SDI1)
1537  return false; // Sorry, SDI1 only (1st SDI of 4 links)
1538  for (path = 0; path < 4; path++) // 4 FBs, 4 SDIs
1539  if (isFrameRGB)
1540  { // RGB
1541  // DLInDS1 <== SDIInDS1
1542  in = ::GetDLInInputXptFromChannel (NTV2Channel(path), /*B*/false);
1543  out = ::GetSDIInputOutputXptFromChannel (NTV2Channel(path), /*DS2*/false);
1544  conns.insert(NTV2Connection(in, out));
1545  // DLInDS2 <== SDIInDS2
1546  in = ::GetDLInInputXptFromChannel (NTV2Channel(path), /*B*/true);
1547  out = ::GetSDIInputOutputXptFromChannel (NTV2Channel(path), /*DS2*/true);
1548  conns.insert(NTV2Connection(in, out));
1549  // FB <== DLIn
1552  conns.insert(NTV2Connection(in, out));
1553  } // for each path
1554  else // YUV
1555  { // FB <== SDIIn
1558  conns.insert(NTV2Connection(in, out));
1559  } // for each path
1560  } // else Squares
1561  return !conns.empty();
1562 } // GetInputRouting8K
1563 
1564 
1565 bool CNTV2DemoCommon::ConfigureAudioSystems (CNTV2Card & inDevice, const CaptureConfig & inConfig, const NTV2AudioSystemSet inAudioSystems)
1566 {
1567  UWord failures(0);
1568  UWord numAudChannels(inDevice.features().GetMaxAudioChannels());
1569  for (NTV2AudioSystemSetConstIter it(inAudioSystems.begin()); it != inAudioSystems.end(); ++it)
1570  { const NTV2AudioSystem audSys(*it);
1571  // Have the audio system capture audio from the designated device input...
1572  if (!inDevice.SetAudioSystemInputSource (audSys, NTV2_AUDIO_EMBEDDED,
1574  failures++;
1575 
1576  // Configure for max available audio channels, 48KHz, 4MB buffers, and disable loopback...
1577  if (!inDevice.SetNumberAudioChannels (numAudChannels, audSys)) failures++;
1578  if (!inDevice.SetAudioRate (NTV2_AUDIO_48K, audSys)) failures++;
1579  if (!inDevice.SetAudioBufferSize (NTV2_AUDIO_BUFFER_SIZE_4MB, audSys)) failures++;
1580  if (!inDevice.SetAudioLoopBack(NTV2_AUDIO_LOOPBACK_OFF, audSys)) failures++;
1581  }
1582  return !failures;
1583 }
1584 
1585 
1587 {
1588  const size_t hwPageSizeBytes (NTV2Buffer::HostPageSize());
1589  const size_t sdkPageSizeBytes (NTV2Buffer::DefaultPageSize());
1590  if (hwPageSizeBytes != sdkPageSizeBytes)
1591  {
1592  if (NTV2Buffer::SetDefaultPageSize(hwPageSizeBytes))
1593  cerr << "## NOTE: Page size changed from " << DEC(sdkPageSizeBytes/1024) << "K to " << DEC(hwPageSizeBytes/1024) << "K" << endl;
1594  else
1595  cerr << "## WARNING: Failed to change page size from " << DEC(sdkPageSizeBytes/1024) << "K to " << DEC(hwPageSizeBytes/1024) << "K" << endl;
1596  }
1597  return hwPageSizeBytes;
1598 }
1599 
1600 
1601 CNTV2DemoCommon::Popt::Popt (const int inArgc, const char ** pArgs, const PoptOpts * pInOptionsTable)
1602 {
1603  mContext = ::poptGetContext(AJA_NULL, inArgc, pArgs, pInOptionsTable, 0);
1604  mResult = ::poptGetNextOpt(mContext);
1605  if (mResult < -1)
1606  { ostringstream oss;
1607  oss << ::poptBadOption(mContext, 0) << ": " << ::poptStrerror(mResult);
1608  mError = oss.str();
1609  }
1610  else
1611  {
1612  const char * pStr (::poptGetArg(mContext));
1613  while (pStr)
1614  {
1615  mOtherArgs.push_back(string(pStr)); // Append to file list
1616  pStr = ::poptGetArg(mContext);
1617  } // for each additional positional argument
1618  }
1619 }
1620 
1622 {
1623  mContext = ::poptFreeContext(mContext);
1624 }
1625 
1626 
1628 {
1629  typedef struct {string fName; NTV2VideoFormat fFormat;} FormatNameDictionary;
1630  static const FormatNameDictionary sVFmtDict[] = {
1631  {"1080i50", NTV2_FORMAT_1080i_5000},
1632  {"1080i", NTV2_FORMAT_1080i_5994},
1633  {"1080i5994", NTV2_FORMAT_1080i_5994},
1634  {"hd", NTV2_FORMAT_1080i_5994},
1635  {"1080i60", NTV2_FORMAT_1080i_6000},
1636  {"720p", NTV2_FORMAT_720p_5994},
1637  {"720p5994", NTV2_FORMAT_720p_5994},
1638  {"720p60", NTV2_FORMAT_720p_6000},
1639  {"1080psf2398", NTV2_FORMAT_1080psf_2398},
1640  {"1080psf24", NTV2_FORMAT_1080psf_2400},
1641  {"1080p2997", NTV2_FORMAT_1080p_2997},
1642  {"1080p30", NTV2_FORMAT_1080p_3000},
1643  {"1080p25", NTV2_FORMAT_1080p_2500},
1644  {"1080p2398", NTV2_FORMAT_1080p_2398},
1645  {"1080p24", NTV2_FORMAT_1080p_2400},
1646  {"2048x1080p2398", NTV2_FORMAT_1080p_2K_2398},
1647  {"2048x1080p24", NTV2_FORMAT_1080p_2K_2400},
1648  {"2048x1080psf2398", NTV2_FORMAT_1080psf_2K_2398},
1649  {"2048x1080psf24", NTV2_FORMAT_1080psf_2K_2400},
1650  {"720p50", NTV2_FORMAT_720p_5000},
1651  {"1080p50b", NTV2_FORMAT_1080p_5000_B},
1652  {"1080p", NTV2_FORMAT_1080p_5994_B},
1653  {"1080p5994b", NTV2_FORMAT_1080p_5994_B},
1654  {"1080p60b", NTV2_FORMAT_1080p_6000_B},
1655  {"720p2398", NTV2_FORMAT_720p_2398},
1656  {"720p25", NTV2_FORMAT_720p_2500},
1657  {"1080p50", NTV2_FORMAT_1080p_5000_A},
1658  {"1080p5994", NTV2_FORMAT_1080p_5994_A},
1659  {"1080p60", NTV2_FORMAT_1080p_6000_A},
1660  {"2048x1080p25", NTV2_FORMAT_1080p_2K_2500},
1661  {"2048x1080psf25", NTV2_FORMAT_1080psf_2K_2500},
1662  {"1080psf25", NTV2_FORMAT_1080psf_2500_2},
1663  {"1080psf2997", NTV2_FORMAT_1080psf_2997_2},
1664  {"1080psf30", NTV2_FORMAT_1080psf_3000_2},
1665  {"525i", NTV2_FORMAT_525_5994},
1666  {"525i2997", NTV2_FORMAT_525_5994},
1667  {"sd", NTV2_FORMAT_525_5994},
1668  {"625i", NTV2_FORMAT_625_5000},
1669  {"625i25", NTV2_FORMAT_625_5000},
1670  {"525i2398", NTV2_FORMAT_525_2398},
1671  {"525i24", NTV2_FORMAT_525_2400},
1672  {"525psf2997", NTV2_FORMAT_525psf_2997},
1673  {"625psf25", NTV2_FORMAT_625psf_2500},
1674  {"2048x1556psf1498", NTV2_FORMAT_2K_1498},
1675  {"2048x1556psf15", NTV2_FORMAT_2K_1500},
1676  {"2048x1556psf2398", NTV2_FORMAT_2K_2398},
1677  {"2048x1556psf24", NTV2_FORMAT_2K_2400},
1678  {"2048x1556psf25", NTV2_FORMAT_2K_2500},
1679  {"4x1920x1080psf2398", NTV2_FORMAT_4x1920x1080psf_2398},
1680  {"4x1920x1080psf24", NTV2_FORMAT_4x1920x1080psf_2400},
1681  {"4x1920x1080psf25", NTV2_FORMAT_4x1920x1080psf_2500},
1682  {"4x1920x1080p2398", NTV2_FORMAT_4x1920x1080p_2398},
1683  {"uhd2398", NTV2_FORMAT_4x1920x1080p_2398},
1684  {"4x1920x1080p24", NTV2_FORMAT_4x1920x1080p_2400},
1685  {"uhd24", NTV2_FORMAT_4x1920x1080p_2400},
1686  {"4x1920x1080p25", NTV2_FORMAT_4x1920x1080p_2500},
1687  {"uhd25", NTV2_FORMAT_4x1920x1080p_2500},
1688  {"4x2048x1080psf2398", NTV2_FORMAT_4x2048x1080psf_2398},
1689  {"4x2048x1080psf24", NTV2_FORMAT_4x2048x1080psf_2400},
1690  {"4x2048x1080psf25", NTV2_FORMAT_4x2048x1080psf_2500},
1691  {"4k2398", NTV2_FORMAT_4x2048x1080p_2398},
1692  {"4x2048x1080p2398", NTV2_FORMAT_4x2048x1080p_2398},
1694  {"4x2048x1080p24", NTV2_FORMAT_4x2048x1080p_2400},
1696  {"4x2048x1080p25", NTV2_FORMAT_4x2048x1080p_2500},
1697  {"4x1920x1080p2997", NTV2_FORMAT_4x1920x1080p_2997},
1698  {"4x1920x1080p30", NTV2_FORMAT_4x1920x1080p_3000},
1699  {"4x1920x1080psf2997", NTV2_FORMAT_4x1920x1080psf_2997},
1700  {"4x1920x1080psf30", NTV2_FORMAT_4x1920x1080psf_3000},
1701  {"4x2048x1080p2997", NTV2_FORMAT_4x2048x1080p_2997},
1702  {"4x2048x1080p30", NTV2_FORMAT_4x2048x1080p_3000},
1703  {"4x2048x1080psf2997", NTV2_FORMAT_4x2048x1080psf_2997},
1704  {"4x2048x1080psf30", NTV2_FORMAT_4x2048x1080psf_3000},
1705  {"4x1920x1080p50", NTV2_FORMAT_4x1920x1080p_5000},
1706  {"uhd50", NTV2_FORMAT_4x1920x1080p_5000},
1707  {"4x1920x1080p5994", NTV2_FORMAT_4x1920x1080p_5994},
1708  {"uhd5994", NTV2_FORMAT_4x1920x1080p_5994},
1709  {"4x1920x1080p60", NTV2_FORMAT_4x1920x1080p_6000},
1711  {"uhd60", NTV2_FORMAT_4x1920x1080p_6000},
1713  {"4x2048x1080p50", NTV2_FORMAT_4x2048x1080p_5000},
1714  {"4k5994", NTV2_FORMAT_4x2048x1080p_5994},
1715  {"4x2048x1080p5994", NTV2_FORMAT_4x2048x1080p_5994},
1718  {"4x2048x1080p60", NTV2_FORMAT_4x2048x1080p_6000},
1719  {"4k4795", NTV2_FORMAT_4x2048x1080p_4795},
1720  {"4x2048x1080p4795", NTV2_FORMAT_4x2048x1080p_4795},
1722  {"4x2048x1080p48", NTV2_FORMAT_4x2048x1080p_4800},
1723  {"4k11988", NTV2_FORMAT_4x2048x1080p_11988},
1724  {"4x2048x1080p11988", NTV2_FORMAT_4x2048x1080p_11988},
1725  {"4k120", NTV2_FORMAT_4x2048x1080p_12000},
1726  {"4x2048x1080p120", NTV2_FORMAT_4x2048x1080p_12000},
1727  {"2048x1080p60", NTV2_FORMAT_1080p_2K_6000_A},
1728  {"2048x1080p5994", NTV2_FORMAT_1080p_2K_5994_A},
1729  {"2048x1080p2997", NTV2_FORMAT_1080p_2K_2997},
1730  {"2048x1080p30", NTV2_FORMAT_1080p_2K_3000},
1731  {"2048x1080p50", NTV2_FORMAT_1080p_2K_5000_A},
1732  {"2048x1080p4795", NTV2_FORMAT_1080p_2K_4795_A},
1733  {"2048x1080p48", NTV2_FORMAT_1080p_2K_4800_A},
1734  {"2048x1080p60b", NTV2_FORMAT_1080p_2K_6000_B},
1735  {"2048x1080p5994b", NTV2_FORMAT_1080p_2K_5994_B},
1736  {"2048x1080p50b", NTV2_FORMAT_1080p_2K_5000_B},
1737  {"2048x1080p48b", NTV2_FORMAT_1080p_2K_4800_B},
1738  {"2048x1080p4795b", NTV2_FORMAT_1080p_2K_4795_B},
1739  {"", NTV2_FORMAT_UNKNOWN} };
1740  if (true)
1741  {
1742  // Dump the gString2VideoFormatMMap map...
1743  for (String2VideoFormatMMapCI it(gString2VideoFormatMMap.begin()); it != gString2VideoFormatMMap.end(); ++it)
1744  {
1745  cout << "'" << it->first << "'\t'" << ::NTV2VideoFormatToString(it->second) << "'\t" << ::NTV2VideoFormatString(it->second) << "\t" << DEC(it->second) << endl;
1746  }
1747  }
1748  cout << endl << endl;
1749  for (unsigned ndx(0); !sVFmtDict[ndx].fName.empty(); ndx++)
1750  {
1751  const string & str (sVFmtDict[ndx].fName);
1752  const NTV2VideoFormat vFormat (sVFmtDict[ndx].fFormat);
1754  const NTV2VideoFormat vFormat2 (it != gString2VideoFormatMMap.end() ? it->second : NTV2_FORMAT_UNKNOWN);
1755  if (vFormat != vFormat2)
1756  cerr << "'" << str << "': '" << ::NTV2VideoFormatString(vFormat) << "' (" << DEC(vFormat) << ") != '" << ::NTV2VideoFormatString(vFormat2) << "' (" << DEC(vFormat2) << ")" << endl;
1757  //SHOULD_BE_EQUAL(vFormat, vFormat2);
1758  }
1759  return true;
1760 }
1761 
1762 
1764 
1765 
1766 AJALabelValuePairs CaptureConfig::Get (const bool inCompact) const
1767 {
1768  AJALabelValuePairs result;
1769  AJASystemInfo::append (result, "Capture Config");
1770  AJASystemInfo::append (result, "Device Specifier", fDeviceSpec);
1771  AJASystemInfo::append (result, "Input Channel", ::NTV2ChannelToString(fInputChannel, inCompact));
1772  AJASystemInfo::append (result, "Input Source", ::NTV2InputSourceToString(fInputSource, inCompact));
1773  AJASystemInfo::append (result, "Pixel Format", ::NTV2FrameBufferFormatToString(fPixelFormat, inCompact));
1774  AJASystemInfo::append (result, "AutoCirc Frames", fFrames.toString());
1775  AJASystemInfo::append (result, "A/B Conversion", fDoABConversion ? "Y" : "N");
1776  AJASystemInfo::append (result, "MultiFormat Mode", fDoMultiFormat ? "Y" : "N");
1777  AJASystemInfo::append (result, "Capture Anc", fWithAnc ? "Y" : "N");
1778  AJASystemInfo::append (result, "Anc Capture File", fAncDataFilePath.empty() ? "---" : fAncDataFilePath);
1779  AJASystemInfo::append (result, "Capture Audio", fWithAudio ? "Y" : "N");
1780  AJASystemInfo::append (result, "Num Audio Links", aja::to_string(fNumAudioLinks));
1781  AJASystemInfo::append (result, "TSI Routing", fDoTSIRouting ? "Y" : "N");
1782  return result;
1783 }
1784 
1785 
1786 std::ostream & operator << (std::ostream & ioStrm, const CaptureConfig & inObj)
1787 {
1788  ioStrm << AJASystemInfo::ToString(inObj.Get());
1789  return ioStrm;
1790 }
1791 
1792 
1794 
1795 
1796 AJALabelValuePairs PlayerConfig::Get (const bool inCompact) const
1797 {
1798  AJALabelValuePairs result;
1799  AJASystemInfo::append (result, "NTV2Player Config");
1800  AJASystemInfo::append (result, "Device Specifier", fDeviceSpec);
1801  AJASystemInfo::append (result, "Video Format", ::NTV2VideoFormatToString(fVideoFormat));
1802  AJASystemInfo::append (result, "Pixel Format", ::NTV2FrameBufferFormatToString(fPixelFormat, inCompact));
1803  AJASystemInfo::append (result, "AutoCirc Frames", fFrames.toString());
1804  AJASystemInfo::append (result, "MultiFormat Mode", fDoMultiFormat ? "Y" : "N");
1805  AJASystemInfo::append (result, "VANC Mode", ::NTV2VANCModeToString(fVancMode));
1806  AJASystemInfo::append (result, "Output Channel", ::NTV2ChannelToString(fOutputChannel, inCompact));
1807  AJASystemInfo::append (result, "Output Connector", ::NTV2OutputDestinationToString(fOutputDest, inCompact));
1808  AJASystemInfo::append (result, "Anc Playback File", fAncDataFilePath.empty() ? "---" : fAncDataFilePath);
1809  AJASystemInfo::append (result, "Suppress Audio", fSuppressAudio ? "Y" : "N");
1810  AJASystemInfo::append (result, "Num Audio Links", aja::to_string(fNumAudioLinks));
1811  AJASystemInfo::append (result, "Suppress Video", fSuppressVideo ? "Y" : "N");
1812  AJASystemInfo::append (result, "Embedded Timecode", fTransmitLTC ? "LTC" : "VITC");
1813  AJASystemInfo::append (result, "Level Conversion", fDoABConversion ? "Y" : "N");
1814  AJASystemInfo::append (result, "HDMI Output", fDoHDMIOutput ? "Yes" : "No");
1815  AJASystemInfo::append (result, "RGB-On-SDI", fDoRGBOnWire ? "Yes" : "No");
1816  AJASystemInfo::append (result, "TSI Routing", fDoTsiRouting ? "Yes" : "No");
1817  AJASystemInfo::append (result, "6G/12G Output", fDoLinkGrouping ? "Yes" : "No");
1818  return result;
1819 }
1820 
1821 
1822 std::ostream & operator << (std::ostream & ioStrm, const PlayerConfig & inObj)
1823 {
1824  ioStrm << AJASystemInfo::ToString(inObj.Get());
1825  return ioStrm;
1826 }
1827 
1828 
1830 
1831 
1832 AJALabelValuePairs BurnConfig::Get (const bool inCompact) const
1833 {
1834  AJALabelValuePairs result;
1835  AJASystemInfo::append(result, "NTV2Burn Config");
1836  if (fDeviceSpec2.empty())
1837  AJASystemInfo::append(result, "Device Specifier", fDeviceSpec);
1838  else
1839  {
1840  AJASystemInfo::append(result, "Input Device", fDeviceSpec);
1841  AJASystemInfo::append(result, "Output Device", fDeviceSpec2);
1842  }
1843  AJASystemInfo::append(result, "Input Channel", ::NTV2ChannelToString(fInputChannel, inCompact));
1844  AJASystemInfo::append(result, "Output Channel", ::NTV2ChannelToString(fOutputChannel, inCompact));
1845  AJASystemInfo::append(result, "Input Source", ::NTV2InputSourceToString(fInputSource, inCompact));
1846  if (WithTimecode())
1847  AJASystemInfo::append(result, "Timecode Source", ::NTV2TCIndexToString(fTimecodeSource, inCompact));
1848  AJASystemInfo::append(result, "Output Destination", ::NTV2OutputDestinationToString(fOutputDest, inCompact));
1849  AJASystemInfo::append(result, "Pixel Format", ::NTV2FrameBufferFormatToString(fPixelFormat, inCompact));
1850  AJASystemInfo::append(result, "AC Input Frames", fInputFrames.toString());
1851  AJASystemInfo::append(result, "AC Output Frames", fOutputFrames.toString());
1852  AJASystemInfo::append(result, "Include Video", WithVideo() ? "Y" : "N");
1853  AJASystemInfo::append(result, "Include Audio", WithAudio() ? "Y" : "N");
1854  AJASystemInfo::append(result, "Include Anc", WithAnc() ? "Y" : "N");
1855  AJASystemInfo::append(result, "Include HANC", WithHanc() ? "Y" : "N");
1856  AJASystemInfo::append(result, "MultiFormat Mode", fDoMultiFormat ? "Y" : "N");
1857  AJASystemInfo::append(result, "Field Mode", FieldMode() ? "Y" : "N");
1858  AJASystemInfo::append(result, "Verbose Mode", IsVerbose() ? "Y" : "N");
1859  return result;
1860 }
NTV2Channel NTV2InputSourceToChannel(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Channel value.
Definition: ntv2utils.cpp:5050
pair< string, string > String2TPNamePair
String2PixelFormatMap::const_iterator String2PixelFormatMapConstIter
Fractional rate of 15,000 frames per 1,001 seconds.
Definition: ntv2enums.h:431
AJALabelValuePairs Get(const bool inCompact=(0)) const
Renders a human-readable representation of me.
std::set< NTV2VideoFormat > NTV2VideoFormatSet
A set of distinct NTV2VideoFormat values.
static std::string GetTestPatternNameFromString(const std::string &inStr)
static NTV2OutputDestinations gOutputDestinations
enum _NTV2TCIndexKinds NTV2TCIndexKinds
The invalid video input.
Definition: ntv2enums.h:1279
static NTV2TCIndexSet gTCIndexesVITC1
static String2TPNamesMap gString2TPNamesMap
const FRAME_STAMP & GetFrameInfo(void) const
Returns a constant reference to my FRAME_STAMP.
static const char * GetGlobalMutexName(void)
#define NTV2_IS_ATC_VITC1_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3991
std::set< NTV2FrameBufferFormat > NTV2FrameBufferFormatSet
A set of distinct NTV2FrameBufferFormat values.
String2VideoFormatMMap::const_iterator String2VideoFormatMMapCI
map< string, NTV2VANCMode > String2VANCModeMap
map< string, NTV2InputSource > String2InputSourceMap
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
Definition: ntv2enums.h:3898
std::set< NTV2TCIndex > NTV2TCIndexSet
A set of distinct NTV2TCIndex values.
map< string, NTV2FrameBufferFormat > String2PixelFormatMap
NTV2OutputDestinations::const_iterator NTV2OutputDestinationsConstIter
A handy const iterator for iterating over an NTV2OutputDestinations.
Specifies SDI input/output kinds.
Definition: ntv2enums.h:1294
std::set< NTV2TCIndex > NTV2TCIndexes
virtual bool SetAudioLoopBack(const NTV2AudioLoopBack inMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Enables or disables NTV2AudioLoopBack mode for the given NTV2AudioSystem.
Definition: ntv2audio.cpp:301
static NTV2TCIndexSet gTCIndexesAnalog
static NTV2VideoFormatSet GetSupportedVideoFormats(const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_SDHD)
defined(NTV2_DEPRECATE_18_1)
This identifies the invalid (unspecified, uninitialized) VANC mode.
Definition: ntv2enums.h:3805
static NTV2AudioSystem GetAudioSystemFromString(const std::string &inStr)
Returns the NTV2AudioSystem that matches the given string.
AJA_PixelFormat
Definition: videotypes.h:121
bool WithCustomAnc(void) const
bool CanDoPixelFormat(const NTV2PixelFormat inPF)
Same as DeviceCapabilities::CanDoFrameBufferFormat.
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
Definition: ntv2enums.h:221
#define NTV2_IS_ATC_LTC_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3996
10-Bit 4:2:2 2-Plane YCbCr
Definition: ntv2enums.h:254
NTV2OutputDestination
Identifies a specific video output destination.
Definition: ntv2enums.h:1326
#define NTV2_IS_QUAD_QUAD_HFR_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:828
See 10-Bit YCbCr Format.
Definition: ntv2enums.h:224
ULWord GetCapturedAudioByteCount(void) const
std::set< NTV2InputSource > NTV2InputSourceSet
A set of distinct NTV2InputSource values.
Apple ProRes DVC Pro.
Definition: ntv2enums.h:243
std::string NTV2OutputDestinationToString(const NTV2OutputDestination inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:7065
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
static bool SetDefaultPageSize(const size_t inNewSize)
Changes the default page size for use in future page-aligned allocations.
Identifies the 1st HDMI video input.
Definition: ntv2enums.h:1267
Fractional rate of 120,000 frames per 1,001 seconds.
Definition: ntv2enums.h:429
NTV2StringList::const_iterator NTV2StringListConstIter
#define NTV2_IS_FBF_PLANAR(__s__)
Definition: ntv2enums.h:269
ULWord GetIndexForNTV2Channel(const NTV2Channel inChannel)
Definition: ntv2utils.cpp:4705
Declares the NTV2TestPatternGen class.
static bool GetInputRouting8K(NTV2XptConnections &outConnections, const CaptureConfig &inConfig, const NTV2VideoFormat inVidFormat, const NTV2DeviceID inDevID=DEVICE_ID_INVALID, const bool isInputRGB=(0))
Answers with the crosspoint connections needed to implement the given 8K/UHD2 capture configuration...
static NTV2ChannelList GetTSIMuxesForFrameStore(CNTV2Card &inDevice, const NTV2Channel in1stFrameStore, const UWord inCount)
See 10-Bit Raw YCbCr (CION).
Definition: ntv2enums.h:250
static NTV2VideoFormat GetVideoFormatFromString(const std::string &inStr, const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_SDHD, const std::string &inDevSpec=std::string())
Returns the NTV2VideoFormat that matches the given string.
NTV2EmbeddedAudioInput NTV2InputSourceToEmbeddedAudioInput(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2EmbeddedAudioInput value.
Definition: ntv2utils.cpp:4880
NTV2InputSource NTV2ChannelToInputSource(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
Definition: ntv2utils.cpp:5135
multimap< string, NTV2VideoFormat > String2VideoFormatMMap
static std::string GetInputSourceStrings(const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL, const std::string inDevSpec=std::string())
static void WaitForEnterKeyPress(void)
Prompts the user (via stdout) to press the Return or Enter key, then waits for it to happen...
See Alternate 8-Bit YCbCr (&#39;YUY2&#39;).
Definition: ntv2enums.h:229
See 10-Bit YCbCr - DPX Format.
Definition: ntv2enums.h:233
std::vector< AJALabelValuePair > AJALabelValuePairs
An ordered sequence of label/value pairs.
Definition: info.h:71
bool WithAudio(void) const
#define NTV2_IS_4K_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:785
See 3-Plane 10-Bit YCbCr 4:2:2 (&#39;I422_10LE&#39; a.k.a. &#39;YUV-P-L10&#39;).
Definition: ntv2enums.h:252
Specifies HDMI input/output kinds.
Definition: ntv2enums.h:1295
LWord64 acFrameTime
(input/ingest/capture only) The absolute timestamp at the VBI when the frame started recording into d...
virtual bool Open(const UWord inDeviceIndex)
Opens a local/physical AJA device so it can be monitored/controlled.
NTV2OutputXptID GetTSIMuxOutputXptFromChannel(const NTV2Channel inTSIMuxer, const bool inLinkB=false, const bool inIsRGB=false)
static std::string GetPixelFormatStrings(const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL, const std::string inDevSpec=std::string())
Obtain audio samples from the audio that&#39;s embedded in the video HANC.
Definition: ntv2enums.h:2010
NTV2InputXptID GetDLInInputXptFromChannel(const NTV2Channel inChannel, const bool inLinkB=false)
String2VANCModeMap::const_iterator String2VANCModeMapConstIter
Specifies any/all input/output kinds.
Definition: ntv2enums.h:1297
The "default" timecode (mostly used by the AJA "Retail" service and Control Panel) ...
Definition: ntv2enums.h:3956
static NTV2OutputDestinations gOutputDestsHDMI
See 3-Plane 8-Bit YCbCr 4:2:0 (&#39;I420&#39; a.k.a. &#39;YUV-P420&#39;).
Definition: ntv2enums.h:235
static NTV2VideoFormatSet gSDHDFormats
Definition: json.hpp:5362
virtual bool SetAudioRate(const NTV2AudioRate inRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the NTV2AudioRate for the given Audio System.
Definition: ntv2audio.cpp:206
Fractional rate of 60,000 frames per 1,001 seconds.
Definition: ntv2enums.h:419
static std::string GetTestPatternStrings(void)
std::set< NTV2OutputDestination > NTV2OutputDestinations
A set of distinct NTV2OutputDestination values.
std::pair< NTV2InputXptID, NTV2OutputXptID > NTV2Connection
This links an NTV2InputXptID and an NTV2OutputXptID.
See 8-Bit DVCPro.
Definition: ntv2enums.h:234
uint32_t ULWord
Definition: ajatypes.h:236
static String2InputSourceMap gString2InputSourceMap
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1359
short HANDLE
Definition: ajatypes.h:298
map< string, NTV2TCIndex > String2TCIndexMap
virtual class DeviceCapabilities & features(void)
Definition: ntv2card.h:148
bool CanDoInputSource(const NTV2InputSource inSrc)
AJALabelValuePairs Get(const bool inCompact=(0)) const
Renders a human-readable representation of me.
#define NTV2_OUTPUT_DEST_IS_HDMI(_dest_)
Definition: ntv2enums.h:1346
static String2TCIndexMap gString2TCIndexMap
static NTV2VideoFormatSet gAllFormats
#define NTV2_ASSERT(_expr_)
Definition: ajatypes.h:489
String2InputSourceMap::const_iterator String2InputSourceMapConstIter
See 3-Plane 8-Bit YCbCr 4:2:2 (Weitek &#39;Y42B&#39; a.k.a. &#39;YUV-P8&#39;).
Definition: ntv2enums.h:248
Represents an unknown or invalid frame rate.
Definition: ntv2enums.h:416
This struct replaces the old RP188_STRUCT.
poptContext poptGetContext(const char *name, int argc, const char **argv, const struct poptOption *options, unsigned int flags)
50 frames per second
Definition: ntv2enums.h:425
#define NTV2_IS_ANALOG_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3989
NTV2Channel fInputChannel
The device channel to use.
unsigned long stoul(const std::string &str, std::size_t *idx, int base)
Definition: common.cpp:143
NTV2TCIndex
These enum values are indexes into the capture/playout AutoCirculate timecode arrays.
Definition: ntv2enums.h:3954
bool Fill(const T &inValue)
Fills me with the given scalar value.
static NTV2StringList gTestPatternNames
Fractional rate of 48,000 frames per 1,001 seconds.
Definition: ntv2enums.h:427
virtual bool SetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedInput)
Sets the audio source for the given NTV2AudioSystem on the device.
Definition: ntv2audio.cpp:486
std::string NTV2InputSourceToString(const NTV2InputSource inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:7042
30 frames per second
Definition: ntv2enums.h:420
NTV2OutputXptID GetInputSourceOutputXpt(const NTV2InputSource inInputSource, const bool inIsSDI_DS2=false, const bool inIsHDMI_RGB=false, const UWord inHDMI_Quadrant=0)
static bool IsValidDevice(const std::string &spec)
static AJA_PixelFormat GetAJAPixelFormat(const NTV2PixelFormat inFormat)
NTV2Channel NTV2OutputDestinationToChannel(const NTV2OutputDestination inOutputDest)
Converts a given NTV2OutputDestination to its equivalent NTV2Channel value.
Definition: ntv2utils.cpp:5158
NTV2FrameRate
Identifies a particular video frame rate.
Definition: ntv2enums.h:414
8-Bit 4:2:2 2-Plane YCbCr
Definition: ntv2enums.h:256
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
bool CanDoOutputDestination(const NTV2OutputDestination inDest)
This class is used to configure an NTV2Capture instance.
static TimecodeFormat NTV2FrameRate2TimecodeFormat(const NTV2FrameRate inFrameRate)
static NTV2TCIndexSet gTCIndexesVITC2
virtual bool DMABufferUnlock(const NTV2Buffer &inBuffer)
Unlocks the given host buffer that was previously locked using CNTV2Card::DMABufferLock.
Definition: ntv2dma.cpp:444
virtual bool IsOpen(void) const
16-Bit ARGB
Definition: ntv2enums.h:247
static NTV2PixelFormats GetSupportedPixelFormats(const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL)
std::string to_string(bool val)
Definition: common.cpp:180
#define NTV2_IS_ATC_VITC2_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3994
static bool GetFirstDeviceFromArgument(const std::string &inArgument, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the AJA device that matches a command li...
std::set< std::string > NTV2StringSet
String2AudioSystemMap::const_iterator String2AudioSystemMapConstIter
#define NTV2_INPUT_SOURCE_IS_HDMI(_inpSrc_)
Definition: ntv2enums.h:1283
static std::string GetVideoFormatStrings(const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_SDHD, const std::string inDevSpec=std::string())
NTV2VideoFormatSet::const_iterator NTV2VideoFormatSetConstIter
A handy const iterator for iterating over an NTV2VideoFormatSet.
static NTV2FrameBufferFormatSet gFBFsAlpha
Specifies analog input/output kinds.
Definition: ntv2enums.h:1296
virtual bool DMABufferLock(const NTV2Buffer &inBuffer, bool inMap=(0), bool inRDMA=(0))
Page-locks the given host buffer to reduce transfer time and CPU usage of DMA transfers.
Definition: ntv2dma.cpp:429
static NTV2StringList getColorNames(void)
const char * poptBadOption(poptContext con, unsigned int flags)
#define AJA_NULL
Definition: ajatypes.h:180
See 10-Bit RGB Format.
Definition: ntv2enums.h:228
map< string, string > String2TPNamesMap
virtual std::string GetDisplayName(void)
Answers with this device&#39;s display name.
Definition: ntv2card.cpp:88
#define NTV2_IS_FBF_RGB(__fbf__)
Definition: ntv2enums.h:285
NTV2TimeCodes::const_iterator NTV2TimeCodesConstIter
A handy const interator for iterating over NTV2TCIndex/NTV2TimeCodeList pairs.
static String2VANCModeMap gString2VANCModeMap
static NTV2VideoFormatSet g8KFormats
NTV2InputXptID GetCSCInputXptFromChannel(const NTV2Channel inCSC, const bool inIsKeyInput=false)
String2TPNamesMap::const_iterator String2TPNamesMapConstIter
bool SetCapturedFrameInfo(const AUTOCIRCULATE_TRANSFER &inXferInfo, const AUTOCIRCULATE_STATUS &acStatus)
bool LockAll(CNTV2Card &inDevice)
static NTV2TCIndex GetTCIndexFromString(const std::string &inStr, const NTV2TCIndexKinds inKinds=TC_INDEXES_ALL, const std::string inDevSpec=std::string())
Returns the NTV2TCIndex that matches the given string.
static String2OutputDestMap gString2OutputDestMap
NTV2InputXptID GetFrameStoreInputXptFromChannel(const NTV2Channel inFrameStore, const bool inIsBInput=false)
static NTV2OutputDestination GetOutputDestinationFromString(const std::string &inStr, const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL, const std::string inDevSpec=std::string())
Returns the NTV2OutputDestination that matches the given string.
std::string NTV2VANCModeToString(const NTV2VANCMode inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6508
static std::string ToLower(const std::string &inStr)
Returns the given string after converting it to lower case.
static size_t DefaultPageSize(void)
bool CanDoOutputTCIndex(const NTV2TCIndex inTCNdx)
std::set< NTV2AudioSystem > NTV2AudioSystemSet
A set of distinct NTV2AudioSystem values. New in SDK 16.2.
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Definition: ntv2utils.cpp:6749
See 8-Bit ARGB, RGBA, ABGR Formats.
Definition: ntv2enums.h:230
See 8-Bit ARGB, RGBA, ABGR Formats.
Definition: ntv2enums.h:226
static NTV2VANCMode GetVANCModeFromString(const std::string &inStr)
Embeds silence (zeroes) into the data stream.
Definition: ntv2enums.h:2033
static bool Get8KInputFormat(NTV2VideoFormat &inOutVideoFormat)
Given a video format, if all 4 inputs are the same and promotable to 8K, this function does the promo...
static NTV2VideoFormatSet g4KFormats
static String2VideoFormatMMap gString2VideoFormatMMap
pair< string, NTV2TCIndex > String2TCIndexPair
bool WithRP188(void) const
static bool BFT(void)
static String2PixelFormatMap gString2PixelFormatMap
std::string NTV2TCIndexToString(const NTV2TCIndex inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6397
static NTV2TCIndexSet gTCIndexesSDI
See 12-Bit Packed RGB.
Definition: ntv2enums.h:242
#define NTV2_OUTPUT_DEST_IS_ANALOG(_dest_)
Definition: ntv2enums.h:1347
See 3-Plane 10-Bit YCbCr 4:2:0 (&#39;I420_10LE&#39; a.k.a. &#39;YUV-P420-L10&#39;).
Definition: ntv2enums.h:251
NTV2OutputXptID GetDLInOutputXptFromChannel(const NTV2Channel inDLInput)
Declares the CNTV2DeviceScanner class.
static NTV2FrameBufferFormatSet gFBFsPacked
ULWord NTV2PixelFormatKinds
static NTV2OutputDestinations gOutputDestsAnalog
#define NTV2_OUTPUT_DEST_IS_SDI(_dest_)
Definition: ntv2enums.h:1348
10-Bit DPX Little-Endian
Definition: ntv2enums.h:240
Describes a user-space buffer on the host computer. I have an address and a length, plus some optional attributes (allocated by SDK?, page-aligned? etc.).
static NTV2TestPatternNames getTestPatternNames(void)
bool NTV2DeviceGetSupportedOutputDests(const NTV2DeviceID inDeviceID, NTV2OutputDestinations &outOutputDests, const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL)
Returns a set of distinct NTV2OutputDest values supported on the given device.
Fractional rate of 30,000 frames per 1,001 seconds.
Definition: ntv2enums.h:421
10-Bit 4:2:0 2-Plane YCbCr
Definition: ntv2enums.h:253
NTV2InputSource
Identifies a specific video input source.
Definition: ntv2enums.h:1264
NTV2InputSourceSet::const_iterator NTV2InputSourceSetConstIter
A handy const iterator for iterating over an NTV2InputSourceSet.
bool IsRGBFormat(const NTV2FrameBufferFormat format)
Definition: ntv2utils.cpp:5413
static NTV2InputSourceSet gInputSourcesSDI
static char ReadCharacterPress(void)
Returns the character that represents the last key that was pressed on the keyboard without waiting f...
This object specifies the information that will be transferred to or from the AJA device in the CNTV2...
bool NTV2DeviceCanDo12gRouting(const NTV2DeviceID inDeviceID)
std::string & strip(std::string &str, const std::string &ws)
Definition: common.cpp:461
virtual bool SetAudioBufferSize(const NTV2AudioBufferSize inValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Changes the size of the audio buffer that is used for a given Audio System in the AJA device...
Definition: ntv2audio.cpp:250
NTV2InputSource fInputSource
The device input connector to use.
static AJALabelValuePairs & append(AJALabelValuePairs &inOutTable, const std::string &inLabel, const std::string &inValue=std::string())
A convenience function that appends the given label and value strings to the provided AJALabelValuePa...
Definition: info.h:170
static size_t HostPageSize(void)
#define DEC(__x__)
static NTV2OutputDestinations gOutputDestsSDI
NTV2InputXptID GetTSIMuxInputXptFromChannel(const NTV2Channel inTSIMuxer, const bool inLinkB=false)
map< string, NTV2OutputDestination > String2OutputDestMap
See 8-Bit HDV.
Definition: ntv2enums.h:236
static std::string GetAudioSystemStrings(const std::string inDeviceSpecifier=std::string())
Apple ProRes HDV.
Definition: ntv2enums.h:244
60 frames per second
Definition: ntv2enums.h:417
15 frames per second
Definition: ntv2enums.h:430
10-Bit ARGB
Definition: ntv2enums.h:246
Declares numerous NTV2 utility functions.
static NTV2TCIndexSet gTCIndexesHDMI
static NTV2FrameBufferFormatSet gFBFsRGB
bool CanDoInputTCIndex(const NTV2TCIndex inTCNdx)
static NTV2TCIndexSet gTCIndexesATCLTC
static NTV2FrameBufferFormatSet gPixelFormats
bool GetInputTimeCodes(NTV2TimeCodeList &outValues) const
Intended for capture, answers with the timecodes captured in my acTransferStatus member&#39;s acFrameStam...
static bool Get4KInputFormat(NTV2VideoFormat &inOutVideoFormat)
Given a video format, if all 4 inputs are the same and promotable to 4K, this function does the promo...
See 8-Bit ARGB, RGBA, ABGR Formats.
Definition: ntv2enums.h:227
#define NTV2_IS_QUAD_QUAD_FORMAT(__f__)
Definition: ntv2enums.h:821
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
static const NTV2InputSourceSet GetSupportedInputSources(const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL)
bool UnlockAll(CNTV2Card &inDevice)
uint16_t UWord
Definition: ajatypes.h:234
static NTV2InputSourceSet gInputSources
Specifies channel or FrameStore 1 (or the first item).
Definition: ntv2enums.h:1361
120 frames per second
Definition: ntv2enums.h:428
See 48-Bit RGB.
Definition: ntv2enums.h:241
static bool GetInputRouting4K(NTV2XptConnections &outConnections, const CaptureConfig &inConfig, const NTV2DeviceID inDevID=DEVICE_ID_INVALID, const bool isInputRGB=(0))
Answers with the crosspoint connections needed to implement the given 4K/UHD capture configuration...
bool CanDoFrameBufferFormat(const NTV2PixelFormat inPF)
static NTV2InputSource GetInputSourceFromString(const std::string &inStr, const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL, const std::string inDevSpec=std::string())
Returns the NTV2InputSource that matches the given string.
bool NTV2DeviceGetSupportedInputSources(const NTV2DeviceID inDeviceID, NTV2InputSourceSet &outInputSources, const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL)
Returns a set of distinct NTV2InputSource values supported on the given device.
NTV2Channel GetChannel(void) const
NTV2VANCMode
These enum values identify the available VANC modes.
Definition: ntv2enums.h:3800
25 frames per second
Definition: ntv2enums.h:422
TimecodeFormat
Definition: ntv2rp188.h:22
NTV2PixelFormat fPixelFormat
Pixel format to use.
static bool GetInputRouting(NTV2XptConnections &outConnections, const CaptureConfig &inConfig, const bool isInputRGB=(0))
Answers with the crosspoint connections needed to implement the given capture configuration.
static String2AudioSystemMap gString2AudioSystemMap
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6939
static AJA_FrameRate GetAJAFrameRate(const NTV2FrameRate inFrameRate)
10-Bit YCbCrA
Definition: ntv2enums.h:239
#define NTV2_INPUT_SOURCE_IS_ANALOG(_inpSrc_)
Definition: ntv2enums.h:1284
ULWord NTV2VideoFormatKinds
NTV2AudioSystemSet::const_iterator NTV2AudioSystemSetConstIter
A handy const iterator into an NTV2AudioSystemSet. New in SDK 16.2.
String2TCIndexMap::const_iterator String2TCIndexMapConstIter
String2OutputDestMap::const_iterator String2OutputDestMapConstIter
NTV2InputSource NTV2TimecodeIndexToInputSource(const NTV2TCIndex inTCIndex)
Converts the given NTV2TCIndex value into the appropriate NTV2InputSource value.
Definition: ntv2utils.cpp:4991
enum NTV2OutputDestination NTV2OutputDest
static NTV2TCIndexSet gTCIndexes
enum NTV2InputCrosspointID NTV2InputXptID
This file contains some structures, constants, classes and functions that are used in some of the dem...
const char * poptGetArg(poptContext con)
std::ostream & operator<<(std::ostream &ioStrm, const CaptureConfig &inObj)
Private include file for all ajabase sources.
poptContext poptFreeContext(poptContext con)
Configures an NTV2Player instance.
See 10-Bit RGB - DPX Format.
Definition: ntv2enums.h:232
static bool ConfigureAudioSystems(CNTV2Card &inDevice, const CaptureConfig &inConfig, const NTV2AudioSystemSet inAudioSystems)
Configures capture audio systems.
static std::string GetVANCModeStrings(void)
static const NTV2TCIndexes GetSupportedTCIndexes(const NTV2TCIndexKinds inKinds)
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:727
std::vector< NTV2Channel > NTV2ChannelList
An ordered sequence of NTV2Channel values.
AJALabelValuePairs Get(const bool inCompact=(0)) const
std::string join(const std::vector< std::string > &parts, const std::string &delim)
Definition: common.cpp:468
See 24-Bit RGB.
Definition: ntv2enums.h:237
10-Bit Raw RGB
Definition: ntv2enums.h:249
#define NTV2_FBF_HAS_ALPHA(__fbf__)
Definition: ntv2enums.h:325
int poptGetNextOpt(poptContext con)
NTV2_RP188 Timecode(const NTV2TCIndex inTCNdx) const
static std::string StripFormatString(const std::string &inStr)
static size_t SetDefaultPageSize(void)
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
Definition: ntv2enums.h:265
ULWord64 acAudioClockTimeStamp
(input/ingest/capture only) The absolute timestamp at the VBI when the frame started recording into d...
std::map< NTV2InputXptID, NTV2OutputXptID > NTV2XptConnections
NTV2OutputXptID GetSDIInputOutputXptFromChannel(const NTV2Channel inSDIInput, const bool inIsDS2=false)
Popt(const int inArgc, const char **pArgs, const PoptOpts *pInOptionsTable)
NTV2TCIndexes::const_iterator NTV2TCIndexesConstIter
ULWord GetCapturedAncByteCount(const bool inField2=false) const
std::vector< std::string > NTV2StringList
static const string gGlobalMutexName("com.aja.ntv2.mutex.demo")
bool CanDoVideoFormat(const NTV2VideoFormat inVF)
48 frames per second
Definition: ntv2enums.h:426
std::string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:5730
map< string, NTV2AudioSystem > String2AudioSystemMap
#define NTV2_INPUT_SOURCE_IS_SDI(_inpSrc_)
Definition: ntv2enums.h:1285
std::string & lower(std::string &str)
Definition: common.cpp:436
static NTV2InputSourceSet gInputSourcesHDMI
24 frames per second
Definition: ntv2enums.h:423
10-Bit Packed RGB
Definition: ntv2enums.h:245
8-Bit 4:2:0 2-Plane YCbCr
Definition: ntv2enums.h:255
Identifies the 1st SDI video input.
Definition: ntv2enums.h:1271
std::string & replace(std::string &str, const std::string &from, const std::string &to)
Definition: common.cpp:110
static std::string GetOutputDestinationStrings(const NTV2IOKinds inKinds, const std::string inDevSpec=std::string())
static NTV2FrameBufferFormatSet gFBFsPlanar
const char * poptStrerror(const int error)
static NTV2FrameBufferFormatSet gFBFsProRes
AJA_FrameRate
Definition: videotypes.h:210
virtual bool SetNumberAudioChannels(const ULWord inNumChannels, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the number of audio channels to be concurrently captured or played for a given Audio System on t...
Definition: ntv2audio.cpp:147
const char * NTV2VideoFormatString(NTV2VideoFormat fmt)
Definition: ntv2debug.cpp:331
virtual void ToString(std::string &outAllLabelsAndValues) const
Answers with a multi-line string that contains the complete host system info table.
static const DemoCommonInitializer gInitializer
enum NTV2OutputCrosspointID NTV2OutputXptID
static NTV2InputSourceSet gInputSourcesAnalog
Declares device capability functions.
See 24-Bit BGR.
Definition: ntv2enums.h:238
static NTV2PixelFormat GetPixelFormatFromString(const std::string &inStr, const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL, const std::string inDevSpec=std::string())
Returns the NTV2PixelFormat that matches the given string.
static NTV2FrameBufferFormatSet gFBFsRaw
NTV2OutputXptID GetCSCOutputXptFromChannel(const NTV2Channel inCSC, const bool inIsKey=false, const bool inIsRGB=false)
This identifies the mode in which there are no VANC lines in the frame buffer.
Definition: ntv2enums.h:3802
static std::string GetTCIndexStrings(const NTV2TCIndexKinds inKinds=TC_INDEXES_ALL, const std::string inDeviceSpecifier=std::string(), const bool inIsInputOnly=(!(0)))
Fractional rate of 24,000 frames per 1,001 seconds.
Definition: ntv2enums.h:424
ULWord NTV2IOKinds
Definition: ntv2enums.h:1312
#define NTV2_FBF_IS_RAW(__fbf__)
Definition: ntv2enums.h:333
See 8-Bit YCbCr Format.
Definition: ntv2enums.h:225
#define NTV2_IS_FBF_PRORES(__fbf__)
Definition: ntv2enums.h:281
bool fDoTSIRouting
If true, do TSI routing; otherwise squares.
static const NTV2OutputDestinations GetSupportedOutputDestinations(const NTV2IOKinds inKinds)
NTV2FrameBufferFormatSet::const_iterator NTV2FrameBufferFormatSetConstIter
A handy const iterator for iterating over an NTV2FrameBufferFormatSet.
NTV2TestPatternSelect
Identifies a predefined NTV2 test pattern.