AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
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 map <string, NTV2VideoFormat> String2VideoFormatMap;
26 typedef String2VideoFormatMap::const_iterator String2VideoFormatMapConstIter;
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");
85 
86 
88 {
89  public:
91  {
92  typedef pair <string, NTV2VideoFormat> String2VideoFormatPair;
93  typedef pair <string, NTV2FrameBufferFormat> String2PixelFormatPair;
94  typedef pair <string, NTV2AudioSystem> String2AudioSystemPair;
95  typedef pair <string, NTV2VANCMode> String2VANCModePair;
96  typedef pair <string, NTV2InputSource> String2InputSourcePair;
97  typedef pair <string, NTV2OutputDestination> String2OutputDestPair;
98 
99  NTV2_ASSERT (gNon4KFormats.empty ());
100  for (NTV2VideoFormat legalFormat (NTV2_FORMAT_UNKNOWN); legalFormat < NTV2_MAX_NUM_VIDEO_FORMATS; legalFormat = NTV2VideoFormat (legalFormat + 1))
101  {
102  string str;
103  if (!NTV2_IS_VALID_VIDEO_FORMAT (legalFormat))
104  continue;
105 
106  if (NTV2_IS_QUAD_QUAD_FORMAT(legalFormat))
107  g8KFormats.insert (legalFormat);
108  else if (NTV2_IS_4K_VIDEO_FORMAT (legalFormat))
109  g4KFormats.insert (legalFormat);
110  else
111  gNon4KFormats.insert (legalFormat);
112  gAllFormats.insert (legalFormat);
113 
114  if (legalFormat == NTV2_FORMAT_525_5994) str = "525i2997";
115  else if (legalFormat == NTV2_FORMAT_625_5000) str = "625i25";
116  else if (legalFormat == NTV2_FORMAT_525_2398) str = "525i2398";
117  else if (legalFormat == NTV2_FORMAT_525_2400) str = "525i24";
118  else
119  {
120  str = ::NTV2VideoFormatToString (legalFormat);
121  if (str.at (str.length () - 1) == 'a') // If it ends in "a"...
122  str.erase (str.length () - 1); // ...lop off the "a"
123 
124  if (str.find (".00") != string::npos) // If it ends in ".00"...
125  str.erase (str.find (".00"), 3); // ...lop off the ".00" (but keep the "b", if any)
126 
127  while (str.find (" ") != string::npos)
128  str.erase (str.find (" "), 1); // Remove all spaces
129 
130  if (str.find (".") != string::npos)
131  str.erase (str.find ("."), 1); // Remove "."
132 
133  str = CNTV2DemoCommon::ToLower (str); // Fold to lower case
134  }
135  gString2VideoFormatMap.insert (String2VideoFormatPair (str, legalFormat));
136  gString2VideoFormatMap.insert (String2VideoFormatPair (ULWordToString (legalFormat), legalFormat));
137  } // for each video format supported in demo apps
138 
139  // Add popular format names...
140  gString2VideoFormatMap.insert (String2VideoFormatPair ("sd", NTV2_FORMAT_525_5994));
141  gString2VideoFormatMap.insert (String2VideoFormatPair ("525i", NTV2_FORMAT_525_5994));
142  gString2VideoFormatMap.insert (String2VideoFormatPair ("625i", NTV2_FORMAT_625_5000));
143  gString2VideoFormatMap.insert (String2VideoFormatPair ("720p", NTV2_FORMAT_720p_5994));
144  gString2VideoFormatMap.insert (String2VideoFormatPair ("hd", NTV2_FORMAT_1080i_5994));
145  gString2VideoFormatMap.insert (String2VideoFormatPair ("1080i", NTV2_FORMAT_1080i_5994));
146  gString2VideoFormatMap.insert (String2VideoFormatPair ("1080i50", NTV2_FORMAT_1080i_5000));
147  gString2VideoFormatMap.insert (String2VideoFormatPair ("1080p", NTV2_FORMAT_1080p_5994_B));
148  gString2VideoFormatMap.insert (String2VideoFormatPair ("1080p50", NTV2_FORMAT_1080p_5000_B));
149 
150  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd", NTV2_FORMAT_4x1920x1080p_6000));
151  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd2398", NTV2_FORMAT_4x1920x1080p_2398));
152  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd24", NTV2_FORMAT_4x1920x1080p_2400));
153  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd25", NTV2_FORMAT_4x1920x1080p_2500));
154  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd50", NTV2_FORMAT_4x1920x1080p_5000));
155  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd5994", NTV2_FORMAT_4x1920x1080p_5994));
156  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd60", NTV2_FORMAT_4x1920x1080p_6000));
157 
158  gString2VideoFormatMap.insert (String2VideoFormatPair ("4k", NTV2_FORMAT_4x2048x1080p_6000));
159  gString2VideoFormatMap.insert (String2VideoFormatPair ("4k2398", NTV2_FORMAT_4x2048x1080p_2398));
160  gString2VideoFormatMap.insert (String2VideoFormatPair ("4k24", NTV2_FORMAT_4x2048x1080p_2400));
161  gString2VideoFormatMap.insert (String2VideoFormatPair ("4k25", NTV2_FORMAT_4x2048x1080p_2500));
162  gString2VideoFormatMap.insert (String2VideoFormatPair ("4k4795", NTV2_FORMAT_4x2048x1080p_4795));
163  gString2VideoFormatMap.insert (String2VideoFormatPair ("4k48", NTV2_FORMAT_4x2048x1080p_4800));
164  gString2VideoFormatMap.insert (String2VideoFormatPair ("4k50", NTV2_FORMAT_4x2048x1080p_5000));
165  gString2VideoFormatMap.insert (String2VideoFormatPair ("4k5994", NTV2_FORMAT_4x2048x1080p_5994));
166  gString2VideoFormatMap.insert (String2VideoFormatPair ("4k60", NTV2_FORMAT_4x2048x1080p_6000));
167  gString2VideoFormatMap.insert (String2VideoFormatPair ("4k11988", NTV2_FORMAT_4x2048x1080p_11988));
168  gString2VideoFormatMap.insert (String2VideoFormatPair ("4k120", NTV2_FORMAT_4x2048x1080p_12000));
169 
170  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd2", NTV2_FORMAT_4x3840x2160p_2398));
171  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd22398", NTV2_FORMAT_4x3840x2160p_2398));
172  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd224", NTV2_FORMAT_4x3840x2160p_2400));
173  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd225", NTV2_FORMAT_4x3840x2160p_2500));
174  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd250", NTV2_FORMAT_4x3840x2160p_5000));
175  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd25994", NTV2_FORMAT_4x3840x2160p_5994));
176  gString2VideoFormatMap.insert (String2VideoFormatPair ("uhd260", NTV2_FORMAT_4x3840x2160p_6000));
177 
178  gString2VideoFormatMap.insert (String2VideoFormatPair ("8k", NTV2_FORMAT_4x4096x2160p_6000));
179  gString2VideoFormatMap.insert (String2VideoFormatPair ("8k2398", NTV2_FORMAT_4x4096x2160p_2398));
180  gString2VideoFormatMap.insert (String2VideoFormatPair ("8k24", NTV2_FORMAT_4x4096x2160p_2400));
181  gString2VideoFormatMap.insert (String2VideoFormatPair ("8k25", NTV2_FORMAT_4x4096x2160p_2500));
182  gString2VideoFormatMap.insert (String2VideoFormatPair ("8k4795", NTV2_FORMAT_4x4096x2160p_4795));
183  gString2VideoFormatMap.insert (String2VideoFormatPair ("8k48", NTV2_FORMAT_4x4096x2160p_4800));
184  gString2VideoFormatMap.insert (String2VideoFormatPair ("8k50", NTV2_FORMAT_4x4096x2160p_5000));
185  gString2VideoFormatMap.insert (String2VideoFormatPair ("8k5994", NTV2_FORMAT_4x4096x2160p_5994));
186  gString2VideoFormatMap.insert (String2VideoFormatPair ("8k60", NTV2_FORMAT_4x4096x2160p_6000));
187 
188  NTV2_ASSERT (gPixelFormats.empty ());
189  for (NTV2FrameBufferFormat legalFormat (NTV2_FBF_10BIT_YCBCR); legalFormat < NTV2_FBF_NUMFRAMEBUFFERFORMATS; legalFormat = NTV2FrameBufferFormat (legalFormat + 1))
190  {
191  string str;
192  if (!NTV2_IS_VALID_FRAME_BUFFER_FORMAT (legalFormat))
193  continue;
194 
195  gPixelFormats.insert (legalFormat);
196  if (NTV2_IS_FBF_PLANAR (legalFormat))
197  gFBFsPlanar.insert (legalFormat);
198  if (NTV2_IS_FBF_RGB (legalFormat))
199  gFBFsRGB.insert (legalFormat);
200  if (NTV2_IS_FBF_PRORES (legalFormat))
201  gFBFsProRes.insert (legalFormat);
202  if (NTV2_FBF_HAS_ALPHA (legalFormat))
203  gFBFsAlpha.insert (legalFormat);
204  if (NTV2_FBF_IS_RAW (legalFormat))
205  gFBFsRaw.insert (legalFormat);
206 
207  str = ::NTV2FrameBufferFormatToString (legalFormat, true);
208  while (str.find (" ") != string::npos)
209  str.erase (str.find (" "), 1); // Remove all spaces
210 
211  while (str.find ("-") != string::npos)
212  str.erase (str.find ("-"), 1); // Remove all "-"
213 
214  if (str.find ("compatible") != string::npos)
215  str.erase (str.find ("compatible"), 10); // Remove "compatible"
216 
217  if (str.find ("ittle") != string::npos)
218  str.erase (str.find ("ittle"), 5); // Remove "ittle"
219 
220  if (str.find ("ndian") != string::npos)
221  str.erase (str.find ("ndian"), 5); // Remove "ndian"
222 
223  str = CNTV2DemoCommon::ToLower (str); // Fold to lower case
224 
225  gString2PixelFormatMap.insert (String2PixelFormatPair (str, legalFormat));
226 
227  str = ::NTV2FrameBufferFormatToString (legalFormat, false);
228  if (str.find ("NTV2_FBF_") == 0) // If it starts with "NTV2_FBF_"...
229  str.erase (0, 9); // ...lop it off
230 
231  while (str.find (" ") != string::npos)
232  str.erase (str.find (" "), 1); // Remove all spaces
233 
234  while (str.find ("_") != string::npos)
235  str.erase (str.find ("_"), 1); // Remove all "_"
236 
237  str = CNTV2DemoCommon::ToLower (str); // Fold to lower case
238 
239  gString2PixelFormatMap.insert (String2PixelFormatPair (str, legalFormat));
240  gString2PixelFormatMap.insert (String2PixelFormatPair (::NTV2FrameBufferFormatToString (legalFormat, false), legalFormat));
241  gString2PixelFormatMap.insert (String2PixelFormatPair (ULWordToString (legalFormat), legalFormat));
242  } // for each pixel format supported in demo apps
243 
244  // Add popular pixel format names...
245  gString2PixelFormatMap.insert (String2PixelFormatPair ("v210", NTV2_FBF_10BIT_YCBCR));
246  gString2PixelFormatMap.insert (String2PixelFormatPair ("yuv10", NTV2_FBF_10BIT_YCBCR));
247  gString2PixelFormatMap.insert (String2PixelFormatPair ("2vuy", NTV2_FBF_8BIT_YCBCR));
248  gString2PixelFormatMap.insert (String2PixelFormatPair ("uyvy", NTV2_FBF_8BIT_YCBCR));
249  gString2PixelFormatMap.insert (String2PixelFormatPair ("argb", NTV2_FBF_ARGB));
250  gString2PixelFormatMap.insert (String2PixelFormatPair ("argb8", NTV2_FBF_ARGB));
251  gString2PixelFormatMap.insert (String2PixelFormatPair ("bgra", NTV2_FBF_RGBA));
252  gString2PixelFormatMap.insert (String2PixelFormatPair ("bgra8", NTV2_FBF_RGBA));
253  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgba", NTV2_FBF_RGBA));
254  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgba8", NTV2_FBF_RGBA));
255  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb10", NTV2_FBF_10BIT_RGB));
256  gString2PixelFormatMap.insert (String2PixelFormatPair ("yuy2", NTV2_FBF_8BIT_YCBCR_YUY2));
257  gString2PixelFormatMap.insert (String2PixelFormatPair ("abgr", NTV2_FBF_ABGR));
258  gString2PixelFormatMap.insert (String2PixelFormatPair ("abgr8", NTV2_FBF_ABGR));
259  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb10dpx", NTV2_FBF_10BIT_DPX));
260  gString2PixelFormatMap.insert (String2PixelFormatPair ("yuv10dpx", NTV2_FBF_10BIT_YCBCR_DPX));
261  gString2PixelFormatMap.insert (String2PixelFormatPair ("ycbcr10dpx", NTV2_FBF_10BIT_YCBCR_DPX));
262  gString2PixelFormatMap.insert (String2PixelFormatPair ("dvcpro8", NTV2_FBF_8BIT_DVCPRO));
263  gString2PixelFormatMap.insert (String2PixelFormatPair ("i420", NTV2_FBF_8BIT_YCBCR_420PL3));
264  gString2PixelFormatMap.insert (String2PixelFormatPair ("hdv", NTV2_FBF_8BIT_HDV));
265  gString2PixelFormatMap.insert (String2PixelFormatPair ("hdv8", NTV2_FBF_8BIT_HDV));
266  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb24", NTV2_FBF_24BIT_RGB));
267  gString2PixelFormatMap.insert (String2PixelFormatPair ("bgr24", NTV2_FBF_24BIT_BGR));
268  gString2PixelFormatMap.insert (String2PixelFormatPair ("ycbcra10", NTV2_FBF_10BIT_YCBCRA));
269  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb10dpxle", NTV2_FBF_10BIT_DPX_LE));
270  gString2PixelFormatMap.insert (String2PixelFormatPair ("proresdvcpro", NTV2_FBF_PRORES_DVCPRO));
271  gString2PixelFormatMap.insert (String2PixelFormatPair ("proreshdv", NTV2_FBF_PRORES_HDV));
272  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb10packed", NTV2_FBF_10BIT_RGB_PACKED));
273  gString2PixelFormatMap.insert (String2PixelFormatPair ("argb10", NTV2_FBF_10BIT_ARGB));
274  gString2PixelFormatMap.insert (String2PixelFormatPair ("argb16", NTV2_FBF_16BIT_ARGB));
275  gString2PixelFormatMap.insert (String2PixelFormatPair ("rgb10raw", NTV2_FBF_10BIT_RAW_RGB));
276  gString2PixelFormatMap.insert (String2PixelFormatPair ("ycbcr10raw", NTV2_FBF_10BIT_RAW_YCBCR));
277  gString2PixelFormatMap.insert (String2PixelFormatPair ("yuv10raw", NTV2_FBF_10BIT_RAW_YCBCR));
278 
279  // Audio systems...
280  for (uint8_t ndx (0); ndx < 8; ndx++)
281  gString2AudioSystemMap.insert (String2AudioSystemPair(ULWordToString (ndx + 1), NTV2AudioSystem(ndx)));
282 
283  // VANC Modes...
285  {
286  gString2VANCModeMap.insert (String2VANCModePair(aja::to_string(vm), vm));
287 // gString2VANCModeMap.insert (String2VANCModePair(::NTV2VANCModeToString(vm, false), vm));
288  gString2VANCModeMap.insert (String2VANCModePair(::NTV2VANCModeToString(vm, true), vm));
289  }
290 
291  // Input Sources...
296  for (NTV2InputSourceSetConstIter it(gInputSources.begin()); it != gInputSources.end(); ++it)
297  {
298  const NTV2InputSource src(*it);
299  string sSmall(::NTV2InputSourceToString(src, true)), sBig(::NTV2InputSourceToString(src, false));
300  gString2InputSourceMap.insert(String2InputSourcePair(sBig, src));
301  gString2InputSourceMap.insert(String2InputSourcePair(sSmall, src));
302  gString2InputSourceMap.insert(String2InputSourcePair(CNTV2DemoCommon::ToLower(sSmall), src));
303  if (NTV2_INPUT_SOURCE_IS_SDI(src))
304  {
305  sSmall.erase(0, 3); // Erase first 3 chars to leave just the number (e.g. "SDI3" becomes "3")
306  gString2InputSourceMap.insert(String2InputSourcePair(sSmall, src));
307  }
308  } // for each input source
309  gString2InputSourceMap.insert(String2InputSourcePair(string("hdmi"),NTV2_INPUTSOURCE_HDMI1));
310 
311  // Output Destinations...
313  for (NTV2OutputDestinationsConstIter it(gOutputDestinations.begin()); it != gOutputDestinations.end(); ++it)
314  {
315  const NTV2OutputDest dst(*it);
316  string sSmall(::NTV2OutputDestinationToString(dst, true)), sBig(::NTV2OutputDestinationToString(dst, false));
317  gString2OutputDestMap.insert(String2OutputDestPair(sBig, dst));
318  gString2OutputDestMap.insert(String2OutputDestPair(sSmall, dst));
319  gString2OutputDestMap.insert(String2OutputDestPair(CNTV2DemoCommon::ToLower(sSmall), dst));
320  if (NTV2_OUTPUT_DEST_IS_SDI(dst))
321  {
322  const string str(aja::to_string(UWord(::NTV2OutputDestinationToChannel(dst)+1)));
323  gString2OutputDestMap.insert(String2OutputDestPair(str, dst));
324  }
325  } // for each output dest
326  gString2OutputDestMap.insert(String2OutputDestPair(string("hdmi1"),NTV2_OUTPUTDESTINATION_HDMI));
327 
328  // TCIndexes...
329  for (uint16_t ndx (0); ndx < NTV2_MAX_NUM_TIMECODE_INDEXES; ndx++)
330  {
331  const NTV2TCIndex tcIndex (NTV2TCIndex(ndx+0));
332  gTCIndexes.insert (tcIndex);
333  gString2TCIndexMap.insert (String2TCIndexPair(ULWordToString(ndx), tcIndex));
334  gString2TCIndexMap.insert (String2TCIndexPair(::NTV2TCIndexToString(tcIndex, false), tcIndex));
336  if (NTV2_IS_ANALOG_TIMECODE_INDEX(tcIndex))
337  gTCIndexesAnalog.insert (tcIndex);
338  else
339  gTCIndexesSDI.insert (tcIndex);
340  if (NTV2_IS_ATC_LTC_TIMECODE_INDEX(tcIndex))
341  gTCIndexesATCLTC.insert (tcIndex);
343  gTCIndexesVITC1.insert (tcIndex);
345  gTCIndexesVITC2.insert (tcIndex);
346  }
347 
348  { // Test Patterns...
352  {
353  string tpName(tpNames.at(tp));
354  aja::replace(aja::replace(aja::replace(tpName, " ", ""), "%", ""), "_", "");
355  gString2TPNamesMap.insert(String2TPNamePair(aja::lower(tpName), tpNames.at(tp)));
356  ostringstream oss; oss << DEC(tp);
357  gString2TPNamesMap.insert(String2TPNamePair(oss.str(), tpNames.at(tp)));
358  }
359  for (NTV2StringListConstIter it(colorNames.begin()); it != colorNames.end(); ++it)
360  {
361  string colorName(*it);
362  aja::replace(aja::replace(aja::replace(colorName, " ", ""), "%", ""), "_", "");
363  gString2TPNamesMap.insert(String2TPNamePair(aja::lower(colorName), *it));
364  }
365  }
366  } // constructor
367  private:
368  string ULWordToString (const ULWord inNum)
369  {
370  ostringstream oss;
371  oss << inNum;
372  return oss.str ();
373  }
374 }; // constructor
375 
377 
378 
380 {
381  NTV2TimeCodesConstIter it(fTimecodes.find(inTCNdx));
382  if (it != fTimecodes.end())
383  return it->second;
384  return NTV2_RP188();
385 }
386 
388 {
389  size_t errorCount(0);
390  if (fVideoBuffer)
391  if (!inDevice.DMABufferLock(fVideoBuffer, true))
392  errorCount++;
393  if (fVideoBuffer2)
394  if (!inDevice.DMABufferLock(fVideoBuffer2, true))
395  errorCount++;
396  if (fAudioBuffer)
397  if (!inDevice.DMABufferLock(fAudioBuffer, true))
398  errorCount++;
399  if (fAncBuffer)
400  if (!inDevice.DMABufferLock(fAncBuffer, true))
401  errorCount++;
402  if (fAncBuffer2)
403  if (!inDevice.DMABufferLock(fAncBuffer2, true))
404  errorCount++;
405  return !errorCount;
406 }
407 
409 {
410  size_t errorCount(0);
411  if (fVideoBuffer)
412  if (!inDevice.DMABufferUnlock(fVideoBuffer))
413  errorCount++;
414  if (fVideoBuffer2)
415  if (!inDevice.DMABufferUnlock(fVideoBuffer2))
416  errorCount++;
417  if (fAudioBuffer)
418  if (!inDevice.DMABufferUnlock(fAudioBuffer))
419  errorCount++;
420  if (fAncBuffer)
421  if (!inDevice.DMABufferUnlock(fAncBuffer))
422  errorCount++;
423  if (fAncBuffer2)
424  if (!inDevice.DMABufferUnlock(fAncBuffer2))
425  errorCount++;
426  return !errorCount;
427 }
428 
429 
430 bool CNTV2DemoCommon::IsValidDevice (const string & inDeviceSpec)
431 {
432  CNTV2Card device;
433  const string deviceSpec (inDeviceSpec.empty() ? "0" : inDeviceSpec);
434  if (! CNTV2DeviceScanner::GetFirstDeviceFromArgument (deviceSpec, device))
435  {
436  if (deviceSpec != "LIST" && deviceSpec != "list" && deviceSpec != "?")
437  cerr << "## ERROR: Failed to open device spec '" << deviceSpec << "'" << endl;
438  return false;
439  }
440  return true;
441 }
442 
443 
444 static string DeviceFilterString (const NTV2DeviceKinds inKinds)
445 {
446  if (inKinds == NTV2_DEVICEKIND_ALL)
447  return "any device";
448  else if (inKinds == NTV2_DEVICEKIND_NONE)
449  return "no device";
450 
451  vector<string> strs;
452  if (inKinds & NTV2_DEVICEKIND_INPUT)
453  strs.push_back("capture");
454  if (inKinds & NTV2_DEVICEKIND_OUTPUT)
455  strs.push_back("playout");
456  if (inKinds & NTV2_DEVICEKIND_SDI)
457  strs.push_back("SDI");
458  if (inKinds & NTV2_DEVICEKIND_HDMI)
459  strs.push_back("HDMI");
460  if (inKinds & NTV2_DEVICEKIND_ANALOG)
461  strs.push_back("analog video");
462  if (inKinds & NTV2_DEVICEKIND_SFP)
463  strs.push_back("IP/SFPs");
464  if (inKinds & NTV2_DEVICEKIND_EXTERNAL)
465  strs.push_back("Thunderbolt/PCMCIA");
466  if (inKinds & NTV2_DEVICEKIND_4K)
467  strs.push_back("4K");
468  if (inKinds & NTV2_DEVICEKIND_12G)
469  strs.push_back("12G SDI");
470  if (inKinds & NTV2_DEVICEKIND_6G)
471  strs.push_back("6G SDI");
472  if (inKinds & NTV2_DEVICEKIND_CUSTOM_ANC)
473  strs.push_back("custom Anc");
474  if (inKinds & NTV2_DEVICEKIND_RELAYS)
475  strs.push_back("SDI relays");
476  if (strs.empty())
477  return "??";
478 
479  ostringstream oss;
480  for (vector<string>::const_iterator it(strs.begin()); it != strs.end(); )
481  {
482  oss << *it;
483  if (++it != strs.end())
484  oss << " | ";
485  }
486  return oss.str();
487 }
488 
489 
491 {
492  ostringstream oss, hdr;
493  CNTV2Card device;
494  ULWord ndx(0);
495  const NTV2DeviceIDSet supportedDevices(::NTV2GetSupportedDevices(inKinds));
496  const string filterString(DeviceFilterString(inKinds));
497 
498  typedef map<NTV2DeviceID,UWord> DeviceTallies;
499  DeviceTallies tallies;
500 
501  for (ndx = 0; CNTV2DeviceScanner::GetDeviceAtIndex(ndx, device); ndx++)
502  {
503  const NTV2DeviceID deviceID(device.GetDeviceID());
504  string serialNum;
505  oss << endl
506  << DEC(ndx);
507  if (tallies.find(deviceID) == tallies.end())
508  {
509  tallies[deviceID] = 1;
510  oss << endl
511  << ToLower(::NTV2DeviceIDToString(deviceID));
512  }
513  else
514  {
515  const UWord num(tallies[deviceID]);
516  tallies.erase(deviceID);
517  tallies[deviceID] = num+1;
518  }
519  if (device.GetSerialNumberString(serialNum))
520  oss << endl
521  << serialNum;
522  if (inKinds != NTV2_DEVICEKIND_ALL && inKinds != NTV2_DEVICEKIND_NONE)
523  if (supportedDevices.find(deviceID) == supportedDevices.end())
524  oss << "\t## Doesn't support one of " << filterString;
525  oss << endl;
526  }
527 
528  if (!ndx)
529  return string("No devices\n");
530  hdr << DEC(ndx) << " local " << (ndx == 1 ? "device" : "devices") << " found:" << endl
531  << setw(16) << left << "Legal -d Values" << endl
532  << setw(16) << left << "----------------";
533  hdr << oss.str();
534  return hdr.str();
535 }
536 
537 
539 {
540  switch(inKinds)
541  {
542  case VIDEO_FORMATS_ALL: return gAllFormats;
543  case VIDEO_FORMATS_4KUHD: return g4KFormats;
544  case VIDEO_FORMATS_8KUHD2: return g8KFormats;
545  default: return gNon4KFormats;
546  }
547 }
548 
549 
550 string CNTV2DemoCommon::GetVideoFormatStrings (const NTV2VideoFormatKinds inKinds, const string inDeviceSpecifier)
551 {
552  const NTV2VideoFormatSet & formatSet (GetSupportedVideoFormats(inKinds));
553  ostringstream oss;
554  CNTV2Card theDevice;
555  if (!inDeviceSpecifier.empty())
556  CNTV2DeviceScanner::GetFirstDeviceFromArgument (inDeviceSpecifier, theDevice);
557 
558  oss << setw(25) << left << "Video Format" << "\t" << setw(16) << left << "Legal -v Values" << endl
559  << setw(25) << left << "------------------------" << "\t" << setw(16) << left << "----------------" << endl;
560  for (NTV2VideoFormatSetConstIter iter(formatSet.begin()); iter != formatSet.end(); ++iter)
561  {
562  string formatName (::NTV2VideoFormatToString (*iter));
564  if (*iter == it->second)
565  {
566  oss << setw(25) << left << formatName << "\t" << setw(16) << left << it->first;
567  if (!inDeviceSpecifier.empty() && theDevice.IsOpen() && !theDevice.features().CanDoVideoFormat(*iter))
568  oss << "\t## Incompatible with " << theDevice.GetDisplayName();
569  oss << endl;
570  formatName.clear();
571  }
572  oss << endl;
573  }
574  return oss.str();
575 }
576 
577 
579 {
580  if (inKinds == PIXEL_FORMATS_ALL)
581  return gPixelFormats;
582 
584 
585  if (inKinds & PIXEL_FORMATS_RGB)
586  result += gFBFsRGB;
587  if (inKinds & PIXEL_FORMATS_PLANAR)
588  result += gFBFsPlanar;
589  if (inKinds & PIXEL_FORMATS_RAW)
590  result += gFBFsRaw;
591  if (inKinds & PIXEL_FORMATS_PACKED)
592  result += gFBFsPacked;
593  if (inKinds & PIXEL_FORMATS_ALPHA)
594  result += gFBFsAlpha;
595 
596  return result;
597 }
598 
599 
600 string CNTV2DemoCommon::GetPixelFormatStrings (const NTV2PixelFormatKinds inKinds, const string inDeviceSpecifier)
601 {
602  const NTV2FrameBufferFormatSet & formatSet (GetSupportedPixelFormats(inKinds));
603  string displayName;
604  CNTV2Card device;
605  ostringstream oss;
606 
607  if (!inDeviceSpecifier.empty())
608  {
609  CNTV2DeviceScanner::GetFirstDeviceFromArgument (inDeviceSpecifier, device);
610  if (device.IsOpen ())
611  displayName = device.GetDisplayName();
612  }
613 
614 
615  oss << setw (34) << left << "Frame Buffer Format" << "\t" << setw (32) << left << "Legal -p Values" << endl
616  << setw (34) << left << "----------------------------------" << "\t" << setw (32) << left << "--------------------------------" << endl;
617  for (NTV2FrameBufferFormatSetConstIter iter (formatSet.begin ()); iter != formatSet.end (); ++iter)
618  {
619  string formatName (::NTV2FrameBufferFormatToString (*iter, true));
621  if (*iter == it->second)
622  {
623  oss << setw(35) << left << formatName << "\t" << setw(25) << left << it->first;
624  if (!displayName.empty() && !device.features().CanDoFrameBufferFormat(*iter))
625  oss << "\t## Incompatible with " << displayName;
626  oss << endl;
627  formatName.clear ();
628  }
629  oss << endl;
630  }
631  return oss.str();
632 }
633 
634 
636 {
638  if (iter == gString2VideoFormatMap.end())
639  return NTV2_FORMAT_UNKNOWN;
640  const NTV2VideoFormat format (iter->second);
641  if (inKinds == VIDEO_FORMATS_ALL)
642  return format;
643  if (inKinds == VIDEO_FORMATS_4KUHD && NTV2_IS_4K_VIDEO_FORMAT(format))
644  return format;
645  if (inKinds == VIDEO_FORMATS_8KUHD2 && NTV2_IS_QUAD_QUAD_FORMAT(format))
646  return format;
647  if (inKinds == VIDEO_FORMATS_NON_4KUHD && !NTV2_IS_4K_VIDEO_FORMAT(format))
648  return format;
649  return NTV2_FORMAT_UNKNOWN;
650 }
651 
652 
654 {
656  return iter != gString2PixelFormatMap.end () ? iter->second : NTV2_FBF_INVALID;
657 }
658 
659 
661 {
662  if (inKinds == NTV2_IOKINDS_ALL)
663  return gInputSources;
664 
665  NTV2InputSourceSet result;
666 
667  if (inKinds & NTV2_IOKINDS_SDI)
668  result += gInputSourcesSDI;
669  if (inKinds & NTV2_IOKINDS_HDMI)
670  result += gInputSourcesHDMI;
671  if (inKinds & NTV2_IOKINDS_ANALOG)
672  result += gInputSourcesAnalog;
673 
674  return result;
675 }
676 
677 
678 string CNTV2DemoCommon::GetInputSourceStrings (const NTV2IOKinds inKinds, const string inDeviceSpecifier)
679 {
680  const NTV2InputSourceSet & sourceSet (GetSupportedInputSources (inKinds));
681  ostringstream oss;
682  CNTV2Card theDevice;
683  if (!inDeviceSpecifier.empty ())
684  CNTV2DeviceScanner::GetFirstDeviceFromArgument (inDeviceSpecifier, theDevice);
685 
686  oss << setw (25) << left << "Input Source" << "\t" << setw (16) << left << "Legal -i Values" << endl
687  << setw (25) << left << "------------------------" << "\t" << setw (16) << left << "----------------" << endl;
688  for (NTV2InputSourceSetConstIter iter(sourceSet.begin()); iter != sourceSet.end(); ++iter)
689  {
690  string sourceName (::NTV2InputSourceToString (*iter));
692  if (*iter == it->second)
693  {
694  oss << setw (25) << left << sourceName << "\t" << setw (16) << left << it->first;
695  if (!inDeviceSpecifier.empty () && theDevice.IsOpen() && !theDevice.features().CanDoInputSource(*iter))
696  oss << "\t## Incompatible with " << theDevice.GetDisplayName();
697  oss << endl;
698  sourceName.clear();
699  }
700  oss << endl;
701  }
702  return oss.str ();
703 }
704 
705 
707 {
709  if (iter == gString2InputSourceMap.end ())
711  return iter->second;
712 }
713 
714 
715 string CNTV2DemoCommon::GetOutputDestinationStrings (const string inDeviceSpecifier)
716 {
718  ostringstream oss;
719  CNTV2Card theDevice;
720  if (!inDeviceSpecifier.empty())
721  CNTV2DeviceScanner::GetFirstDeviceFromArgument(inDeviceSpecifier, theDevice);
722 
723  oss << setw (25) << left << "Output Destination" << "\t" << setw(16) << left << "Legal -o Values" << endl
724  << setw (25) << left << "------------------------" << "\t" << setw(16) << left << "----------------" << endl;
725  for (NTV2OutputDestinationsConstIter iter(dests.begin()); iter != dests.end(); ++iter)
726  {
727  string destName(::NTV2OutputDestinationToString(*iter));
729  if (*iter == it->second)
730  {
731  oss << setw(25) << left << destName << "\t" << setw(16) << left << it->first;
732  if (!inDeviceSpecifier.empty() && theDevice.IsOpen() && !theDevice.features().CanDoOutputDestination(*iter))
733  oss << "\t## Incompatible with " << theDevice.GetDisplayName();
734  oss << endl;
735  destName.clear();
736  }
737  oss << endl;
738  }
739  return oss.str();
740 }
741 
742 
744 {
746  if (iter == gString2OutputDestMap.end())
748  return iter->second;
749 }
750 
751 
753 {
754  if (inKinds == TC_INDEXES_ALL)
755  return gTCIndexes;
756 
757  NTV2TCIndexes result;
758 
759  if (inKinds & TC_INDEXES_SDI)
760  result += gTCIndexesSDI;
761  if (inKinds & TC_INDEXES_ANALOG)
762  result += gTCIndexesAnalog;
763  if (inKinds & TC_INDEXES_ATCLTC)
764  result += gTCIndexesATCLTC;
765  if (inKinds & TC_INDEXES_VITC1)
766  result += gTCIndexesVITC1;
767  if (inKinds & TC_INDEXES_VITC2)
768  result += gTCIndexesVITC2;
769 
770  return result;
771 }
772 
774  const string inDeviceSpecifier,
775  const bool inIsInputOnly)
776 {
777  const NTV2TCIndexes & tcIndexes (GetSupportedTCIndexes(inKinds));
778  ostringstream oss;
779  CNTV2Card theDevice;
780  if (!inDeviceSpecifier.empty())
781  CNTV2DeviceScanner::GetFirstDeviceFromArgument (inDeviceSpecifier, theDevice);
782 
783  oss << setw (25) << left << "Timecode Index" << "\t" << setw (16) << left << "Legal Values " << endl
784  << setw (25) << left << "------------------------" << "\t" << setw (16) << left << "----------------" << endl;
785  for (NTV2TCIndexesConstIter iter (tcIndexes.begin()); iter != tcIndexes.end(); ++iter)
786  {
787  string tcNdxName(::NTV2TCIndexToString(*iter));
788  for (String2TCIndexMapConstIter it (gString2TCIndexMap.begin()); it != gString2TCIndexMap.end(); ++it)
789  if (*iter == it->second)
790  {
791  oss << setw (25) << left << tcNdxName << "\t" << setw (16) << left << it->first;
792  if (!inDeviceSpecifier.empty() && theDevice.IsOpen())
793  {
794 // const NTV2DeviceID deviceID(theDevice.GetDeviceID());
795  const bool canDoTCIndex (inIsInputOnly ? theDevice.features().CanDoInputTCIndex(*iter)
796  : theDevice.features().CanDoOutputTCIndex(*iter));
797  if (!canDoTCIndex)
798  oss << "\t## Incompatible with " << theDevice.GetDisplayName();
799  }
800  oss << endl;
801  tcNdxName.clear();
802  }
803  oss << endl;
804  }
805  return oss.str();
806 }
807 
808 
810 {
812  if (iter == gString2TCIndexMap.end ())
813  return NTV2_TCINDEX_INVALID;
814  return iter->second;
815 }
816 
817 
818 string CNTV2DemoCommon::GetAudioSystemStrings (const string inDeviceSpecifier)
819 {
820  CNTV2Card device;
821  string displayName;
822  ostringstream oss;
823 
824  if (!inDeviceSpecifier.empty())
825  {
826  CNTV2DeviceScanner::GetFirstDeviceFromArgument (inDeviceSpecifier, device);
827  if (device.IsOpen())
828  displayName = device.GetDisplayName();
829  }
830 
831  const UWord numAudioSystems (device.features().GetNumAudioSystems());
832  oss << setw(12) << left << "Audio System" << endl
833  << setw(12) << left << "------------" << endl;
834  for (UWord ndx(0); ndx < 8; ndx++)
835  {
836  oss << setw(12) << left << (ndx+1);
837  if (!displayName.empty() && ndx >= numAudioSystems)
838  oss << "\t## Incompatible with " << displayName;
839  oss << endl;
840  }
841  return oss.str();
842 }
843 
844 
846 {
848  return iter != gString2AudioSystemMap.end() ? iter->second : NTV2_AUDIOSYSTEM_INVALID;
849 }
850 
852 {
853  typedef map<string,string> NTV2StringMap;
854  NTV2StringSet keys;
855  for (String2VANCModeMapConstIter it(gString2VANCModeMap.begin()); it != gString2VANCModeMap.end(); ++it)
856  {
857  const string val(aja::to_string(it->second));
858  if (keys.find(val) == keys.end())
859  keys.insert(val);
860  }
861 
862  NTV2StringMap legals;
863  for (NTV2StringSet::const_iterator kit(keys.begin()); kit != keys.end(); ++kit)
864  {
865  NTV2VANCMode officialVM(NTV2VANCMode(aja::stoul(*kit)));
866  NTV2StringList legalValues;
867  for (String2VANCModeMapConstIter it(gString2VANCModeMap.begin()); it != gString2VANCModeMap.end(); ++it)
868  if (it->second == officialVM)
869  legalValues.push_back(it->first);
870  legals[aja::to_string(officialVM)] = aja::join(legalValues, ", ");
871  }
872 
873  ostringstream oss;
874  oss << setw(12) << left << "VANC Mode" << "\t" << setw(32) << left << "Legal --vanc Values " << endl
875  << setw(12) << left << "---------" << "\t" << setw(32) << left << "--------------------------------" << endl;
876  for (NTV2StringMap::const_iterator it(legals.begin()); it != legals.end(); ++it)
877  oss << setw(12) << left << it->first << "\t" << setw(32) << left << it->second << endl;
878  return oss.str();
879 }
880 
881 
883 {
885  return iter != gString2VANCModeMap.end() ? iter->second : NTV2_VANCMODE_INVALID;
886 }
887 
888 
890 {
891  typedef map<string,string> NTV2StringMap;
892  NTV2StringSet keys;
893  for (String2TPNamesMapConstIter it(gString2TPNamesMap.begin()); it != gString2TPNamesMap.end(); ++it)
894  if (keys.find(it->second) == keys.end())
895  keys.insert(it->second);
896 
897  NTV2StringMap legals;
898  for (NTV2StringSet::const_iterator kit(keys.begin()); kit != keys.end(); ++kit)
899  {
900  const string & officialPatName(*kit);
901  NTV2StringList legalValues;
902  for (String2TPNamesMapConstIter it(gString2TPNamesMap.begin()); it != gString2TPNamesMap.end(); ++it)
903  if (it->second == officialPatName)
904  legalValues.push_back(it->first);
905  legals[officialPatName] = aja::join(legalValues, ", ");
906  }
907 
908  ostringstream oss;
909  oss << setw(25) << left << "Test Pattern or Color " << "\t" << setw(22) << left << "Legal --pattern Values" << endl
910  << setw(25) << left << "------------------------" << "\t" << setw(22) << left << "----------------------" << endl;
911  for (NTV2StringMap::const_iterator it(legals.begin()); it != legals.end(); ++it)
912  oss << setw(25) << left << it->first << "\t" << setw(22) << left << it->second << endl;
913  return oss.str();
914 }
915 
916 
918 {
919  string tpName(inStr);
920  aja::lower(aja::strip(aja::replace(tpName, " ", "")));
922  return (it != gString2TPNamesMap.end()) ? it->second : "";
923 }
924 
925 
926 string CNTV2DemoCommon::ToLower (const string & inStr)
927 {
928  string result(inStr);
929  return aja::lower(result);
930 }
931 
932 
933 string CNTV2DemoCommon::StripFormatString (const std::string & inStr)
934 {
935  string result (inStr);
936  while (result.find (" ") != string::npos)
937  result.erase (result.find (" "), 1);
938  while (result.find ("00") != string::npos)
939  result.erase (result.find ("00"), 2);
940  while (result.find (".") != string::npos)
941  result.erase (result.find ("."), 1);
942  return result;
943 }
944 
945 
947 {
948  char result (0);
949  #if defined (AJAMac) || defined (AJALinux)
950  struct termios terminalStatus;
951  ::memset (&terminalStatus, 0, sizeof (terminalStatus));
952  if (::tcgetattr (0, &terminalStatus) < 0)
953  cerr << "tcsetattr()";
954  terminalStatus.c_lflag &= ~uint32_t(ICANON);
955  terminalStatus.c_lflag &= ~uint32_t(ECHO);
956  terminalStatus.c_cc[VMIN] = 1;
957  terminalStatus.c_cc[VTIME] = 0;
958  if (::tcsetattr (0, TCSANOW, &terminalStatus) < 0)
959  cerr << "tcsetattr ICANON";
960  if (::read (0, &result, 1) < 0)
961  cerr << "read()" << endl;
962  terminalStatus.c_lflag |= ICANON;
963  terminalStatus.c_lflag |= ECHO;
964  if (::tcsetattr (0, TCSADRAIN, &terminalStatus) < 0)
965  cerr << "tcsetattr ~ICANON" << endl;
966  #elif defined (MSWindows) || defined (AJAWindows)
967  HANDLE hdl (GetStdHandle (STD_INPUT_HANDLE));
968  DWORD nEvents (0);
969  INPUT_RECORD buffer;
970  PeekConsoleInput (hdl, &buffer, 1, &nEvents);
971  if (nEvents > 0)
972  {
973  ReadConsoleInput (hdl, &buffer, 1, &nEvents);
974  result = char (buffer.Event.KeyEvent.wVirtualKeyCode);
975  }
976  #endif
977  return result;
978 }
979 
980 
982 {
983  cout << "## Press Enter/Return key to exit: ";
984  cout.flush();
985  cin.get();
986 }
987 
988 
990 {
992  switch (inFrameRate)
993  {
994  case NTV2_FRAMERATE_6000: result = kTCFormat60fps; break;
995  case NTV2_FRAMERATE_5994: result = kTCFormat60fpsDF; break;
996  case NTV2_FRAMERATE_4800: result = kTCFormat48fps; break;
997  case NTV2_FRAMERATE_4795: result = kTCFormat48fps; break;
998  case NTV2_FRAMERATE_3000: result = kTCFormat30fps; break;
999  case NTV2_FRAMERATE_2997: result = kTCFormat30fpsDF; break;
1000  case NTV2_FRAMERATE_2500: result = kTCFormat25fps; break;
1001  case NTV2_FRAMERATE_2400: result = kTCFormat24fps; break;
1002  case NTV2_FRAMERATE_2398: result = kTCFormat24fps; break;
1003  case NTV2_FRAMERATE_5000: result = kTCFormat50fps; break;
1004  default: break;
1005  }
1006  return result;
1007 
1008 } // NTV2FrameRate2TimecodeFormat
1009 
1010 
1012 {
1013  switch (inFrameRate)
1014  {
1017 #if !defined(NTV2_DEPRECATE_16_0)
1022 #endif
1023  case NTV2_FRAMERATE_5000: return AJA_FrameRate_5000;
1035 
1036  case NTV2_NUM_FRAMERATES:
1037  case NTV2_FRAMERATE_UNKNOWN: break;
1038  }
1039  return AJA_FrameRate_Unknown;
1040 } // GetAJAFrameRate
1041 
1042 
1044 {
1045  switch (inFormat)
1046  {
1049  case NTV2_FBF_ARGB: return AJA_PixelFormat_ARGB8;
1050  case NTV2_FBF_RGBA: return AJA_PixelFormat_RGBA8;
1053  case NTV2_FBF_ABGR: return AJA_PixelFormat_ABGR8;
1067 
1072 
1077 
1080  case NTV2_FBF_10BIT_ARGB:
1081  case NTV2_FBF_16BIT_ARGB:
1082  case NTV2_FBF_INVALID: break;
1083  }
1084  return AJA_PixelFormat_Unknown;
1085 } // GetAJAPixelFormat
1086 
1087 
1089 {
1090  static struct VideoFormatPair
1091  {
1092  NTV2VideoFormat vIn;
1093  NTV2VideoFormat vOut;
1094  } VideoFormatPairs[] = { // vIn vOut
1113 
1117 
1121  };
1122  for (size_t formatNdx(0); formatNdx < sizeof(VideoFormatPairs) / sizeof(VideoFormatPair); formatNdx++)
1123  if (VideoFormatPairs[formatNdx].vIn == inOutVideoFormat)
1124  {
1125  inOutVideoFormat = VideoFormatPairs[formatNdx].vOut;
1126  return true;
1127  }
1128  return false;
1129 
1130 } // get4KInputFormat
1131 
1133 {
1134  static struct VideoFormatPair
1135  {
1136  NTV2VideoFormat vIn;
1137  NTV2VideoFormat vOut;
1138  } VideoFormatPairs[] = { // vIn vOut
1165  };
1166  for (size_t formatNdx(0); formatNdx < sizeof(VideoFormatPairs) / sizeof(VideoFormatPair); formatNdx++)
1167  if (VideoFormatPairs[formatNdx].vIn == inOutVideoFormat)
1168  {
1169  inOutVideoFormat = VideoFormatPairs[formatNdx].vOut;
1170  return true;
1171  }
1172  return false;
1173 
1174 } // get8KInputFormat
1175 
1176 
1178 {
1179  return gGlobalMutexName.c_str();
1180 }
1181 
1183 {
1184  UWord totFrameStores(inDevice.features().GetNumFrameStores());
1185  UWord totTSIMuxers(inDevice.features().GetNumTSIMuxers());
1186  UWord firstFramestoreIndex = UWord(::GetIndexForNTV2Channel(in1stFrameStore));
1187  UWord tsiMux(firstFramestoreIndex);
1188  NTV2ChannelList result;
1189  if (totFrameStores > totTSIMuxers)
1190  tsiMux = firstFramestoreIndex/2;
1191  else if (totFrameStores < totTSIMuxers)
1192  tsiMux = firstFramestoreIndex*2;
1193  for (UWord num(0); num < inCount; num++)
1194  result.push_back(NTV2Channel(tsiMux + num));
1195  return result;
1196 }
1197 
1198 
1200  const CaptureConfig & inConfig,
1201  const bool isInputRGB)
1202 {
1203  const bool isFrameRGB (::IsRGBFormat(inConfig.fPixelFormat));
1205  const NTV2OutputXptID inputOXpt (::GetInputSourceOutputXpt(inConfig.fInputSource, false, isInputRGB));
1206  const NTV2InputXptID cscVidIXpt (::GetCSCInputXptFromChannel(inConfig.fInputChannel));
1207  NTV2OutputXptID cscOXpt (::GetCSCOutputXptFromChannel(inConfig.fInputChannel, /*key?*/false, /*RGB?*/isFrameRGB));
1208 
1209  conns.clear();
1210  if (isInputRGB && !isFrameRGB)
1211  {
1212  conns.insert(NTV2Connection(fbIXpt, cscOXpt)); // FB <== CSC
1213  conns.insert(NTV2Connection(cscVidIXpt, inputOXpt)); // CSC <== SDIIn/HDMIin
1214  }
1215  else if (!isInputRGB && isFrameRGB)
1216  {
1217  conns.insert(NTV2Connection(fbIXpt, cscOXpt)); // FB <== CSC
1218  conns.insert(NTV2Connection(cscVidIXpt, inputOXpt)); // CSC <== SDIIn/HDMIIn
1219  }
1220  else
1221  conns.insert(NTV2Connection(fbIXpt, inputOXpt)); // FB <== SDIIn/HDMIin
1222 
1223  return !conns.empty();
1224 
1225 } // GetRoutingCapture
1226 
1227 
1229  const CaptureConfig & inConfig,
1230  const NTV2DeviceID devID,
1231  const bool isInputRGB)
1232 {
1233  UWord sdi(0), mux(0), csc(0), fb(0), path(0);
1236  const bool isFrameRGB (::IsRGBFormat(inConfig.fPixelFormat));
1237  conns.clear();
1239  { // HDMI
1240  if (inConfig.fInputChannel == NTV2_CHANNEL1)
1241  { // HDMI CH1234
1242  if (isInputRGB == isFrameRGB)
1243  { // HDMI CH1234 RGB SIGNAL AND RGB FBF OR YUV SIGNAL AND YUV FBF
1244  for (path = 0; path < 4; path++)
1245  { // MUX <== HDMIIn
1246  in = ::GetTSIMuxInputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1);
1247  out = ::GetInputSourceOutputXpt(inConfig.fInputSource, /*DS2*/false, isInputRGB, /*quadrant*/path);
1248  conns.insert(NTV2Connection(in, out));
1249  // FB <== MUX
1250  in = ::GetFrameBufferInputXptFromChannel(NTV2Channel(fb+path/2), /*Binput*/path & 1);
1251  out = ::GetTSIMuxOutputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1, /*RGB*/isInputRGB);
1252  conns.insert(NTV2Connection(in, out));
1253  }
1254  } // HDMI CH1234 RGB SIGNAL AND RGB FBF
1255  else if (isInputRGB && !isFrameRGB)
1256  { // HDMI CH1234 RGB SIGNAL AND YUV FBF
1257  for (path = 0; path < 4; path++)
1258  {
1259  // CSC <== HDMIIn
1260  in = ::GetCSCInputXptFromChannel(NTV2Channel(csc+path));
1261  out = ::GetInputSourceOutputXpt(inConfig.fInputSource, /*DS2*/false, isInputRGB, /*quadrant*/path);
1262  conns.insert(NTV2Connection(in, out));
1263  // MUX <== CSC
1264  in = ::GetTSIMuxInputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1);
1265  out = ::GetCSCOutputXptFromChannel(NTV2Channel(csc+path), /*key*/false, /*rgb*/isFrameRGB);
1266  conns.insert(NTV2Connection(in, out));
1267  // FB <== MUX
1268  in = ::GetFrameBufferInputXptFromChannel(NTV2Channel(fb+path/2), /*DS2*/path & 1);
1269  out = ::GetTSIMuxOutputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1, /*rgb*/isFrameRGB);
1270  conns.insert(NTV2Connection(in, out));
1271  }
1272  } // HDMI CH1234 RGB SIGNAL AND YUV FBF
1273  else // !isInputRGB && isFrameRGB
1274  { // HDMI CH1234 YUV SIGNAL AND RGB FBF
1275  for (path = 0; path < 4; path++)
1276  {
1277  // CSC <== HDMIIn
1278  in = ::GetCSCInputXptFromChannel(NTV2Channel(csc+path));
1279  out = ::GetInputSourceOutputXpt(inConfig.fInputSource, /*DS2*/false, isInputRGB, /*quadrant*/path);
1280  conns.insert(NTV2Connection(in, out));
1281  // MUX <== CSC
1282  in = ::GetTSIMuxInputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1);
1283  out = ::GetCSCOutputXptFromChannel(NTV2Channel(csc+path), /*key*/false, /*rgb*/isFrameRGB);
1284  conns.insert(NTV2Connection(in, out));
1285  // FB <== MUX
1286  in = ::GetFrameBufferInputXptFromChannel(NTV2Channel(fb+path/2), /*DS2*/path & 1);
1287  out = ::GetTSIMuxOutputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1, /*rgb*/isFrameRGB);
1288  conns.insert(NTV2Connection(in, out));
1289  }
1290  } // HDMI CH1234 YUV SIGNAL AND RGB FBF
1291  } // HDMI CH1234
1292  else
1293  { // HDMI CH5678
1294  cerr << "## ERROR: Ch5678 must be for Corvid88, but no HDMI on that device" << endl;
1295  } // HDMI CH5678
1296  } // HDMI
1297  else
1298  { // SDI
1299  if (::NTV2DeviceCanDo12gRouting(devID))
1300  { // FB <== SDIIn
1302  out = ::GetInputSourceOutputXpt(inConfig.fInputSource);
1303  conns.insert(NTV2Connection(in, out));
1304  }
1305  else
1306  { // SDI CH1234 or CH5678
1307  if (inConfig.fInputChannel != NTV2_CHANNEL1)
1308  {fb = 4; sdi = fb; mux = fb / 2; csc = fb;}
1309  if (isFrameRGB)
1310  { // RGB FB
1311  if (inConfig.fDoTSIRouting)
1312  { // SDI CH1234 RGB TSI
1313  for (path = 0; path < 4; path++)
1314  {
1315  // CSC <== SDIIn
1316  in = ::GetCSCInputXptFromChannel(NTV2Channel(csc+path));
1318  conns.insert(NTV2Connection(in, out));
1319  // MUX <== CSC
1320  in = ::GetTSIMuxInputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1);
1321  out = ::GetCSCOutputXptFromChannel(NTV2Channel(csc+path), /*key*/false, /*rgb*/isFrameRGB);
1322  conns.insert(NTV2Connection(in, out));
1323  // FB <== MUX
1324  in = ::GetFrameBufferInputXptFromChannel(NTV2Channel(fb+path/2), /*DS2*/path & 1);
1325  out = ::GetTSIMuxOutputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1, /*rgb*/isFrameRGB);
1326  conns.insert(NTV2Connection(in, out));
1327  } // for each spigot
1328  } // SDI CH1234 RGB TSI
1329  else
1330  { // SDI CH1234 RGB SQUARES
1331  for (path = 0; path < 4; path++)
1332  {
1333  // CSC <== SDIIn
1334  in = ::GetCSCInputXptFromChannel(NTV2Channel(csc+path));
1336  conns.insert(NTV2Connection(in, out));
1337  // FB <== CSC
1339  out = ::GetCSCOutputXptFromChannel(NTV2Channel(csc+path), /*key*/false, /*rgb*/isFrameRGB);
1340  conns.insert(NTV2Connection(in, out));
1341  } // for each spigot
1342  } // SDI CH1234 RGB SQUARES
1343  } // SDI CH1234 RGB FBF
1344  else // YUV FBF
1345  {
1346  if (inConfig.fDoTSIRouting)
1347  { // SDI CH1234 YUV TSI
1348  for (path = 0; path < 4; path++)
1349  {
1350  // MUX <== SDIIn
1351  in = ::GetTSIMuxInputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1);
1353  conns.insert(NTV2Connection(in, out));
1354  // FB <== MUX
1355  in = ::GetFrameBufferInputXptFromChannel(NTV2Channel(fb+path/2), /*DS2*/path & 1);
1356  out = ::GetTSIMuxOutputXptFromChannel(NTV2Channel(mux+path/2), /*LinkB*/path & 1, /*rgb*/isFrameRGB);
1357  conns.insert(NTV2Connection(in, out));
1358  } // for each spigot
1359  } // SDI CH1234 YUV TSI
1360  else
1361  {
1362  for (path = 0; path < 4; path++)
1363  { // FB <== SDIIn
1366  conns.insert(NTV2Connection(in, out));
1367  } // for each path
1368  } // SDI CH1234 YUV SQUARES
1369  } // YUV FBF
1370  } // 3G SDI CH1234 or CH5678
1371  } // SDI
1372  return !conns.empty();
1373 } // GetRoutingCapture4K
1374 
1375 
1377  const CaptureConfig & inConfig,
1378  const NTV2VideoFormat inVideoFormat,
1379  const NTV2DeviceID devID,
1380  const bool isInputRGB)
1381 { (void)isInputRGB; (void) devID;
1382  UWord fb(0), path(0);
1385  const bool isFrameRGB (::IsRGBFormat(inConfig.fPixelFormat));
1386  const bool isQuadQuadHFR (NTV2_IS_QUAD_QUAD_HFR_VIDEO_FORMAT(inVideoFormat));
1387  conns.clear();
1388  if (inConfig.fInputChannel % 2)
1389  return false; // Input channel cannot be Ch2/Ch4/Ch6/etc
1390  if (inConfig.fInputChannel > 3)
1391  return false; // Input channel cannot be Ch5 or greater
1392  if (::NTV2InputSourceToChannel(inConfig.fInputSource) % 2)
1393  return false; // Input source cannot be SDIIn2/4/6/etc
1394  if (::NTV2InputSourceToChannel(inConfig.fInputSource) > 3)
1395  return false; // Input source cannot be SDIIn5 or greater
1396 
1397  if (inConfig.fDoTSIRouting)
1398  { // TSI
1399  if (inConfig.fInputChannel)
1400  fb = 2;
1401  for (path = 0; path < 4; path++)
1402  if (isFrameRGB) // Uses 2 FBs, 4 SDIs
1403  { // RGB
1404  // DLInDS1 <== SDIInDS1
1405  in = ::GetDLInInputXptFromChannel (NTV2Channel(path), /*B*/false);
1406  out = ::GetSDIInputOutputXptFromChannel (NTV2Channel(path), /*DS2*/false);
1407  conns.insert(NTV2Connection(in, out));
1408  // DLInDS2 <== SDIInDS2
1409  in = ::GetDLInInputXptFromChannel (NTV2Channel(path), /*B*/true);
1410  out = ::GetSDIInputOutputXptFromChannel (NTV2Channel(path), /*DS2*/true);
1411  conns.insert(NTV2Connection(in, out));
1412  // FB <== DLIn
1413  in = ::GetFrameBufferInputXptFromChannel (NTV2Channel(fb+path/2), /*B*/path & 1);
1415  conns.insert(NTV2Connection(in, out));
1416  } // if RGB
1417  else if (isQuadQuadHFR) // Uses 2 FBs, 4 SDIs
1418  { // FB <== SDIIn, FBDS2 <== SDIIn
1419  in = ::GetFrameBufferInputXptFromChannel (NTV2Channel(fb+path/2), /*DS2?*/path & 1);
1421  conns.insert(NTV2Connection(in, out));
1422  } // else if YUV QuadQuad
1423  else // Uses 2 FBs, 2 SDIs
1424  { // FB <== SDIIn, FBDS2 <== SDIInDS2
1425  in = ::GetFrameBufferInputXptFromChannel (NTV2Channel(fb+path/2), /*DS2?*/path & 1);
1426  out = ::GetSDIInputOutputXptFromChannel (NTV2Channel(fb+path/2), /*DS2?*/path & 1);
1427  conns.insert(NTV2Connection(in, out));
1428  } // else YUV non-QuadQuad
1429  } // if TSI
1430  else
1431  { // Square-division routing
1432  if (inConfig.fInputChannel)
1433  return false; // Sorry, Ch1 only
1434  if (inConfig.fInputSource != NTV2_INPUTSOURCE_SDI1)
1435  return false; // Sorry, SDI1 only (1st SDI of 4 links)
1436  for (path = 0; path < 4; path++) // 4 FBs, 4 SDIs
1437  if (isFrameRGB)
1438  { // RGB
1439  // DLInDS1 <== SDIInDS1
1440  in = ::GetDLInInputXptFromChannel (NTV2Channel(path), /*B*/false);
1441  out = ::GetSDIInputOutputXptFromChannel (NTV2Channel(path), /*DS2*/false);
1442  conns.insert(NTV2Connection(in, out));
1443  // DLInDS2 <== SDIInDS2
1444  in = ::GetDLInInputXptFromChannel (NTV2Channel(path), /*B*/true);
1445  out = ::GetSDIInputOutputXptFromChannel (NTV2Channel(path), /*DS2*/true);
1446  conns.insert(NTV2Connection(in, out));
1447  // FB <== DLIn
1450  conns.insert(NTV2Connection(in, out));
1451  } // for each path
1452  else // YUV
1453  { // FB <== SDIIn
1456  conns.insert(NTV2Connection(in, out));
1457  } // for each path
1458  } // else Squares
1459  return !conns.empty();
1460 } // GetInputRouting8K
1461 
1462 
1463 bool CNTV2DemoCommon::ConfigureAudioSystems (CNTV2Card & inDevice, const CaptureConfig & inConfig, const NTV2AudioSystemSet inAudioSystems)
1464 {
1465  UWord failures(0);
1466  UWord numAudChannels(inDevice.features().GetMaxAudioChannels());
1467  for (NTV2AudioSystemSetConstIter it(inAudioSystems.begin()); it != inAudioSystems.end(); ++it)
1468  { const NTV2AudioSystem audSys(*it);
1469  // Have the audio system capture audio from the designated device input...
1470  if (!inDevice.SetAudioSystemInputSource (audSys, NTV2_AUDIO_EMBEDDED,
1472  failures++;
1473 
1474  // Configure for max available audio channels, 48KHz, 4MB buffers, and disable loopback...
1475  if (!inDevice.SetNumberAudioChannels (numAudChannels, audSys)) failures++;
1476  if (!inDevice.SetAudioRate (NTV2_AUDIO_48K, audSys)) failures++;
1477  if (!inDevice.SetAudioBufferSize (NTV2_AUDIO_BUFFER_SIZE_4MB, audSys)) failures++;
1478  if (!inDevice.SetAudioLoopBack(NTV2_AUDIO_LOOPBACK_OFF, audSys)) failures++;
1479  }
1480  return !failures;
1481 }
1482 
1483 
1485 {
1486  const size_t hwPageSizeBytes (NTV2Buffer::HostPageSize());
1487  const size_t sdkPageSizeBytes (NTV2Buffer::DefaultPageSize());
1488  if (hwPageSizeBytes != sdkPageSizeBytes)
1489  {
1490  if (NTV2Buffer::SetDefaultPageSize(hwPageSizeBytes))
1491  cerr << "## NOTE: Page size changed from " << DEC(sdkPageSizeBytes/1024) << "K to " << DEC(hwPageSizeBytes/1024) << "K" << endl;
1492  else
1493  cerr << "## WARNING: Failed to change page size from " << DEC(sdkPageSizeBytes/1024) << "K to " << DEC(hwPageSizeBytes/1024) << "K" << endl;
1494  }
1495  return hwPageSizeBytes;
1496 }
1497 
1498 
1499 CNTV2DemoCommon::Popt::Popt (const int inArgc, const char ** pArgs, const PoptOpts * pInOptionsTable)
1500 {
1501  mContext = ::poptGetContext(AJA_NULL, inArgc, pArgs, pInOptionsTable, 0);
1502  mResult = ::poptGetNextOpt(mContext);
1503  if (mResult < -1)
1504  { ostringstream oss;
1505  oss << ::poptBadOption(mContext, 0) << ": " << ::poptStrerror(mResult);
1506  mError = oss.str();
1507  }
1508  else
1509  {
1510  const char * pStr (::poptGetArg(mContext));
1511  while (pStr)
1512  {
1513  mOtherArgs.push_back(string(pStr)); // Append to file list
1514  pStr = ::poptGetArg(mContext);
1515  } // for each additional positional argument
1516  }
1517 }
1518 
1520 {
1521  mContext = ::poptFreeContext(mContext);
1522 }
1523 
1524 
1526 {
1527  typedef struct {string fName; NTV2VideoFormat fFormat;} FormatNameDictionary;
1528  static const FormatNameDictionary sVFmtDict[] = {
1529  {"1080i50", NTV2_FORMAT_1080i_5000},
1530  {"1080i", NTV2_FORMAT_1080i_5994},
1531  {"1080i5994", NTV2_FORMAT_1080i_5994},
1532  {"hd", NTV2_FORMAT_1080i_5994},
1533  {"1080i60", NTV2_FORMAT_1080i_6000},
1534  {"720p", NTV2_FORMAT_720p_5994},
1535  {"720p5994", NTV2_FORMAT_720p_5994},
1536  {"720p60", NTV2_FORMAT_720p_6000},
1537  {"1080psf2398", NTV2_FORMAT_1080psf_2398},
1538  {"1080psf24", NTV2_FORMAT_1080psf_2400},
1539  {"1080p2997", NTV2_FORMAT_1080p_2997},
1540  {"1080p30", NTV2_FORMAT_1080p_3000},
1541  {"1080p25", NTV2_FORMAT_1080p_2500},
1542  {"1080p2398", NTV2_FORMAT_1080p_2398},
1543  {"1080p24", NTV2_FORMAT_1080p_2400},
1544  {"2048x1080p2398", NTV2_FORMAT_1080p_2K_2398},
1545  {"2048x1080p24", NTV2_FORMAT_1080p_2K_2400},
1546  {"2048x1080psf2398", NTV2_FORMAT_1080psf_2K_2398},
1547  {"2048x1080psf24", NTV2_FORMAT_1080psf_2K_2400},
1548  {"720p50", NTV2_FORMAT_720p_5000},
1549  {"1080p50b", NTV2_FORMAT_1080p_5000_B},
1550  {"1080p", NTV2_FORMAT_1080p_5994_B},
1551  {"1080p5994b", NTV2_FORMAT_1080p_5994_B},
1552  {"1080p60b", NTV2_FORMAT_1080p_6000_B},
1553  {"720p2398", NTV2_FORMAT_720p_2398},
1554  {"720p25", NTV2_FORMAT_720p_2500},
1555  {"1080p50", NTV2_FORMAT_1080p_5000_A},
1556  {"1080p5994", NTV2_FORMAT_1080p_5994_A},
1557  {"1080p60", NTV2_FORMAT_1080p_6000_A},
1558  {"2048x1080p25", NTV2_FORMAT_1080p_2K_2500},
1559  {"2048x1080psf25", NTV2_FORMAT_1080psf_2K_2500},
1560  {"1080psf25", NTV2_FORMAT_1080psf_2500_2},
1561  {"1080psf2997", NTV2_FORMAT_1080psf_2997_2},
1562  {"1080psf30", NTV2_FORMAT_1080psf_3000_2},
1563  {"525i", NTV2_FORMAT_525_5994},
1564  {"525i2997", NTV2_FORMAT_525_5994},
1565  {"sd", NTV2_FORMAT_525_5994},
1566  {"625i", NTV2_FORMAT_625_5000},
1567  {"625i25", NTV2_FORMAT_625_5000},
1568  {"525i2398", NTV2_FORMAT_525_2398},
1569  {"525i24", NTV2_FORMAT_525_2400},
1570  {"525psf2997", NTV2_FORMAT_525psf_2997},
1571  {"625psf25", NTV2_FORMAT_625psf_2500},
1572  {"2048x1556psf1498", NTV2_FORMAT_2K_1498},
1573  {"2048x1556psf15", NTV2_FORMAT_2K_1500},
1574  {"2048x1556psf2398", NTV2_FORMAT_2K_2398},
1575  {"2048x1556psf24", NTV2_FORMAT_2K_2400},
1576  {"2048x1556psf25", NTV2_FORMAT_2K_2500},
1577  {"4x1920x1080psf2398", NTV2_FORMAT_4x1920x1080psf_2398},
1578  {"4x1920x1080psf24", NTV2_FORMAT_4x1920x1080psf_2400},
1579  {"4x1920x1080psf25", NTV2_FORMAT_4x1920x1080psf_2500},
1580  {"4x1920x1080p2398", NTV2_FORMAT_4x1920x1080p_2398},
1581  {"uhd2398", NTV2_FORMAT_4x1920x1080p_2398},
1582  {"4x1920x1080p24", NTV2_FORMAT_4x1920x1080p_2400},
1583  {"uhd24", NTV2_FORMAT_4x1920x1080p_2400},
1584  {"4x1920x1080p25", NTV2_FORMAT_4x1920x1080p_2500},
1585  {"uhd25", NTV2_FORMAT_4x1920x1080p_2500},
1586  {"4x2048x1080psf2398", NTV2_FORMAT_4x2048x1080psf_2398},
1587  {"4x2048x1080psf24", NTV2_FORMAT_4x2048x1080psf_2400},
1588  {"4x2048x1080psf25", NTV2_FORMAT_4x2048x1080psf_2500},
1589  {"4k2398", NTV2_FORMAT_4x2048x1080p_2398},
1590  {"4x2048x1080p2398", NTV2_FORMAT_4x2048x1080p_2398},
1592  {"4x2048x1080p24", NTV2_FORMAT_4x2048x1080p_2400},
1594  {"4x2048x1080p25", NTV2_FORMAT_4x2048x1080p_2500},
1595  {"4x1920x1080p2997", NTV2_FORMAT_4x1920x1080p_2997},
1596  {"4x1920x1080p30", NTV2_FORMAT_4x1920x1080p_3000},
1597  {"4x1920x1080psf2997", NTV2_FORMAT_4x1920x1080psf_2997},
1598  {"4x1920x1080psf30", NTV2_FORMAT_4x1920x1080psf_3000},
1599  {"4x2048x1080p2997", NTV2_FORMAT_4x2048x1080p_2997},
1600  {"4x2048x1080p30", NTV2_FORMAT_4x2048x1080p_3000},
1601  {"4x2048x1080psf2997", NTV2_FORMAT_4x2048x1080psf_2997},
1602  {"4x2048x1080psf30", NTV2_FORMAT_4x2048x1080psf_3000},
1603  {"4x1920x1080p50", NTV2_FORMAT_4x1920x1080p_5000},
1604  {"uhd50", NTV2_FORMAT_4x1920x1080p_5000},
1605  {"4x1920x1080p5994", NTV2_FORMAT_4x1920x1080p_5994},
1606  {"uhd5994", NTV2_FORMAT_4x1920x1080p_5994},
1607  {"4x1920x1080p60", NTV2_FORMAT_4x1920x1080p_6000},
1609  {"uhd60", NTV2_FORMAT_4x1920x1080p_6000},
1611  {"4x2048x1080p50", NTV2_FORMAT_4x2048x1080p_5000},
1612  {"4k5994", NTV2_FORMAT_4x2048x1080p_5994},
1613  {"4x2048x1080p5994", NTV2_FORMAT_4x2048x1080p_5994},
1616  {"4x2048x1080p60", NTV2_FORMAT_4x2048x1080p_6000},
1617  {"4k4795", NTV2_FORMAT_4x2048x1080p_4795},
1618  {"4x2048x1080p4795", NTV2_FORMAT_4x2048x1080p_4795},
1620  {"4x2048x1080p48", NTV2_FORMAT_4x2048x1080p_4800},
1621  {"4k11988", NTV2_FORMAT_4x2048x1080p_11988},
1622  {"4x2048x1080p11988", NTV2_FORMAT_4x2048x1080p_11988},
1623  {"4k120", NTV2_FORMAT_4x2048x1080p_12000},
1624  {"4x2048x1080p120", NTV2_FORMAT_4x2048x1080p_12000},
1625  {"2048x1080p60", NTV2_FORMAT_1080p_2K_6000_A},
1626  {"2048x1080p5994", NTV2_FORMAT_1080p_2K_5994_A},
1627  {"2048x1080p2997", NTV2_FORMAT_1080p_2K_2997},
1628  {"2048x1080p30", NTV2_FORMAT_1080p_2K_3000},
1629  {"2048x1080p50", NTV2_FORMAT_1080p_2K_5000_A},
1630  {"2048x1080p4795", NTV2_FORMAT_1080p_2K_4795_A},
1631  {"2048x1080p48", NTV2_FORMAT_1080p_2K_4800_A},
1632  {"2048x1080p60b", NTV2_FORMAT_1080p_2K_6000_B},
1633  {"2048x1080p5994b", NTV2_FORMAT_1080p_2K_5994_B},
1634  {"2048x1080p50b", NTV2_FORMAT_1080p_2K_5000_B},
1635  {"2048x1080p48b", NTV2_FORMAT_1080p_2K_4800_B},
1636  {"2048x1080p4795b", NTV2_FORMAT_1080p_2K_4795_B},
1637  {"", NTV2_FORMAT_UNKNOWN} };
1638  if (true)
1639  {
1640  // Dump the gString2VideoFormatMap map...
1642  {
1643  cout << "'" << it->first << "'\t'" << ::NTV2VideoFormatToString(it->second) << "'\t" << ::NTV2VideoFormatString(it->second) << "\t" << DEC(it->second) << endl;
1644  }
1645  }
1646  cout << endl << endl;
1647  for (unsigned ndx(0); !sVFmtDict[ndx].fName.empty(); ndx++)
1648  {
1649  const string & str (sVFmtDict[ndx].fName);
1650  const NTV2VideoFormat vFormat (sVFmtDict[ndx].fFormat);
1652  const NTV2VideoFormat vFormat2 (it != gString2VideoFormatMap.end() ? it->second : NTV2_FORMAT_UNKNOWN);
1653  if (vFormat != vFormat2)
1654  cerr << "'" << str << "': '" << ::NTV2VideoFormatString(vFormat) << "' (" << DEC(vFormat) << ") != '" << ::NTV2VideoFormatString(vFormat2) << "' (" << DEC(vFormat2) << ")" << endl;
1655  //SHOULD_BE_EQUAL(vFormat, vFormat2);
1656  }
1657  return true;
1658 }
1659 
1660 
1662 
1663 
1664 AJALabelValuePairs CaptureConfig::Get (const bool inCompact) const
1665 {
1666  AJALabelValuePairs result;
1667  AJASystemInfo::append (result, "Capture Config");
1668  AJASystemInfo::append (result, "Device Specifier", fDeviceSpec);
1669  AJASystemInfo::append (result, "Input Channel", ::NTV2ChannelToString(fInputChannel, inCompact));
1670  AJASystemInfo::append (result, "Input Source", ::NTV2InputSourceToString(fInputSource, inCompact));
1671  AJASystemInfo::append (result, "Pixel Format", ::NTV2FrameBufferFormatToString(fPixelFormat, inCompact));
1672  AJASystemInfo::append (result, "AutoCirc Frames", fFrames.toString());
1673  AJASystemInfo::append (result, "A/B Conversion", fDoABConversion ? "Y" : "N");
1674  AJASystemInfo::append (result, "MultiFormat Mode", fDoMultiFormat ? "Y" : "N");
1675  AJASystemInfo::append (result, "Capture Anc", fWithAnc ? "Y" : "N");
1676  AJASystemInfo::append (result, "Anc Capture File", fAncDataFilePath.empty() ? "---" : fAncDataFilePath);
1677  AJASystemInfo::append (result, "Capture Audio", fWithAudio ? "Y" : "N");
1678  AJASystemInfo::append (result, "Num Audio Links", aja::to_string(fNumAudioLinks));
1679  AJASystemInfo::append (result, "TSI Routing", fDoTSIRouting ? "Y" : "N");
1680  return result;
1681 }
1682 
1683 
1684 std::ostream & operator << (std::ostream & ioStrm, const CaptureConfig & inObj)
1685 {
1686  ioStrm << AJASystemInfo::ToString(inObj.Get());
1687  return ioStrm;
1688 }
1689 
1690 
1692 
1693 
1694 AJALabelValuePairs PlayerConfig::Get (const bool inCompact) const
1695 {
1696  AJALabelValuePairs result;
1697  AJASystemInfo::append (result, "NTV2Player Config");
1698  AJASystemInfo::append (result, "Device Specifier", fDeviceSpec);
1699  AJASystemInfo::append (result, "Video Format", ::NTV2VideoFormatToString(fVideoFormat));
1700  AJASystemInfo::append (result, "Pixel Format", ::NTV2FrameBufferFormatToString(fPixelFormat, inCompact));
1701  AJASystemInfo::append (result, "AutoCirc Frames", fFrames.toString());
1702  AJASystemInfo::append (result, "MultiFormat Mode", fDoMultiFormat ? "Y" : "N");
1703  AJASystemInfo::append (result, "VANC Mode", ::NTV2VANCModeToString(fVancMode));
1704  AJASystemInfo::append (result, "HDR Anc Type", ::AJAAncDataTypeToString(fTransmitHDRType));
1705  AJASystemInfo::append (result, "Output Channel", ::NTV2ChannelToString(fOutputChannel, inCompact));
1706  AJASystemInfo::append (result, "Output Connector", ::NTV2OutputDestinationToString(fOutputDest, inCompact));
1707  AJASystemInfo::append (result, "Anc Playback File", fAncDataFilePath.empty() ? "---" : fAncDataFilePath);
1708  AJASystemInfo::append (result, "Suppress Audio", fSuppressAudio ? "Y" : "N");
1709  AJASystemInfo::append (result, "Num Audio Links", aja::to_string(fNumAudioLinks));
1710  AJASystemInfo::append (result, "Suppress Video", fSuppressVideo ? "Y" : "N");
1711  AJASystemInfo::append (result, "Embedded Timecode", fTransmitLTC ? "LTC" : "VITC");
1712  AJASystemInfo::append (result, "Level Conversion", fDoABConversion ? "Y" : "N");
1713  AJASystemInfo::append (result, "HDMI Output", fDoHDMIOutput ? "Yes" : "No");
1714  AJASystemInfo::append (result, "RGB-On-SDI", fDoRGBOnWire ? "Yes" : "No");
1715  AJASystemInfo::append (result, "TSI Routing", fDoTsiRouting ? "Yes" : "No");
1716  AJASystemInfo::append (result, "6G/12G Output", fDoLinkGrouping ? "Yes" : "No");
1717  return result;
1718 }
1719 
1720 
1721 std::ostream & operator << (std::ostream & ioStrm, const PlayerConfig & inObj)
1722 {
1723  ioStrm << AJASystemInfo::ToString(inObj.Get());
1724  return ioStrm;
1725 }
1726 
1727 
1729 
1730 
1731 AJALabelValuePairs BurnConfig::Get (const bool inCompact) const
1732 {
1733  AJALabelValuePairs result;
1734  AJASystemInfo::append(result, "NTV2Burn Config");
1735  if (fDeviceSpec2.empty())
1736  AJASystemInfo::append(result, "Device Specifier", fDeviceSpec);
1737  else
1738  {
1739  AJASystemInfo::append(result, "Input Device", fDeviceSpec);
1740  AJASystemInfo::append(result, "Output Device", fDeviceSpec2);
1741  }
1742  AJASystemInfo::append(result, "Input Channel", ::NTV2ChannelToString(fInputChannel, inCompact));
1743  AJASystemInfo::append(result, "Output Channel", ::NTV2ChannelToString(fOutputChannel, inCompact));
1744  AJASystemInfo::append(result, "Input Source", ::NTV2InputSourceToString(fInputSource, inCompact));
1745  if (WithTimecode())
1746  AJASystemInfo::append(result, "Timecode Source", ::NTV2TCIndexToString(fTimecodeSource, inCompact));
1747  AJASystemInfo::append(result, "Pixel Format", ::NTV2FrameBufferFormatToString(fPixelFormat, inCompact));
1748  AJASystemInfo::append(result, "AC Input Frames", fInputFrames.toString());
1749  AJASystemInfo::append(result, "AC Output Frames", fOutputFrames.toString());
1750  AJASystemInfo::append(result, "Include Video", WithVideo() ? "Y" : "N");
1751  AJASystemInfo::append(result, "Include Audio", WithAudio() ? "Y" : "N");
1752  AJASystemInfo::append(result, "Include Anc", WithAnc() ? "Y" : "N");
1753  AJASystemInfo::append(result, "Include HANC", WithHanc() ? "Y" : "N");
1754  AJASystemInfo::append(result, "MultiFormat Mode", fDoMultiFormat ? "Y" : "N");
1755  AJASystemInfo::append(result, "Field Mode", FieldMode() ? "Y" : "N");
1756  return result;
1757 }
NTV2InputSourceSet
std::set< NTV2InputSource > NTV2InputSourceSet
A set of distinct NTV2InputSource values.
Definition: ntv2publicinterface.h:8783
NTV2TestPatternGen::getColorNames
static NTV2StringList getColorNames(void)
Definition: ntv2testpatterngen.cpp:2552
NTV2_FORMAT_3840x2160p_6000
@ NTV2_FORMAT_3840x2160p_6000
Definition: ntv2enums.h:616
NTV2_FBF_10BIT_YCBCR_420PL3_LE
@ NTV2_FBF_10BIT_YCBCR_420PL3_LE
See 3-Plane 10-Bit YCbCr 4:2:0 ('I420_10LE' a.k.a. 'YUV-P420-L10').
Definition: ntv2enums.h:237
TC_INDEXES_VITC1
@ TC_INDEXES_VITC1
Definition: ntv2democommon.h:256
aja::stoul
unsigned long stoul(const std::string &str, std::size_t *idx, int base)
Definition: common.cpp:143
NTV2_FORMAT_625_5000
@ NTV2_FORMAT_625_5000
Definition: ntv2enums.h:544
NTV2_FORMAT_4x1920x1080p_6000
@ NTV2_FORMAT_4x1920x1080p_6000
Definition: ntv2enums.h:580
NTV2ChannelToInputSource
NTV2InputSource NTV2ChannelToInputSource(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
Definition: ntv2utils.cpp:5190
NTV2_FORMAT_1080psf_2398
@ NTV2_FORMAT_1080psf_2398
Definition: ntv2enums.h:516
AJA_FrameRate_1900
@ AJA_FrameRate_1900
Definition: videotypes.h:218
CNTV2Card::DMABufferUnlock
virtual bool DMABufferUnlock(const NTV2Buffer &inBuffer)
Unlocks the given host buffer that was previously locked using CNTV2Card::DMABufferLock.
Definition: ntv2dma.cpp:444
NTV2InputSourceToChannel
NTV2Channel NTV2InputSourceToChannel(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Channel value.
Definition: ntv2utils.cpp:5105
CNTV2DemoCommon::GetInputSourceFromString
static NTV2InputSource GetInputSourceFromString(const std::string &inStr)
Returns the NTV2InputSource that matches the given string.
Definition: ntv2democommon.cpp:706
NTV2Buffer::SetDefaultPageSize
static bool SetDefaultPageSize(const size_t inNewSize)
Changes the default page size for use in future page-aligned allocations.
Definition: ntv2publicinterface.cpp:2012
NTV2_FORMAT_4096x2160p_2400
@ NTV2_FORMAT_4096x2160p_2400
Definition: ntv2enums.h:625
CNTV2DemoCommon::GetVideoFormatStrings
static std::string GetVideoFormatStrings(const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_NON_4KUHD, const std::string inDeviceSpecifier=std::string())
Definition: ntv2democommon.cpp:550
gGlobalMutexName
static const string gGlobalMutexName("com.aja.ntv2.mutex.demo")
DeviceCapabilities::CanDoVideoFormat
bool CanDoVideoFormat(const NTV2VideoFormat inVF)
Definition: ntv2devicecapabilities.h:251
NTV2_FBF_NUMFRAMEBUFFERFORMATS
@ NTV2_FBF_NUMFRAMEBUFFERFORMATS
Definition: ntv2enums.h:244
AJA_PixelFormat_YCBCR10_422PL
@ AJA_PixelFormat_YCBCR10_422PL
Definition: videotypes.h:157
NTV2_FBF_ARGB
@ NTV2_FBF_ARGB
See 8-Bit ARGB, RGBA, ABGR Formats.
Definition: ntv2enums.h:212
NTV2_FORMAT_2K_1498
@ NTV2_FORMAT_2K_1498
Definition: ntv2enums.h:551
GetSDIInputOutputXptFromChannel
NTV2OutputXptID GetSDIInputOutputXptFromChannel(const NTV2Channel inSDIInput, const bool inIsDS2=false)
Definition: ntv2signalrouter.cpp:893
NTV2_FORMAT_720p_5000
@ NTV2_FORMAT_720p_5000
Definition: ntv2enums.h:527
NTV2_FBF_10BIT_YCBCR_420PL2
@ NTV2_FBF_10BIT_YCBCR_420PL2
10-Bit 4:2:0 2-Plane YCbCr
Definition: ntv2enums.h:239
String2PixelFormatMapConstIter
String2PixelFormatMap::const_iterator String2PixelFormatMapConstIter
Definition: ntv2democommon.cpp:29
gTCIndexesVITC1
static NTV2TCIndexSet gTCIndexesVITC1
Definition: ntv2democommon.cpp:80
NTV2_AUDIO_LOOPBACK_OFF
@ NTV2_AUDIO_LOOPBACK_OFF
Embeds silence (zeroes) into the data stream.
Definition: ntv2enums.h:1975
gString2OutputDestMap
static String2OutputDestMap gString2OutputDestMap
Definition: ntv2democommon.cpp:74
NTV2_DEVICEKIND_OUTPUT
@ NTV2_DEVICEKIND_OUTPUT
Specifies devices that output (playout).
Definition: ntv2enums.h:1330
NTV2FrameBufferFormatSetConstIter
NTV2FrameBufferFormatSet::const_iterator NTV2FrameBufferFormatSetConstIter
A handy const iterator for iterating over an NTV2FrameBufferFormatSet.
Definition: ntv2publicinterface.h:8773
NTV2_IS_ATC_VITC1_TIMECODE_INDEX
#define NTV2_IS_ATC_VITC1_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3907
AJA_PixelFormat_ARGB8
@ AJA_PixelFormat_ARGB8
Definition: videotypes.h:126
HANDLE
short HANDLE
Definition: ajatypes.h:315
NTV2_FORMAT_2K_2400
@ NTV2_FORMAT_2K_2400
Definition: ntv2enums.h:554
NTV2_DEVICEKIND_RELAYS
@ NTV2_DEVICEKIND_RELAYS
Specifies devices that have bypass relays.
Definition: ntv2enums.h:1343
AJA_FrameRate_3000
@ AJA_FrameRate_3000
Definition: videotypes.h:223
NTV2_FORMAT_4x4096x2160p_4800
@ NTV2_FORMAT_4x4096x2160p_4800
Definition: ntv2enums.h:674
NTV2FrameBufferFormatSet
std::set< NTV2FrameBufferFormat > NTV2FrameBufferFormatSet
A set of distinct NTV2FrameBufferFormat values.
Definition: ntv2publicinterface.h:8772
NTV2OutputDestination
NTV2OutputDestination
Identifies a specific video output destination.
Definition: ntv2enums.h:1276
AJA_PixelFormat_YUY28
@ AJA_PixelFormat_YUY28
Definition: videotypes.h:129
gInputSources
static NTV2InputSourceSet gInputSources
Definition: ntv2democommon.cpp:64
poptOption
Definition: options_popt.h:148
NTV2_FORMAT_4x4096x2160p_2398
@ NTV2_FORMAT_4x4096x2160p_2398
Definition: ntv2enums.h:668
AJA_PixelFormat_YCBCR8_422PL3
@ AJA_PixelFormat_YCBCR8_422PL3
Definition: videotypes.h:162
NTV2_FBF_12BIT_RGB_PACKED
@ NTV2_FBF_12BIT_RGB_PACKED
See 12-Bit Packed RGB.
Definition: ntv2enums.h:228
NTV2_FORMAT_525_5994
@ NTV2_FORMAT_525_5994
Definition: ntv2enums.h:543
kTCFormat24fps
@ kTCFormat24fps
Definition: ntv2rp188.h:30
NTV2_DEVICEKIND_ANALOG
@ NTV2_DEVICEKIND_ANALOG
Specifies devices with analog video connectors.
Definition: ntv2enums.h:1333
CNTV2DemoCommon::GetSupportedPixelFormats
static NTV2FrameBufferFormatSet GetSupportedPixelFormats(const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL)
Definition: ntv2democommon.cpp:578
String2PixelFormatMap
map< string, NTV2FrameBufferFormat > String2PixelFormatMap
Definition: ntv2democommon.cpp:28
GetDLInInputXptFromChannel
NTV2InputXptID GetDLInInputXptFromChannel(const NTV2Channel inChannel, const bool inLinkB=false)
Definition: ntv2signalrouter.cpp:796
NTV2OutputDestinations
std::set< NTV2OutputDestination > NTV2OutputDestinations
A set of distinct NTV2OutputDestination values.
Definition: ntv2publicinterface.h:8786
CNTV2DemoCommon::GetSupportedVideoFormats
static const NTV2VideoFormatSet & GetSupportedVideoFormats(const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_NON_4KUHD)
Definition: ntv2democommon.cpp:538
ntv2devicefeatures.h
Declares device capability functions.
gInputSourcesHDMI
static NTV2InputSourceSet gInputSourcesHDMI
Definition: ntv2democommon.cpp:66
CNTV2DemoCommon::GetVANCModeFromString
static NTV2VANCMode GetVANCModeFromString(const std::string &inStr)
Definition: ntv2democommon.cpp:882
NTV2StringSet
std::set< std::string > NTV2StringSet
Definition: ntv2utils.h:1137
NTV2_IS_FBF_PLANAR
#define NTV2_IS_FBF_PLANAR(__s__)
Definition: ntv2enums.h:255
CNTV2DemoCommon::GetOutputDestinationStrings
static std::string GetOutputDestinationStrings(const std::string inDeviceSpecifier=std::string())
Definition: ntv2democommon.cpp:715
aja::strip
std::string & strip(std::string &str, const std::string &ws)
Definition: common.cpp:461
NTV2TestPatternSelect
NTV2TestPatternSelect
Identifies a predefined NTV2 test pattern.
Definition: ntv2testpatterngen.h:26
NTV2_FBF_PRORES_HDV
@ NTV2_FBF_PRORES_HDV
Apple ProRes HDV.
Definition: ntv2enums.h:230
NTV2_FORMAT_4096x2160p_2500
@ NTV2_FORMAT_4096x2160p_2500
Definition: ntv2enums.h:626
NTV2_FBF_IS_RAW
#define NTV2_FBF_IS_RAW(__fbf__)
Definition: ntv2enums.h:319
NTV2_FRAMERATE_1500
@ NTV2_FRAMERATE_1500
15 frames per second
Definition: ntv2enums.h:412
NTV2_TestPatt_All
@ NTV2_TestPatt_All
Definition: ntv2testpatterngen.h:52
NTV2TCIndexes
std::set< NTV2TCIndex > NTV2TCIndexes
Definition: ntv2publicinterface.h:6849
NTV2_FRAMERATE_6000
@ NTV2_FRAMERATE_6000
60 frames per second
Definition: ntv2enums.h:399
NTV2GetSupportedDevices
NTV2DeviceIDSet NTV2GetSupportedDevices(const NTV2DeviceKinds inKinds=NTV2_DEVICEKIND_ALL)
Returns an NTV2DeviceIDSet of devices supported by the SDK.
Definition: ntv2utils.cpp:7548
CNTV2DemoCommon::GetTSIMuxesForFrameStore
static NTV2ChannelList GetTSIMuxesForFrameStore(CNTV2Card &inDevice, const NTV2Channel in1stFrameStore, const UWord inCount)
Definition: ntv2democommon.cpp:1182
NTV2_IS_FBF_PRORES
#define NTV2_IS_FBF_PRORES(__fbf__)
Definition: ntv2enums.h:267
CNTV2DemoCommon::ReadCharacterPress
static char ReadCharacterPress(void)
Returns the character that represents the last key that was pressed on the keyboard without waiting f...
Definition: ntv2democommon.cpp:946
NTV2_FORMAT_525psf_2997
@ NTV2_FORMAT_525psf_2997
Definition: ntv2enums.h:547
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1305
gPixelFormats
static NTV2FrameBufferFormatSet gPixelFormats
Definition: ntv2democommon.cpp:57
AJA_FrameRate_11988
@ AJA_FrameRate_11988
Definition: videotypes.h:230
NTV2_FORMAT_4x2048x1080p_4795
@ NTV2_FORMAT_4x2048x1080p_4795
Definition: ntv2enums.h:584
AJA_FrameRate_1498
@ AJA_FrameRate_1498
Definition: videotypes.h:213
g4KFormats
static NTV2VideoFormatSet g4KFormats
Definition: ntv2democommon.cpp:55
NTV2_FBF_10BIT_DPX_LE
@ NTV2_FBF_10BIT_DPX_LE
10-Bit DPX Little-Endian
Definition: ntv2enums.h:226
aja::join
std::string join(const std::vector< std::string > &parts, const std::string &delim)
Definition: common.cpp:468
NTV2_FORMAT_3840x2160p_5994_B
@ NTV2_FORMAT_3840x2160p_5994_B
Definition: ntv2enums.h:618
AJA_FrameRate_Unknown
@ AJA_FrameRate_Unknown
Definition: videotypes.h:212
NTV2_ASSERT
#define NTV2_ASSERT(_expr_)
Definition: ajatypes.h:506
NTV2VideoFormatSet
std::set< NTV2VideoFormat > NTV2VideoFormatSet
A set of distinct NTV2VideoFormat values.
Definition: ntv2publicinterface.h:8769
NTV2_FRAMERATE_2997
@ NTV2_FRAMERATE_2997
Fractional rate of 30,000 frames per 1,001 seconds.
Definition: ntv2enums.h:403
NTV2_FORMAT_1080p_2K_6000_B
@ NTV2_FORMAT_1080p_2K_6000_B
Definition: ntv2enums.h:601
NTV2_FORMAT_4096x2160p_5000_B
@ NTV2_FORMAT_4096x2160p_5000_B
Definition: ntv2enums.h:640
poptGetArg
const char * poptGetArg(poptContext con)
Definition: options_popt.cpp:3494
NTV2_FBF_RGBA
@ NTV2_FBF_RGBA
See 8-Bit ARGB, RGBA, ABGR Formats.
Definition: ntv2enums.h:213
AJA_PixelFormat_BGR8_PACK
@ AJA_PixelFormat_BGR8_PACK
Definition: videotypes.h:137
AJA_PixelFormat_YCbCr8
@ AJA_PixelFormat_YCbCr8
Definition: videotypes.h:125
NTV2_FORMAT_1080psf_2K_2398
@ NTV2_FORMAT_1080psf_2K_2398
Definition: ntv2enums.h:525
DeviceCapabilities::CanDoInputTCIndex
bool CanDoInputTCIndex(const NTV2TCIndex inTCNdx)
Definition: ntv2devicecapabilities.h:320
NTV2_IS_QUAD_QUAD_HFR_VIDEO_FORMAT
#define NTV2_IS_QUAD_QUAD_HFR_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:785
NTV2_AUDIO_48K
@ NTV2_AUDIO_48K
Definition: ntv2enums.h:1875
CNTV2DemoCommon::GetInputRouting
static bool GetInputRouting(NTV2XptConnections &outConnections, const CaptureConfig &inConfig, const bool isInputRGB=(0))
Answers with the crosspoint connections needed to implement the given capture configuration.
Definition: ntv2democommon.cpp:1199
CNTV2DemoCommon::GetAudioSystemStrings
static std::string GetAudioSystemStrings(const std::string inDeviceSpecifier=std::string())
Definition: ntv2democommon.cpp:818
NTV2_FORMAT_1080p_2K_4800_A
@ NTV2_FORMAT_1080p_2K_4800_A
Definition: ntv2enums.h:596
String2TCIndexPair
pair< string, NTV2TCIndex > String2TCIndexPair
Definition: ntv2democommon.cpp:44
NTV2_FORMAT_4x2048x1080p_11988
@ NTV2_FORMAT_4x2048x1080p_11988
Definition: ntv2enums.h:586
AJA_PixelFormat_RGB10
@ AJA_PixelFormat_RGB10
Definition: videotypes.h:128
NTV2_FRAMERATE_12000
@ NTV2_FRAMERATE_12000
120 frames per second
Definition: ntv2enums.h:410
AJA_FrameRate_2997
@ AJA_FrameRate_2997
Definition: videotypes.h:222
NTV2_FBF_48BIT_RGB
@ NTV2_FBF_48BIT_RGB
See 48-Bit RGB.
Definition: ntv2enums.h:227
PIXEL_FORMATS_RGB
@ PIXEL_FORMATS_RGB
Definition: ntv2democommon.h:241
String2InputSourceMap
map< string, NTV2InputSource > String2InputSourceMap
Definition: ntv2democommon.cpp:37
NTV2_FORMAT_1080i_5994
@ NTV2_FORMAT_1080i_5994
Definition: ntv2enums.h:512
CNTV2DeviceScanner::GetFirstDeviceFromArgument
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...
Definition: ntv2devicescanner.cpp:366
gString2TPNamesMap
static String2TPNamesMap gString2TPNamesMap
Definition: ntv2democommon.cpp:83
poptStrerror
const char * poptStrerror(const int error)
Definition: options_popt.cpp:3633
NTV2OutputDestinationsConstIter
NTV2OutputDestinations::const_iterator NTV2OutputDestinationsConstIter
A handy const iterator for iterating over an NTV2OutputDestinations.
Definition: ntv2publicinterface.h:8787
AJA_PixelFormat_PRORES_DVPRO
@ AJA_PixelFormat_PRORES_DVPRO
Definition: videotypes.h:142
NTV2_FORMAT_4x1920x1080psf_3000
@ NTV2_FORMAT_4x1920x1080psf_3000
Definition: ntv2enums.h:573
String2VANCModeMapConstIter
String2VANCModeMap::const_iterator String2VANCModeMapConstIter
Definition: ntv2democommon.cpp:35
CaptureConfig::fPixelFormat
NTV2PixelFormat fPixelFormat
Pixel format to use.
Definition: ntv2democommon.h:273
NTV2OutputDestinationToChannel
NTV2Channel NTV2OutputDestinationToChannel(const NTV2OutputDestination inOutputDest)
Converts a given NTV2OutputDestination to its equivalent NTV2Channel value.
Definition: ntv2utils.cpp:5213
PIXEL_FORMATS_ALPHA
@ PIXEL_FORMATS_ALPHA
Definition: ntv2democommon.h:245
NTV2InputSourceToEmbeddedAudioInput
NTV2EmbeddedAudioInput NTV2InputSourceToEmbeddedAudioInput(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2EmbeddedAudioInput value.
Definition: ntv2utils.cpp:4935
NTV2_FBF_8BIT_HDV
@ NTV2_FBF_8BIT_HDV
See 8-Bit HDV.
Definition: ntv2enums.h:222
AJA_PixelFormat_YCBCR8_422PL
@ AJA_PixelFormat_YCBCR8_422PL
Definition: videotypes.h:159
ntv2testpatterngen.h
Declares the NTV2TestPatternGen class.
NTV2_FORMAT_1080p_2K_3000
@ NTV2_FORMAT_1080p_2K_3000
Definition: ntv2enums.h:593
String2TCIndexMap
map< string, NTV2TCIndex > String2TCIndexMap
Definition: ntv2democommon.cpp:43
GetFrameBufferInputXptFromChannel
NTV2InputXptID GetFrameBufferInputXptFromChannel(const NTV2Channel inFrameStore, const bool inIsBInput=false)
Definition: ntv2signalrouter.cpp:762
NTV2_FORMAT_4x2048x1080p_2997
@ NTV2_FORMAT_4x2048x1080p_2997
Definition: ntv2enums.h:574
NTV2_TestPatt_ColorBars100
@ NTV2_TestPatt_ColorBars100
Definition: ntv2testpatterngen.h:28
NTV2_FBF_10BIT_ARGB
@ NTV2_FBF_10BIT_ARGB
10-Bit ARGB
Definition: ntv2enums.h:232
NTV2_FBF_10BIT_YCBCRA
@ NTV2_FBF_10BIT_YCBCRA
10-Bit YCbCrA
Definition: ntv2enums.h:225
AJAAncDataTypeToString
const std::string & AJAAncDataTypeToString(const AJAAncDataType inValue, const bool inCompact=true)
Definition: ancillarydata.cpp:1391
NTV2_FRAMERATE_1798
@ NTV2_FRAMERATE_1798
Definition: ntv2enums.h:419
kTCFormat30fpsDF
@ kTCFormat30fpsDF
Definition: ntv2rp188.h:33
DemoCommonInitializer::DemoCommonInitializer
DemoCommonInitializer()
Definition: ntv2democommon.cpp:90
NTV2_FORMAT_4x4096x2160p_2500
@ NTV2_FORMAT_4x4096x2160p_2500
Definition: ntv2enums.h:670
PIXEL_FORMATS_PACKED
@ PIXEL_FORMATS_PACKED
Definition: ntv2democommon.h:244
NTV2DeviceID
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
NTV2_IOKINDS_HDMI
@ NTV2_IOKINDS_HDMI
Specifies HDMI input/output kinds.
Definition: ntv2enums.h:1252
NTV2_FORMAT_4x4096x2160p_4795
@ NTV2_FORMAT_4x4096x2160p_4795
Definition: ntv2enums.h:673
NTV2_FORMAT_4x1920x1080p_2997
@ NTV2_FORMAT_4x1920x1080p_2997
Definition: ntv2enums.h:570
NTV2_FORMAT_4x1920x1080p_2500
@ NTV2_FORMAT_4x1920x1080p_2500
Definition: ntv2enums.h:563
NTV2_FBF_INVALID
@ NTV2_FBF_INVALID
Definition: ntv2enums.h:245
NTV2_FORMAT_4x2048x1080p_4800
@ NTV2_FORMAT_4x2048x1080p_4800
Definition: ntv2enums.h:585
NTV2FrameBufferFormat
NTV2FrameBufferFormat
Identifies a particular video frame buffer format. See Device Frame Buffer Formats for details.
Definition: ntv2enums.h:207
NTV2_FORMAT_4x3840x2160p_2500
@ NTV2_FORMAT_4x3840x2160p_2500
Definition: ntv2enums.h:657
NTV2_IS_ATC_VITC2_TIMECODE_INDEX
#define NTV2_IS_ATC_VITC2_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3910
kTCFormat30fps
@ kTCFormat30fps
Definition: ntv2rp188.h:32
NTV2_IS_ATC_LTC_TIMECODE_INDEX
#define NTV2_IS_ATC_LTC_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3912
gFBFsProRes
static NTV2FrameBufferFormatSet gFBFsProRes
Definition: ntv2democommon.cpp:63
NTV2_FBF_10BIT_DPX
@ NTV2_FBF_10BIT_DPX
See 10-Bit RGB - DPX Format.
Definition: ntv2enums.h:218
NTV2_FORMAT_4x3840x2160p_5000_B
@ NTV2_FORMAT_4x3840x2160p_5000_B
Definition: ntv2enums.h:663
NTV2IOKinds
enum NTV2InputSourceKinds NTV2IOKinds
NTV2InputXptID
enum NTV2InputCrosspointID NTV2InputXptID
NTV2_NUM_FRAMERATES
@ NTV2_NUM_FRAMERATES
Definition: ntv2enums.h:424
NTV2_OUTPUT_CROSSPOINT_INVALID
@ NTV2_OUTPUT_CROSSPOINT_INVALID
Definition: ntv2enums.h:2656
CaptureConfig::Get
AJALabelValuePairs Get(const bool inCompact=(0)) const
Definition: ntv2democommon.cpp:1664
NTV2TimeCodesConstIter
NTV2TimeCodes::const_iterator NTV2TimeCodesConstIter
A handy const interator for iterating over NTV2TCIndex/NTV2TimeCodeList pairs.
Definition: ntv2publicinterface.h:6847
TimecodeFormat
TimecodeFormat
Definition: ntv2rp188.h:27
NTV2_IOKINDS_ANALOG
@ NTV2_IOKINDS_ANALOG
Specifies analog input/output kinds.
Definition: ntv2enums.h:1253
operator<<
std::ostream & operator<<(std::ostream &ioStrm, const CaptureConfig &inObj)
Definition: ntv2democommon.cpp:1684
CNTV2Card::SetAudioLoopBack
virtual bool SetAudioLoopBack(const NTV2AudioLoopBack inMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Enables or disables NTV2AudioLoopBack mode for the given NTV2AudioSystem.
Definition: ntv2audio.cpp:300
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
Definition: ntv2enums.h:1307
AJA_FrameRate_2400
@ AJA_FrameRate_2400
Definition: videotypes.h:220
ntv2debug.h
NTV2_FORMAT_4x3840x2160p_2398
@ NTV2_FORMAT_4x3840x2160p_2398
Definition: ntv2enums.h:655
NTV2_FBF_24BIT_RGB
@ NTV2_FBF_24BIT_RGB
See 24-Bit RGB.
Definition: ntv2enums.h:223
NTV2_FORMAT_4x4096x2160p_6000_B
@ NTV2_FORMAT_4x4096x2160p_6000_B
Definition: ntv2enums.h:682
NTV2_FRAMERATE_1898
@ NTV2_FRAMERATE_1898
Definition: ntv2enums.h:417
AJA_PixelFormat_YCBCR8_420PL3
@ AJA_PixelFormat_YCBCR8_420PL3
Definition: videotypes.h:161
nlohmann::json_abiNLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON_v3_11_NLOHMANN_JSON_VERSION_PATCH::detail::void
j template void())
Definition: json.hpp:4893
DeviceCapabilities::CanDoOutputDestination
bool CanDoOutputDestination(const NTV2OutputDestination inDest)
Definition: ntv2devicecapabilities.h:242
GetIndexForNTV2Channel
ULWord GetIndexForNTV2Channel(const NTV2Channel inChannel)
Definition: ntv2utils.cpp:4760
kTCFormat48fps
@ kTCFormat48fps
Definition: ntv2rp188.h:34
NTV2_FRAMERATE_2500
@ NTV2_FRAMERATE_2500
25 frames per second
Definition: ntv2enums.h:404
NTV2_DEVICEKIND_HDMI
@ NTV2_DEVICEKIND_HDMI
Specifies devices with HDMI connectors.
Definition: ntv2enums.h:1332
NTV2_FORMAT_1080p_2K_4795_A
@ NTV2_FORMAT_1080p_2K_4795_A
Definition: ntv2enums.h:595
CNTV2DemoCommon::Get4KInputFormat
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...
Definition: ntv2democommon.cpp:1088
NTV2_FORMAT_3840x2160p_2500
@ NTV2_FORMAT_3840x2160p_2500
Definition: ntv2enums.h:609
NTV2FrameRate
NTV2FrameRate
Identifies a particular video frame rate.
Definition: ntv2enums.h:396
String2TPNamesMap
map< string, string > String2TPNamesMap
Definition: ntv2democommon.cpp:47
NTV2_FORMAT_4096x2160p_6000_B
@ NTV2_FORMAT_4096x2160p_6000_B
Definition: ntv2enums.h:642
TC_INDEXES_ATCLTC
@ TC_INDEXES_ATCLTC
Definition: ntv2democommon.h:255
DemoCommonInitializer
Definition: ntv2democommon.cpp:87
CNTV2Card::SetAudioSystemInputSource
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:485
CNTV2DemoCommon::GetTCIndexFromString
static NTV2TCIndex GetTCIndexFromString(const std::string &inStr)
Returns the NTV2TCIndex that matches the given string.
Definition: ntv2democommon.cpp:809
NTV2OutputDest
enum NTV2OutputDestination NTV2OutputDest
kTCFormat60fps
@ kTCFormat60fps
Definition: ntv2rp188.h:36
NTV2_FORMAT_2K_2398
@ NTV2_FORMAT_2K_2398
Definition: ntv2enums.h:553
NTV2_FORMAT_4x4096x2160p_2997
@ NTV2_FORMAT_4x4096x2160p_2997
Definition: ntv2enums.h:671
NTV2_FRAMERATE_4800
@ NTV2_FRAMERATE_4800
48 frames per second
Definition: ntv2enums.h:408
CNTV2DemoCommon::GetVideoFormatFromString
static NTV2VideoFormat GetVideoFormatFromString(const std::string &inStr, const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_NON_4KUHD)
Returns the NTV2VideoFormat that matches the given string.
Definition: ntv2democommon.cpp:635
NTV2_IS_4K_VIDEO_FORMAT
#define NTV2_IS_4K_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:746
CNTV2Card::DMABufferLock
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
CNTV2DemoCommon::GetDeviceStrings
static std::string GetDeviceStrings(const NTV2DeviceKinds inKinds=NTV2_DEVICEKIND_ALL)
Definition: ntv2democommon.cpp:490
AJA_FrameRate_1898
@ AJA_FrameRate_1898
Definition: videotypes.h:217
PIXEL_FORMATS_RAW
@ PIXEL_FORMATS_RAW
Definition: ntv2democommon.h:243
AJA_FrameRate_1500
@ AJA_FrameRate_1500
Definition: videotypes.h:214
VIDEO_FORMATS_ALL
@ VIDEO_FORMATS_ALL
Definition: ntv2democommon.h:224
AJA_FrameRate
AJA_FrameRate
Definition: videotypes.h:210
NTV2_FRAMERATE_2400
@ NTV2_FRAMERATE_2400
24 frames per second
Definition: ntv2enums.h:405
gTCIndexesATCLTC
static NTV2TCIndexSet gTCIndexesATCLTC
Definition: ntv2democommon.cpp:79
TC_INDEXES_VITC2
@ TC_INDEXES_VITC2
Definition: ntv2democommon.h:257
CNTV2Card::features
virtual class DeviceCapabilities & features(void)
Definition: ntv2card.h:141
NTV2_FORMAT_4x2048x1080psf_2398
@ NTV2_FORMAT_4x2048x1080psf_2398
Definition: ntv2enums.h:564
NTV2_FBF_10BIT_RGB_PACKED
@ NTV2_FBF_10BIT_RGB_PACKED
10-Bit Packed RGB
Definition: ntv2enums.h:231
NTV2_FBF_8BIT_YCBCR_420PL2
@ NTV2_FBF_8BIT_YCBCR_420PL2
8-Bit 4:2:0 2-Plane YCbCr
Definition: ntv2enums.h:241
String2TPNamePair
pair< string, string > String2TPNamePair
Definition: ntv2democommon.cpp:48
NTV2_FORMAT_4x2048x1080p_2398
@ NTV2_FORMAT_4x2048x1080p_2398
Definition: ntv2enums.h:567
AJA_PixelFormat_RGB_DPX_LE
@ AJA_PixelFormat_RGB_DPX_LE
Definition: videotypes.h:139
AJA_PixelFormat_YCbCr_DPX
@ AJA_PixelFormat_YCbCr_DPX
Definition: videotypes.h:132
AJA_PixelFormat_RGB16
@ AJA_PixelFormat_RGB16
Definition: videotypes.h:147
NTV2_INPUTSOURCE_SDI1
@ NTV2_INPUTSOURCE_SDI1
Identifies the 1st SDI video input.
Definition: ntv2enums.h:1228
NTV2_IS_ANALOG_TIMECODE_INDEX
#define NTV2_IS_ANALOG_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3905
CNTV2Card::GetDisplayName
virtual std::string GetDisplayName(void)
Answers with this device's display name.
Definition: ntv2card.cpp:86
CNTV2DemoCommon::IsValidDevice
static bool IsValidDevice(const std::string &inDeviceSpec)
Definition: ntv2democommon.cpp:430
gAllFormats
static NTV2VideoFormatSet gAllFormats
Definition: ntv2democommon.cpp:53
AJA_PixelFormat_RGB8_PACK
@ AJA_PixelFormat_RGB8_PACK
Definition: videotypes.h:136
NTV2Buffer::DefaultPageSize
static size_t DefaultPageSize(void)
Definition: ntv2publicinterface.cpp:2007
CNTV2DemoCommon::GetAudioSystemFromString
static NTV2AudioSystem GetAudioSystemFromString(const std::string &inStr)
Returns the NTV2AudioSystem that matches the given string.
Definition: ntv2democommon.cpp:845
NTV2_FORMAT_1080psf_2K_2500
@ NTV2_FORMAT_1080psf_2K_2500
Definition: ntv2enums.h:537
AJA_FrameRate_4795
@ AJA_FrameRate_4795
Definition: videotypes.h:224
String2TPNamesMapConstIter
String2TPNamesMap::const_iterator String2TPNamesMapConstIter
Definition: ntv2democommon.cpp:49
CNTV2DemoCommon::GetTestPatternStrings
static std::string GetTestPatternStrings(void)
Definition: ntv2democommon.cpp:889
kTCFormat50fps
@ kTCFormat50fps
Definition: ntv2rp188.h:35
NTV2_IS_FBF_RGB
#define NTV2_IS_FBF_RGB(__fbf__)
Definition: ntv2enums.h:271
NTV2_FORMAT_4x2048x1080psf_2400
@ NTV2_FORMAT_4x2048x1080psf_2400
Definition: ntv2enums.h:565
aja::lower
std::string & lower(std::string &str)
Definition: common.cpp:436
NTV2_FBF_10BIT_RAW_RGB
@ NTV2_FBF_10BIT_RAW_RGB
10-Bit Raw RGB
Definition: ntv2enums.h:235
NTV2InputSourceToString
std::string NTV2InputSourceToString(const NTV2InputSource inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:7215
AJA_FrameRate_2500
@ AJA_FrameRate_2500
Definition: videotypes.h:221
CNTV2DemoCommon::Popt::Popt
Popt(const int inArgc, const char **pArgs, const PoptOpts *pInOptionsTable)
Definition: ntv2democommon.cpp:1499
gTCIndexesVITC2
static NTV2TCIndexSet gTCIndexesVITC2
Definition: ntv2democommon.cpp:81
AJA_PixelFormat_HDV
@ AJA_PixelFormat_HDV
Definition: videotypes.h:135
NTV2TCIndexToString
std::string NTV2TCIndexToString(const NTV2TCIndex inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6413
NTV2_FORMAT_1080p_5994_B
@ NTV2_FORMAT_1080p_5994_B
Definition: ntv2enums.h:529
gFBFsRaw
static NTV2FrameBufferFormatSet gFBFsRaw
Definition: ntv2democommon.cpp:60
NTV2_FORMAT_1080psf_3000_2
@ NTV2_FORMAT_1080psf_3000_2
Definition: ntv2enums.h:540
NTV2_FORMAT_1080p_2K_2400
@ NTV2_FORMAT_1080p_2K_2400
Definition: ntv2enums.h:524
AJA_PixelFormat_DVCPRO
@ AJA_PixelFormat_DVCPRO
Definition: videotypes.h:133
NTV2DeviceKinds
enum _NTV2DeviceKinds NTV2DeviceKinds
These enum values are used for device selection/filtering.
NTV2_FORMAT_525_2398
@ NTV2_FORMAT_525_2398
Definition: ntv2enums.h:545
NTV2_FORMAT_4x2048x1080p_3000
@ NTV2_FORMAT_4x2048x1080p_3000
Definition: ntv2enums.h:575
NTV2_DEVICEKIND_CUSTOM_ANC
@ NTV2_DEVICEKIND_CUSTOM_ANC
Specifies devices that have custom Anc inserter/extractor firmware.
Definition: ntv2enums.h:1342
NTV2_VANCMODE_OFF
@ NTV2_VANCMODE_OFF
This identifies the mode in which there are no VANC lines in the frame buffer.
Definition: ntv2enums.h:3718
NTV2_FORMAT_4096x2160p_4795
@ NTV2_FORMAT_4096x2160p_4795
Definition: ntv2enums.h:631
aja::replace
std::string & replace(std::string &str, const std::string &from, const std::string &to)
Definition: common.cpp:110
NTV2_FRAMERATE_2398
@ NTV2_FRAMERATE_2398
Fractional rate of 24,000 frames per 1,001 seconds.
Definition: ntv2enums.h:406
CNTV2DemoCommon::ConfigureAudioSystems
static bool ConfigureAudioSystems(CNTV2Card &inDevice, const CaptureConfig &inConfig, const NTV2AudioSystemSet inAudioSystems)
Configures capture audio systems.
Definition: ntv2democommon.cpp:1463
kTCFormat25fps
@ kTCFormat25fps
Definition: ntv2rp188.h:31
ULWord
uint32_t ULWord
Definition: ajatypes.h:253
CNTV2DemoCommon::ToLower
static std::string ToLower(const std::string &inStr)
Returns the given string after converting it to lower case.
Definition: ntv2democommon.cpp:926
NTV2_FORMAT_4x4096x2160p_3000
@ NTV2_FORMAT_4x4096x2160p_3000
Definition: ntv2enums.h:672
AJASystemInfo::append
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:168
NTV2_FORMAT_2K_2500
@ NTV2_FORMAT_2K_2500
Definition: ntv2enums.h:555
NTV2_FRAMERATE_1900
@ NTV2_FRAMERATE_1900
Definition: ntv2enums.h:416
ntv2devicescanner.h
Declares the CNTV2DeviceScanner class.
CaptureConfig
This class is used to configure an NTV2Capture instance.
Definition: ntv2democommon.h:265
gFBFsPacked
static NTV2FrameBufferFormatSet gFBFsPacked
Definition: ntv2democommon.cpp:61
NTV2_FORMAT_4x2048x1080psf_3000
@ NTV2_FORMAT_4x2048x1080psf_3000
Definition: ntv2enums.h:577
NTV2_FORMAT_1080p_2997
@ NTV2_FORMAT_1080p_2997
Definition: ntv2enums.h:518
NTV2_DEVICEKIND_12G
@ NTV2_DEVICEKIND_12G
Specifies devices that have 12G SDI connectors.
Definition: ntv2enums.h:1341
NTV2_FORMAT_1080p_2K_4795_B
@ NTV2_FORMAT_1080p_2K_4795_B
Definition: ntv2enums.h:597
AJA_PixelFormat_YCBCR10_420PL
@ AJA_PixelFormat_YCBCR10_420PL
Definition: videotypes.h:156
NTV2_FRAMERATE_1498
@ NTV2_FRAMERATE_1498
Fractional rate of 15,000 frames per 1,001 seconds.
Definition: ntv2enums.h:413
NTV2_FORMAT_1080p_3000
@ NTV2_FORMAT_1080p_3000
Definition: ntv2enums.h:519
CNTV2DemoCommon::SetDefaultPageSize
static size_t SetDefaultPageSize(void)
Definition: ntv2democommon.cpp:1484
CNTV2DemoCommon::GetPixelFormatFromString
static NTV2FrameBufferFormat GetPixelFormatFromString(const std::string &inStr)
Returns the NTV2FrameBufferFormat that matches the given string.
Definition: ntv2democommon.cpp:653
NTV2FrameData::Timecode
NTV2_RP188 Timecode(const NTV2TCIndex inTCNdx) const
Definition: ntv2democommon.cpp:379
NTV2_FORMAT_4x3840x2160p_5994
@ NTV2_FORMAT_4x3840x2160p_5994
Definition: ntv2enums.h:661
NTV2_FORMAT_4096x2160p_2398
@ NTV2_FORMAT_4096x2160p_2398
Definition: ntv2enums.h:624
NTV2_FORMAT_720p_6000
@ NTV2_FORMAT_720p_6000
Definition: ntv2enums.h:515
NTV2_INPUTSOURCE_INVALID
@ NTV2_INPUTSOURCE_INVALID
The invalid video input.
Definition: ntv2enums.h:1236
NTV2_DEVICEKIND_4K
@ NTV2_DEVICEKIND_4K
Specifies devices that can do 4K video.
Definition: ntv2enums.h:1337
NTV2DeviceIDToString
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:4673
NTV2_FORMAT_1080p_2500
@ NTV2_FORMAT_1080p_2500
Definition: ntv2enums.h:520
NTV2AudioSystemSet
std::set< NTV2AudioSystem > NTV2AudioSystemSet
A set of distinct NTV2AudioSystem values. New in SDK 16.2.
Definition: ntv2publicinterface.h:3900
NTV2_MAX_NUM_VIDEO_FORMATS
@ NTV2_MAX_NUM_VIDEO_FORMATS
Definition: ntv2enums.h:685
String2VideoFormatMapConstIter
String2VideoFormatMap::const_iterator String2VideoFormatMapConstIter
Definition: ntv2democommon.cpp:26
CNTV2DemoCommon::BFT
static bool BFT(void)
Definition: ntv2democommon.cpp:1525
NTV2TCIndex
NTV2TCIndex
These enum values are indexes into the capture/playout AutoCirculate timecode arrays.
Definition: ntv2enums.h:3870
AJA_PixelFormat_RGBA8
@ AJA_PixelFormat_RGBA8
Definition: videotypes.h:127
String2AudioSystemMap
map< string, NTV2AudioSystem > String2AudioSystemMap
Definition: ntv2democommon.cpp:31
GetCSCOutputXptFromChannel
NTV2OutputXptID GetCSCOutputXptFromChannel(const NTV2Channel inCSC, const bool inIsKey=false, const bool inIsRGB=false)
Definition: ntv2signalrouter.cpp:819
AJASystemInfo::ToString
virtual void ToString(std::string &outAllLabelsAndValues) const
Answers with a multi-line string that contains the complete host system info table.
AJA_FrameRate_2398
@ AJA_FrameRate_2398
Definition: videotypes.h:219
NTV2_FORMAT_4x2048x1080p_5000
@ NTV2_FORMAT_4x2048x1080p_5000
Definition: ntv2enums.h:581
NTV2_FBF_24BIT_BGR
@ NTV2_FBF_24BIT_BGR
See 24-Bit BGR.
Definition: ntv2enums.h:224
CNTV2Card::GetSerialNumberString
virtual bool GetSerialNumberString(std::string &outSerialNumberString)
Answers with a string that contains my human-readable serial number.
Definition: ntv2card.cpp:214
AJA_PixelFormat_YCBCR10_422PL3LE
@ AJA_PixelFormat_YCBCR10_422PL3LE
Definition: videotypes.h:164
NTV2_FORMAT_4096x2160p_6000
@ NTV2_FORMAT_4096x2160p_6000
Definition: ntv2enums.h:635
PIXEL_FORMATS_ALL
@ PIXEL_FORMATS_ALL
Definition: ntv2democommon.h:240
UWord
uint16_t UWord
Definition: ajatypes.h:251
NTV2VANCModeToString
std::string NTV2VANCModeToString(const NTV2VANCMode inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6521
AJA_PixelFormat_YCBCR10_420PL3LE
@ AJA_PixelFormat_YCBCR10_420PL3LE
Definition: videotypes.h:163
CNTV2DemoCommon::GetVANCModeStrings
static std::string GetVANCModeStrings(void)
Definition: ntv2democommon.cpp:851
CNTV2DemoCommon::GetSupportedTCIndexes
static const NTV2TCIndexes GetSupportedTCIndexes(const NTV2TCIndexKinds inKinds)
Definition: ntv2democommon.cpp:752
NTV2_FORMAT_4x1920x1080p_3000
@ NTV2_FORMAT_4x1920x1080p_3000
Definition: ntv2enums.h:571
NTV2_FORMAT_4x3840x2160p_2997
@ NTV2_FORMAT_4x3840x2160p_2997
Definition: ntv2enums.h:658
NTV2_FBF_8BIT_YCBCR
@ NTV2_FBF_8BIT_YCBCR
See 8-Bit YCbCr Format.
Definition: ntv2enums.h:211
ntv2utils.h
Declares numerous NTV2 utility functions.
AJA_PixelFormat_RGB10_PACK
@ AJA_PixelFormat_RGB10_PACK
Definition: videotypes.h:144
PlayerConfig::Get
AJALabelValuePairs Get(const bool inCompact=(0)) const
Renders a human-readable representation of me.
Definition: ntv2democommon.cpp:1694
NTV2_FORMAT_1080p_5000_B
@ NTV2_FORMAT_1080p_5000_B
Definition: ntv2enums.h:528
AJA_PixelFormat_RGB_DPX
@ AJA_PixelFormat_RGB_DPX
Definition: videotypes.h:131
poptFreeContext
poptContext poptFreeContext(poptContext con)
Definition: options_popt.cpp:3539
NTV2VideoFormatToString
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Definition: ntv2utils.cpp:6750
NTV2_FRAMERATE_1800
@ NTV2_FRAMERATE_1800
Definition: ntv2enums.h:418
NTV2VideoFormatSetConstIter
NTV2VideoFormatSet::const_iterator NTV2VideoFormatSetConstIter
A handy const iterator for iterating over an NTV2VideoFormatSet.
Definition: ntv2publicinterface.h:8770
NTV2_FORMAT_4x3840x2160p_5000
@ NTV2_FORMAT_4x3840x2160p_5000
Definition: ntv2enums.h:660
NTV2_FORMAT_1080p_2K_5994_A
@ NTV2_FORMAT_1080p_2K_5994_A
Definition: ntv2enums.h:591
NTV2_INPUT_SOURCE_IS_HDMI
#define NTV2_INPUT_SOURCE_IS_HDMI(_inpSrc_)
Definition: ntv2enums.h:1240
CNTV2DemoCommon::Popt::~Popt
virtual ~Popt()
Definition: ntv2democommon.cpp:1519
NTV2_MAX_NUM_TIMECODE_INDEXES
@ NTV2_MAX_NUM_TIMECODE_INDEXES
Definition: ntv2enums.h:3899
gInitializer
static const DemoCommonInitializer gInitializer
Definition: ntv2democommon.cpp:376
GetCSCInputXptFromChannel
NTV2InputXptID GetCSCInputXptFromChannel(const NTV2Channel inCSC, const bool inIsKeyInput=false)
Definition: ntv2signalrouter.cpp:775
CNTV2Card
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
NTV2_FORMAT_4x2048x1080p_12000
@ NTV2_FORMAT_4x2048x1080p_12000
Definition: ntv2enums.h:587
NTV2_DEVICEKIND_ALL
@ NTV2_DEVICEKIND_ALL
Specifies any/all devices.
Definition: ntv2enums.h:1328
kTCFormat60fpsDF
@ kTCFormat60fpsDF
Definition: ntv2rp188.h:37
CNTV2DemoCommon::GetTCIndexStrings
static std::string GetTCIndexStrings(const NTV2TCIndexKinds inKinds=TC_INDEXES_ALL, const std::string inDeviceSpecifier=std::string(), const bool inIsInputOnly=(!(0)))
Definition: ntv2democommon.cpp:773
NTV2_DEVICEKIND_INPUT
@ NTV2_DEVICEKIND_INPUT
Specifies devices that input (capture).
Definition: ntv2enums.h:1329
NTV2_FBF_10BIT_YCBCR_422PL2
@ NTV2_FBF_10BIT_YCBCR_422PL2
10-Bit 4:2:2 2-Plane YCbCr
Definition: ntv2enums.h:240
NTV2Connection
std::pair< NTV2InputXptID, NTV2OutputXptID > NTV2Connection
This links an NTV2InputXptID and an NTV2OutputXptID.
Definition: ntv2signalrouter.h:38
NTV2_FORMAT_625psf_2500
@ NTV2_FORMAT_625psf_2500
Definition: ntv2enums.h:548
CNTV2DemoCommon::WaitForEnterKeyPress
static void WaitForEnterKeyPress(void)
Prompts the user (via stdout) to press the Return or Enter key, then waits for it to happen.
Definition: ntv2democommon.cpp:981
NTV2_AUDIO_BUFFER_SIZE_4MB
@ NTV2_AUDIO_BUFFER_SIZE_4MB
Definition: ntv2enums.h:1862
NTV2_DEVICEKIND_EXTERNAL
@ NTV2_DEVICEKIND_EXTERNAL
Specifies external devices (e.g. Thunderbolt).
Definition: ntv2enums.h:1336
DEVICE_ID_INVALID
@ DEVICE_ID_INVALID
Definition: ntv2enums.h:91
PIXEL_FORMATS_PLANAR
@ PIXEL_FORMATS_PLANAR
Definition: ntv2democommon.h:242
NTV2_FORMAT_1080p_2K_2500
@ NTV2_FORMAT_1080p_2K_2500
Definition: ntv2enums.h:536
NTV2_FORMAT_4x4096x2160p_4800_B
@ NTV2_FORMAT_4x4096x2160p_4800_B
Definition: ntv2enums.h:679
NTV2_FORMAT_4x1920x1080psf_2997
@ NTV2_FORMAT_4x1920x1080psf_2997
Definition: ntv2enums.h:572
DeviceCapabilities::CanDoInputSource
bool CanDoInputSource(const NTV2InputSource inSrc)
Definition: ntv2devicecapabilities.h:233
CNTV2DemoCommon::GetTestPatternNameFromString
static std::string GetTestPatternNameFromString(const std::string &inStr)
Definition: ntv2democommon.cpp:917
NTV2_FORMAT_1080p_6000_A
@ NTV2_FORMAT_1080p_6000_A
Definition: ntv2enums.h:535
NTV2_INPUTSOURCE_HDMI1
@ NTV2_INPUTSOURCE_HDMI1
Identifies the 1st HDMI video input.
Definition: ntv2enums.h:1224
GetDLInOutputXptFromChannel
NTV2OutputXptID GetDLInOutputXptFromChannel(const NTV2Channel inDLInput)
Definition: ntv2signalrouter.cpp:917
NTV2_FRAMERATE_11988
@ NTV2_FRAMERATE_11988
Fractional rate of 120,000 frames per 1,001 seconds.
Definition: ntv2enums.h:411
DeviceFilterString
static string DeviceFilterString(const NTV2DeviceKinds inKinds)
Definition: ntv2democommon.cpp:444
AJA_FrameRate_5994
@ AJA_FrameRate_5994
Definition: videotypes.h:227
AJA_FrameRate_1800
@ AJA_FrameRate_1800
Definition: videotypes.h:216
NTV2_FORMAT_1080p_2K_2398
@ NTV2_FORMAT_1080p_2K_2398
Definition: ntv2enums.h:523
NTV2_FORMAT_3840x2160p_2997
@ NTV2_FORMAT_3840x2160p_2997
Definition: ntv2enums.h:610
NTV2_FORMAT_4096x2160p_4800
@ NTV2_FORMAT_4096x2160p_4800
Definition: ntv2enums.h:632
NTV2PixelFormatKinds
enum _NTV2PixelFormatKinds NTV2PixelFormatKinds
NTV2StringList
std::vector< std::string > NTV2StringList
Definition: ntv2utils.h:1134
NTV2_FORMAT_1080p_2398
@ NTV2_FORMAT_1080p_2398
Definition: ntv2enums.h:521
gString2VANCModeMap
static String2VANCModeMap gString2VANCModeMap
Definition: ntv2democommon.cpp:72
NTV2VANCMode
NTV2VANCMode
These enum values identify the available VANC modes.
Definition: ntv2enums.h:3716
AJA_FrameRate_4800
@ AJA_FrameRate_4800
Definition: videotypes.h:225
NTV2_INPUT_CROSSPOINT_INVALID
@ NTV2_INPUT_CROSSPOINT_INVALID
Definition: ntv2enums.h:2827
NTV2_FORMAT_1080psf_2K_2400
@ NTV2_FORMAT_1080psf_2K_2400
Definition: ntv2enums.h:526
AJA_PixelFormat_YCbCrA10
@ AJA_PixelFormat_YCbCrA10
Definition: videotypes.h:138
NTV2_OUTPUT_DEST_IS_SDI
#define NTV2_OUTPUT_DEST_IS_SDI(_dest_)
Definition: ntv2enums.h:1294
gNon4KFormats
static NTV2VideoFormatSet gNon4KFormats
Definition: ntv2democommon.cpp:54
AJA_NULL
#define AJA_NULL
Definition: ajatypes.h:197
NTV2_VANCMODE_INVALID
@ NTV2_VANCMODE_INVALID
This identifies the invalid (unspecified, uninitialized) VANC mode.
Definition: ntv2enums.h:3721
CNTV2DemoCommon::GetAJAFrameRate
static AJA_FrameRate GetAJAFrameRate(const NTV2FrameRate inFrameRate)
Definition: ntv2democommon.cpp:1011
NTV2_FORMAT_3840x2160p_5994
@ NTV2_FORMAT_3840x2160p_5994
Definition: ntv2enums.h:615
NTV2_FORMAT_4x4096x2160p_2400
@ NTV2_FORMAT_4x4096x2160p_2400
Definition: ntv2enums.h:669
NTV2_FBF_8BIT_YCBCR_YUY2
@ NTV2_FBF_8BIT_YCBCR_YUY2
See Alternate 8-Bit YCbCr ('YUY2').
Definition: ntv2enums.h:215
CaptureConfig::fInputChannel
NTV2Channel fInputChannel
The device channel to use.
Definition: ntv2democommon.h:270
CNTV2DemoCommon::GetOutputDestinationFromString
static NTV2OutputDestination GetOutputDestinationFromString(const std::string &inStr)
Returns the NTV2OutputDestination that matches the given string.
Definition: ntv2democommon.cpp:743
NTV2_FORMAT_4x4096x2160p_6000
@ NTV2_FORMAT_4x4096x2160p_6000
Definition: ntv2enums.h:677
NTV2ChannelList
std::vector< NTV2Channel > NTV2ChannelList
An ordered sequence of NTV2Channel values.
Definition: ntv2publicinterface.h:3835
NTV2_FORMAT_3840x2160p_2398
@ NTV2_FORMAT_3840x2160p_2398
Definition: ntv2enums.h:607
AJA_PixelFormat_PRORES_HDV
@ AJA_PixelFormat_PRORES_HDV
Definition: videotypes.h:143
NTV2InputSource
NTV2InputSource
Identifies a specific video input source.
Definition: ntv2enums.h:1221
gString2VideoFormatMap
static String2VideoFormatMap gString2VideoFormatMap
Definition: ntv2democommon.cpp:69
gOutputDestinations
static NTV2OutputDestinations gOutputDestinations
Definition: ntv2democommon.cpp:68
NTV2_DEVICEKIND_SDI
@ NTV2_DEVICEKIND_SDI
Specifies devices with SDI connectors.
Definition: ntv2enums.h:1331
NTV2_FORMAT_UNKNOWN
@ NTV2_FORMAT_UNKNOWN
Definition: ntv2enums.h:498
NTV2_IS_QUAD_QUAD_FORMAT
#define NTV2_IS_QUAD_QUAD_FORMAT(__f__)
Definition: ntv2enums.h:778
NTV2_FORMAT_4x1920x1080psf_2398
@ NTV2_FORMAT_4x1920x1080psf_2398
Definition: ntv2enums.h:558
NTV2DeviceCanDo12gRouting
bool NTV2DeviceCanDo12gRouting(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:287
poptGetContext
poptContext poptGetContext(const char *name, int argc, const char **argv, const struct poptOption *options, unsigned int flags)
Definition: options_popt.cpp:2264
CNTV2DemoCommon::GetInputRouting8K
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.
Definition: ntv2democommon.cpp:1376
NTV2_FORMAT_1080p_2K_6000_A
@ NTV2_FORMAT_1080p_2K_6000_A
Definition: ntv2enums.h:590
NTV2_FBF_10BIT_YCBCR
@ NTV2_FBF_10BIT_YCBCR
See 10-Bit YCbCr Format.
Definition: ntv2enums.h:210
String2InputSourceMapConstIter
String2InputSourceMap::const_iterator String2InputSourceMapConstIter
Definition: ntv2democommon.cpp:38
NTV2_FBF_PRORES_DVCPRO
@ NTV2_FBF_PRORES_DVCPRO
Apple ProRes DVC Pro.
Definition: ntv2enums.h:229
g8KFormats
static NTV2VideoFormatSet g8KFormats
Definition: ntv2democommon.cpp:56
VIDEO_FORMATS_NON_4KUHD
@ VIDEO_FORMATS_NON_4KUHD
Definition: ntv2democommon.h:225
NTV2_DEVICEKIND_SFP
@ NTV2_DEVICEKIND_SFP
Specifies devices with SFP connectors.
Definition: ntv2enums.h:1334
NTV2_FORMAT_3840x2160p_5000_B
@ NTV2_FORMAT_3840x2160p_5000_B
Definition: ntv2enums.h:617
NTV2_FORMAT_4096x2160p_3000
@ NTV2_FORMAT_4096x2160p_3000
Definition: ntv2enums.h:628
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5605
NTV2_FORMAT_4x1920x1080psf_2500
@ NTV2_FORMAT_4x1920x1080psf_2500
Definition: ntv2enums.h:560
NTV2_FRAMERATE_5994
@ NTV2_FRAMERATE_5994
Fractional rate of 60,000 frames per 1,001 seconds.
Definition: ntv2enums.h:401
NTV2_OUTPUTDESTINATION_HDMI
@ NTV2_OUTPUTDESTINATION_HDMI
Definition: ntv2enums.h:1279
poptGetNextOpt
int poptGetNextOpt(poptContext con)
Definition: options_popt.cpp:3236
ntv2democommon.h
This file contains some structures, constants, classes and functions that are used in some of the dem...
common.h
Private include file for all ajabase sources.
NTV2_FORMAT_4x3840x2160p_2400
@ NTV2_FORMAT_4x3840x2160p_2400
Definition: ntv2enums.h:656
CNTV2DeviceScanner::GetDeviceAtIndex
static bool GetDeviceAtIndex(const ULWord inDeviceIndexNumber, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the AJA device having the given zero-bas...
Definition: ntv2devicescanner.cpp:274
NTV2AudioSystemSetConstIter
NTV2AudioSystemSet::const_iterator NTV2AudioSystemSetConstIter
A handy const iterator into an NTV2AudioSystemSet. New in SDK 16.2.
Definition: ntv2publicinterface.h:3901
AJA_PixelFormat_ABGR8
@ AJA_PixelFormat_ABGR8
Definition: videotypes.h:130
NTV2_FORMAT_4x4096x2160p_5000_B
@ NTV2_FORMAT_4x4096x2160p_5000_B
Definition: ntv2enums.h:680
AJA_PixelFormat_Unknown
@ AJA_PixelFormat_Unknown
Definition: videotypes.h:123
NTV2TCIndexesConstIter
NTV2TCIndexes::const_iterator NTV2TCIndexesConstIter
Definition: ntv2publicinterface.h:6850
NTV2_FBF_10BIT_RAW_YCBCR
@ NTV2_FBF_10BIT_RAW_YCBCR
See 10-Bit Raw YCbCr (CION).
Definition: ntv2enums.h:236
NTV2_DEVICEKIND_6G
@ NTV2_DEVICEKIND_6G
Specifies devices that have 6G SDI connectors.
Definition: ntv2enums.h:1340
CNTV2DemoCommon::GetInputSourceStrings
static std::string GetInputSourceStrings(const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL, const std::string inDeviceSpecifier=std::string())
Definition: ntv2democommon.cpp:678
NTV2_OUTPUTDESTINATION_INVALID
@ NTV2_OUTPUTDESTINATION_INVALID
Definition: ntv2enums.h:1288
String2VideoFormatMap
map< string, NTV2VideoFormat > String2VideoFormatMap
Definition: ntv2democommon.cpp:25
NTV2_FORMAT_4x2048x1080p_2500
@ NTV2_FORMAT_4x2048x1080p_2500
Definition: ntv2enums.h:569
NTV2_FORMAT_720p_2398
@ NTV2_FORMAT_720p_2398
Definition: ntv2enums.h:531
NTV2_FORMAT_4x1920x1080p_5994
@ NTV2_FORMAT_4x1920x1080p_5994
Definition: ntv2enums.h:579
NTV2_FORMAT_4x4096x2160p_5000
@ NTV2_FORMAT_4x4096x2160p_5000
Definition: ntv2enums.h:675
NTV2FrameBufferFormatToString
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6940
TC_INDEXES_SDI
@ TC_INDEXES_SDI
Definition: ntv2democommon.h:253
NTV2_FORMAT_4x3840x2160p_6000
@ NTV2_FORMAT_4x3840x2160p_6000
Definition: ntv2enums.h:662
CaptureConfig::fDoTSIRouting
bool fDoTSIRouting
If true, do TSI routing; otherwise squares.
Definition: ntv2democommon.h:279
NTV2DeviceGetSupportedOutputDests
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.
Definition: ntv2publicinterface.cpp:1293
AJA_PixelFormat_YCbCr10
@ AJA_PixelFormat_YCbCr10
Definition: videotypes.h:124
NTV2XptConnections
std::map< NTV2InputXptID, NTV2OutputXptID > NTV2XptConnections
Definition: ntv2signalrouter.h:39
GetTSIMuxOutputXptFromChannel
NTV2OutputXptID GetTSIMuxOutputXptFromChannel(const NTV2Channel inTSIMuxer, const bool inLinkB=false, const bool inIsRGB=false)
Definition: ntv2signalrouter.cpp:1005
NTV2_FBF_10BIT_YCBCR_DPX
@ NTV2_FBF_10BIT_YCBCR_DPX
See 10-Bit YCbCr - DPX Format.
Definition: ntv2enums.h:219
AJA_FrameRate_12000
@ AJA_FrameRate_12000
Definition: videotypes.h:231
NTV2InputSourceSetConstIter
NTV2InputSourceSet::const_iterator NTV2InputSourceSetConstIter
A handy const iterator for iterating over an NTV2InputSourceSet.
Definition: ntv2publicinterface.h:8784
std
Definition: json.hpp:5362
NTV2_RP188
This struct replaces the old RP188_STRUCT.
Definition: ntv2publicinterface.h:6760
NTV2_FBF_10BIT_YCBCR_422PL3_LE
@ NTV2_FBF_10BIT_YCBCR_422PL3_LE
See 3-Plane 10-Bit YCbCr 4:2:2 ('I422_10LE' a.k.a. 'YUV-P-L10').
Definition: ntv2enums.h:238
AJA_FrameRate_1798
@ AJA_FrameRate_1798
Definition: videotypes.h:215
BurnConfig::Get
AJALabelValuePairs Get(const bool inCompact=(0)) const
Renders a human-readable representation of me.
Definition: ntv2democommon.cpp:1731
IsRGBFormat
bool IsRGBFormat(const NTV2FrameBufferFormat format)
Definition: ntv2utils.cpp:5442
NTV2_AUDIO_EMBEDDED
@ NTV2_AUDIO_EMBEDDED
Obtain audio samples from the audio that's embedded in the video HANC.
Definition: ntv2enums.h:1952
VIDEO_FORMATS_8KUHD2
@ VIDEO_FORMATS_8KUHD2
Definition: ntv2democommon.h:227
NTV2_FRAMERATE_UNKNOWN
@ NTV2_FRAMERATE_UNKNOWN
Represents an unknown or invalid frame rate.
Definition: ntv2enums.h:398
NTV2_FORMAT_1080p_5000_A
@ NTV2_FORMAT_1080p_5000_A
Definition: ntv2enums.h:533
NTV2_FORMAT_4x2048x1080p_6000
@ NTV2_FORMAT_4x2048x1080p_6000
Definition: ntv2enums.h:583
NTV2VideoFormat
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
CNTV2DemoCommon::GetInputRouting4K
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.
Definition: ntv2democommon.cpp:1228
NTV2_FORMAT_4096x2160p_5000
@ NTV2_FORMAT_4096x2160p_5000
Definition: ntv2enums.h:633
NTV2_FORMAT_1080i_5000
@ NTV2_FORMAT_1080i_5000
Definition: ntv2enums.h:511
gTCIndexesAnalog
static NTV2TCIndexSet gTCIndexesAnalog
Definition: ntv2democommon.cpp:78
NTV2_FORMAT_4x1920x1080p_5000
@ NTV2_FORMAT_4x1920x1080p_5000
Definition: ntv2enums.h:578
NTV2_FBF_8BIT_YCBCR_420PL3
@ NTV2_FBF_8BIT_YCBCR_420PL3
See 3-Plane 8-Bit YCbCr 4:2:0 ('I420' a.k.a. 'YUV-P420').
Definition: ntv2enums.h:221
NTV2_FORMAT_4x1920x1080p_2398
@ NTV2_FORMAT_4x1920x1080p_2398
Definition: ntv2enums.h:561
NTV2DeviceGetSupportedInputSources
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.
Definition: ntv2publicinterface.cpp:1277
gInputSourcesSDI
static NTV2InputSourceSet gInputSourcesSDI
Definition: ntv2democommon.cpp:65
NTV2_FORMAT_1080p_6000_B
@ NTV2_FORMAT_1080p_6000_B
Definition: ntv2enums.h:530
NTV2_FORMAT_4x4096x2160p_5994_B
@ NTV2_FORMAT_4x4096x2160p_5994_B
Definition: ntv2enums.h:681
NTV2_IOKINDS_ALL
@ NTV2_IOKINDS_ALL
Specifies any/all input/output kinds.
Definition: ntv2enums.h:1250
gString2AudioSystemMap
static String2AudioSystemMap gString2AudioSystemMap
Definition: ntv2democommon.cpp:71
NTV2DeviceIDSet
std::set< NTV2DeviceID > NTV2DeviceIDSet
A set of NTV2DeviceIDs.
Definition: ntv2utils.h:1031
NTV2_FORMAT_4096x2160p_2997
@ NTV2_FORMAT_4096x2160p_2997
Definition: ntv2enums.h:627
NTV2_TCINDEX_INVALID
@ NTV2_TCINDEX_INVALID
Definition: ntv2enums.h:3900
CNTV2DriverInterface::GetDeviceID
virtual NTV2DeviceID GetDeviceID(void)
Definition: ntv2driverinterface.cpp:381
NTV2_FBF_8BIT_DVCPRO
@ NTV2_FBF_8BIT_DVCPRO
See 8-Bit DVCPro.
Definition: ntv2enums.h:220
gTestPatternNames
static NTV2StringList gTestPatternNames
Definition: ntv2democommon.cpp:84
NTV2_FORMAT_4096x2160p_5994_B
@ NTV2_FORMAT_4096x2160p_5994_B
Definition: ntv2enums.h:641
NTV2_FORMAT_4x3840x2160p_5994_B
@ NTV2_FORMAT_4x3840x2160p_5994_B
Definition: ntv2enums.h:664
NTV2_FORMAT_1080p_5994_A
@ NTV2_FORMAT_1080p_5994_A
Definition: ntv2enums.h:534
NTV2_FORMAT_4x3840x2160p_6000_B
@ NTV2_FORMAT_4x3840x2160p_6000_B
Definition: ntv2enums.h:665
NTV2_FBF_8BIT_YCBCR_422PL2
@ NTV2_FBF_8BIT_YCBCR_422PL2
8-Bit 4:2:2 2-Plane YCbCr
Definition: ntv2enums.h:242
GetInputSourceOutputXpt
NTV2OutputXptID GetInputSourceOutputXpt(const NTV2InputSource inInputSource, const bool inIsSDI_DS2=false, const bool inIsHDMI_RGB=false, const UWord inHDMI_Quadrant=0)
Definition: ntv2signalrouter.cpp:865
AJA_FrameRate_6000
@ AJA_FrameRate_6000
Definition: videotypes.h:228
CNTV2DemoCommon::GetPixelFormatStrings
static std::string GetPixelFormatStrings(const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL, const std::string inDeviceSpecifier=std::string())
Definition: ntv2democommon.cpp:600
VIDEO_FORMATS_4KUHD
@ VIDEO_FORMATS_4KUHD
Definition: ntv2democommon.h:226
NTV2_FORMAT_4x2048x1080p_5994
@ NTV2_FORMAT_4x2048x1080p_5994
Definition: ntv2enums.h:582
gFBFsRGB
static NTV2FrameBufferFormatSet gFBFsRGB
Definition: ntv2democommon.cpp:58
NTV2StringListConstIter
NTV2StringList::const_iterator NTV2StringListConstIter
Definition: ntv2utils.h:1136
NTV2_DEVICEKIND_NONE
@ NTV2_DEVICEKIND_NONE
Doesn't specify any kind of device.
Definition: ntv2enums.h:1344
NTV2FrameData::UnlockAll
bool UnlockAll(CNTV2Card &inDevice)
Definition: ntv2democommon.cpp:408
gTCIndexesSDI
static NTV2TCIndexSet gTCIndexesSDI
Definition: ntv2democommon.cpp:76
AJA_PixelFormat
AJA_PixelFormat
Definition: videotypes.h:121
NTV2_FORMAT_4x3840x2160p_3000
@ NTV2_FORMAT_4x3840x2160p_3000
Definition: ntv2enums.h:659
NTV2_FORMAT_1080p_2K_5994_B
@ NTV2_FORMAT_1080p_2K_5994_B
Definition: ntv2enums.h:600
gString2InputSourceMap
static String2InputSourceMap gString2InputSourceMap
Definition: ntv2democommon.cpp:73
NTV2_FBF_16BIT_ARGB
@ NTV2_FBF_16BIT_ARGB
16-Bit ARGB
Definition: ntv2enums.h:233
PlayerConfig
Configures an NTV2Player instance.
Definition: ntv2democommon.h:310
NTV2ChannelToString
std::string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:5759
NTV2_INPUT_SOURCE_IS_SDI
#define NTV2_INPUT_SOURCE_IS_SDI(_inpSrc_)
Definition: ntv2enums.h:1242
NTV2_IOKINDS_SDI
@ NTV2_IOKINDS_SDI
Specifies SDI input/output kinds.
Definition: ntv2enums.h:1251
NTV2OutputXptID
enum NTV2OutputCrosspointID NTV2OutputXptID
NTV2_FBF_8BIT_YCBCR_422PL3
@ NTV2_FBF_8BIT_YCBCR_422PL3
See 3-Plane 8-Bit YCbCr 4:2:2 (Weitek 'Y42B' a.k.a. 'YUV-P8').
Definition: ntv2enums.h:234
NTV2TestPatternGen::getTestPatternNames
static NTV2TestPatternNames getTestPatternNames(void)
Definition: ntv2testpatterngen.cpp:2542
NTV2_FORMAT_3840x2160p_5000
@ NTV2_FORMAT_3840x2160p_5000
Definition: ntv2enums.h:614
NTV2_FORMAT_720p_5994
@ NTV2_FORMAT_720p_5994
Definition: ntv2enums.h:514
kTCFormatUnknown
@ kTCFormatUnknown
Definition: ntv2rp188.h:29
CNTV2DemoCommon::GetSupportedInputSources
static const NTV2InputSourceSet GetSupportedInputSources(const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL)
Definition: ntv2democommon.cpp:660
NTV2FrameData::LockAll
bool LockAll(CNTV2Card &inDevice)
Definition: ntv2democommon.cpp:387
CNTV2DemoCommon::NTV2FrameRate2TimecodeFormat
static TimecodeFormat NTV2FrameRate2TimecodeFormat(const NTV2FrameRate inFrameRate)
Definition: ntv2democommon.cpp:989
NTV2_FORMAT_1080p_2K_5000_A
@ NTV2_FORMAT_1080p_2K_5000_A
Definition: ntv2enums.h:594
NTV2_FRAMERATE_5000
@ NTV2_FRAMERATE_5000
50 frames per second
Definition: ntv2enums.h:407
NTV2_FORMAT_4x4096x2160p_4795_B
@ NTV2_FORMAT_4x4096x2160p_4795_B
Definition: ntv2enums.h:678
NTV2Buffer::HostPageSize
static size_t HostPageSize(void)
Definition: ntv2publicinterface.cpp:2020
CNTV2Card::SetNumberAudioChannels
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:146
CNTV2Card::SetAudioBufferSize
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:249
NTV2_FORMAT_4x2048x1080psf_2500
@ NTV2_FORMAT_4x2048x1080psf_2500
Definition: ntv2enums.h:566
NTV2_FBF_10BIT_RGB
@ NTV2_FBF_10BIT_RGB
See 10-Bit RGB Format.
Definition: ntv2enums.h:214
gFBFsAlpha
static NTV2FrameBufferFormatSet gFBFsAlpha
Definition: ntv2democommon.cpp:62
CNTV2DemoCommon::StripFormatString
static std::string StripFormatString(const std::string &inStr)
Definition: ntv2democommon.cpp:933
CNTV2DemoCommon::GetGlobalMutexName
static const char * GetGlobalMutexName(void)
Definition: ntv2democommon.cpp:1177
poptBadOption
const char * poptBadOption(poptContext con, unsigned int flags)
Definition: options_popt.cpp:3623
NTV2_FRAMERATE_4795
@ NTV2_FRAMERATE_4795
Fractional rate of 48,000 frames per 1,001 seconds.
Definition: ntv2enums.h:409
NTV2_FORMAT_2K_1500
@ NTV2_FORMAT_2K_1500
Definition: ntv2enums.h:552
aja::to_string
std::string to_string(bool val)
Definition: common.cpp:180
NTV2_FRAMERATE_3000
@ NTV2_FRAMERATE_3000
30 frames per second
Definition: ntv2enums.h:402
NTV2_IS_VALID_FRAME_BUFFER_FORMAT
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
Definition: ntv2enums.h:251
AJALabelValuePairs
std::vector< AJALabelValuePair > AJALabelValuePairs
An ordered sequence of label/value pairs.
Definition: info.h:69
CNTV2DemoCommon::GetAJAPixelFormat
static AJA_PixelFormat GetAJAPixelFormat(const NTV2FrameBufferFormat inFormat)
Definition: ntv2democommon.cpp:1043
NTV2AudioSystem
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information.
Definition: ntv2enums.h:3814
NTV2_FORMAT_1080p_2K_5000_B
@ NTV2_FORMAT_1080p_2K_5000_B
Definition: ntv2enums.h:599
gString2PixelFormatMap
static String2PixelFormatMap gString2PixelFormatMap
Definition: ntv2democommon.cpp:70
NTV2_FORMAT_525_2400
@ NTV2_FORMAT_525_2400
Definition: ntv2enums.h:546
CNTV2DemoCommon::Get8KInputFormat
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...
Definition: ntv2democommon.cpp:1132
NTV2_FORMAT_1080psf_2997_2
@ NTV2_FORMAT_1080psf_2997_2
Definition: ntv2enums.h:539
String2OutputDestMap
map< string, NTV2OutputDestination > String2OutputDestMap
Definition: ntv2democommon.cpp:40
String2AudioSystemMapConstIter
String2AudioSystemMap::const_iterator String2AudioSystemMapConstIter
Definition: ntv2democommon.cpp:32
TC_INDEXES_ANALOG
@ TC_INDEXES_ANALOG
Definition: ntv2democommon.h:254
NTV2_FORMAT_4x4096x2160p_5994
@ NTV2_FORMAT_4x4096x2160p_5994
Definition: ntv2enums.h:676
NTV2_FORMAT_4x2048x1080p_2400
@ NTV2_FORMAT_4x2048x1080p_2400
Definition: ntv2enums.h:568
gFBFsPlanar
static NTV2FrameBufferFormatSet gFBFsPlanar
Definition: ntv2democommon.cpp:59
NTV2_FORMAT_1080p_2K_4800_B
@ NTV2_FORMAT_1080p_2K_4800_B
Definition: ntv2enums.h:598
DeviceCapabilities::CanDoFrameBufferFormat
bool CanDoFrameBufferFormat(const NTV2PixelFormat inPF)
Definition: ntv2devicecapabilities.h:223
NTV2_FORMAT_4x1920x1080p_2400
@ NTV2_FORMAT_4x1920x1080p_2400
Definition: ntv2enums.h:562
NTV2_FORMAT_4x1920x1080psf_2400
@ NTV2_FORMAT_4x1920x1080psf_2400
Definition: ntv2enums.h:559
NTV2VideoFormatKinds
enum _NTV2VideoFormatKinds NTV2VideoFormatKinds
gTCIndexesHDMI
static NTV2TCIndexSet gTCIndexesHDMI
Definition: ntv2democommon.cpp:77
NTV2_FORMAT_720p_2500
@ NTV2_FORMAT_720p_2500
Definition: ntv2enums.h:532
NTV2_FORMAT_3840x2160p_6000_B
@ NTV2_FORMAT_3840x2160p_6000_B
Definition: ntv2enums.h:619
NTV2_FORMAT_1080psf_2500_2
@ NTV2_FORMAT_1080psf_2500_2
Definition: ntv2enums.h:538
NTV2TCIndexKinds
enum _NTV2TCIndexKinds NTV2TCIndexKinds
NTV2_FORMAT_4096x2160p_4795_B
@ NTV2_FORMAT_4096x2160p_4795_B
Definition: ntv2enums.h:638
GetTSIMuxInputXptFromChannel
NTV2InputXptID GetTSIMuxInputXptFromChannel(const NTV2Channel inTSIMuxer, const bool inLinkB=false)
Definition: ntv2signalrouter.cpp:993
String2OutputDestMapConstIter
String2OutputDestMap::const_iterator String2OutputDestMapConstIter
Definition: ntv2democommon.cpp:41
gInputSourcesAnalog
static NTV2InputSourceSet gInputSourcesAnalog
Definition: ntv2democommon.cpp:67
NTV2_FORMAT_4096x2160p_4800_B
@ NTV2_FORMAT_4096x2160p_4800_B
Definition: ntv2enums.h:639
NTV2_FORMAT_3840x2160p_2400
@ NTV2_FORMAT_3840x2160p_2400
Definition: ntv2enums.h:608
NTV2_FORMAT_1080p_2400
@ NTV2_FORMAT_1080p_2400
Definition: ntv2enums.h:522
NTV2_FORMAT_1080i_6000
@ NTV2_FORMAT_1080i_6000
Definition: ntv2enums.h:513
String2VANCModeMap
map< string, NTV2VANCMode > String2VANCModeMap
Definition: ntv2democommon.cpp:34
NTV2_FBF_ABGR
@ NTV2_FBF_ABGR
See 8-Bit ARGB, RGBA, ABGR Formats.
Definition: ntv2enums.h:216
CaptureConfig::fInputSource
NTV2InputSource fInputSource
The device input connector to use.
Definition: ntv2democommon.h:271
NTV2_IS_VALID_VIDEO_FORMAT
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:688
gString2TCIndexMap
static String2TCIndexMap gString2TCIndexMap
Definition: ntv2democommon.cpp:82
NTV2_FORMAT_3840x2160p_3000
@ NTV2_FORMAT_3840x2160p_3000
Definition: ntv2enums.h:611
NTV2_FORMAT_1080psf_2400
@ NTV2_FORMAT_1080psf_2400
Definition: ntv2enums.h:517
AJA_PixelFormat_YCBCR8_420PL
@ AJA_PixelFormat_YCBCR8_420PL
Definition: videotypes.h:158
AJA_PixelFormat_RGB12P
@ AJA_PixelFormat_RGB12P
Definition: videotypes.h:141
NTV2TCIndexSet
std::set< NTV2TCIndex > NTV2TCIndexSet
A set of distinct NTV2TCIndex values.
Definition: ntv2publicinterface.h:6849
DeviceCapabilities::CanDoOutputTCIndex
bool CanDoOutputTCIndex(const NTV2TCIndex inTCNdx)
Definition: ntv2devicecapabilities.h:329
TC_INDEXES_ALL
@ TC_INDEXES_ALL
Definition: ntv2democommon.h:252
String2TCIndexMapConstIter
String2TCIndexMap::const_iterator String2TCIndexMapConstIter
Definition: ntv2democommon.cpp:45
NTV2_FORMAT_4096x2160p_5994
@ NTV2_FORMAT_4096x2160p_5994
Definition: ntv2enums.h:634
NTV2_FBF_HAS_ALPHA
#define NTV2_FBF_HAS_ALPHA(__fbf__)
Definition: ntv2enums.h:311
gTCIndexes
static NTV2TCIndexSet gTCIndexes
Definition: ntv2democommon.cpp:75
NTV2VideoFormatString
const char * NTV2VideoFormatString(NTV2VideoFormat fmt)
Definition: ntv2debug.cpp:314
CNTV2Card::SetAudioRate
virtual bool SetAudioRate(const NTV2AudioRate inRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the NTV2AudioRate for the given Audio System.
Definition: ntv2audio.cpp:205
NTV2_FORMAT_4x2048x1080psf_2997
@ NTV2_FORMAT_4x2048x1080psf_2997
Definition: ntv2enums.h:576
NTV2OutputDestinationToString
std::string NTV2OutputDestinationToString(const NTV2OutputDestination inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:7238
NTV2_AUDIOSYSTEM_INVALID
@ NTV2_AUDIOSYSTEM_INVALID
Definition: ntv2enums.h:3826
NTV2_FORMAT_1080p_2K_2997
@ NTV2_FORMAT_1080p_2K_2997
Definition: ntv2enums.h:592