AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2utils.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
7 #include "ajatypes.h"
8 #include "ntv2utils.h"
9 #include "ntv2formatdescriptor.h"
10 #include "ntv2registerexpert.h"
11 #include "ntv2videodefines.h"
12 #include "ntv2audiodefines.h"
13 #include "ntv2endian.h"
14 #include "ntv2debug.h"
15 #include "ntv2transcode.h"
16 #include "ntv2version.h"
17 #include "ntv2devicefeatures.h" // Required for NTV2DeviceCanDoVideoFormat
18 #include "ajabase/system/lock.h"
19 #include "ajabase/system/info.h"
20 #include "ajabase/common/common.h"
21 #if defined(AJALinux)
22  #include <string.h> // For memset
23  #include <stdint.h>
24 
25 #endif
26 #include <algorithm>
27 #include <sstream>
28 #include <iomanip>
29 #include <iterator>
30 #include <map>
31 
32 
33 using namespace std;
34 
35 
36 // Macros to simplify returning of strings for given enum
37 #define NTV2UTILS_ENUM_CASE_RETURN_STR(enum_name) case(enum_name): return #enum_name
38 
39 #define NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(condition, retail_name, enum_name)\
40  case(enum_name): return condition ? retail_name : #enum_name
41 
43 // BEGIN SECTION MOVED FROM 'videoutilities.cpp'
45 
46 uint32_t CalcRowBytesForFormat (const NTV2FrameBufferFormat inPixelFormat, const uint32_t inPixelWidth)
47 {
48  uint32_t rowBytes = 0;
49 
50  switch (inPixelFormat)
51  {
54  rowBytes = inPixelWidth * 2;
55  break;
56 
59  rowBytes = (( inPixelWidth % 48 == 0 ) ? inPixelWidth : (((inPixelWidth / 48 ) + 1) * 48)) * 8 / 3;
60  break;
61 
62  case NTV2_FBF_10BIT_RGB:
63  case NTV2_FBF_10BIT_DPX:
66  case NTV2_FBF_ARGB:
67  case NTV2_FBF_RGBA:
68  case NTV2_FBF_ABGR:
69  rowBytes = inPixelWidth * 4;
70  break;
71 
72  case NTV2_FBF_24BIT_RGB:
73  case NTV2_FBF_24BIT_BGR:
74  rowBytes = inPixelWidth * 3;
75  break;
76 
78  rowBytes = inPixelWidth * 2/4;
79  break;
80 
81  case NTV2_FBF_48BIT_RGB:
82  rowBytes = inPixelWidth * 6;
83  break;
84 
86  rowBytes = inPixelWidth * 36 / 8;
87  break;
88 
91  rowBytes = inPixelWidth * 20 / 16;
92  break;
93 
96  rowBytes = inPixelWidth;
97  break;
98 
100  rowBytes = inPixelWidth * 5;
101  break;
102 
104  case NTV2_FBF_8BIT_HDV:
107  case NTV2_FBF_PRORES_HDV:
108  case NTV2_FBF_16BIT_ARGB:
115  // TO DO.....add more
116  break;
117  }
118 
119  return rowBytes;
120 }
121 
122 
123 bool UnpackLine_10BitYUVtoUWordSequence (const void * pIn10BitYUVLine, UWordSequence & out16BitYUVLine, ULWord inNumPixels)
124 {
125  out16BitYUVLine.clear();
126  const ULWord * pInputLine (reinterpret_cast <const ULWord *> (pIn10BitYUVLine));
127 
128  if (!pInputLine)
129  return false; // bad pointer
130  if (inNumPixels < 6)
131  return false; // bad width
132  if (inNumPixels % 6)
133  inNumPixels -= inNumPixels % 6;
134 
135  const ULWord totalULWords (inNumPixels * 4 / 6); // 4 ULWords per 6 pixels
136  out16BitYUVLine.reserve(totalULWords * 3);
137  for (ULWord inputCount (0); inputCount < totalULWords; inputCount++)
138  {
139  out16BitYUVLine.push_back ((pInputLine [inputCount] ) & 0x3FF);
140  out16BitYUVLine.push_back ((pInputLine [inputCount] >> 10) & 0x3FF);
141  out16BitYUVLine.push_back ((pInputLine [inputCount] >> 20) & 0x3FF);
142  }
143  return true;
144 }
145 
146 
147 bool UnpackLine_10BitYUVtoUWordSequence (const void * pIn10BitYUVLine, const NTV2FormatDescriptor & inFormatDesc, UWordSequence & out16BitYUVLine)
148 {
149  out16BitYUVLine.clear();
150  const ULWord * pInputLine (reinterpret_cast <const ULWord *> (pIn10BitYUVLine));
151 
152  if (!pInputLine)
153  return false; // bad pointer
154  if (!inFormatDesc.IsValid())
155  return false; // bad formatDesc
156  if (inFormatDesc.GetRasterWidth() < 6)
157  return false; // bad width
158  if (inFormatDesc.GetPixelFormat() != NTV2_FBF_10BIT_YCBCR)
159  return false; // wrong FBF
160 
161  out16BitYUVLine.reserve(inFormatDesc.linePitch * 3);
162  for (ULWord inputCount (0); inputCount < inFormatDesc.linePitch; inputCount++)
163  {
164  out16BitYUVLine.push_back ((pInputLine [inputCount] ) & 0x3FF);
165  out16BitYUVLine.push_back ((pInputLine [inputCount] >> 10) & 0x3FF);
166  out16BitYUVLine.push_back ((pInputLine [inputCount] >> 20) & 0x3FF);
167  }
168  return true;
169 }
170 
171 
172 bool UnpackLine_10BitARGBtoUWordSequence (const void * pIn10BitARGBLine, const NTV2FormatDescriptor & inFormatDesc, UWordSequence & out16BitARGBLine)
173 {
174  out16BitARGBLine.clear();
175  const UByte * pInputLine (reinterpret_cast <const UByte *> (pIn10BitARGBLine));
176 
177  if (!pInputLine)
178  return false; // bad pointer
179  if (!inFormatDesc.IsValid())
180  return false; // bad formatDesc
181  if (inFormatDesc.GetRasterWidth() < 1)
182  return false; // bad width
183  if (inFormatDesc.GetPixelFormat() != NTV2_FBF_10BIT_ARGB)
184  return false; // wrong FBF
185 
186  out16BitARGBLine.reserve(inFormatDesc.linePitch * 4);
187  for (ULWord inputCount (0); inputCount < inFormatDesc.linePitch; inputCount++)
188  {
189  out16BitARGBLine.push_back ((UWord(pInputLine[1] & 0x03) << 8) | (UWord(pInputLine[0] & 0xFF) >> 0)); // B
190  out16BitARGBLine.push_back ((UWord(pInputLine[2] & 0x0F) << 6) | (UWord(pInputLine[1] & 0xFC) >> 2)); // G
191  out16BitARGBLine.push_back ((UWord(pInputLine[3] & 0x3F) << 4) | (UWord(pInputLine[2] & 0xF0) >> 4)); // R
192  out16BitARGBLine.push_back ((UWord(pInputLine[4] & 0xFF) << 2) | (UWord(pInputLine[3] & 0xC0) >> 6)); // A
193  pInputLine += 5;
194  }
195  return true;
196 }
197 
198 
199 // UnPack10BitYCbCrBuffer
200 // UnPack 10 Bit YCbCr Data to 16 bit Word per component
201 void UnPack10BitYCbCrBuffer (uint32_t* packedBuffer, uint16_t* ycbcrBuffer, uint32_t numPixels)
202 {
203  for ( uint32_t sampleCount = 0, dataCount = 0;
204  sampleCount < (numPixels*2) ;
205  sampleCount+=3,dataCount++ )
206  {
207  ycbcrBuffer[sampleCount] = packedBuffer[dataCount]&0x3FF;
208  ycbcrBuffer[sampleCount+1] = (packedBuffer[dataCount]>>10)&0x3FF;
209  ycbcrBuffer[sampleCount+2] = (packedBuffer[dataCount]>>20)&0x3FF;
210 
211  }
212 }
213 
214 // PackTo10BitYCbCrBuffer
215 // Pack 16 bit Word per component to 10 Bit YCbCr Data
216 void PackTo10BitYCbCrBuffer (const uint16_t * ycbcrBuffer, uint32_t * packedBuffer, const uint32_t numPixels)
217 {
218  for ( uint32_t inputCount=0, outputCount=0;
219  inputCount < (numPixels*2);
220  outputCount += 4, inputCount += 12 )
221  {
222  packedBuffer[outputCount] = uint32_t (ycbcrBuffer[inputCount+0]) + uint32_t (ycbcrBuffer[inputCount+1]<<10) + uint32_t (ycbcrBuffer[inputCount+2]<<20);
223  packedBuffer[outputCount+1] = uint32_t (ycbcrBuffer[inputCount+3]) + uint32_t (ycbcrBuffer[inputCount+4]<<10) + uint32_t (ycbcrBuffer[inputCount+5]<<20);
224  packedBuffer[outputCount+2] = uint32_t (ycbcrBuffer[inputCount+6]) + uint32_t (ycbcrBuffer[inputCount+7]<<10) + uint32_t (ycbcrBuffer[inputCount+8]<<20);
225  packedBuffer[outputCount+3] = uint32_t (ycbcrBuffer[inputCount+9]) + uint32_t (ycbcrBuffer[inputCount+10]<<10) + uint32_t (ycbcrBuffer[inputCount+11]<<20);
226  }
227 }
228 
229 void MakeUnPacked10BitYCbCrBuffer( uint16_t* buffer, uint16_t Y , uint16_t Cb , uint16_t Cr,uint32_t numPixels )
230 {
231  // assumes lineData is large enough for numPixels
232  for ( uint32_t count = 0; count < numPixels*2; count+=4 )
233  {
234  buffer[count] = Cb;
235  buffer[count+1] = Y;
236  buffer[count+2] = Cr;
237  buffer[count+3] = Y;
238  }
239 }
240 
241 
242 // ConvertLineTo8BitYCbCr
243 // 10 Bit YCbCr to 8 Bit YCbCr
244 void ConvertLineTo8BitYCbCr (const uint16_t * ycbcr10BitBuffer, uint8_t * ycbcr8BitBuffer, const uint32_t numPixels)
245 {
246  for (uint32_t pixel(0); pixel < numPixels * 2; pixel++)
247  ycbcr8BitBuffer[pixel] = uint8_t(ycbcr10BitBuffer[pixel] >> 2);
248 }
249 
250 //***********************************************************************************************************
251 
252 // ConvertUnpacked10BitYCbCrToPixelFormat()
253 // Converts a line of "unpacked" 10-bit Y/Cb/Cr pixels into a "packed" line in the pixel format
254 // for the current frame buffer format.
255 void ConvertUnpacked10BitYCbCrToPixelFormat(uint16_t *unPackedBuffer, uint32_t *packedBuffer, uint32_t numPixels, NTV2FrameBufferFormat pixelFormat,
256  bool bUseSmpteRange, bool bAlphaFromLuma)
257 {
258  bool bIsSD = false;
259  if(numPixels < 1280)
260  bIsSD = true;
261 
262  switch(pixelFormat)
263  {
265  PackTo10BitYCbCrBuffer(unPackedBuffer, packedBuffer, numPixels);
266  break;
267 
268  case NTV2_FBF_8BIT_YCBCR:
269  ConvertLineTo8BitYCbCr(unPackedBuffer, reinterpret_cast<uint8_t*>(packedBuffer), numPixels);
270  break;
271 
272  case NTV2_FBF_ARGB:
273  ConvertLinetoRGB(unPackedBuffer, reinterpret_cast<RGBAlphaPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange, bAlphaFromLuma);
274  break;
275 
276  case NTV2_FBF_RGBA:
277  ConvertLinetoRGB(unPackedBuffer, reinterpret_cast<RGBAlphaPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange, bAlphaFromLuma);
278  ConvertARGBYCbCrToRGBA(reinterpret_cast<UByte*>(packedBuffer), numPixels);
279  break;
280 
281  case NTV2_FBF_10BIT_RGB:
282  ConvertLineto10BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
283  PackRGB10BitFor10BitRGB(reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels);
284  break;
285 
287  ConvertLineTo8BitYCbCr(unPackedBuffer, reinterpret_cast<uint8_t*>(packedBuffer), numPixels);
288  Convert8BitYCbCrToYUY2(reinterpret_cast<uint8_t*>(packedBuffer), numPixels);
289  break;
290 
291  case NTV2_FBF_ABGR:
292  ConvertLinetoRGB(unPackedBuffer, reinterpret_cast<RGBAlphaPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange, bAlphaFromLuma);
293  ConvertARGBYCbCrToABGR(reinterpret_cast<uint8_t*>(packedBuffer), numPixels);
294  break;
295 
296  case NTV2_FBF_10BIT_DPX:
297  ConvertLineto10BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
298  PackRGB10BitFor10BitDPX(reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels);
299  break;
300 
303  break;
304 
305  case NTV2_FBF_24BIT_RGB:
306  ConvertLinetoRGB(unPackedBuffer,reinterpret_cast<RGBAlphaPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
307  ConvertARGBToRGB(reinterpret_cast<UByte*>(packedBuffer), reinterpret_cast<UByte*>(packedBuffer), numPixels);
308  break;
309 
310  case NTV2_FBF_24BIT_BGR:
311  ConvertLinetoRGB(unPackedBuffer,reinterpret_cast<RGBAlphaPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
312  ConvertARGBToBGR(reinterpret_cast<UByte*>(packedBuffer), reinterpret_cast<UByte*>(packedBuffer), numPixels);
313  break;
314 
316  ConvertLineto10BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
317  PackRGB10BitFor10BitDPX(reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels, false);
318  break;
319 
320  case NTV2_FBF_48BIT_RGB:
321  ConvertLineto16BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha16BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
322  Convert16BitARGBTo16BitRGB(reinterpret_cast<RGBAlpha16BitPixel*>(packedBuffer), reinterpret_cast<UWord*>(packedBuffer), numPixels);
323  break;
324 
326  ConvertLineto10BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
327  PackRGB10BitFor10BitRGBPacked(reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels);
328  break;
329 
330  case NTV2_FBF_10BIT_ARGB:
331  ConvertLineto10BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange, bAlphaFromLuma);
332  PackRGB10BitFor10BitARGBPacked(reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels);
333  break;
334 
336  ConvertLineto16BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha16BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
337  Convert16BitARGBTo12BitRGBPacked(reinterpret_cast<RGBAlpha16BitPixel*>(packedBuffer), reinterpret_cast<UByte*>(packedBuffer), numPixels);
338  break;
339 
340  #if defined(_DEBUG)
343  case NTV2_FBF_8BIT_HDV:
346  case NTV2_FBF_PRORES_HDV:
347  case NTV2_FBF_16BIT_ARGB:
357  case NTV2_FBF_LAST:
358  break;
359  #else
360  default: break;
361  #endif
362  }
363 }
364 
365 // MaskUnPacked10BitYCbCrBuffer
366 // Mask Data In place based on signalMask
367 void MaskUnPacked10BitYCbCrBuffer( uint16_t* ycbcrUnPackedBuffer, uint16_t signalMask , uint32_t numPixels )
368 {
369  uint32_t pixelCount;
370 
371  // Not elegant but fairly fast.
372  switch ( signalMask )
373  {
374  case NTV2_SIGNALMASK_NONE: // Output Black
375  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
376  {
377  ycbcrUnPackedBuffer[pixelCount] = CCIR601_10BIT_CHROMAOFFSET; // Cb
378  ycbcrUnPackedBuffer[pixelCount+1] = CCIR601_10BIT_BLACK; // Y
379  ycbcrUnPackedBuffer[pixelCount+2] = CCIR601_10BIT_CHROMAOFFSET; // Cr
380  ycbcrUnPackedBuffer[pixelCount+3] = CCIR601_10BIT_BLACK; // Y
381  }
382  break;
383  case NTV2_SIGNALMASK_Y:
384  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
385  {
386  ycbcrUnPackedBuffer[pixelCount] = CCIR601_10BIT_CHROMAOFFSET; // Cb
387  ycbcrUnPackedBuffer[pixelCount+2] = CCIR601_10BIT_CHROMAOFFSET; // Cr
388  }
389 
390  break;
391  case NTV2_SIGNALMASK_Cb:
392  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
393  {
394  ycbcrUnPackedBuffer[pixelCount+1] = CCIR601_10BIT_BLACK; // Y
395  ycbcrUnPackedBuffer[pixelCount+2] = CCIR601_10BIT_CHROMAOFFSET; // Cr
396  ycbcrUnPackedBuffer[pixelCount+3] = CCIR601_10BIT_BLACK; // Y
397  }
398 
399  break;
401  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
402  {
403  ycbcrUnPackedBuffer[pixelCount+2] = CCIR601_10BIT_CHROMAOFFSET; // Cr
404  }
405 
406  break;
407 
408  case NTV2_SIGNALMASK_Cr:
409  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
410  {
411  ycbcrUnPackedBuffer[pixelCount] = CCIR601_10BIT_CHROMAOFFSET; // Cb
412  ycbcrUnPackedBuffer[pixelCount+1] = CCIR601_10BIT_BLACK; // Y
413  ycbcrUnPackedBuffer[pixelCount+3] = CCIR601_10BIT_BLACK; // Y
414  }
415 
416 
417  break;
419  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
420  {
421  ycbcrUnPackedBuffer[pixelCount] = CCIR601_10BIT_CHROMAOFFSET; // Cb
422  }
423 
424 
425  break;
427  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
428  {
429  ycbcrUnPackedBuffer[pixelCount+1] = CCIR601_10BIT_BLACK; // Y
430  ycbcrUnPackedBuffer[pixelCount+3] = CCIR601_10BIT_BLACK; // Y
431  }
432 
433 
434  break;
436  // Do nothing
437  break;
438  }
439 
440 }
441 
442 
443 
444 //--------------------------------------------------------------------------------------------------------------------
445 // StackQuadrants()
446 //
447 // Take a 4K source, cut it into 4 quandrants and stack it into the destination. Also handle cases where
448 // where source/destination rowBytes/widths are mismatched (eg 4096 -> 3840)
449 //--------------------------------------------------------------------------------------------------------------------
450 void StackQuadrants(uint8_t* pSrc, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcRowBytes,
451  uint8_t* pDst)
452 {
453  (void) srcWidth;
454  uint32_t dstSample;
455  uint32_t srcSample;
456  uint32_t copyRowBytes = srcRowBytes/2;
457  uint32_t copyHeight = srcHeight/2;
458  uint32_t dstRowBytes = copyRowBytes;
459  uint32_t dstHeight = srcHeight/2;
460  //uint32_t dstWidth = srcWidth/2;
461 
462  // rowbytes for left hand side quadrant
463  uint32_t srcLHSQuadrantRowBytes = srcRowBytes/2;
464 
465  for (uint32_t quadrant=0; quadrant<4; quadrant++)
466  {
467  // starting point for source quadrant
468  switch (quadrant)
469  {
470  default:
471  case 0: srcSample = 0; break; // quadrant 0, upper left
472  case 1: srcSample = srcLHSQuadrantRowBytes; break; // quadrant 1, upper right
473  case 2: srcSample = (srcRowBytes*copyHeight); break; // quadrant 2, lower left
474  case 3: srcSample = (srcRowBytes*copyHeight) + srcLHSQuadrantRowBytes; break; // quadrant 3, lower right
475  }
476 
477  // starting point for destination stack
478  dstSample = quadrant * dstRowBytes * dstHeight;
479 
480  for (uint32_t row=0; row<copyHeight; row++)
481  {
482  memcpy(&pDst[dstSample], &pSrc[srcSample], copyRowBytes);
483  dstSample += dstRowBytes;
484  srcSample += srcRowBytes;
485  }
486  }
487 }
488 
489 // Copy a quater-sized quadrant from a source buffer to a destination buffer
490 // quad13Offset is almost always zero, but can be used for Quadrants 1, 3 for special offset frame buffers. (e.g. 4096x1080 10Bit YCbCr frame buffers)
491 void CopyFromQuadrant(uint8_t* srcBuffer, uint32_t srcHeight, uint32_t srcRowBytes, uint32_t srcQuadrant, uint8_t* dstBuffer, uint32_t quad13Offset)
492 {
493  ULWord dstSample = 0;
494  ULWord srcSample = 0;
495  ULWord dstHeight = srcHeight / 2;
496  ULWord dstRowBytes = srcRowBytes / 2;
497 
498  // calculate starting point for source of copy, based on source quadrant
499  switch (srcQuadrant)
500  {
501  default:
502  case 0: srcSample = 0; break; // quadrant 0, upper left
503  case 1: srcSample = dstRowBytes - quad13Offset; break; // quadrant 1, upper right
504  case 2: srcSample = srcRowBytes*dstHeight; break; // quadrant 2, lower left
505  case 3: srcSample = srcRowBytes*dstHeight + dstRowBytes - quad13Offset; break; // quadrant 3, lower right
506  }
507 
508  // for each row
509  for (ULWord i=0; i<dstHeight; i++)
510  {
511  memcpy(&dstBuffer[dstSample], &srcBuffer[srcSample], dstRowBytes);
512  dstSample += dstRowBytes;
513  srcSample += srcRowBytes;
514  }
515 }
516 
517 // Copy a source buffer to a quadrant of a 4x-sized destination buffer
518 // quad13Offset is almost always zero, but can be used for Quadrants 1, 3 for special offset frame buffers. (e.g. 4096x1080 10Bit YCbCr frame buffers)
519 void CopyToQuadrant(uint8_t* srcBuffer, uint32_t srcHeight, uint32_t srcRowBytes, uint32_t dstQuadrant, uint8_t* dstBuffer, uint32_t quad13Offset)
520 {
521  ULWord dstSample = 0;
522  ULWord srcSample = 0;
523  ULWord dstRowBytes = srcRowBytes * 2;
524 
525  // calculate starting point for destination of copy, based on destination quadrant
526  switch (dstQuadrant)
527  {
528  default:
529  case 0: dstSample = 0; break; // quadrant 0, upper left
530  case 1: dstSample = srcRowBytes - quad13Offset; break; // quadrant 1, upper right
531  case 2: dstSample = dstRowBytes*srcHeight; break; // quadrant 2, lower left
532  case 3: dstSample = dstRowBytes*srcHeight + srcRowBytes - quad13Offset; break; // quadrant 3, lower right
533  }
534 
535  // for each row
536  for (ULWord i=0; i<srcHeight; i++)
537  {
538  memcpy(&dstBuffer[dstSample], &srcBuffer[srcSample], srcRowBytes);
539  dstSample += dstRowBytes;
540  srcSample += srcRowBytes;
541  }
542 }
544 // END SECTION MOVED FROM 'videoutilities.cpp'
546 
547 
548 void UnpackLine_10BitYUVto16BitYUV (const ULWord * pIn10BitYUVLine, UWord * pOut16BitYUVLine, const ULWord inNumPixels)
549 {
550  NTV2_ASSERT (pIn10BitYUVLine && pOut16BitYUVLine && "UnpackLine_10BitYUVto16BitYUV -- NULL buffer pointer(s)");
551  NTV2_ASSERT (inNumPixels && "UnpackLine_10BitYUVto16BitYUV -- Zero pixel count");
552 
553  for (ULWord outputCount = 0, inputCount = 0;
554  outputCount < (inNumPixels * 2);
555  outputCount += 3, inputCount++)
556  {
557  pOut16BitYUVLine [outputCount ] = pIn10BitYUVLine [inputCount] & 0x3FF;
558  pOut16BitYUVLine [outputCount + 1] = (pIn10BitYUVLine [inputCount] >> 10) & 0x3FF;
559  pOut16BitYUVLine [outputCount + 2] = (pIn10BitYUVLine [inputCount] >> 20) & 0x3FF;
560  }
561 }
562 
563 
564 void PackLine_16BitYUVto10BitYUV (const UWord * pIn16BitYUVLine, ULWord * pOut10BitYUVLine, const ULWord inNumPixels)
565 {
566  NTV2_ASSERT (pIn16BitYUVLine && pOut10BitYUVLine && "PackLine_16BitYUVto10BitYUV -- NULL buffer pointer(s)");
567  NTV2_ASSERT (inNumPixels && "PackLine_16BitYUVto10BitYUV -- Zero pixel count");
568 
569  for (ULWord inputCount = 0, outputCount = 0;
570  inputCount < (inNumPixels * 2);
571  outputCount += 4, inputCount += 12)
572  {
573  pOut10BitYUVLine [outputCount ] = ULWord (pIn16BitYUVLine [inputCount + 0]) + (ULWord (pIn16BitYUVLine [inputCount + 1]) << 10) + (ULWord (pIn16BitYUVLine [inputCount + 2]) << 20);
574  pOut10BitYUVLine [outputCount + 1] = ULWord (pIn16BitYUVLine [inputCount + 3]) + (ULWord (pIn16BitYUVLine [inputCount + 4]) << 10) + (ULWord (pIn16BitYUVLine [inputCount + 5]) << 20);
575  pOut10BitYUVLine [outputCount + 2] = ULWord (pIn16BitYUVLine [inputCount + 6]) + (ULWord (pIn16BitYUVLine [inputCount + 7]) << 10) + (ULWord (pIn16BitYUVLine [inputCount + 8]) << 20);
576  pOut10BitYUVLine [outputCount + 3] = ULWord (pIn16BitYUVLine [inputCount + 9]) + (ULWord (pIn16BitYUVLine [inputCount +10]) << 10) + (ULWord (pIn16BitYUVLine [inputCount +11]) << 20);
577  } // for each component in the line
578 }
579 
580 
581 bool PackLine_UWordSequenceTo10BitYUV (const UWordSequence & in16BitYUVLine, ULWord * pOut10BitYUVLine, const ULWord inNumPixels)
582 {
583  if (!pOut10BitYUVLine)
584  return false; // NULL buffer pointer
585  if (!inNumPixels)
586  return false; // Zero pixel count
587  if (ULWord(in16BitYUVLine.size()) < inNumPixels*2)
588  return false; // UWordSequence too small
589 
590  for (ULWord inputCount = 0, outputCount = 0;
591  inputCount < (inNumPixels * 2);
592  outputCount += 4, inputCount += 12)
593  {
594  pOut10BitYUVLine[outputCount ] = ULWord(in16BitYUVLine[inputCount + 0]) + (ULWord(in16BitYUVLine[inputCount + 1]) << 10) + (ULWord(in16BitYUVLine[inputCount + 2]) << 20);
595  pOut10BitYUVLine[outputCount + 1] = ULWord(in16BitYUVLine[inputCount + 3]) + (ULWord(in16BitYUVLine[inputCount + 4]) << 10) + (ULWord(in16BitYUVLine[inputCount + 5]) << 20);
596  pOut10BitYUVLine[outputCount + 2] = ULWord(in16BitYUVLine[inputCount + 6]) + (ULWord(in16BitYUVLine[inputCount + 7]) << 10) + (ULWord(in16BitYUVLine[inputCount + 8]) << 20);
597  pOut10BitYUVLine[outputCount + 3] = ULWord(in16BitYUVLine[inputCount + 9]) + (ULWord(in16BitYUVLine[inputCount +10]) << 10) + (ULWord(in16BitYUVLine[inputCount +11]) << 20);
598  } // for each component in the line
599  return true;
600 }
601 
602 
603 bool YUVComponentsTo10BitYUVPackedBuffer (const vector<uint16_t> & inYCbCrLine, NTV2Buffer & inFrameBuffer,
604  const NTV2FormatDescriptor & inDescriptor, const UWord inLineOffset)
605 {
606  if (inYCbCrLine.size() < 12)
607  return false; // Input vector needs at least 12 components
608  if (inFrameBuffer.IsNULL())
609  return false; // NULL frame buffer
610  if (!inDescriptor.IsValid())
611  return false; // Bad format descriptor
612  if (ULWord(inLineOffset) >= inDescriptor.GetFullRasterHeight())
613  return false; // Illegal line offset
614  if (inDescriptor.GetPixelFormat() != NTV2_FBF_10BIT_YCBCR)
615  return false; // Not 'v210' pixel format
616 
617  const uint32_t pixPerLineX2 (inDescriptor.GetRasterWidth() * 2);
618  uint32_t * pOutPackedLine (AJA_NULL);
619  if (inFrameBuffer.GetByteCount() < inDescriptor.GetBytesPerRow() * ULWord(inLineOffset+1))
620  return false; // Buffer too small
621 
622  pOutPackedLine = reinterpret_cast<uint32_t*>(inDescriptor.GetWriteableRowAddress(inFrameBuffer.GetHostAddress(0), inLineOffset));
623  if (!pOutPackedLine)
624  return false; // Buffer too small
625 
626  for (uint32_t inputCount = 0, outputCount = 0; inputCount < pixPerLineX2; outputCount += 4, inputCount += 12)
627  {
628  if ((inputCount+11) >= uint32_t(inYCbCrLine.size()))
629  break; // Early exit (not fatal)
630  #if defined(_DEBUG) // 'at' throws upon bad index values
631  pOutPackedLine[outputCount] = uint32_t(inYCbCrLine.at(inputCount+0)) | uint32_t(inYCbCrLine.at(inputCount+ 1)<<10) | uint32_t(inYCbCrLine.at(inputCount+ 2)<<20);
632  pOutPackedLine[outputCount+1] = uint32_t(inYCbCrLine.at(inputCount+3)) | uint32_t(inYCbCrLine.at(inputCount+ 4)<<10) | uint32_t(inYCbCrLine.at(inputCount+ 5)<<20);
633  pOutPackedLine[outputCount+2] = uint32_t(inYCbCrLine.at(inputCount+6)) | uint32_t(inYCbCrLine.at(inputCount+ 7)<<10) | uint32_t(inYCbCrLine.at(inputCount+ 8)<<20);
634  pOutPackedLine[outputCount+3] = uint32_t(inYCbCrLine.at(inputCount+9)) | uint32_t(inYCbCrLine.at(inputCount+10)<<10) | uint32_t(inYCbCrLine.at(inputCount+11)<<20);
635  #else // 'operator[]' doesn't throw
636  pOutPackedLine[outputCount] = uint32_t(inYCbCrLine[inputCount+0]) | uint32_t(inYCbCrLine[inputCount+ 1]<<10) | uint32_t(inYCbCrLine[inputCount+ 2]<<20);
637  pOutPackedLine[outputCount+1] = uint32_t(inYCbCrLine[inputCount+3]) | uint32_t(inYCbCrLine[inputCount+ 4]<<10) | uint32_t(inYCbCrLine[inputCount+ 5]<<20);
638  pOutPackedLine[outputCount+2] = uint32_t(inYCbCrLine[inputCount+6]) | uint32_t(inYCbCrLine[inputCount+ 7]<<10) | uint32_t(inYCbCrLine[inputCount+ 8]<<20);
639  pOutPackedLine[outputCount+3] = uint32_t(inYCbCrLine[inputCount+9]) | uint32_t(inYCbCrLine[inputCount+10]<<10) | uint32_t(inYCbCrLine[inputCount+11]<<20);
640  #endif
641  }
642  return true;
643 }
644 
645 
646 bool UnpackLine_10BitYUVtoU16s (vector<uint16_t> & outYCbCrLine, const NTV2Buffer & inFrameBuffer,
647  const NTV2FormatDescriptor & inDescriptor, const UWord inLineOffset)
648 {
649  outYCbCrLine.clear();
650  if (inFrameBuffer.IsNULL())
651  return false; // NULL frame buffer
652  if (!inDescriptor.IsValid())
653  return false; // Bad format descriptor
654  if (ULWord(inLineOffset) >= inDescriptor.GetFullRasterHeight())
655  return false; // Illegal line offset
656  if (inDescriptor.GetPixelFormat() != NTV2_FBF_10BIT_YCBCR)
657  return false; // Not 'v210' pixel format
658  if (inDescriptor.GetRasterWidth () < 6)
659  return false; // bad width
660 
661  const ULWord * pInputLine (reinterpret_cast<const ULWord*>(inDescriptor.GetRowAddress(inFrameBuffer.GetHostPointer(), inLineOffset)));
662  outYCbCrLine.reserve (inDescriptor.linePitch * 3);
663  for (ULWord inputCount(0); inputCount < inDescriptor.linePitch; inputCount++)
664  {
665  outYCbCrLine.push_back((pInputLine[inputCount] ) & 0x3FF);
666  outYCbCrLine.push_back((pInputLine[inputCount] >> 10) & 0x3FF);
667  outYCbCrLine.push_back((pInputLine[inputCount] >> 20) & 0x3FF);
668  }
669  return true;
670 }
671 
672 
673 // RePackLineDataForYCbCrDPX
674 void RePackLineDataForYCbCrDPX(ULWord *packedycbcrLine, ULWord numULWords )
675 {
676  for ( UWord count = 0; count < numULWords; count++)
677  {
678  ULWord value = (packedycbcrLine[count])<<2;
679  value = (value<<24) + ((value>>24)&0x000000FF) + ((value<<8)&0x00FF0000) + ((value>>8)&0x0000FF00);
680 
681  packedycbcrLine[count] = value;
682  }
683 }
684 // UnPack 10 Bit DPX Format linebuffer to RGBAlpha10BitPixel linebuffer.
685 void UnPack10BitDPXtoRGBAlpha10BitPixel(RGBAlpha10BitPixel* rgba10BitBuffer, const ULWord* DPXLinebuffer ,ULWord numPixels, bool bigEndian)
686 {
687  for ( ULWord pixel=0;pixel<numPixels;pixel++)
688  {
689  ULWord value = DPXLinebuffer[pixel];
690  if ( bigEndian)
691  {
692  rgba10BitBuffer[pixel].Red = UWord((value&0xC0)>>14) + UWord((value&0xFF)<<2);
693  rgba10BitBuffer[pixel].Green = UWord((value&0x3F00)>>4) + UWord((value&0xF00000)>>20);
694  rgba10BitBuffer[pixel].Blue = UWord((value&0xFC000000)>>26) + UWord((value&0xF0000)>>12);
695  }
696  else
697  {
698  rgba10BitBuffer[pixel].Red = (value>>22)&0x3FF;
699  rgba10BitBuffer[pixel].Green = (value>>12)&0x3FF;
700  rgba10BitBuffer[pixel].Blue = (value>>2)&0x3FF;
701 
702  }
703  }
704 }
705 
706 void UnPack10BitDPXtoForRP215withEndianSwap(UWord* rawrp215Buffer,ULWord* DPXLinebuffer ,ULWord numPixels)
707 {
708  // gets the green component.
709  for ( ULWord pixel=0;pixel<numPixels;pixel++)
710  {
711  ULWord value = DPXLinebuffer[pixel];
712  rawrp215Buffer[pixel] = ((value&0x3F00)>>4) + ((value&0xF00000)>>20);
713  }
714 }
715 
716 void UnPack10BitDPXtoForRP215(UWord* rawrp215Buffer,ULWord* DPXLinebuffer ,ULWord numPixels)
717 {
718  // gets the green component.
719  for ( ULWord pixel=0;pixel<numPixels;pixel++)
720  {
721  ULWord value = DPXLinebuffer[pixel];
722  rawrp215Buffer[pixel] = ((value&0x3F)>>4) + ((value&0xF00000)>>20);
723  }
724 }
725 
726 // MaskYCbCrLine
727 // Mask Data In place based on signalMask
728 void MaskYCbCrLine(UWord* ycbcrLine, UWord signalMask , ULWord numPixels)
729 {
730  ULWord pixelCount;
731 
732  // Not elegant but fairly fast.
733  switch ( signalMask )
734  {
735  case NTV2_SIGNALMASK_NONE: // Output Black
736  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
737  {
738  ycbcrLine[pixelCount] = CCIR601_10BIT_CHROMAOFFSET; // Cb
739  ycbcrLine[pixelCount+1] = CCIR601_10BIT_BLACK; // Y
740  ycbcrLine[pixelCount+2] = CCIR601_10BIT_CHROMAOFFSET; // Cr
741  ycbcrLine[pixelCount+3] = CCIR601_10BIT_BLACK; // Y
742  }
743  break;
744  case NTV2_SIGNALMASK_Y:
745  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
746  {
747  ycbcrLine[pixelCount] = CCIR601_10BIT_CHROMAOFFSET; // Cb
748  ycbcrLine[pixelCount+2] = CCIR601_10BIT_CHROMAOFFSET; // Cr
749  }
750 
751  break;
752  case NTV2_SIGNALMASK_Cb:
753  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
754  {
755  ycbcrLine[pixelCount+1] = CCIR601_10BIT_BLACK; // Y
756  ycbcrLine[pixelCount+2] = CCIR601_10BIT_CHROMAOFFSET; // Cr
757  ycbcrLine[pixelCount+3] = CCIR601_10BIT_BLACK; // Y
758  }
759 
760  break;
762  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
763  {
764  ycbcrLine[pixelCount+2] = CCIR601_10BIT_CHROMAOFFSET; // Cr
765  }
766 
767  break;
768 
769  case NTV2_SIGNALMASK_Cr:
770  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
771  {
772  ycbcrLine[pixelCount] = CCIR601_10BIT_CHROMAOFFSET; // Cb
773  ycbcrLine[pixelCount+1] = CCIR601_10BIT_BLACK; // Y
774  ycbcrLine[pixelCount+3] = CCIR601_10BIT_BLACK; // Y
775  }
776 
777 
778  break;
780  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
781  {
782  ycbcrLine[pixelCount] = CCIR601_10BIT_CHROMAOFFSET; // Cb
783  }
784 
785 
786  break;
788  for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
789  {
790  ycbcrLine[pixelCount+1] = CCIR601_10BIT_BLACK; // Y
791  ycbcrLine[pixelCount+3] = CCIR601_10BIT_BLACK; // Y
792  }
793 
794 
795  break;
797  // Do nothing
798  break;
799  }
800 
801 }
802 
803 void Make10BitBlackLine (UWord * pOutLineData, const ULWord inNumPixels)
804 {
805  // Write *UNPACKED* 10-bit YCbCr values into pOutLineData, assuming it can hold at least inNumPixels * 4 bytes
806  // NOTE: When I return, 'pOutLineData' will NOT contain NTV2_FBF_10BIT_YCBCR!
807  // (Use ::PackLine_16BitYUVto10BitYUV to convert to NTV2_FBF_10BIT_YCBCR.)
808  if (pOutLineData && inNumPixels)
809  for (ULWord count(0); count < inNumPixels; count++)
810  {
811  *pOutLineData++ = UWord(CCIR601_10BIT_CHROMAOFFSET); // 512 0x200
812  *pOutLineData++ = UWord(CCIR601_10BIT_BLACK); // 64 0x40
813  }
814 }
815 
816 void Make10BitWhiteLine (UWord* pOutLineData, const ULWord inNumPixels)
817 {
818  // Write *UNPACKED* 10-bit YCbCr values into pOutLineData, assuming it can hold at least inNumPixels * 4 bytes
819  // NOTE: When I return, 'pOutLineData' will NOT contain NTV2_FBF_10BIT_YCBCR!
820  // (Use ::PackLine_16BitYUVto10BitYUV to convert to NTV2_FBF_10BIT_YCBCR.)
821  if (pOutLineData && inNumPixels)
822  for (ULWord count(0); count < inNumPixels; count++)
823  {
824  *pOutLineData++ = UWord(CCIR601_10BIT_CHROMAOFFSET); // 512 0x200
825  *pOutLineData++ = UWord(CCIR601_10BIT_WHITE); // 940 0x3AC
826  }
827 }
828 
829 void Make10BitLine (UWord* pOutLineData, const UWord Y, const UWord Cb, const UWord Cr, const ULWord inNumPixels)
830 {
831  // assumes lineData is large enough for numPixels
832  if (pOutLineData && inNumPixels)
833  for (ULWord count(0); count < inNumPixels*2; count+=4)
834  {
835  pOutLineData[count] = Cb;
836  pOutLineData[count+1] = Y;
837  pOutLineData[count+2] = Cr;
838  pOutLineData[count+3] = Y;
839  }
840 }
841 
842 bool Fill10BitYCbCrVideoFrame (void * pBaseVideoAddress,
843  const NTV2Standard inStandard,
844  const NTV2FrameBufferFormat inFBF,
845  const YCbCr10BitPixel inPixelColor,
846  const NTV2VANCMode inVancMode)
847 {
848  if (!pBaseVideoAddress)
849  return false;
850 
851  const NTV2FormatDescriptor fd (inStandard, inFBF, inVancMode);
852  UWord lineBuffer[2048*2];
853  ULWord * pBaseAddress (reinterpret_cast<ULWord*>(pBaseVideoAddress));
854  Make10BitLine (lineBuffer, inPixelColor.y, inPixelColor.cb, inPixelColor.cr, UWord(fd.GetRasterWidth()));
855 
856  for (UWord lineNdx(0); lineNdx < fd.numLines; lineNdx++)
857  {
858  ::PackLine_16BitYUVto10BitYUV (lineBuffer, pBaseAddress, fd.GetRasterWidth());
859  pBaseAddress += fd.linePitch;
860  }
861  return true;
862 }
863 
864 
865 void Make8BitBlackLine (UByte * lineData, ULWord numPixels, NTV2FrameBufferFormat fbFormat)
866 {
867  // assumes lineData is large enough for numPixels
868  if ( fbFormat == NTV2_FBF_8BIT_YCBCR )
869  {
870  for ( uint32_t count = 0; count < numPixels*2; count+=2 )
871  {
872  lineData[count] = UWord(CCIR601_8BIT_CHROMAOFFSET);
873  lineData[count+1] = UWord(CCIR601_8BIT_BLACK);
874  }
875  }
876  else
877  {
878  // NTV2_FBF_8BIT_YCBCR_YUY2
879  for ( uint32_t count = 0; count < numPixels*2; count+=2 )
880  {
881  lineData[count] = UWord(CCIR601_8BIT_BLACK);
882  lineData[count+1] = UWord(CCIR601_8BIT_CHROMAOFFSET);
883  }
884  }
885 }
886 
887 void Make8BitWhiteLine (UByte * lineData, ULWord numPixels, NTV2FrameBufferFormat fbFormat)
888 {
889  // assumes lineData is large enough for numPixels
890  // assumes lineData is large enough for numPixels
891  if ( fbFormat == NTV2_FBF_8BIT_YCBCR )
892  {
893  for ( uint32_t count = 0; count < numPixels*2; count+=2 )
894  {
895  lineData[count] = UWord(CCIR601_8BIT_CHROMAOFFSET);
896  lineData[count+1] = UWord(CCIR601_8BIT_WHITE);
897  }
898  }
899  else
900  {
901  // NTV2_FBF_8BIT_YCBCR_YUY2
902  for ( uint32_t count = 0; count < numPixels*2; count+=2 )
903  {
904  lineData[count] = UWord(CCIR601_8BIT_WHITE);
905  lineData[count+1] = UWord(CCIR601_8BIT_CHROMAOFFSET);
906  }
907  }
908 
909 }
910 
911 void Make8BitLine (UByte * lineData, UByte Y, UByte Cb, UByte Cr, ULWord numPixels, NTV2FrameBufferFormat fbFormat)
912 {
913  // assumes lineData is large enough for numPixels
914  if (fbFormat == NTV2_FBF_8BIT_YCBCR)
915  {
916  for (ULWord count = 0; count < numPixels*2; count += 4)
917  {
918  lineData[count] = Cb;
919  lineData[count+1] = Y;
920  lineData[count+2] = Cr;
921  lineData[count+3] = Y;
922  }
923  }
924  else
925  {
926  for (ULWord count = 0; count < numPixels*2; count += 4)
927  {
928  lineData[count] = Y;
929  lineData[count+1] = Cb;
930  lineData[count+2] = Y;
931  lineData[count+3] = Cr;
932  }
933 
934  }
935 }
936 
937 bool Fill8BitYCbCrVideoFrame (void * pBaseVideoAddress, const NTV2Standard inStandard, const NTV2FrameBufferFormat inFBF,
938  const YCbCrPixel inPixelColor, const NTV2VANCMode inVancMode)
939 {
940  if (!pBaseVideoAddress)
941  return false;
942 
943  const NTV2FormatDescriptor fd (inStandard, inFBF, inVancMode);
944  UByte * pBaseAddress (reinterpret_cast<UByte*>(pBaseVideoAddress));
945 
946  for (UWord lineNdx(0); lineNdx < fd.numLines; lineNdx++)
947  {
948  Make8BitLine (pBaseAddress, inPixelColor.y, inPixelColor.cb, inPixelColor.cr, fd.numPixels, inFBF);
949  pBaseAddress += fd.GetBytesPerRow();
950  }
951  return true;
952 }
953 
954 void Fill4k8BitYCbCrVideoFrame(PULWord _baseVideoAddress,
955  NTV2FrameBufferFormat frameBufferFormat,
956  YCbCrPixel color,
957  bool vancEnabled,
958  bool b4k,
959  bool wideVANC)
960 {
961  (void) vancEnabled;
962  (void) wideVANC;
964  if(b4k)
965  {
966  fd.numLines = 2160;
967  fd.numPixels = 4096;
968  fd.firstActiveLine = 0;
969  fd.linePitch = 4096*2/4;
970  }
971  else
972  {
973  fd.numLines = 2160;
974  fd.numPixels = 3840;
975  fd.firstActiveLine = 0;
976  fd.linePitch = 3840*2/4;
977  }
978 
979  Make8BitLine(reinterpret_cast<UByte*>(_baseVideoAddress), color.y, color.cb, color.cr, fd.numPixels*fd.numLines, frameBufferFormat);
980 }
981 
982 
983 // Copy arbrary-sized source image buffer to arbitrary-sized destination frame buffer.
984 // It will automatically clip and/or pad the source image to center it in the destination frame.
985 // This will work with any RGBA/RGB frame buffer formats with 4 Bytes/pixel size
986 void CopyRGBAImageToFrame(ULWord* pSrcBuffer, ULWord srcWidth, ULWord srcHeight,
987  ULWord* pDstBuffer, ULWord dstWidth, ULWord dstHeight)
988 {
989  // all variables are in pixels
990  ULWord topPad = 0, bottomPad = 0, leftPad = 0, rightPad = 0;
991  ULWord contentHeight = 0;
992  ULWord contentWidth = 0;
993  ULWord* pSrc = pSrcBuffer;
994  ULWord* pDst = pDstBuffer;
995 
996  if (dstHeight > srcHeight)
997  {
998  topPad = (dstHeight - srcHeight) / 2;
999  bottomPad = dstHeight - topPad - srcHeight;
1000  }
1001  else
1002  pSrc += ((srcHeight - dstHeight) / 2) * srcWidth;
1003 
1004  if (dstWidth > srcWidth)
1005  {
1006  leftPad = (dstWidth - srcWidth) / 2;
1007  rightPad = dstWidth - srcWidth - leftPad;
1008  }
1009  else
1010  pSrc += (srcWidth - dstWidth) / 2;
1011 
1012  // content
1013  contentHeight = dstHeight - topPad - bottomPad;
1014  contentWidth = dstWidth - leftPad - rightPad;
1015 
1016  // top pad
1017  memset(pDst, 0, topPad * dstWidth * 4);
1018  pDst += topPad * dstWidth;
1019 
1020  // content
1021  while (contentHeight--)
1022  {
1023  // left
1024  memset(pDst, 0, leftPad * 4);
1025  pDst += leftPad;
1026 
1027  // content
1028  memcpy(pDst, pSrc, contentWidth * 4);
1029  pDst += contentWidth;
1030  pSrc += srcWidth;
1031 
1032  // right
1033  memset(pDst, 0, rightPad * 4);
1034  pDst += rightPad;
1035  }
1036 
1037  // bottom pad
1038  memset(pDst, 0, bottomPad * dstWidth * 4);
1039 }
1040 
1041 
1042 static bool SetRasterLinesBlack8BitYCbCr (UByte * pDstBuffer,
1043  const ULWord inDstBytesPerLine,
1044  const UWord inDstTotalLines)
1045 {
1046  const ULWord dstMaxPixelWidth (inDstBytesPerLine / 2); // 2 bytes per pixel for '2vuy'
1047  UByte * pLine (pDstBuffer);
1048  NTV2_ASSERT(dstMaxPixelWidth < 64UL*1024UL); // Because Make8BitBlackLine takes uint16_t pixelWidth
1049  for (UWord lineNum(0); lineNum < inDstTotalLines; lineNum++)
1050  {
1051  ::Make8BitBlackLine (pLine, UWord(dstMaxPixelWidth));
1052  pLine += inDstBytesPerLine;
1053  }
1054  return true;
1055 }
1056 
1057 
1058 static bool SetRasterLinesBlack10BitYCbCr (UByte * pDstBuffer,
1059  const ULWord inDstBytesPerLine,
1060  const UWord inDstTotalLines)
1061 {
1062  // In SDKs before 17.0, this function wrote past the end of the last line in
1063  // the destination raster buffer, because Make10BitBlackLine (which used to
1064  // be called once per line) always wrote 1.5 times inDstBytesPerLine.
1065  NTV2Buffer tmp(inDstBytesPerLine * 2); // Temporarily holds unpacked Y/C values
1066  NTV2Buffer dstBuffer (pDstBuffer, ULWord(inDstTotalLines) * inDstBytesPerLine);
1067  const ULWord dstMaxPixelWidth (inDstBytesPerLine / 16 * 6);
1068  ::Make10BitBlackLine (tmp, dstMaxPixelWidth); // Write unpacked SMPTE black Y/C values
1069  ::PackLine_16BitYUVto10BitYUV (tmp, dstBuffer, dstMaxPixelWidth); // Pack to '2vuy' into dstBuffer line 0
1070  for (UWord lineNum(1); lineNum < inDstTotalLines; lineNum++) // Make copies of line 0...
1071  if (!dstBuffer.CopyFrom (dstBuffer, // srcBuffer is line 0 of dstBuffer
1072  0, // srcByteOffset
1073  ULWord(lineNum) * inDstBytesPerLine, // dstByteOffset
1074  inDstBytesPerLine)) // numBytesToCopy
1075  return false; // failed!
1076  return true;
1077 }
1078 
1079 
1080 static bool SetRasterLinesWhite8BitYCbCr (UByte * pDstBuffer,
1081  const ULWord inDstBytesPerLine,
1082  const UWord inDstTotalLines)
1083 {
1084  const ULWord dstMaxPixelWidth (inDstBytesPerLine / 2); // 2 bytes per pixel for '2vuy'
1085  UByte * pLine (pDstBuffer);
1086  NTV2_ASSERT(dstMaxPixelWidth < 64UL*1024UL); // Because Make8BitWhiteLine takes uint16_t pixelWidth
1087  for (UWord lineNum(0); lineNum < inDstTotalLines; lineNum++)
1088  {
1089  ::Make8BitWhiteLine (pLine, UWord(dstMaxPixelWidth));
1090  pLine += inDstBytesPerLine;
1091  }
1092  return true;
1093 }
1094 
1095 
1096 static bool SetRasterLinesWhite10BitYCbCr (UByte * pDstBuffer,
1097  const ULWord inDstBytesPerLine,
1098  const UWord inDstTotalLines)
1099 {
1100  // In SDKs before 17.0, this function wrote past the end of the last line in
1101  // the destination raster buffer, because Make10BitWhiteLine (which used to
1102  // be called once per line) always wrote 1.5 times inDstBytesPerLine.
1103  NTV2Buffer tmp(inDstBytesPerLine * 2); // Temporarily holds unpacked Y/C values
1104  NTV2Buffer dstBuffer (pDstBuffer, ULWord(inDstTotalLines) * inDstBytesPerLine);
1105  const ULWord dstMaxPixelWidth (inDstBytesPerLine / 16 * 6);
1106  ::Make10BitWhiteLine (tmp, dstMaxPixelWidth); // Write unpacked SMPTE white Y/C values
1107  ::PackLine_16BitYUVto10BitYUV (tmp, dstBuffer, dstMaxPixelWidth); // Pack to '2vuy' into dstBuffer line 0
1108  for (UWord lineNum(1); lineNum < inDstTotalLines; lineNum++) // Make copies of line 0...
1109  if (!dstBuffer.CopyFrom (dstBuffer, // srcBuffer is line 0 of dstBuffer
1110  0, // srcByteOffset
1111  ULWord(lineNum) * inDstBytesPerLine, // dstByteOffset
1112  inDstBytesPerLine)) // numBytesToCopy
1113  return false; // failed!
1114  return true;
1115 }
1116 
1117 
1118 bool SetRasterLinesBlack (const NTV2PixelFormat inPixelFormat,
1119  UByte * pDstBuffer,
1120  const ULWord inDstBytesPerLine,
1121  const UWord inDstTotalLines)
1122 {
1123  if (!pDstBuffer) // NULL buffer
1124  return false;
1125  if (inDstBytesPerLine == 0) // zero rowbytes
1126  return false;
1127  if (inDstTotalLines == 0) // zero height
1128  return false;
1129 
1130  switch (inPixelFormat)
1131  {
1132  case NTV2_FBF_10BIT_YCBCR: return SetRasterLinesBlack10BitYCbCr (pDstBuffer, inDstBytesPerLine, inDstTotalLines);
1133 
1134  case NTV2_FBF_8BIT_YCBCR: return SetRasterLinesBlack8BitYCbCr (pDstBuffer, inDstBytesPerLine, inDstTotalLines);
1135 
1136  case NTV2_FBF_ARGB:
1137  case NTV2_FBF_RGBA:
1138  case NTV2_FBF_ABGR:
1139  case NTV2_FBF_24BIT_RGB:
1140  case NTV2_FBF_24BIT_BGR:
1141  case NTV2_FBF_48BIT_RGB:
1142  case NTV2_FBF_10BIT_RGB:
1143  case NTV2_FBF_10BIT_ARGB:
1144  case NTV2_FBF_16BIT_ARGB:
1145  { NTV2Buffer dst(pDstBuffer, inDstBytesPerLine * ULWord(inDstTotalLines));
1146  return dst.Fill(ULWord(0)); // Zero all R/G/B/A components
1147  }
1148 
1150  case NTV2_FBF_10BIT_DPX:
1152  case NTV2_FBF_8BIT_DVCPRO:
1154  case NTV2_FBF_8BIT_HDV:
1155  case NTV2_FBF_10BIT_YCBCRA:
1156  case NTV2_FBF_10BIT_DPX_LE:
1159  case NTV2_FBF_PRORES_HDV:
1171  return false;
1172  }
1173  return false;
1174 
1175 } // SetRasterLinesBlack
1176 
1177 
1178 bool SetRasterLinesWhite (const NTV2PixelFormat inPixelFormat,
1179  UByte * pDstBuffer,
1180  const ULWord inDstBytesPerLine,
1181  const UWord inDstTotalLines)
1182 {
1183  if (!pDstBuffer) // NULL buffer
1184  return false;
1185  if (inDstBytesPerLine == 0) // zero rowbytes
1186  return false;
1187  if (inDstTotalLines == 0) // zero height
1188  return false;
1189 
1190  switch (inPixelFormat)
1191  {
1192  case NTV2_FBF_10BIT_YCBCR: return SetRasterLinesWhite10BitYCbCr (pDstBuffer, inDstBytesPerLine, inDstTotalLines);
1193 
1194  case NTV2_FBF_8BIT_YCBCR: return SetRasterLinesWhite8BitYCbCr (pDstBuffer, inDstBytesPerLine, inDstTotalLines);
1195 
1196  case NTV2_FBF_ARGB:
1197  case NTV2_FBF_RGBA:
1198  case NTV2_FBF_ABGR:
1199  case NTV2_FBF_24BIT_RGB:
1200  case NTV2_FBF_24BIT_BGR:
1201  case NTV2_FBF_48BIT_RGB:
1202  case NTV2_FBF_10BIT_RGB:
1203  case NTV2_FBF_10BIT_ARGB:
1204  case NTV2_FBF_16BIT_ARGB:
1205  { NTV2Buffer dst(pDstBuffer, inDstBytesPerLine * ULWord(inDstTotalLines));
1206  return dst.Fill(ULWord(0xFFFFFFFF)); // Set all R/G/B/A components to 0xFFs
1207  }
1208 
1210  case NTV2_FBF_10BIT_DPX:
1212  case NTV2_FBF_8BIT_DVCPRO:
1214  case NTV2_FBF_8BIT_HDV:
1215  case NTV2_FBF_10BIT_YCBCRA:
1216  case NTV2_FBF_10BIT_DPX_LE:
1219  case NTV2_FBF_PRORES_HDV:
1231  return false;
1232  }
1233  return false;
1234 
1235 } // SetRasterLinesWhite
1236 
1237 
1238 static const UByte * GetReadAddress_2vuy (const UByte * pInFrameBuffer, const ULWord inBytesPerVertLine, const UWord inVertLineOffset, const UWord inHorzPixelOffset, const UWord inBytesPerHorzPixel)
1239 {
1240  const UByte * pResult (pInFrameBuffer);
1241  NTV2_ASSERT (inBytesPerVertLine);
1242  NTV2_ASSERT ((inHorzPixelOffset & 1) == 0); // For '2vuy', horizontal pixel offset must be even!!
1243  pResult += inBytesPerVertLine * ULWord(inVertLineOffset);
1244  pResult += ULWord(inBytesPerHorzPixel) * ULWord(inHorzPixelOffset);
1245  return pResult;
1246 }
1247 
1248 
1249 static UByte * GetWriteAddress_2vuy (UByte * pInFrameBuffer, const ULWord inBytesPerVertLine, const UWord inVertLineOffset, const UWord inHorzPixelOffset, const UWord inBytesPerHorzPixel)
1250 {
1251  UByte * pResult (pInFrameBuffer);
1252  NTV2_ASSERT (inBytesPerVertLine);
1253  NTV2_ASSERT ((inHorzPixelOffset & 1) == 0); // For '2vuy', horizontal pixel offset must be even!!
1254  pResult += inBytesPerVertLine * ULWord(inVertLineOffset);
1255  pResult += ULWord(inBytesPerHorzPixel) * ULWord(inHorzPixelOffset);
1256  return pResult;
1257 }
1258 
1259 
1260 // This function should work on all 4-byte-per-2-pixel formats
1261 static bool CopyRaster4BytesPer2Pixels (UByte * pDstBuffer, // Dest buffer to be modified
1262  const ULWord inDstBytesPerLine, // Dest buffer bytes per raster line (determines max width)
1263  const UWord inDstTotalLines, // Dest buffer total raster lines (max height)
1264  const UWord inDstVertLineOffset, // Vertical line offset into the dest raster where the top edge of the src image will appear
1265  const UWord inDstHorzPixelOffset, // Horizontal pixel offset into the dest raster where the left edge of the src image will appear
1266  const UByte * pSrcBuffer, // Src buffer
1267  const ULWord inSrcBytesPerLine, // Src buffer bytes per raster line (determines max width)
1268  const UWord inSrcTotalLines, // Src buffer total raster lines (max height)
1269  const UWord inSrcVertLineOffset, // Src image top edge
1270  const UWord inSrcVertLinesToCopy, // Src image height
1271  const UWord inSrcHorzPixelOffset, // Src image left edge
1272  const UWord inSrcHorzPixelsToCopy) // Src image width
1273 {
1274  if (inDstHorzPixelOffset & 1) // dst odd pixel offset
1275  return false;
1276  if (inSrcHorzPixelOffset & 1) // src odd pixel offset
1277  return false;
1278 
1279  const ULWord TWO_BYTES_PER_PIXEL (2); // 2 bytes per pixel for '2vuy'
1280  const ULWord dstMaxPixelWidth (inDstBytesPerLine / TWO_BYTES_PER_PIXEL);
1281  const ULWord srcMaxPixelWidth (inSrcBytesPerLine / TWO_BYTES_PER_PIXEL);
1282  UWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1283  UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1284 
1285  if (inDstHorzPixelOffset >= dstMaxPixelWidth) // dst past right edge
1286  return false;
1287  if (inSrcHorzPixelOffset >= srcMaxPixelWidth) // src past right edge
1288  return false;
1289  if (ULWord(inSrcHorzPixelOffset + inSrcHorzPixelsToCopy) > srcMaxPixelWidth)
1290  numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth; // Clip to src raster's right edge
1291  if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1292  numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines; // Clip to src raster's bottom edge
1293  if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1294  {
1295  if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1296  numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1297  else
1298  return true;
1299  }
1300 
1301  const UByte * pSrc (::GetReadAddress_2vuy (pSrcBuffer, inSrcBytesPerLine, inSrcVertLineOffset, inSrcHorzPixelOffset, TWO_BYTES_PER_PIXEL));
1302  UByte * pDst (::GetWriteAddress_2vuy (pDstBuffer, inDstBytesPerLine, inDstVertLineOffset, inDstHorzPixelOffset, TWO_BYTES_PER_PIXEL));
1303 
1304  for (UWord srcLinesToCopy (numVertLinesToCopy); srcLinesToCopy > 0; srcLinesToCopy--) // for each src raster line
1305  {
1306  UWord dstPixelsCopied (0);
1307  const UByte * pSavedSrc (pSrc);
1308  UByte * pSavedDst (pDst);
1309  for (UWord hPixelsToCopy (numHorzPixelsToCopy); hPixelsToCopy > 0; hPixelsToCopy--) // for each pixel/column
1310  {
1311  pDst[0] = pSrc[0];
1312  pDst[1] = pSrc[1];
1313  dstPixelsCopied++;
1314  if (dstPixelsCopied + inDstHorzPixelOffset >= UWord(dstMaxPixelWidth))
1315  break; // Clip to dst raster's right edge
1316  pDst += TWO_BYTES_PER_PIXEL;
1317  pSrc += TWO_BYTES_PER_PIXEL;
1318  }
1319  pSrc = pSavedSrc;
1320  pDst = pSavedDst;
1321  pSrc += inSrcBytesPerLine;
1322  pDst += inDstBytesPerLine;
1323  } // for each src line to copy
1324  return true;
1325 
1326 } // CopyRaster4BytesPer2Pixels
1327 
1328 
1329 // This function should work on all 16-byte-per-6-pixel formats
1330 static bool CopyRaster16BytesPer6Pixels ( UByte * pDstBuffer, // Dest buffer to be modified
1331  const ULWord inDstBytesPerLine, // Dest buffer bytes per raster line (determines max width) -- must be evenly divisible by 16
1332  const UWord inDstTotalLines, // Dest buffer total raster lines (max height)
1333  const UWord inDstVertLineOffset, // Vertical line offset into the dest raster where the top edge of the src image will appear
1334  const UWord inDstHorzPixelOffset, // Horizontal pixel offset into the dest raster where the left edge of the src image will appear -- must be evenly divisible by 6
1335  const UByte * pSrcBuffer, // Src buffer
1336  const ULWord inSrcBytesPerLine, // Src buffer bytes per raster line (determines max width) -- must be evenly divisible by 16
1337  const UWord inSrcTotalLines, // Src buffer total raster lines (max height)
1338  const UWord inSrcVertLineOffset, // Src image top edge
1339  const UWord inSrcVertLinesToCopy, // Src image height
1340  const UWord inSrcHorzPixelOffset, // Src image left edge -- must be evenly divisible by 6
1341  const UWord inSrcHorzPixelsToCopy) // Src image width -- must be evenly divisible by 6
1342 {
1343  if (inDstHorzPixelOffset % 6) // dst pixel offset must be on 6-pixel boundary
1344  return false;
1345  if (inSrcHorzPixelOffset % 6) // src pixel offset must be on 6-pixel boundary
1346  return false;
1347  if (inDstBytesPerLine % 16) // dst raster width must be evenly divisible by 16 (width must be multiple of 6)
1348  return false;
1349  if (inSrcBytesPerLine % 16) // src raster width must be evenly divisible by 16 (width must be multiple of 6)
1350  return false;
1351  if (inSrcHorzPixelsToCopy % 6) // pixel width of src image portion to copy must be on 6-pixel boundary
1352  return false;
1353 
1354  const ULWord dstMaxPixelWidth (inDstBytesPerLine / 16 * 6);
1355  const ULWord srcMaxPixelWidth (inSrcBytesPerLine / 16 * 6);
1356  ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1357  UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1358 
1359  if (inDstHorzPixelOffset >= dstMaxPixelWidth) // dst past right edge
1360  return false;
1361  if (inSrcHorzPixelOffset >= srcMaxPixelWidth) // src past right edge
1362  return false;
1363  if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy > UWord(srcMaxPixelWidth))
1364  numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth; // Clip to src raster's right edge
1365  if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1366  numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1367  NTV2_ASSERT (numHorzPixelsToCopy % 6 == 0);
1368  if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1369  numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines; // Clip to src raster's bottom edge
1370  if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1371  {
1372  if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1373  numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1374  else
1375  return true;
1376  }
1377 
1378  for (UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++) // for each raster line to copy
1379  {
1380  const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * 16 / 6);
1381  UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * 16 / 6);
1382  ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * 16 / 6); // copy the line
1383  }
1384 
1385  return true;
1386 
1387 } // CopyRaster16BytesPer6Pixels
1388 
1389 
1390 // This function should work on all 20-byte-per-16-pixel formats
1391 static bool CopyRaster20BytesPer16Pixels ( UByte * pDstBuffer, // Dest buffer to be modified
1392  const ULWord inDstBytesPerLine, // Dest buffer bytes per raster line (determines max width) -- must be evenly divisible by 20
1393  const UWord inDstTotalLines, // Dest buffer total raster lines (max height)
1394  const UWord inDstVertLineOffset, // Vertical line offset into the dest raster where the top edge of the src image will appear
1395  const UWord inDstHorzPixelOffset, // Horizontal pixel offset into the dest raster where the left edge of the src image will appear
1396  const UByte * pSrcBuffer, // Src buffer
1397  const ULWord inSrcBytesPerLine, // Src buffer bytes per raster line (determines max width) -- must be evenly divisible by 20
1398  const UWord inSrcTotalLines, // Src buffer total raster lines (max height)
1399  const UWord inSrcVertLineOffset, // Src image top edge
1400  const UWord inSrcVertLinesToCopy, // Src image height
1401  const UWord inSrcHorzPixelOffset, // Src image left edge
1402  const UWord inSrcHorzPixelsToCopy) // Src image width
1403 {
1404  if (inDstHorzPixelOffset % 16) // dst pixel offset must be on 16-pixel boundary
1405  return false;
1406  if (inSrcHorzPixelOffset % 16) // src pixel offset must be on 16-pixel boundary
1407  return false;
1408  if (inDstBytesPerLine % 20) // dst raster width must be evenly divisible by 20
1409  return false;
1410  if (inSrcBytesPerLine % 20) // src raster width must be evenly divisible by 20
1411  return false;
1412  if (inSrcHorzPixelsToCopy % 16) // pixel width of src image portion to copy must be on 16-pixel boundary
1413  return false;
1414 
1415  const ULWord dstMaxPixelWidth (inDstBytesPerLine / 20 * 16);
1416  const ULWord srcMaxPixelWidth (inSrcBytesPerLine / 20 * 16);
1417  ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1418  UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1419 
1420  if (inDstHorzPixelOffset >= dstMaxPixelWidth) // dst past right edge
1421  return false;
1422  if (inSrcHorzPixelOffset >= srcMaxPixelWidth) // src past right edge
1423  return false;
1424  if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy > UWord(srcMaxPixelWidth))
1425  numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth; // Clip to src raster's right edge
1426  if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1427  numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1428  NTV2_ASSERT (numHorzPixelsToCopy % 16 == 0);
1429  if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1430  numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines; // Clip to src raster's bottom edge
1431  if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1432  {
1433  if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1434  numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1435  else
1436  return true;
1437  }
1438 
1439  for (UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++) // for each raster line to copy
1440  {
1441  const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * 20 / 16);
1442  UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * 20 / 16);
1443  ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * 20 / 16); // copy the line
1444  }
1445 
1446  return true;
1447 
1448 } // CopyRaster20BytesPer16Pixels
1449 
1450 // This function should work on all 36-byte-per-8-pixel formats
1451 static bool CopyRaster36BytesPer8Pixels ( UByte * pDstBuffer, // Dest buffer to be modified
1452  const ULWord inDstBytesPerLine, // Dest buffer bytes per raster line (determines max width) -- must be evenly divisible by 20
1453  const UWord inDstTotalLines, // Dest buffer total raster lines (max height)
1454  const UWord inDstVertLineOffset, // Vertical line offset into the dest raster where the top edge of the src image will appear
1455  const UWord inDstHorzPixelOffset, // Horizontal pixel offset into the dest raster where the left edge of the src image will appear
1456  const UByte * pSrcBuffer, // Src buffer
1457  const ULWord inSrcBytesPerLine, // Src buffer bytes per raster line (determines max width) -- must be evenly divisible by 20
1458  const UWord inSrcTotalLines, // Src buffer total raster lines (max height)
1459  const UWord inSrcVertLineOffset, // Src image top edge
1460  const UWord inSrcVertLinesToCopy, // Src image height
1461  const UWord inSrcHorzPixelOffset, // Src image left edge
1462  const UWord inSrcHorzPixelsToCopy) // Src image width
1463 {
1464  if (inDstHorzPixelOffset % 8) // dst pixel offset must be on 16-pixel boundary
1465  return false;
1466  if (inSrcHorzPixelOffset % 8) // src pixel offset must be on 16-pixel boundary
1467  return false;
1468  if (inDstBytesPerLine % 36) // dst raster width must be evenly divisible by 20
1469  return false;
1470  if (inSrcBytesPerLine % 36) // src raster width must be evenly divisible by 20
1471  return false;
1472  if (inSrcHorzPixelsToCopy % 8) // pixel width of src image portion to copy must be on 16-pixel boundary
1473  return false;
1474 
1475  const ULWord dstMaxPixelWidth (inDstBytesPerLine / 36 * 8);
1476  const ULWord srcMaxPixelWidth (inSrcBytesPerLine / 36 * 8);
1477  ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1478  UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1479 
1480  if (inDstHorzPixelOffset >= dstMaxPixelWidth) // dst past right edge
1481  return false;
1482  if (inSrcHorzPixelOffset >= srcMaxPixelWidth) // src past right edge
1483  return false;
1484  if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy > UWord(srcMaxPixelWidth))
1485  numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth; // Clip to src raster's right edge
1486  if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1487  numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1488  NTV2_ASSERT (numHorzPixelsToCopy % 8 == 0);
1489  if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1490  numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines; // Clip to src raster's bottom edge
1491  if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1492  {
1493  if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1494  numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1495  else
1496  return true;
1497  }
1498 
1499  for (UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++) // for each raster line to copy
1500  {
1501  const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * 36 / 8);
1502  UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * 36 / 8);
1503  ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * 36 / 8); // copy the line
1504  }
1505 
1506  return true;
1507 
1508 } // CopyRaster20BytesPer16Pixels
1509 
1510 
1511 // This function should work on all 5-byte-per-pixel formats
1512 static bool CopyRaster5BytesPerPixel ( UByte * pDstBuffer, // Dest buffer to be modified
1513  const ULWord inDstBytesPerLine, // Dest buffer bytes per raster line (determines max width)
1514  const UWord inDstTotalLines, // Dest buffer total raster lines (max height)
1515  const UWord inDstVertLineOffset, // Vertical line offset into the dest raster where the top edge of the src image will appear
1516  const UWord inDstHorzPixelOffset, // Horizontal pixel offset into the dest raster where the left edge of the src image will appear -- must be evenly divisible by 6
1517  const UByte * pSrcBuffer, // Src buffer
1518  const ULWord inSrcBytesPerLine, // Src buffer bytes per raster line (determines max width)
1519  const UWord inSrcTotalLines, // Src buffer total raster lines (max height)
1520  const UWord inSrcVertLineOffset, // Src image top edge
1521  const UWord inSrcVertLinesToCopy, // Src image height
1522  const UWord inSrcHorzPixelOffset, // Src image left edge
1523  const UWord inSrcHorzPixelsToCopy) // Src image width
1524 {
1525  const UWord FIVE_BYTES_PER_PIXEL (5);
1526 
1527  if (inDstBytesPerLine % FIVE_BYTES_PER_PIXEL) // dst raster width (in bytes) must be evenly divisible by 5
1528  return false;
1529  if (inSrcBytesPerLine % FIVE_BYTES_PER_PIXEL) // src raster width (in bytes) must be evenly divisible by 5
1530  return false;
1531 
1532  const ULWord dstMaxPixelWidth (inDstBytesPerLine / FIVE_BYTES_PER_PIXEL);
1533  const ULWord srcMaxPixelWidth (inSrcBytesPerLine / FIVE_BYTES_PER_PIXEL);
1534  ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1535  UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1536 
1537  if (inDstHorzPixelOffset >= dstMaxPixelWidth) // dst past right edge
1538  return false;
1539  if (inSrcHorzPixelOffset >= srcMaxPixelWidth) // src past right edge
1540  return false;
1541  if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy > UWord(srcMaxPixelWidth))
1542  numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth; // Clip to src raster's right edge
1543  if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1544  numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1545  if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1546  numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines; // Clip to src raster's bottom edge
1547  if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1548  {
1549  if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1550  numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1551  else
1552  return true;
1553  }
1554 
1555  for (UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++) // for each raster line to copy
1556  {
1557  const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * FIVE_BYTES_PER_PIXEL);
1558  UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * FIVE_BYTES_PER_PIXEL);
1559  ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * FIVE_BYTES_PER_PIXEL); // copy the line
1560  }
1561 
1562  return true;
1563 
1564 } // CopyRaster5BytesPerPixel
1565 
1566 
1567 // This function should work on all 4-byte-per-pixel formats
1568 static bool CopyRaster4BytesPerPixel ( UByte * pDstBuffer, // Dest buffer to be modified
1569  const ULWord inDstBytesPerLine, // Dest buffer bytes per raster line (determines max width)
1570  const UWord inDstTotalLines, // Dest buffer total raster lines (max height)
1571  const UWord inDstVertLineOffset, // Vertical line offset into the dest raster where the top edge of the src image will appear
1572  const UWord inDstHorzPixelOffset, // Horizontal pixel offset into the dest raster where the left edge of the src image will appear -- must be evenly divisible by 6
1573  const UByte * pSrcBuffer, // Src buffer
1574  const ULWord inSrcBytesPerLine, // Src buffer bytes per raster line (determines max width)
1575  const UWord inSrcTotalLines, // Src buffer total raster lines (max height)
1576  const UWord inSrcVertLineOffset, // Src image top edge
1577  const UWord inSrcVertLinesToCopy, // Src image height
1578  const UWord inSrcHorzPixelOffset, // Src image left edge
1579  const UWord inSrcHorzPixelsToCopy) // Src image width
1580 {
1581  const UWord FOUR_BYTES_PER_PIXEL (4);
1582 
1583  if (inDstBytesPerLine % FOUR_BYTES_PER_PIXEL) // dst raster width (in bytes) must be evenly divisible by 4
1584  return false;
1585  if (inSrcBytesPerLine % FOUR_BYTES_PER_PIXEL) // src raster width (in bytes) must be evenly divisible by 4
1586  return false;
1587 
1588  const ULWord dstMaxPixelWidth (inDstBytesPerLine / FOUR_BYTES_PER_PIXEL);
1589  const ULWord srcMaxPixelWidth (inSrcBytesPerLine / FOUR_BYTES_PER_PIXEL);
1590  ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1591  UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1592 
1593  if (inDstHorzPixelOffset >= dstMaxPixelWidth) // dst past right edge
1594  return false;
1595  if (inSrcHorzPixelOffset >= srcMaxPixelWidth) // src past right edge
1596  return false;
1597  if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy > UWord(srcMaxPixelWidth))
1598  numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth; // Clip to src raster's right edge
1599  if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1600  numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1601  if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1602  numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines; // Clip to src raster's bottom edge
1603  if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1604  {
1605  if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1606  numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1607  else
1608  return true;
1609  }
1610 
1611  for (UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++) // for each raster line to copy
1612  {
1613  const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * FOUR_BYTES_PER_PIXEL);
1614  UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * FOUR_BYTES_PER_PIXEL);
1615  ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * FOUR_BYTES_PER_PIXEL); // copy the line
1616  }
1617 
1618  return true;
1619 
1620 } // CopyRaster4BytesPerPixel
1621 
1622 
1623 // This function should work on all 3-byte-per-pixel formats
1624 static bool CopyRaster3BytesPerPixel ( UByte * pDstBuffer, // Dest buffer to be modified
1625  const ULWord inDstBytesPerLine, // Dest buffer bytes per raster line (determines max width)
1626  const UWord inDstTotalLines, // Dest buffer total raster lines (max height)
1627  const UWord inDstVertLineOffset, // Vertical line offset into the dest raster where the top edge of the src image will appear
1628  const UWord inDstHorzPixelOffset, // Horizontal pixel offset into the dest raster where the left edge of the src image will appear -- must be evenly divisible by 6
1629  const UByte * pSrcBuffer, // Src buffer
1630  const ULWord inSrcBytesPerLine, // Src buffer bytes per raster line (determines max width)
1631  const UWord inSrcTotalLines, // Src buffer total raster lines (max height)
1632  const UWord inSrcVertLineOffset, // Src image top edge
1633  const UWord inSrcVertLinesToCopy, // Src image height
1634  const UWord inSrcHorzPixelOffset, // Src image left edge
1635  const UWord inSrcHorzPixelsToCopy) // Src image width
1636 {
1637  const UWord THREE_BYTES_PER_PIXEL (3);
1638 
1639  if (inDstBytesPerLine % THREE_BYTES_PER_PIXEL) // dst raster width (in bytes) must be evenly divisible by 3
1640  return false;
1641  if (inSrcBytesPerLine % THREE_BYTES_PER_PIXEL) // src raster width (in bytes) must be evenly divisible by 3
1642  return false;
1643 
1644  const ULWord dstMaxPixelWidth (inDstBytesPerLine / THREE_BYTES_PER_PIXEL);
1645  const ULWord srcMaxPixelWidth (inSrcBytesPerLine / THREE_BYTES_PER_PIXEL);
1646  ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1647  UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1648 
1649  if (inDstHorzPixelOffset >= dstMaxPixelWidth) // dst past right edge
1650  return false;
1651  if (inSrcHorzPixelOffset >= srcMaxPixelWidth) // src past right edge
1652  return false;
1653  if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy > UWord(srcMaxPixelWidth))
1654  numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth; // Clip to src raster's right edge
1655  if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1656  numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1657  if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1658  numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines; // Clip to src raster's bottom edge
1659  if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1660  {
1661  if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1662  numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1663  else
1664  return true;
1665  }
1666 
1667  for (UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++) // for each raster line to copy
1668  {
1669  const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * THREE_BYTES_PER_PIXEL);
1670  UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * THREE_BYTES_PER_PIXEL);
1671  ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * THREE_BYTES_PER_PIXEL); // copy the line
1672  }
1673 
1674  return true;
1675 
1676 } // CopyRaster3BytesPerPixel
1677 
1678 
1679 // This function should work on all 6-byte-per-pixel formats
1680 static bool CopyRaster6BytesPerPixel ( UByte * pDstBuffer, // Dest buffer to be modified
1681  const ULWord inDstBytesPerLine, // Dest buffer bytes per raster line (determines max width)
1682  const UWord inDstTotalLines, // Dest buffer total raster lines (max height)
1683  const UWord inDstVertLineOffset, // Vertical line offset into the dest raster where the top edge of the src image will appear
1684  const UWord inDstHorzPixelOffset, // Horizontal pixel offset into the dest raster where the left edge of the src image will appear -- must be evenly divisible by 6
1685  const UByte * pSrcBuffer, // Src buffer
1686  const ULWord inSrcBytesPerLine, // Src buffer bytes per raster line (determines max width)
1687  const UWord inSrcTotalLines, // Src buffer total raster lines (max height)
1688  const UWord inSrcVertLineOffset, // Src image top edge
1689  const UWord inSrcVertLinesToCopy, // Src image height
1690  const UWord inSrcHorzPixelOffset, // Src image left edge
1691  const UWord inSrcHorzPixelsToCopy) // Src image width
1692 {
1693  const UWord SIX_BYTES_PER_PIXEL (6);
1694 
1695  if (inDstBytesPerLine % SIX_BYTES_PER_PIXEL) // dst raster width (in bytes) must be evenly divisible by 6
1696  return false;
1697  if (inSrcBytesPerLine % SIX_BYTES_PER_PIXEL) // src raster width (in bytes) must be evenly divisible by 6
1698  return false;
1699 
1700  const ULWord dstMaxPixelWidth (inDstBytesPerLine / SIX_BYTES_PER_PIXEL);
1701  const ULWord srcMaxPixelWidth (inSrcBytesPerLine / SIX_BYTES_PER_PIXEL);
1702  ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1703  UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1704 
1705  if (inDstHorzPixelOffset >= dstMaxPixelWidth) // dst past right edge
1706  return false;
1707  if (inSrcHorzPixelOffset >= srcMaxPixelWidth) // src past right edge
1708  return false;
1709  if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy > UWord(srcMaxPixelWidth))
1710  numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth; // Clip to src raster's right edge
1711  if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1712  numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1713  if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1714  numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines; // Clip to src raster's bottom edge
1715  if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1716  {
1717  if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1718  numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1719  else
1720  return true;
1721  }
1722 
1723  for (UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++) // for each raster line to copy
1724  {
1725  const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * SIX_BYTES_PER_PIXEL);
1726  UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * SIX_BYTES_PER_PIXEL);
1727  ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * SIX_BYTES_PER_PIXEL); // copy the line
1728  }
1729 
1730  return true;
1731 
1732 } // CopyRaster6BytesPerPixel
1733 
1734 
1735 bool CopyRaster (const NTV2PixelFormat inPixelFormat, // Pixel format of both src and dst buffers
1736  UByte * pDstBuffer, // Dest buffer to be modified
1737  const ULWord inDstBytesPerLine, // Dest buffer bytes per raster line (determines max width)
1738  const UWord inDstTotalLines, // Dest buffer total lines in raster (max height)
1739  const UWord inDstVertLineOffset, // Vertical line offset into the dest raster where the top edge of the src image will appear
1740  const UWord inDstHorzPixelOffset, // Horizontal pixel offset into the dest raster where the left edge of the src image will appear
1741  const UByte * pSrcBuffer, // Src buffer
1742  const ULWord inSrcBytesPerLine, // Src buffer bytes per raster line (determines max width)
1743  const UWord inSrcTotalLines, // Src buffer total lines in raster (max height)
1744  const UWord inSrcVertLineOffset, // Src image top edge
1745  const UWord inSrcVertLinesToCopy, // Src image height
1746  const UWord inSrcHorzPixelOffset, // Src image left edge
1747  const UWord inSrcHorzPixelsToCopy) // Src image width
1748 {
1749  if (!pDstBuffer) // NULL buffer
1750  return false;
1751  if (!pSrcBuffer) // NULL buffer
1752  return false;
1753  if (pDstBuffer == pSrcBuffer) // src & dst buffers must be different
1754  return false;
1755  if (inDstBytesPerLine == 0) // zero rowbytes
1756  return false;
1757  if (inSrcBytesPerLine == 0) // zero rowbytes
1758  return false;
1759  if (inDstTotalLines == 0) // zero height
1760  return false;
1761  if (inSrcTotalLines == 0) // zero height
1762  return false;
1763  if (inDstVertLineOffset >= inDstTotalLines) // dst past bottom edge
1764  return false;
1765  if (inSrcVertLineOffset >= inSrcTotalLines) // src past bottom edge
1766  return false;
1767  switch (inPixelFormat)
1768  {
1769  case NTV2_FBF_10BIT_YCBCR:
1770  case NTV2_FBF_10BIT_YCBCR_DPX: return CopyRaster16BytesPer6Pixels (pDstBuffer, inDstBytesPerLine, inDstTotalLines, inDstVertLineOffset, inDstHorzPixelOffset,
1771  pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1772  inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1773 
1774  case NTV2_FBF_8BIT_YCBCR:
1775  case NTV2_FBF_8BIT_YCBCR_YUY2: return CopyRaster4BytesPer2Pixels (pDstBuffer, inDstBytesPerLine, inDstTotalLines, inDstVertLineOffset, inDstHorzPixelOffset,
1776  pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1777  inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1778 
1779  case NTV2_FBF_ARGB:
1780  case NTV2_FBF_RGBA:
1781  case NTV2_FBF_ABGR:
1782  case NTV2_FBF_10BIT_DPX:
1783  case NTV2_FBF_10BIT_DPX_LE:
1784  case NTV2_FBF_10BIT_RGB: return CopyRaster4BytesPerPixel (pDstBuffer, inDstBytesPerLine, inDstTotalLines, inDstVertLineOffset, inDstHorzPixelOffset,
1785  pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1786  inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1787 
1788  case NTV2_FBF_24BIT_RGB:
1789  case NTV2_FBF_24BIT_BGR: return CopyRaster3BytesPerPixel (pDstBuffer, inDstBytesPerLine, inDstTotalLines, inDstVertLineOffset, inDstHorzPixelOffset,
1790  pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1791  inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1792 
1793  case NTV2_FBF_48BIT_RGB: return CopyRaster6BytesPerPixel (pDstBuffer, inDstBytesPerLine, inDstTotalLines, inDstVertLineOffset, inDstHorzPixelOffset,
1794  pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1795  inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1796 
1797  case NTV2_FBF_12BIT_RGB_PACKED: return CopyRaster36BytesPer8Pixels (pDstBuffer, inDstBytesPerLine, inDstTotalLines, inDstVertLineOffset, inDstHorzPixelOffset,
1798  pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1799  inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1800  case NTV2_FBF_10BIT_RAW_YCBCR: return CopyRaster20BytesPer16Pixels (pDstBuffer, inDstBytesPerLine, inDstTotalLines, inDstVertLineOffset, inDstHorzPixelOffset,
1801  pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1802  inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1803 
1804  case NTV2_FBF_10BIT_ARGB: return CopyRaster5BytesPerPixel (pDstBuffer, inDstBytesPerLine, inDstTotalLines, inDstVertLineOffset, inDstHorzPixelOffset,
1805  pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1806  inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1807 
1808  case NTV2_FBF_8BIT_DVCPRO: // Lossy
1809  case NTV2_FBF_8BIT_HDV: // Lossy
1811  case NTV2_FBF_10BIT_YCBCRA:
1813  case NTV2_FBF_PRORES_HDV:
1815  case NTV2_FBF_16BIT_ARGB:
1825  return false; // Unsupported
1826  }
1827  return false;
1828 
1829 } // CopyRaster
1830 
1831 
1832 // frames per second
1833 double GetFramesPerSecond (const NTV2FrameRate inFrameRate)
1834 {
1835  switch (inFrameRate)
1836  {
1837  case NTV2_FRAMERATE_12000: return 120.0;
1838  case NTV2_FRAMERATE_11988: return 120000.0 / 1001.0;
1839  case NTV2_FRAMERATE_6000: return 60.0;
1840  case NTV2_FRAMERATE_5994: return 60000.0 / 1001.0;
1841  case NTV2_FRAMERATE_5000: return 50.0;
1842  case NTV2_FRAMERATE_4800: return 48.0;
1843  case NTV2_FRAMERATE_4795: return 48000.0 / 1001.0;
1844  case NTV2_FRAMERATE_3000: return 30.0;
1845  case NTV2_FRAMERATE_2997: return 30000.0 / 1001.0;
1846  case NTV2_FRAMERATE_2500: return 25.0;
1847  case NTV2_FRAMERATE_2400: return 24.0;
1848  case NTV2_FRAMERATE_2398: return 24000.0 / 1001.0;
1849  case NTV2_FRAMERATE_1500: return 15.0;
1850  case NTV2_FRAMERATE_1498: return 15000.0 / 1001.0;
1851 #if !defined(NTV2_DEPRECATE_16_0)
1852  case NTV2_FRAMERATE_1900: return 19.0;
1853  case NTV2_FRAMERATE_1898: return 19000.0 / 1001.0;
1854  case NTV2_FRAMERATE_1800: return 18.0;
1855  case NTV2_FRAMERATE_1798: return 18000.0 / 1001.0;
1856 #endif
1857 #if defined(_DEBUG)
1858  case NTV2_NUM_FRAMERATES:
1859  case NTV2_FRAMERATE_UNKNOWN: break;
1860 #else
1861  default: break;
1862 #endif
1863  }
1864  return 30.0 / 1.001;
1865 }
1866 
1867 
1868 bool GetFramesPerSecond (const NTV2FrameRate inFrameRate, ULWord & outFractionNumerator, ULWord & outFractionDenominator)
1869 {
1870  switch (inFrameRate)
1871  {
1872  case NTV2_FRAMERATE_12000: outFractionNumerator = 120; outFractionDenominator = 1; break;
1873  case NTV2_FRAMERATE_11988: outFractionNumerator = 120000; outFractionDenominator = 1001; break;
1874  case NTV2_FRAMERATE_6000: outFractionNumerator = 60; outFractionDenominator = 1; break;
1875  case NTV2_FRAMERATE_5994: outFractionNumerator = 60000; outFractionDenominator = 1001; break;
1876  case NTV2_FRAMERATE_5000: outFractionNumerator = 50; outFractionDenominator = 1; break;
1877  case NTV2_FRAMERATE_4800: outFractionNumerator = 48; outFractionDenominator = 1; break;
1878  case NTV2_FRAMERATE_4795: outFractionNumerator = 48000; outFractionDenominator = 1001; break;
1879  case NTV2_FRAMERATE_3000: outFractionNumerator = 30; outFractionDenominator = 1; break;
1880  case NTV2_FRAMERATE_2997: outFractionNumerator = 30000; outFractionDenominator = 1001; break;
1881  case NTV2_FRAMERATE_2500: outFractionNumerator = 25; outFractionDenominator = 1; break;
1882  case NTV2_FRAMERATE_2400: outFractionNumerator = 24; outFractionDenominator = 1; break;
1883  case NTV2_FRAMERATE_2398: outFractionNumerator = 24000; outFractionDenominator = 1001; break;
1884  case NTV2_FRAMERATE_1500: outFractionNumerator = 15; outFractionDenominator = 1; break;
1885  case NTV2_FRAMERATE_1498: outFractionNumerator = 15000; outFractionDenominator = 1001; break;
1886 #if !defined(NTV2_DEPRECATE_16_0)
1887  case NTV2_FRAMERATE_1900: outFractionNumerator = 19; outFractionDenominator = 1; break;
1888  case NTV2_FRAMERATE_1898: outFractionNumerator = 19000; outFractionDenominator = 1001; break;
1889  case NTV2_FRAMERATE_1800: outFractionNumerator = 18; outFractionDenominator = 1; break;
1890  case NTV2_FRAMERATE_1798: outFractionNumerator = 18000; outFractionDenominator = 1001; break;
1891 #endif // !defined(NTV2_DEPRECATE_16_0)
1892 #if defined(_DEBUG)
1893  case NTV2_NUM_FRAMERATES:
1894  case NTV2_FRAMERATE_UNKNOWN: outFractionNumerator = 0; outFractionDenominator = 0; return false;
1895 #else
1896  default: outFractionNumerator = 0; outFractionDenominator = 0; return false;
1897 #endif
1898  }
1899  return true;
1900 }
1901 
1902 
1903 NTV2Standard GetNTV2StandardFromScanGeometry (const UByte inScanGeometry, const bool inIsProgressiveTransport)
1904 {
1905  switch (inScanGeometry)
1906  {
1907  case NTV2_SG_525: return NTV2_STANDARD_525;
1908  case NTV2_SG_625: return NTV2_STANDARD_625;
1909  case NTV2_SG_750: return NTV2_STANDARD_720;
1910  case NTV2_SG_2Kx1556: return NTV2_STANDARD_2K;
1911 
1912  case NTV2_SG_1125:
1913  case NTV2_SG_2Kx1080: return inIsProgressiveTransport ? NTV2_STANDARD_1080p : NTV2_STANDARD_1080;
1914 
1915  default: break;
1916  }
1917  return NTV2_STANDARD_INVALID;
1918 }
1919 
1920 
1922  const UWord inHeightLines,
1923  const UWord inWidthPixels,
1924  const bool inIsInterlaced,
1925  const bool inIsLevelB,
1926  const bool inIsPSF)
1927 {
1929  if (inFrameRate == ::GetNTV2FrameRateFromVideoFormat(fmt))
1930  if (inHeightLines == ::GetDisplayHeight(fmt))
1931  if (inWidthPixels == ::GetDisplayWidth(fmt))
1932  if (inIsInterlaced == !::IsProgressiveTransport(fmt))
1933  if (inIsPSF == ::IsPSF(fmt))
1934  if (NTV2_VIDEO_FORMAT_IS_B(fmt) == inIsLevelB)
1935  return fmt;
1936  return NTV2_FORMAT_UNKNOWN;
1937 }
1938 
1939 
1941 {
1942  NTV2VideoFormat quarterSizedFormat(inVideoFormat);
1943 
1944  switch (inVideoFormat)
1945  {
1947  case NTV2_FORMAT_4x1920x1080psf_2398: quarterSizedFormat = NTV2_FORMAT_1080psf_2398; break;
1949  case NTV2_FORMAT_4x1920x1080psf_2400: quarterSizedFormat = NTV2_FORMAT_1080psf_2400; break;
1951  case NTV2_FORMAT_4x1920x1080psf_2500: quarterSizedFormat = NTV2_FORMAT_1080psf_2500_2; break;
1953  case NTV2_FORMAT_4x1920x1080psf_2997: quarterSizedFormat = NTV2_FORMAT_1080i_5994; break; // NTV2_FORMAT_1080psf_2997
1955  case NTV2_FORMAT_4x1920x1080psf_3000: quarterSizedFormat = NTV2_FORMAT_1080i_6000; break; // NTV2_FORMAT_1080psf_3000
1956 
1958  case NTV2_FORMAT_4x2048x1080psf_2398: quarterSizedFormat = NTV2_FORMAT_1080psf_2K_2398; break;
1960  case NTV2_FORMAT_4x2048x1080psf_2400: quarterSizedFormat = NTV2_FORMAT_1080psf_2K_2400; break;
1962  case NTV2_FORMAT_4x2048x1080psf_2500: quarterSizedFormat = NTV2_FORMAT_1080psf_2K_2500; break;
1963  //case NTV2_FORMAT_4x2048x1080psf_2997: quarterSizedFormat = NTV2_FORMAT_1080psf_2K_2997; break;
1964  //case NTV2_FORMAT_4x2048x1080psf_3000: quarterSizedFormat = NTV2_FORMAT_1080psf_2K_3000; break;
1965 
1967  case NTV2_FORMAT_4x1920x1080p_2398: quarterSizedFormat = NTV2_FORMAT_1080p_2398; break;
1969  case NTV2_FORMAT_4x1920x1080p_2400: quarterSizedFormat = NTV2_FORMAT_1080p_2400; break;
1971  case NTV2_FORMAT_4x1920x1080p_2500: quarterSizedFormat = NTV2_FORMAT_1080p_2500; break;
1973  case NTV2_FORMAT_4x1920x1080p_2997: quarterSizedFormat = NTV2_FORMAT_1080p_2997; break;
1975  case NTV2_FORMAT_4x1920x1080p_3000: quarterSizedFormat = NTV2_FORMAT_1080p_3000; break;
1977  case NTV2_FORMAT_4x1920x1080p_5000: quarterSizedFormat = NTV2_FORMAT_1080p_5000_A; break;
1979  case NTV2_FORMAT_4x1920x1080p_5994: quarterSizedFormat = NTV2_FORMAT_1080p_5994_A; break;
1981  case NTV2_FORMAT_4x1920x1080p_6000: quarterSizedFormat = NTV2_FORMAT_1080p_6000_A; break;
1983  case NTV2_FORMAT_4x1920x1080p_5000_B: quarterSizedFormat = NTV2_FORMAT_1080p_5000_B; break;
1985  case NTV2_FORMAT_4x1920x1080p_5994_B: quarterSizedFormat = NTV2_FORMAT_1080p_5994_B; break;
1987  case NTV2_FORMAT_4x1920x1080p_6000_B: quarterSizedFormat = NTV2_FORMAT_1080p_6000_B; break;
1988 
1990  case NTV2_FORMAT_4x2048x1080p_2398: quarterSizedFormat = NTV2_FORMAT_1080p_2K_2398; break;
1992  case NTV2_FORMAT_4x2048x1080p_2400: quarterSizedFormat = NTV2_FORMAT_1080p_2K_2400; break;
1994  case NTV2_FORMAT_4x2048x1080p_2500: quarterSizedFormat = NTV2_FORMAT_1080p_2K_2500; break;
1996  case NTV2_FORMAT_4x2048x1080p_2997: quarterSizedFormat = NTV2_FORMAT_1080p_2K_2997; break;
1998  case NTV2_FORMAT_4x2048x1080p_3000: quarterSizedFormat = NTV2_FORMAT_1080p_2K_3000; break;
2000  case NTV2_FORMAT_4x2048x1080p_4795: quarterSizedFormat = NTV2_FORMAT_1080p_2K_4795_A; break;
2002  case NTV2_FORMAT_4x2048x1080p_4800: quarterSizedFormat = NTV2_FORMAT_1080p_2K_4800_A; break;
2004  case NTV2_FORMAT_4x2048x1080p_5000: quarterSizedFormat = NTV2_FORMAT_1080p_2K_5000_A; break;
2006  case NTV2_FORMAT_4x2048x1080p_5994: quarterSizedFormat = NTV2_FORMAT_1080p_2K_5994_A; break;
2008  case NTV2_FORMAT_4x2048x1080p_6000: quarterSizedFormat = NTV2_FORMAT_1080p_2K_6000_A; break;
2010  case NTV2_FORMAT_4x2048x1080p_4795_B: quarterSizedFormat = NTV2_FORMAT_1080p_2K_4795_B; break;
2012  case NTV2_FORMAT_4x2048x1080p_4800_B: quarterSizedFormat = NTV2_FORMAT_1080p_2K_4800_B; break;
2014  case NTV2_FORMAT_4x2048x1080p_5000_B: quarterSizedFormat = NTV2_FORMAT_1080p_2K_5000_B; break;
2016  case NTV2_FORMAT_4x2048x1080p_5994_B: quarterSizedFormat = NTV2_FORMAT_1080p_2K_5994_B; break;
2018  case NTV2_FORMAT_4x2048x1080p_6000_B: quarterSizedFormat = NTV2_FORMAT_1080p_2K_6000_B; break;
2019  // No quarter sized formats for 119.88 or 120 Hz
2020 
2021  case NTV2_FORMAT_4x3840x2160p_2398: quarterSizedFormat = NTV2_FORMAT_3840x2160p_2398; break;
2022  case NTV2_FORMAT_4x3840x2160p_2400: quarterSizedFormat = NTV2_FORMAT_3840x2160p_2400; break;
2023  case NTV2_FORMAT_4x3840x2160p_2500: quarterSizedFormat = NTV2_FORMAT_3840x2160p_2500; break;
2024  case NTV2_FORMAT_4x3840x2160p_2997: quarterSizedFormat = NTV2_FORMAT_3840x2160p_2997; break;
2025  case NTV2_FORMAT_4x3840x2160p_3000: quarterSizedFormat = NTV2_FORMAT_3840x2160p_3000; break;
2026  case NTV2_FORMAT_4x3840x2160p_5000: quarterSizedFormat = NTV2_FORMAT_3840x2160p_5000; break;
2027  case NTV2_FORMAT_4x3840x2160p_5994: quarterSizedFormat = NTV2_FORMAT_3840x2160p_5994; break;
2028  case NTV2_FORMAT_4x3840x2160p_6000: quarterSizedFormat = NTV2_FORMAT_3840x2160p_6000; break;
2029  case NTV2_FORMAT_4x3840x2160p_5000_B: quarterSizedFormat = NTV2_FORMAT_3840x2160p_5000_B; break;
2030  case NTV2_FORMAT_4x3840x2160p_5994_B: quarterSizedFormat = NTV2_FORMAT_3840x2160p_5994_B; break;
2031  case NTV2_FORMAT_4x3840x2160p_6000_B: quarterSizedFormat = NTV2_FORMAT_3840x2160p_6000_B; break;
2032 
2033  case NTV2_FORMAT_4x4096x2160p_2398: quarterSizedFormat = NTV2_FORMAT_4096x2160p_2398; break;
2034  case NTV2_FORMAT_4x4096x2160p_2400: quarterSizedFormat = NTV2_FORMAT_4096x2160p_2400; break;
2035  case NTV2_FORMAT_4x4096x2160p_2500: quarterSizedFormat = NTV2_FORMAT_4096x2160p_2500; break;
2036  case NTV2_FORMAT_4x4096x2160p_2997: quarterSizedFormat = NTV2_FORMAT_4096x2160p_2997; break;
2037  case NTV2_FORMAT_4x4096x2160p_3000: quarterSizedFormat = NTV2_FORMAT_4096x2160p_3000; break;
2038  case NTV2_FORMAT_4x4096x2160p_4795: quarterSizedFormat = NTV2_FORMAT_4096x2160p_4795; break;
2039  case NTV2_FORMAT_4x4096x2160p_4800: quarterSizedFormat = NTV2_FORMAT_4096x2160p_4800; break;
2040  case NTV2_FORMAT_4x4096x2160p_5000: quarterSizedFormat = NTV2_FORMAT_4096x2160p_5000; break;
2041  case NTV2_FORMAT_4x4096x2160p_5994: quarterSizedFormat = NTV2_FORMAT_4096x2160p_5994; break;
2042  case NTV2_FORMAT_4x4096x2160p_6000: quarterSizedFormat = NTV2_FORMAT_4096x2160p_6000; break;
2043  case NTV2_FORMAT_4x4096x2160p_4795_B: quarterSizedFormat = NTV2_FORMAT_4096x2160p_4795_B; break;
2044  case NTV2_FORMAT_4x4096x2160p_4800_B: quarterSizedFormat = NTV2_FORMAT_4096x2160p_4800_B; break;
2045  case NTV2_FORMAT_4x4096x2160p_5000_B: quarterSizedFormat = NTV2_FORMAT_4096x2160p_5000_B; break;
2046  case NTV2_FORMAT_4x4096x2160p_5994_B: quarterSizedFormat = NTV2_FORMAT_4096x2160p_5994_B; break;
2047  case NTV2_FORMAT_4x4096x2160p_6000_B: quarterSizedFormat = NTV2_FORMAT_4096x2160p_6000_B; break;
2048 #if defined(_DEBUG)
2049  case NTV2_FORMAT_UNKNOWN:
2053  case NTV2_FORMAT_720p_5994:
2054  case NTV2_FORMAT_720p_6000:
2066  case NTV2_FORMAT_720p_5000:
2070  case NTV2_FORMAT_720p_2398:
2071  case NTV2_FORMAT_720p_2500:
2081  case NTV2_FORMAT_525_5994:
2082  case NTV2_FORMAT_625_5000:
2083  case NTV2_FORMAT_525_2398:
2084  case NTV2_FORMAT_525_2400:
2088  case NTV2_FORMAT_2K_1498:
2089  case NTV2_FORMAT_2K_1500:
2090  case NTV2_FORMAT_2K_2398:
2091  case NTV2_FORMAT_2K_2400:
2092  case NTV2_FORMAT_2K_2500:
2120 #else
2121  default:
2122 #endif
2123  break;
2124  }
2125  return quarterSizedFormat;
2126 }
2127 
2128 
2129 NTV2VideoFormat GetQuadSizedVideoFormat (const NTV2VideoFormat inVideoFormat, const bool isSquareDivision)
2130 {
2131  switch (inVideoFormat)
2132  {
2138 
2142  //case NTV2_FORMAT_1080psf_2K_2997: return NTV2_FORMAT_4x2048x1080psf_29;
2143  //case NT2_FORMAT_1080psf_2K_3000: return NTV2V2_FORMAT_4x2048x1080psf_3000;
2144 
2156 
2172 
2184 
2200 
2201 #if defined(_DEBUG)
2202  case NTV2_FORMAT_UNKNOWN:
2204  case NTV2_FORMAT_720p_5994:
2205  case NTV2_FORMAT_720p_6000:
2206  case NTV2_FORMAT_720p_5000:
2207  case NTV2_FORMAT_720p_2398:
2208  case NTV2_FORMAT_720p_2500:
2212  case NTV2_FORMAT_525_5994:
2213  case NTV2_FORMAT_625_5000:
2214  case NTV2_FORMAT_525_2398:
2215  case NTV2_FORMAT_525_2400:
2219  case NTV2_FORMAT_2K_1498:
2220  case NTV2_FORMAT_2K_1500:
2221  case NTV2_FORMAT_2K_2398:
2222  case NTV2_FORMAT_2K_2400:
2223  case NTV2_FORMAT_2K_2500:
2307 #else
2308  default:
2309 #endif
2310  break;
2311  }
2312  return inVideoFormat;
2313 }
2314 
2316 {
2317  switch (inGeometry)
2318  {
2323  default: return inGeometry;
2324  }
2325 }
2326 
2327 
2329 {
2330  switch (inGeometry)
2331  {
2336  default: return inGeometry;
2337  }
2338 }
2339 
2341 {
2342  switch (inStandard)
2343  {
2352  default: return inStandard;
2353  }
2354 }
2355 
2356 
2357 NTV2Standard Get4xSizedStandard (const NTV2Standard inStandard, const bool bIs4k)
2358 {
2359  switch (inStandard)
2360  {
2363 
2364  case NTV2_STANDARD_3840HFR:
2366 
2367  case NTV2_STANDARD_4096HFR:
2369 
2370  default: return inStandard;
2371  }
2372 }
2373 
2374 
2376 {
2378 
2379  switch (inVideoFormat)
2380  {
2397  standard = NTV2_STANDARD_1080;
2398  break;
2407  standard = NTV2_STANDARD_1080p;
2408  break;
2419  standard = NTV2_STANDARD_2Kx1080p;
2420  break;
2424  standard = NTV2_STANDARD_2Kx1080i;
2425  break;
2426  case NTV2_FORMAT_720p_2398:
2427  case NTV2_FORMAT_720p_5000:
2428  case NTV2_FORMAT_720p_5994:
2429  case NTV2_FORMAT_720p_6000:
2430  case NTV2_FORMAT_720p_2500:
2431  standard = NTV2_STANDARD_720;
2432  break;
2433  case NTV2_FORMAT_525_5994:
2434  case NTV2_FORMAT_525_2398:
2435  case NTV2_FORMAT_525_2400:
2437  standard = NTV2_STANDARD_525;
2438  break;
2439  case NTV2_FORMAT_625_5000:
2441  standard = NTV2_STANDARD_625 ;
2442  break;
2443  case NTV2_FORMAT_2K_1498:
2444  case NTV2_FORMAT_2K_1500:
2445  case NTV2_FORMAT_2K_2398:
2446  case NTV2_FORMAT_2K_2400:
2447  case NTV2_FORMAT_2K_2500:
2448  standard = NTV2_STANDARD_2K ;
2449  break;
2460  standard = NTV2_STANDARD_3840x2160p;
2461  break;
2472  standard = NTV2_STANDARD_3840x2160p;
2473  break;
2480  standard = NTV2_STANDARD_3840HFR;
2481  break;
2496  standard = NTV2_STANDARD_4096x2160p;
2497  break;
2508  standard = NTV2_STANDARD_4096x2160p;
2509  break;
2520  standard = NTV2_STANDARD_4096HFR;
2521  break;
2522 
2531  standard = NTV2_STANDARD_7680;
2532  break;
2533 
2544  standard = NTV2_STANDARD_8192;
2545  break;
2546 
2547 
2548 #if defined (_DEBUG)
2549 // Debug builds warn about missing values
2550  case NTV2_FORMAT_UNKNOWN:
2584  break; // Unsupported
2585 #else
2586  default:
2587  break;
2588 #endif
2589  }
2590 
2591  return standard;
2592 }
2593 
2594 
2595 //-------------------------------------------------------------------------------------------------------
2596 // GetSupportedNTV2VideoFormatFromInputVideoFormat
2597 //-------------------------------------------------------------------------------------------------------
2599 {
2600  NTV2VideoFormat result;
2601 
2602  switch (inVideoFormat)
2603  {
2607 
2613 
2617 
2623 
2627 
2633 
2634  default: result = inVideoFormat; break;
2635  }
2636 
2637  return result;
2638 }
2639 
2640 
2641 //-------------------------------------------------------------------------------------------------------
2642 // GetNTV2FrameGeometryFromVideoFormat
2643 //-------------------------------------------------------------------------------------------------------
2645 {
2647 
2648  switch (inVideoFormat)
2649  {
2661  result = NTV2_FG_4x3840x2160;
2662  break;
2663 
2679  result = NTV2_FG_4x4096x2160;
2680  break;
2681 
2714  result = NTV2_FG_4x1920x1080;
2715  break;
2716 
2761  result = NTV2_FG_4x2048x1080;
2762  break;
2763 
2764  case NTV2_FORMAT_2K_1498:
2765  case NTV2_FORMAT_2K_1500:
2766  case NTV2_FORMAT_2K_2398:
2767  case NTV2_FORMAT_2K_2400:
2768  case NTV2_FORMAT_2K_2500:
2769  result = NTV2_FG_2048x1556;
2770  break;
2771 
2791  result = NTV2_FG_1920x1080;
2792  break;
2793 
2812  result = NTV2_FG_2048x1080;
2813  break;
2814 
2815  case NTV2_FORMAT_720p_2398:
2816  case NTV2_FORMAT_720p_2500:
2817  case NTV2_FORMAT_720p_5994:
2818  case NTV2_FORMAT_720p_6000:
2819  case NTV2_FORMAT_720p_5000:
2820  result = NTV2_FG_1280x720;
2821  break;
2822 
2823  case NTV2_FORMAT_525_2398:
2824  case NTV2_FORMAT_525_2400:
2825  case NTV2_FORMAT_525_5994:
2827  result = NTV2_FG_720x486;
2828  break;
2829 
2830  case NTV2_FORMAT_625_5000:
2832  result = NTV2_FG_720x576;
2833  break;
2834 
2835 #if defined (_DEBUG)
2836 // Debug builds warn about missing values
2837  case NTV2_FORMAT_UNKNOWN:
2847  break; // Unsupported
2848 #else
2849  default:
2850  break;
2851 #endif
2852  }
2853 
2854  return result;
2855 }
2856 
2857 
2858 ULWord GetVideoActiveSize (const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inFBFormat, const NTV2VANCMode inVancMode)
2859 {
2860  const NTV2FormatDescriptor fd (inVideoFormat, inFBFormat, inVancMode);
2861  return fd.GetTotalBytes();
2862 } // GetVideoActiveSize
2863 
2864 
2865 // GetVideoWriteSize
2866 // At least in Windows, to get bursting to work between our board and the disk
2867 // system without going through the file manager cache, you need to open the file
2868 // with FILE_FLAG_NO_BUFFERING flag. With this you must do reads and writes
2869 // on 4096 byte boundaries with most modern disk systems. You could actually
2870 // do 512 on some systems though.
2871 // So this function takes in the videoformat and the framebufferformat
2872 // and gets the framesize you need to write to meet this requirement.
2873 //
2874 
2875 ULWord GetVideoWriteSize (const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inFBFormat, const NTV2VANCMode inVancMode)
2876 {
2877  ULWord ulSize (::GetVideoActiveSize (inVideoFormat, inFBFormat, inVancMode));
2878  if (ulSize % 4096)
2879  ulSize = ((ulSize / 4096) + 1) * 4096;
2880  return ulSize;
2881 }
2882 
2883 
2884 // For a given framerate and audiorate, returns how many audio samples there
2885 // will be in a frame's time. cadenceFrame is only used for 5994 or 2997 @ 48k.
2886 // smpte372Enabled indicates that you are doing 1080p60,1080p5994 or 1080p50
2887 // in this mode the boards framerate might be NTV2_FRAMERATE_3000, but since
2888 // 2 links are coming out, the video rate is actually NTV2_FRAMERATE_6000
2889 ULWord GetAudioSamplesPerFrame (const NTV2FrameRate inFrameRate, const NTV2AudioRate inAudioRate, ULWord inCadenceFrame, const bool inIsSMPTE372Enabled)
2890 {
2891  NTV2FrameRate frameRate(inFrameRate);
2892  ULWord audioSamplesPerFrame(0);
2893  inCadenceFrame %= 5;
2894 
2895  if (inIsSMPTE372Enabled)
2896  {
2897  // the video is actually coming out twice as fast as the board rate
2898  // since there are 2 links.
2899  switch (inFrameRate)
2900  {
2901  case NTV2_FRAMERATE_3000: frameRate = NTV2_FRAMERATE_6000; break;
2902  case NTV2_FRAMERATE_2997: frameRate = NTV2_FRAMERATE_5994; break;
2903  case NTV2_FRAMERATE_2500: frameRate = NTV2_FRAMERATE_5000; break;
2904  case NTV2_FRAMERATE_2400: frameRate = NTV2_FRAMERATE_4800; break;
2905  case NTV2_FRAMERATE_2398: frameRate = NTV2_FRAMERATE_4795; break;
2906  default:
2907  break;
2908  }
2909  }
2910 
2911  if (inAudioRate == NTV2_AUDIO_48K)
2912  {
2913  switch (frameRate)
2914  {
2915  case NTV2_FRAMERATE_12000:
2916  audioSamplesPerFrame = 400;
2917  break;
2918  case NTV2_FRAMERATE_11988:
2919  switch (inCadenceFrame)
2920  {
2921  case 0:
2922  case 2:
2923  case 4: audioSamplesPerFrame = 400; break;
2924 
2925  case 1:
2926  case 3: audioSamplesPerFrame = 401; break;
2927  }
2928  break;
2929  case NTV2_FRAMERATE_6000:
2930  audioSamplesPerFrame = 800;
2931  break;
2932  case NTV2_FRAMERATE_5994:
2933  switch (inCadenceFrame)
2934  {
2935  case 0: audioSamplesPerFrame = 800; break;
2936 
2937  case 1:
2938  case 2:
2939  case 3:
2940  case 4: audioSamplesPerFrame = 801; break;
2941  }
2942  break;
2943  case NTV2_FRAMERATE_5000: audioSamplesPerFrame = 1920/2; break;
2944  case NTV2_FRAMERATE_4800: audioSamplesPerFrame = 1000; break;
2945  case NTV2_FRAMERATE_4795: audioSamplesPerFrame = 1001; break;
2946  case NTV2_FRAMERATE_3000: audioSamplesPerFrame = 1600; break;
2947  case NTV2_FRAMERATE_2997:
2948  // depends on cadenceFrame;
2949  switch (inCadenceFrame)
2950  {
2951  case 0:
2952  case 2:
2953  case 4: audioSamplesPerFrame = 1602; break;
2954 
2955  case 1:
2956  case 3: audioSamplesPerFrame = 1601; break;
2957  }
2958  break;
2959  case NTV2_FRAMERATE_2500: audioSamplesPerFrame = 1920; break;
2960  case NTV2_FRAMERATE_2400: audioSamplesPerFrame = 2000; break;
2961  case NTV2_FRAMERATE_2398: audioSamplesPerFrame = 2002; break;
2962  case NTV2_FRAMERATE_1500: audioSamplesPerFrame = 3200; break;
2963  case NTV2_FRAMERATE_1498:
2964  // depends on cadenceFrame;
2965  switch (inCadenceFrame)
2966  {
2967  case 0: audioSamplesPerFrame = 3204; break;
2968 
2969  case 1:
2970  case 2:
2971  case 3:
2972  case 4: audioSamplesPerFrame = 3203; break;
2973  }
2974  break;
2975  #if !defined(NTV2_DEPRECATE_16_0)
2976  case NTV2_FRAMERATE_1900: // Not supported yet
2977  case NTV2_FRAMERATE_1898: // Not supported yet
2978  case NTV2_FRAMERATE_1800: // Not supported yet
2979  case NTV2_FRAMERATE_1798: // Not supported yet
2980  #endif
2981  case NTV2_FRAMERATE_UNKNOWN:
2982  case NTV2_NUM_FRAMERATES:
2983  audioSamplesPerFrame = 0;
2984  break;
2985  }
2986  }
2987  else if (inAudioRate == NTV2_AUDIO_96K)
2988  {
2989  switch (frameRate)
2990  {
2991  case NTV2_FRAMERATE_12000:
2992  audioSamplesPerFrame = 800;
2993  break;
2994  case NTV2_FRAMERATE_11988:
2995  switch (inCadenceFrame)
2996  {
2997  case 0:
2998  case 1:
2999  case 2:
3000  case 3: audioSamplesPerFrame = 801; break; // Fixed in SDK 16.2, was incorrect (901) before 16.2
3001 
3002  case 4: audioSamplesPerFrame = 800; break;
3003  }
3004  break;
3005  case NTV2_FRAMERATE_6000: audioSamplesPerFrame = 800*2; break;
3006  case NTV2_FRAMERATE_5994:
3007  switch (inCadenceFrame)
3008  {
3009  case 0:
3010  case 2:
3011  case 4: audioSamplesPerFrame = 1602; break;
3012 
3013  case 1:
3014  case 3: audioSamplesPerFrame = 1601; break;
3015  }
3016  break;
3017  case NTV2_FRAMERATE_5000: audioSamplesPerFrame = 1920; break;
3018  case NTV2_FRAMERATE_4800: audioSamplesPerFrame = 2000; break;
3019  case NTV2_FRAMERATE_4795: audioSamplesPerFrame = 2002; break;
3020  case NTV2_FRAMERATE_3000: audioSamplesPerFrame = 1600*2; break;
3021  case NTV2_FRAMERATE_2997:
3022  // depends on cadenceFrame;
3023  switch (inCadenceFrame)
3024  {
3025  case 0: audioSamplesPerFrame = 3204; break;
3026 
3027  case 1:
3028  case 2:
3029  case 3:
3030  case 4: audioSamplesPerFrame = 3203; break;
3031  }
3032  break;
3033  case NTV2_FRAMERATE_2500: audioSamplesPerFrame = 1920*2; break;
3034  case NTV2_FRAMERATE_2400: audioSamplesPerFrame = 2000*2; break;
3035  case NTV2_FRAMERATE_2398: audioSamplesPerFrame = 2002*2; break;
3036  case NTV2_FRAMERATE_1500: audioSamplesPerFrame = 3200*2; break;
3037  case NTV2_FRAMERATE_1498:
3038  // depends on cadenceFrame;
3039  switch (inCadenceFrame)
3040  {
3041  case 0: audioSamplesPerFrame = 3204*2; break;
3042 
3043  case 1:
3044  case 2:
3045  case 3:
3046  case 4: audioSamplesPerFrame = 3203*2; break;
3047  }
3048  break;
3049  #if !defined(NTV2_DEPRECATE_16_0)
3050  case NTV2_FRAMERATE_1900: // Not supported yet
3051  case NTV2_FRAMERATE_1898: // Not supported yet
3052  case NTV2_FRAMERATE_1800: // Not supported yet
3053  case NTV2_FRAMERATE_1798: // Not supported yet
3054  #endif
3055  case NTV2_FRAMERATE_UNKNOWN:
3056  case NTV2_NUM_FRAMERATES:
3057  audioSamplesPerFrame = 0*2; //haha
3058  break;
3059  }
3060  }
3061  else if (inAudioRate == NTV2_AUDIO_192K)
3062  {
3063  switch (frameRate)
3064  {
3065  case NTV2_FRAMERATE_12000:
3066  audioSamplesPerFrame = 1600;
3067  break;
3068  case NTV2_FRAMERATE_11988:
3069  switch (inCadenceFrame)
3070  {
3071  case 0:
3072  case 2:
3073  case 4: audioSamplesPerFrame = 1602; break;
3074 
3075  case 1:
3076  case 3: audioSamplesPerFrame = 1601; break;
3077  }
3078  break;
3079  case NTV2_FRAMERATE_6000:
3080  audioSamplesPerFrame = 3200;
3081  break;
3082  case NTV2_FRAMERATE_5994:
3083  switch (inCadenceFrame)
3084  {
3085  case 0: audioSamplesPerFrame = 3204; break;
3086 
3087  case 1:
3088  case 2:
3089  case 3:
3090  case 4: audioSamplesPerFrame = 3203; break;
3091  }
3092  break;
3093  case NTV2_FRAMERATE_5000: audioSamplesPerFrame = 3840; break;
3094  case NTV2_FRAMERATE_4800: audioSamplesPerFrame = 4000; break;
3095  case NTV2_FRAMERATE_4795: audioSamplesPerFrame = 4004; break;
3096  case NTV2_FRAMERATE_3000: audioSamplesPerFrame = 6400; break;
3097  case NTV2_FRAMERATE_2997:
3098  // depends on cadenceFrame;
3099  switch (inCadenceFrame)
3100  {
3101  case 0:
3102  case 1: audioSamplesPerFrame = 6407; break;
3103 
3104  case 2:
3105  case 3:
3106  case 4: audioSamplesPerFrame = 6406; break;
3107  }
3108  break;
3109  case NTV2_FRAMERATE_2500: audioSamplesPerFrame = 7680; break;
3110  case NTV2_FRAMERATE_2400: audioSamplesPerFrame = 8000; break;
3111  case NTV2_FRAMERATE_2398: audioSamplesPerFrame = 8008; break;
3112  case NTV2_FRAMERATE_1500: audioSamplesPerFrame = 12800; break;
3113  case NTV2_FRAMERATE_1498:
3114  // depends on cadenceFrame;
3115  switch (inCadenceFrame)
3116  {
3117  case 0:
3118  case 1:
3119  case 2:
3120  case 3: audioSamplesPerFrame = 12813; break;
3121 
3122  case 4: audioSamplesPerFrame = 12812; break;
3123  }
3124  break;
3125 #if !defined(NTV2_DEPRECATE_16_0)
3126  case NTV2_FRAMERATE_1900: // Not supported yet
3127  case NTV2_FRAMERATE_1898: // Not supported yet
3128  case NTV2_FRAMERATE_1800: // Not supported yet
3129  case NTV2_FRAMERATE_1798: // Not supported yet
3130 #endif
3131  case NTV2_FRAMERATE_UNKNOWN:
3132  case NTV2_NUM_FRAMERATES:
3133  audioSamplesPerFrame = 0*2; //haha
3134  break;
3135  }
3136  }
3137 
3138  return audioSamplesPerFrame;
3139 }
3140 
3141 
3142 // For a given framerate and audiorate and ending frame number (non-inclusive), returns the total number of audio samples over
3143 // the range of video frames starting at frame number zero up to and not including the passed in frame number, inFrameNumNonInclusive.
3144 // Utilizes cadence patterns in function immediately above, GetAudioSamplesPerFrame().
3145 // No smpte372Enabled support
3146 LWord64 GetTotalAudioSamplesFromFrameNbrZeroUpToFrameNbr (const NTV2FrameRate inFrameRate, const NTV2AudioRate inAudioRate, const ULWord inFrameNumNonInclusive)
3147 {
3148  LWord64 numTotalAudioSamples;
3149  LWord64 numAudioSamplesFromWholeGroups;
3150 
3151  ULWord numWholeGroupsOfFive;
3152  ULWord numAudioSamplesFromRemainder;
3153  ULWord remainder;
3154 
3155  numWholeGroupsOfFive = inFrameNumNonInclusive / 5;
3156  remainder = inFrameNumNonInclusive % 5;
3157 
3158  numTotalAudioSamples = 0;
3159  numAudioSamplesFromWholeGroups = 0;
3160  numAudioSamplesFromRemainder = 0;
3161 
3162  if (inAudioRate == NTV2_AUDIO_48K)
3163  {
3164  switch (inFrameRate)
3165  {
3166  case NTV2_FRAMERATE_12000:
3167  numTotalAudioSamples = 400 * inFrameNumNonInclusive;
3168  break;
3169  case NTV2_FRAMERATE_11988:
3170  numAudioSamplesFromWholeGroups = ((2*401) + (3*400)) * numWholeGroupsOfFive;
3171  numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((400 * remainder) + remainder/2);
3172  numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3173  break;
3174  case NTV2_FRAMERATE_6000:
3175  numTotalAudioSamples = 800 * inFrameNumNonInclusive;
3176  break;
3177  case NTV2_FRAMERATE_5994:
3178  // depends on cadenceFrame;
3179  numAudioSamplesFromWholeGroups = ((1*800) + (4*801)) * numWholeGroupsOfFive;
3180  numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((801 * remainder) - 1);
3181  numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3182  break;
3183  case NTV2_FRAMERATE_5000:
3184  numTotalAudioSamples = 1920/2 * inFrameNumNonInclusive;
3185  break;
3186  case NTV2_FRAMERATE_4800:
3187  numTotalAudioSamples = 1000 * inFrameNumNonInclusive;
3188  break;
3189  case NTV2_FRAMERATE_4795:
3190  numTotalAudioSamples = 1001 * inFrameNumNonInclusive;
3191  break;
3192  case NTV2_FRAMERATE_3000:
3193  numTotalAudioSamples = 1600 * inFrameNumNonInclusive;
3194  break;
3195  case NTV2_FRAMERATE_2997:
3196  // depends on cadenceFrame;
3197  numAudioSamplesFromWholeGroups = ((3*1602) + (2*1601)) * numWholeGroupsOfFive;
3198  numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((1602 * remainder) - remainder/2);
3199  numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3200  break;
3201  case NTV2_FRAMERATE_2500:
3202  numTotalAudioSamples = 1920 * inFrameNumNonInclusive;
3203  break;
3204  case NTV2_FRAMERATE_2400:
3205  numTotalAudioSamples = 2000 * inFrameNumNonInclusive;
3206  break;
3207  case NTV2_FRAMERATE_2398:
3208  numTotalAudioSamples = 2002 * inFrameNumNonInclusive;
3209  break;
3210  case NTV2_FRAMERATE_1500:
3211  numTotalAudioSamples = 3200 * inFrameNumNonInclusive;
3212  break;
3213  case NTV2_FRAMERATE_1498:
3214  // depends on cadenceFrame;
3215  numAudioSamplesFromWholeGroups = ((1*3204) + (4*3203)) * numWholeGroupsOfFive;
3216  numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((3203 * remainder) + 1);
3217  numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3218  break;
3219 #if !defined(NTV2_DEPRECATE_16_0)
3220  case NTV2_FRAMERATE_1900: // Not supported yet
3221  case NTV2_FRAMERATE_1898: // Not supported yet
3222  case NTV2_FRAMERATE_1800: // Not supported yet
3223  case NTV2_FRAMERATE_1798: // Not supported yet
3224 #endif
3225  case NTV2_FRAMERATE_UNKNOWN:
3226  case NTV2_NUM_FRAMERATES:
3227  numTotalAudioSamples = 0;
3228  break;
3229  }
3230  }
3231  else if (inAudioRate == NTV2_AUDIO_96K)
3232  {
3233  switch (inFrameRate)
3234  {
3235  case NTV2_FRAMERATE_12000:
3236  numTotalAudioSamples = 800 * inFrameNumNonInclusive;
3237  break;
3238  case NTV2_FRAMERATE_11988:
3239  numAudioSamplesFromWholeGroups = ((4*801) + (1*800)) * numWholeGroupsOfFive;
3240  numAudioSamplesFromRemainder = (remainder == 0) ? 0 : (801 * remainder);
3241  numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3242  break;
3243  case NTV2_FRAMERATE_6000:
3244  numTotalAudioSamples = (800*2) * inFrameNumNonInclusive;
3245  break;
3246  case NTV2_FRAMERATE_5994:
3247  numAudioSamplesFromWholeGroups = ((3*1602) + (2*1601)) * numWholeGroupsOfFive;
3248  numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((1602 * remainder) - remainder/2);
3249  numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3250  break;
3251  case NTV2_FRAMERATE_5000:
3252  numTotalAudioSamples = 1920 * inFrameNumNonInclusive;
3253  break;
3254  case NTV2_FRAMERATE_4800:
3255  numTotalAudioSamples = 2000 * inFrameNumNonInclusive;
3256  break;
3257  case NTV2_FRAMERATE_4795:
3258  numTotalAudioSamples = 2002 * inFrameNumNonInclusive;
3259  break;
3260  case NTV2_FRAMERATE_3000:
3261  numTotalAudioSamples = (1600*2) * inFrameNumNonInclusive;
3262  break;
3263  case NTV2_FRAMERATE_2997:
3264  // depends on cadenceFrame;
3265  numAudioSamplesFromWholeGroups = ((1*3204) + (4*3203)) * numWholeGroupsOfFive;
3266  numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((3203 * remainder) + 1);
3267  numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3268  break;
3269  case NTV2_FRAMERATE_2500:
3270  numTotalAudioSamples = (1920*2) * inFrameNumNonInclusive;
3271  break;
3272  case NTV2_FRAMERATE_2400:
3273  numTotalAudioSamples = (2000*2) * inFrameNumNonInclusive;
3274  break;
3275  case NTV2_FRAMERATE_2398:
3276  numTotalAudioSamples = (2002*2) * inFrameNumNonInclusive;
3277  break;
3278  case NTV2_FRAMERATE_1500:
3279  numTotalAudioSamples = (3200*2) * inFrameNumNonInclusive;
3280  break;
3281  case NTV2_FRAMERATE_1498:
3282  // depends on cadenceFrame;
3283  numAudioSamplesFromWholeGroups = ((1*3204*2) + (4*3203*2)) * numWholeGroupsOfFive;
3284  numAudioSamplesFromRemainder = (remainder == 0) ? 0 : (((3203*2) * remainder) + 2);
3285  numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3286  break;
3287 #if !defined(NTV2_DEPRECATE_16_0)
3288  case NTV2_FRAMERATE_1900: // Not supported yet
3289  case NTV2_FRAMERATE_1898: // Not supported yet
3290  case NTV2_FRAMERATE_1800: // Not supported yet
3291  case NTV2_FRAMERATE_1798: // Not supported yet
3292 #endif
3293  case NTV2_FRAMERATE_UNKNOWN:
3294  case NTV2_NUM_FRAMERATES:
3295  numTotalAudioSamples = 0*2; //haha
3296  break;
3297  }
3298  }
3299 
3300  return numTotalAudioSamples;
3301 }
3302 
3303 double GetAudioSamplesPerSecond (const NTV2AudioRate inAudioRate)
3304 {
3305  static const ULWord sSamplesPerSecond [] = {48000, 96000, 192000, 0};
3306  if (!NTV2_IS_VALID_AUDIO_RATE(inAudioRate))
3307  return 0.00;
3308  return double(sSamplesPerSecond[inAudioRate]);
3309 }
3310 
3311 
3312 // For a given sequenceRate and playRate, given the cadenceFrame it returns how many times we
3313 // repeate the frame to output varicam. If the result is zero then this is an unsupported varicam
3314 // rate.
3315 ULWord GetVaricamRepeatCount (const NTV2FrameRate inSequenceRate, const NTV2FrameRate inPlayRate, const ULWord inCadenceFrame)
3316 {
3317  ULWord result = 0;
3318 
3319  switch (inPlayRate)
3320  {
3321  case NTV2_FRAMERATE_6000:
3322  switch (inSequenceRate)
3323  {
3324  case NTV2_FRAMERATE_1500:
3325  result = 4;
3326  break;
3327  case NTV2_FRAMERATE_2400: // 24 -> 60 2:3|2:3|2:3 ...
3328  //inCadenceFrame %= 2;
3329  switch (inCadenceFrame % 2)
3330  {
3331  case 0:
3332  result = 2;
3333  break;
3334  case 1:
3335  result = 3;
3336  break;
3337  }
3338  break;
3339  case NTV2_FRAMERATE_2500: // 25 -> 60 2:3:2:3:2|2:3:2:3:2 ...
3340  //inCadenceFrame %= 5;
3341  switch (inCadenceFrame % 5)
3342  {
3343  case 0:
3344  case 2:
3345  case 4:
3346  result = 2;
3347  break;
3348  case 1:
3349  case 3:
3350  result = 3;
3351  break;
3352  }
3353  break;
3354  case NTV2_FRAMERATE_3000: // 30 -> 60 2|2|2|2|2|2 ...
3355  result = 2;
3356  break;
3357  case NTV2_FRAMERATE_4800: // 48 -> 60 2:1:1:1|2:1:1:1 ...
3358  //inCadenceFrame %= 4;
3359  switch (inCadenceFrame % 4)
3360  {
3361  case 0:
3362  result = 2;
3363  break;
3364  case 1:
3365  case 2:
3366  case 3:
3367  result = 1;
3368  break;
3369  }
3370  break;
3371  case NTV2_FRAMERATE_5000: // 50 -> 60 2:1:1:1:1|2:1:1:1:1: ...
3372  //inCadenceFrame %= 5;
3373  switch (inCadenceFrame % 5)
3374  {
3375  case 0:
3376  result = 2;
3377  break;
3378  case 1:
3379  case 2:
3380  case 3:
3381  case 4:
3382  result = 1;
3383  break;
3384  }
3385  break;
3386  case NTV2_FRAMERATE_6000: // 60 -> 60 1|1|1|1|1|1 ...
3387  result = 1;
3388  break;
3389  default:
3390  break;
3391  }
3392  break;
3393 
3394  case NTV2_FRAMERATE_5994:
3395  switch (inSequenceRate)
3396  {
3397  case NTV2_FRAMERATE_1498:
3398  result = 4;
3399  break;
3400  case NTV2_FRAMERATE_2398: // 23.98 -> 59.94 2:3|2:3|2:3 ...
3401  //inCadenceFrame %= 2;
3402  switch (inCadenceFrame % 2)
3403  {
3404  case 0:
3405  result = 2;
3406  break;
3407  case 1:
3408  result = 3;
3409  break;
3410  }
3411  break;
3412  case NTV2_FRAMERATE_2997: // 29.97 -> 59.94 2|2|2|2|2|2 ...
3413  result = 2;
3414  break;
3415  case NTV2_FRAMERATE_4795: // 47.95 -> 59.94 2:1:1:1|2:1:1:1 ...
3416  //inCadenceFrame %= 4;
3417  switch (inCadenceFrame % 4)
3418  {
3419  case 0:
3420  result = 2;
3421  break;
3422  case 1:
3423  case 2:
3424  case 3:
3425  result = 1;
3426  break;
3427  }
3428  break;
3429  case NTV2_FRAMERATE_5994: // 59.94 -> 59.94 1|1|1|1|1|1 ...
3430  result = 1;
3431  break;
3432  default:
3433  break;
3434  }
3435  break;
3436 
3437  case NTV2_FRAMERATE_5000:
3438  switch (inSequenceRate)
3439  {
3440  case NTV2_FRAMERATE_2500: // 25 -> 50 2|2|2|2|2| ...
3441  result = 2;
3442  break;
3443  default:
3444  break;
3445  }
3446  break;
3447 
3448  default:
3449  break;
3450  }
3451  return result;
3452 }
3453 
3455 {
3456  switch (inFrameRate)
3457  {
3458  case NTV2_FRAMERATE_12000: return 12000;
3459  case NTV2_FRAMERATE_11988: return 11988;
3460  case NTV2_FRAMERATE_6000: return 6000;
3461  case NTV2_FRAMERATE_5994: return 5994;
3462  case NTV2_FRAMERATE_5000: return 5000;
3463  case NTV2_FRAMERATE_4800: return 4800;
3464  case NTV2_FRAMERATE_4795: return 4795;
3465  case NTV2_FRAMERATE_3000: return 3000;
3466  case NTV2_FRAMERATE_2997: return 2997;
3467  case NTV2_FRAMERATE_2500: return 2500;
3468  case NTV2_FRAMERATE_2400: return 2400;
3469  case NTV2_FRAMERATE_2398: return 2398;
3470  case NTV2_FRAMERATE_1500: return 1500;
3471  case NTV2_FRAMERATE_1498: return 1498;
3472 #if !defined(NTV2_DEPRECATE_16_0)
3473  case NTV2_FRAMERATE_1900: return 1900;
3474  case NTV2_FRAMERATE_1898: return 1898;
3475  case NTV2_FRAMERATE_1800: return 1800;
3476  case NTV2_FRAMERATE_1798: return 1798;
3477 #endif
3478  case NTV2_FRAMERATE_UNKNOWN: break;
3479 #if defined(_DEBUG)
3480  case NTV2_NUM_FRAMERATES: break;
3481 #else
3482  default: break;
3483 #endif
3484  }
3485  return 0;
3486 }
3487 
3488 // GetFrameRateFromScale(long scale, long duration, NTV2FrameRate playFrameRate)
3489 // For a given scale value it returns the associated frame rate. This routine is
3490 // used to calculate and decipher the sequence frame rate.
3491 NTV2FrameRate GetFrameRateFromScale (long scale, long duration, NTV2FrameRate playFrameRate)
3492 {
3494 
3495  // Generally the duration is 100 and in that event the scale will tell us for sure what the
3496  // sequence rate is.
3497  if (duration == 100)
3498  {
3499  switch (scale)
3500  {
3501  case 12000: result = NTV2_FRAMERATE_12000; break;
3502  case 11988: result = NTV2_FRAMERATE_11988; break;
3503  case 6000: result = NTV2_FRAMERATE_6000; break;
3504  case 5994: result = NTV2_FRAMERATE_5994; break;
3505  case 5000: result = NTV2_FRAMERATE_5000; break;
3506  case 4800: result = NTV2_FRAMERATE_4800; break;
3507  case 4795: result = NTV2_FRAMERATE_4795; break;
3508  case 3000: result = NTV2_FRAMERATE_3000; break;
3509  case 2997: result = NTV2_FRAMERATE_2997; break;
3510  case 2500: result = NTV2_FRAMERATE_2500; break;
3511  case 2400: result = NTV2_FRAMERATE_2400; break;
3512  case 2398: result = NTV2_FRAMERATE_2398; break;
3513  case 1500: result = NTV2_FRAMERATE_1500; break;
3514  case 1498: result = NTV2_FRAMERATE_1498; break;
3515  }
3516  }
3517  else if (duration == 0)
3518  {
3519  result = playFrameRate;
3520  }
3521  else
3522  {
3523  float scaleFloat = scale / duration * float(100.0);
3524  long scaleInt = long(scaleFloat);
3525 
3526  // In this case we need to derive the sequence rate based on scale, duration and what
3527  // our playback rate is. So first we break down what we might expect based on our
3528  // playback rate. This gives us some room to look at values that are returned and
3529  // which are not exact based on rounding errors. We can break this check up into two
3530  // camps because the assumption is we don't have to worry about playing back 23.98 fps
3531  // sequence on a 60 fps output and conversly playing back 30 fps sequences on a 59.94
3532  // fps output.
3533  switch (playFrameRate)
3534  {
3535  case NTV2_FRAMERATE_12000:
3536  case NTV2_FRAMERATE_6000:
3537  case NTV2_FRAMERATE_5000:
3538  case NTV2_FRAMERATE_4800:
3539  case NTV2_FRAMERATE_3000:
3540  case NTV2_FRAMERATE_2500:
3541  case NTV2_FRAMERATE_2400:
3542  case NTV2_FRAMERATE_1500:
3543  if (scaleInt <= 1500 + 100)
3544  result = NTV2_FRAMERATE_1500;
3545  else if (scaleInt <= 2400 + 50)
3546  result = NTV2_FRAMERATE_2400;
3547  else if (scaleInt <= 2500 + 100)
3548  result = NTV2_FRAMERATE_2500;
3549  else if (scaleInt <= 3000 + 100)
3550  result = NTV2_FRAMERATE_3000;
3551  else if (scaleInt <= 4800 + 100)
3552  result = NTV2_FRAMERATE_4800;
3553  else if (scaleInt <= 5000 + 100)
3554  result = NTV2_FRAMERATE_5000;
3555  else if (scaleInt <= 6000 + 100)
3556  result = NTV2_FRAMERATE_6000;
3557  else
3558  result = NTV2_FRAMERATE_12000;
3559  break;
3560 
3561  case NTV2_FRAMERATE_11988:
3562  case NTV2_FRAMERATE_5994:
3563  case NTV2_FRAMERATE_4795:
3564  case NTV2_FRAMERATE_2997:
3565  case NTV2_FRAMERATE_2398:
3566  case NTV2_FRAMERATE_1498:
3567  if (scaleInt <= 1498 + 100) // add some fudge factor for rounding errors
3568  result = NTV2_FRAMERATE_1498;
3569  else if (scaleInt <= 2398 + 100)
3570  result = NTV2_FRAMERATE_2398;
3571  else if (scaleInt <= 2997 + 100)
3572  result = NTV2_FRAMERATE_2997;
3573  else if (scaleInt <= 4795 + 100)
3574  result = NTV2_FRAMERATE_4795;
3575  else if (scaleInt <= 5994 + 100)
3576  result = NTV2_FRAMERATE_5994;
3577  else
3578  result = NTV2_FRAMERATE_11988;
3579  break;
3580  default:
3581  break;
3582  }
3583  }
3584  return result;
3585 }
3586 
3587 
3589 {
3590  if (inDenominator == 100)
3591  switch (inNumerator)
3592  {
3593  case 12000: return NTV2_FRAMERATE_12000;
3594  case 11988: return NTV2_FRAMERATE_11988;
3595  case 6000: return NTV2_FRAMERATE_6000;
3596  case 5994: return NTV2_FRAMERATE_5994;
3597  case 5000: return NTV2_FRAMERATE_5000;
3598  case 4800: return NTV2_FRAMERATE_4800;
3599  case 4795: return NTV2_FRAMERATE_4795;
3600  case 3000: return NTV2_FRAMERATE_3000;
3601  case 2997: return NTV2_FRAMERATE_2997;
3602  case 2500: return NTV2_FRAMERATE_2500;
3603  case 2400: return NTV2_FRAMERATE_2400;
3604  case 2398: return NTV2_FRAMERATE_2398;
3605  case 1500: return NTV2_FRAMERATE_1500;
3606  case 1498: return NTV2_FRAMERATE_1498;
3607  default: break;
3608  }
3609  else
3610  {
3611  const ULWord denominator(inDenominator == 1 ? inDenominator * 1000ULL : inDenominator);
3612  const ULWord numerator(inDenominator == 1 ? inNumerator * 1000ULL : inNumerator);
3613  switch (numerator)
3614  {
3615  case 120000: return (denominator == 1000) ? NTV2_FRAMERATE_12000 : NTV2_FRAMERATE_11988;
3616  case 60000: return (denominator == 1000) ? NTV2_FRAMERATE_6000 : NTV2_FRAMERATE_5994;
3617  case 50000: return (denominator == 1000) ? NTV2_FRAMERATE_5000 : NTV2_FRAMERATE_UNKNOWN;
3618  case 48000: return (denominator == 1000) ? NTV2_FRAMERATE_4800 : NTV2_FRAMERATE_4795;
3619  case 30000: return (denominator == 1000) ? NTV2_FRAMERATE_3000 : NTV2_FRAMERATE_2997;
3620  case 25000: return (denominator == 1000) ? NTV2_FRAMERATE_2500 : NTV2_FRAMERATE_UNKNOWN;
3621  case 24000: return (denominator == 1000) ? NTV2_FRAMERATE_2400 : NTV2_FRAMERATE_2398;
3622  case 15000: return (denominator == 1000) ? NTV2_FRAMERATE_1500 : NTV2_FRAMERATE_1498;
3623  default: break;
3624  }
3625  }
3626  return NTV2_FRAMERATE_UNKNOWN;
3627 }
3628 
3629 
3631 {
3633  switch (videoFormat)
3634  {
3635 
3636  case NTV2_FORMAT_2K_1498:
3637  frameRate = NTV2_FRAMERATE_1498;
3638  break;
3639 
3640  case NTV2_FORMAT_2K_1500:
3641  frameRate = NTV2_FRAMERATE_1500;
3642  break;
3643 
3644  case NTV2_FORMAT_525_2398:
3645  case NTV2_FORMAT_720p_2398:
3651  case NTV2_FORMAT_2K_2398:
3665  frameRate = NTV2_FRAMERATE_2398;
3666  break;
3667 
3668  case NTV2_FORMAT_525_2400:
3674  case NTV2_FORMAT_2K_2400:
3688  frameRate = NTV2_FRAMERATE_2400;
3689  break;
3690 
3691  case NTV2_FORMAT_625_5000:
3693  case NTV2_FORMAT_720p_2500:
3701  case NTV2_FORMAT_2K_2500:
3718  frameRate = NTV2_FRAMERATE_2500;
3719  break;
3720 
3721  case NTV2_FORMAT_525_5994:
3745  frameRate = NTV2_FRAMERATE_2997;
3746  break;
3747 
3770  frameRate = NTV2_FRAMERATE_3000;
3771  break;
3772 
3777  frameRate = NTV2_FRAMERATE_4795;
3778  break;
3779 
3784  frameRate = NTV2_FRAMERATE_4800;
3785  break;
3786 
3787  case NTV2_FORMAT_720p_5000:
3796  frameRate = NTV2_FRAMERATE_5000;
3797  break;
3798 
3799  case NTV2_FORMAT_720p_5994:
3808  frameRate = NTV2_FRAMERATE_5994;
3809  break;
3810 
3811  case NTV2_FORMAT_720p_6000:
3820  frameRate = NTV2_FRAMERATE_6000;
3821  break;
3822 
3825  frameRate = NTV2_FRAMERATE_11988;
3826  break;
3829  frameRate = NTV2_FRAMERATE_12000;
3830  break;
3831 
3832 #if defined (_DEBUG)
3833  // Debug builds warn about missing values
3834  case NTV2_FORMAT_UNKNOWN:
3844  break;
3845 #else
3846  default:
3847  break; // Unsupported -- fail
3848 #endif
3849  }
3850 
3851  return frameRate;
3852 
3853 } // GetNTV2FrameRateFromVideoFormat
3854 
3855 
3857 {
3858  switch (inFrameGeometry)
3859  {
3860  case NTV2_FG_1920x1080: // 1080i, 1080p
3861  case NTV2_FG_1280x720: // 720p
3862  case NTV2_FG_720x486: // ntsc 525i, 525p60
3863  case NTV2_FG_720x576: // pal 625i
3864  case NTV2_FG_2048x1080: // 2k1080p
3865  case NTV2_FG_2048x1556: // 2k1556psf
3866  case NTV2_FG_4x1920x1080: // UHD
3867  case NTV2_FG_4x2048x1080: // 4K
3868  case NTV2_FG_4x3840x2160:
3869  case NTV2_FG_4x4096x2160:
3870  return inFrameGeometry; // No change, already normalized
3871 
3872  // 525i
3873  case NTV2_FG_720x508: return NTV2_FG_720x486; // 720x486 + tall vanc
3874  case NTV2_FG_720x514: return NTV2_FG_720x486; // 720x486 + taller vanc (extra-wide ntsc)
3875 
3876  // 625i
3877  case NTV2_FG_720x598: return NTV2_FG_720x576; // pal 625i + tall vanc
3878  case NTV2_FG_720x612: return NTV2_FG_720x576; // 720x576 + taller vanc (extra-wide pal)
3879 
3880  // 720p
3881  case NTV2_FG_1280x740: return NTV2_FG_1280x720; // 1280x720 + tall vanc
3882 
3883  // 1080
3884  case NTV2_FG_1920x1112: return NTV2_FG_1920x1080; // 1920x1080 + tall vanc
3885  case NTV2_FG_1920x1114: return NTV2_FG_1920x1080; // 1920x1080 + taller vanc
3886 
3887  // 2kx1080
3888  case NTV2_FG_2048x1112: return NTV2_FG_2048x1080; // 2048x1080 + tall vanc
3889  case NTV2_FG_2048x1114: return NTV2_FG_2048x1080; // 2048x1080 + taller vanc
3890 
3891  // 2kx1556 film
3892  case NTV2_FG_2048x1588: return NTV2_FG_2048x1556; // 2048x1556 + tall vanc
3893 
3894 #if defined (_DEBUG)
3895  case NTV2_FG_INVALID: break;
3896 #else
3897  default: break;
3898 #endif
3899  }
3900  return NTV2_FG_INVALID; // fail
3901 }
3902 
3903 
3905 {
3906  if (!NTV2_IS_VALID_VANCMODE(inVancMode))
3907  return NTV2_FG_INVALID; // Invalid vanc mode
3908  if (!NTV2_IS_VALID_NTV2FrameGeometry(inFrameGeometry))
3909  return NTV2_FG_INVALID; // Invalid FG
3910  if (!NTV2_IS_VANCMODE_ON(inVancMode))
3911  return ::GetNormalizedFrameGeometry(inFrameGeometry); // Return normalized
3912 
3913  switch (inFrameGeometry)
3914  {
3915  case NTV2_FG_1920x1080: // 1920x1080 ::NTV2_VANCMODE_OFF
3916  case NTV2_FG_1920x1112: // 1920x1080 ::NTV2_VANCMODE_TALL
3917  case NTV2_FG_1920x1114: // 1920x1080 ::NTV2_VANCMODE_TALLER
3919 
3920  case NTV2_FG_1280x720: // 1280x720, ::NTV2_VANCMODE_OFF
3921  case NTV2_FG_1280x740: // 1280x720 ::NTV2_VANCMODE_TALL
3922  return NTV2_FG_1280x740;
3923 
3924  case NTV2_FG_720x486: // 720x486 ::NTV2_VANCMODE_OFF
3925  case NTV2_FG_720x508: // 720x486 ::NTV2_VANCMODE_TALL
3926  case NTV2_FG_720x514: // 720x486 ::NTV2_VANCMODE_TALLER
3927  return NTV2_IS_VANCMODE_TALL(inVancMode) ? NTV2_FG_720x508 : NTV2_FG_720x514;
3928 
3929  case NTV2_FG_720x576: // 720x576 ::NTV2_VANCMODE_OFF
3930  case NTV2_FG_720x598: // 720x576 ::NTV2_VANCMODE_TALL
3931  case NTV2_FG_720x612: // 720x576 ::NTV2_VANCMODE_TALLER
3932  return NTV2_IS_VANCMODE_TALL(inVancMode) ? NTV2_FG_720x598 : NTV2_FG_720x612;
3933 
3934  case NTV2_FG_2048x1080: // 2048x1080 ::NTV2_VANCMODE_OFF
3935  case NTV2_FG_2048x1112: // 2048x1080 ::NTV2_VANCMODE_TALL
3936  case NTV2_FG_2048x1114: // 2048x1080 ::NTV2_VANCMODE_TALLER
3938 
3939  case NTV2_FG_2048x1556: // 2048x1556 film ::NTV2_VANCMODE_OFF
3940  case NTV2_FG_2048x1588: // 2048x1556 film ::NTV2_VANCMODE_TALL
3941  return NTV2_FG_2048x1588;
3942 
3943  case NTV2_FG_4x1920x1080: // 3840x2160 ::NTV2_VANCMODE_OFF
3944  case NTV2_FG_4x2048x1080: // 4096x2160 ::NTV2_VANCMODE_OFF
3945  case NTV2_FG_4x3840x2160:
3946  case NTV2_FG_4x4096x2160:
3947  return inFrameGeometry; // no tall or taller geometries!
3948 #if defined (_DEBUG)
3949  case NTV2_FG_INVALID: break;
3950 #else
3951  default: break;
3952 #endif
3953  }
3954  return NTV2_FG_INVALID; // fail
3955 }
3956 
3958 {
3960  if (::GetNTV2FrameGeometryWidth(fg) == inFD.width())
3961  if (::GetNTV2FrameGeometryHeight(fg) == inFD.height())
3962  return fg;
3963  return NTV2_FG_INVALID;
3964 }
3965 
3967 {
3968  switch (inFG)
3969  {
3970  case NTV2_FG_1920x1080: // 1920x1080 ::NTV2_VANCMODE_OFF
3971  case NTV2_FG_1920x1112: // 1920x1080 ::NTV2_VANCMODE_TALL
3972  case NTV2_FG_1920x1114: // 1920x1080 ::NTV2_VANCMODE_TALLER
3973  case NTV2_FG_1280x720: // 1280x720, ::NTV2_VANCMODE_OFF
3974  case NTV2_FG_1280x740: // 1280x720 ::NTV2_VANCMODE_TALL
3975  case NTV2_FG_720x486: // 720x486 ::NTV2_VANCMODE_OFF
3976  case NTV2_FG_720x508: // 720x486 ::NTV2_VANCMODE_TALL
3977  case NTV2_FG_720x514: // 720x486 ::NTV2_VANCMODE_TALLER
3978  case NTV2_FG_720x576: // 720x576 ::NTV2_VANCMODE_OFF
3979  case NTV2_FG_720x598: // 720x576 ::NTV2_VANCMODE_TALL
3980  case NTV2_FG_720x612: // 720x576 ::NTV2_VANCMODE_TALLER
3981  case NTV2_FG_2048x1080: // 2048x1080 ::NTV2_VANCMODE_OFF
3982  case NTV2_FG_2048x1112: // 2048x1080 ::NTV2_VANCMODE_TALL
3983  case NTV2_FG_2048x1114: // 2048x1080 ::NTV2_VANCMODE_TALLER
3984  case NTV2_FG_2048x1556: // 2048x1556 film ::NTV2_VANCMODE_OFF
3985  case NTV2_FG_2048x1588: // 2048x1556 film ::NTV2_VANCMODE_TALL
3986  return true;
3987 
3988  case NTV2_FG_4x1920x1080: // 3840x2160
3989  case NTV2_FG_4x2048x1080: // 4096x2160
3990  case NTV2_FG_4x3840x2160:
3991  case NTV2_FG_4x4096x2160:
3992  break; // no tall or taller geometries!
3993 #if defined (_DEBUG)
3994  case NTV2_FG_INVALID: break;
3995 #else
3996  default: break;
3997 #endif
3998  }
3999  return false;
4000 }
4001 
4003 {
4004  NTV2GeometrySet result;
4005  switch (inFG)
4006  {
4007  case NTV2_FG_1920x1080: // 1920x1080 ::NTV2_VANCMODE_OFF
4008  case NTV2_FG_1920x1112: // 1920x1080 ::NTV2_VANCMODE_TALL
4009  case NTV2_FG_1920x1114: // 1920x1080 ::NTV2_VANCMODE_TALLER
4010  result.insert(NTV2_FG_1920x1080); result.insert(NTV2_FG_1920x1112); result.insert(NTV2_FG_1920x1114);
4011  break;
4012 
4013  case NTV2_FG_1280x720: // 1280x720, ::NTV2_VANCMODE_OFF
4014  case NTV2_FG_1280x740: // 1280x720 ::NTV2_VANCMODE_TALL
4015  result.insert(NTV2_FG_1280x720); result.insert(NTV2_FG_1280x740);
4016  break;
4017 
4018  case NTV2_FG_720x486: // 720x486 ::NTV2_VANCMODE_OFF
4019  case NTV2_FG_720x508: // 720x486 ::NTV2_VANCMODE_TALL
4020  case NTV2_FG_720x514: // 720x486 ::NTV2_VANCMODE_TALLER
4021  result.insert(NTV2_FG_720x486); result.insert(NTV2_FG_720x508); result.insert(NTV2_FG_720x514);
4022  break;
4023 
4024  case NTV2_FG_720x576: // 720x576 ::NTV2_VANCMODE_OFF
4025  case NTV2_FG_720x598: // 720x576 ::NTV2_VANCMODE_TALL
4026  case NTV2_FG_720x612: // 720x576 ::NTV2_VANCMODE_TALLER
4027  result.insert(NTV2_FG_720x576); result.insert(NTV2_FG_720x598); result.insert(NTV2_FG_720x612);
4028  break;
4029 
4030  case NTV2_FG_2048x1080: // 2048x1080 ::NTV2_VANCMODE_OFF
4031  case NTV2_FG_2048x1112: // 2048x1080 ::NTV2_VANCMODE_TALL
4032  case NTV2_FG_2048x1114: // 2048x1080 ::NTV2_VANCMODE_TALLER
4033  result.insert(NTV2_FG_2048x1080); result.insert(NTV2_FG_2048x1112); result.insert(NTV2_FG_2048x1114);
4034  break;
4035 
4036  case NTV2_FG_2048x1556: // 2048x1556 film ::NTV2_VANCMODE_OFF
4037  case NTV2_FG_2048x1588: // 2048x1556 film ::NTV2_VANCMODE_TALL
4038  result.insert(NTV2_FG_2048x1556); result.insert(NTV2_FG_2048x1588);
4039  break;
4040 
4041  case NTV2_FG_4x1920x1080: // 3840x2160
4042  case NTV2_FG_4x2048x1080: // 4096x2160
4043  case NTV2_FG_4x3840x2160:
4044  case NTV2_FG_4x4096x2160:
4045  result.insert(inFG);
4046  break; // no tall or taller geometries!
4047 #if defined (_DEBUG)
4048  case NTV2_FG_INVALID: break;
4049 #else
4050  default: break;
4051 #endif
4052  }
4053  return result;
4054 }
4055 
4057 {
4058  if (NTV2_IS_TALL_VANC_GEOMETRY(inFG))
4059  return NTV2_VANCMODE_TALL;
4060  else if (NTV2_IS_TALLER_VANC_GEOMETRY(inFG))
4061  return NTV2_VANCMODE_TALLER;
4062  else if (NTV2_IS_VALID_NTV2FrameGeometry(inFG))
4063  return NTV2_VANCMODE_OFF;
4064  return NTV2_VANCMODE_INVALID;
4065 }
4066 
4067 
4069 {
4070  switch (inStandard)
4071  {
4072  case NTV2_STANDARD_720: return NTV2_FG_1280x720; // 720p
4073  case NTV2_STANDARD_525: return NTV2_FG_720x486; // 525i
4074  case NTV2_STANDARD_625: return NTV2_FG_720x576; // 625i
4075 
4076  case NTV2_STANDARD_1080:
4077  case NTV2_STANDARD_1080p: return NTV2_FG_1920x1080; // 1080i, 1080psf, 1080p
4078 
4079  case NTV2_STANDARD_2K: return NTV2_FG_2048x1556; // 2048x1556 film
4080 
4082  case NTV2_STANDARD_2Kx1080i: return NTV2_FG_2048x1080; // 2K1080p/i/psf
4083 
4084  case NTV2_STANDARD_3840x2160p: // UHD
4085  case NTV2_STANDARD_3840HFR: // HFR UHD
4086  case NTV2_STANDARD_3840i: return NTV2_FG_4x1920x1080; // HFR psf
4087 
4088  case NTV2_STANDARD_4096x2160p: // 4K
4089  case NTV2_STANDARD_4096HFR: // HFR 4K
4090  case NTV2_STANDARD_4096i: return NTV2_FG_4x2048x1080; // HFR 4K psf
4091 
4093 
4095 #if defined (_DEBUG)
4096  case NTV2_STANDARD_INVALID: break;
4097 #else
4098  default: break;
4099 #endif
4100  }
4101  return NTV2_FG_INVALID;
4102 }
4103 
4104 NTV2Standard GetStandardFromGeometry (const NTV2FrameGeometry inGeometry, const bool inIsProgressive)
4105 {
4106  switch (inGeometry)
4107  {
4108  case NTV2_FG_1920x1080: // 1920x1080 ::NTV2_VANCMODE_OFF
4109  case NTV2_FG_1920x1112: // 1920x1080 ::NTV2_VANCMODE_TALL
4110  case NTV2_FG_1920x1114: // 1920x1080 ::NTV2_VANCMODE_TALLER
4111  return inIsProgressive ? NTV2_STANDARD_1080p : NTV2_STANDARD_1080;
4112 
4113  case NTV2_FG_1280x720: // 1280x720, ::NTV2_VANCMODE_OFF
4114  case NTV2_FG_1280x740: // 1280x720 ::NTV2_VANCMODE_TALL
4115  return NTV2_STANDARD_720;
4116 
4117  case NTV2_FG_720x486: // 720x486 ::NTV2_VANCMODE_OFF
4118  case NTV2_FG_720x508: // 720x486 ::NTV2_VANCMODE_TALL
4119  case NTV2_FG_720x514: // 720x486 ::NTV2_VANCMODE_TALLER
4120  return NTV2_STANDARD_525;
4121 
4122  case NTV2_FG_720x576: // 720x576 ::NTV2_VANCMODE_OFF
4123  case NTV2_FG_720x598: // 720x576 ::NTV2_VANCMODE_TALL
4124  case NTV2_FG_720x612: // 720x576 ::NTV2_VANCMODE_TALLER
4125  return NTV2_STANDARD_625;
4126 
4127  case NTV2_FG_2048x1080: // 2048x1080 ::NTV2_VANCMODE_OFF
4128  case NTV2_FG_2048x1112: // 2048x1080 ::NTV2_VANCMODE_TALL
4129  case NTV2_FG_2048x1114: // 2048x1080 ::NTV2_VANCMODE_TALLER
4130  return inIsProgressive ? NTV2_STANDARD_2Kx1080p : NTV2_STANDARD_2Kx1080i;
4131 
4132  case NTV2_FG_2048x1556: // 2048x1556 film ::NTV2_VANCMODE_OFF
4133  case NTV2_FG_2048x1588: // 2048x1556 film ::NTV2_VANCMODE_TALL
4134  return NTV2_STANDARD_2K;
4135 
4136  case NTV2_FG_4x1920x1080: // 3840x2160
4137  return inIsProgressive ? NTV2_STANDARD_3840x2160p : NTV2_STANDARD_3840i; // NTV2_STANDARD_3840HFR
4138 
4139  case NTV2_FG_4x2048x1080: // 4096x2160
4140  return inIsProgressive ? NTV2_STANDARD_4096x2160p : NTV2_STANDARD_4096i; // NTV2_STANDARD_4096HFR
4141 
4142  case NTV2_FG_4x3840x2160: // 4320x7680 uhd 8K
4143  return NTV2_STANDARD_7680;
4144 
4145  case NTV2_FG_4x4096x2160: // 4320x8192 8K
4146  return NTV2_STANDARD_8192;
4147 
4148 #if defined (_DEBUG)
4149  case NTV2_FG_INVALID: break;
4150 #else
4151  default: break;
4152 #endif
4153  }
4154  return NTV2_STANDARD_INVALID;
4155 }
4156 
4157 
4158 bool NTV2DeviceCanDoFormat (const NTV2DeviceID inDeviceID,
4159  const NTV2FrameRate inFrameRate,
4160  const NTV2FrameGeometry inFrameGeometry,
4161  const NTV2Standard inStandard)
4162 { // DEPRECATED FUNCTION
4163  // This implementation is very inefficient, but...
4164  // a) this function is deprecated;
4165  // b) nobody should be calling it (they should be calling NTV2DeviceCanDoVideoFormat instead)
4166  // c) they shouldn't be calling it every frame.
4167  // We could make it efficient by creating a static global rate/geometry/standard-to-videoFormat
4168  // map, but that has race/deadlock issues.
4169 
4170  const NTV2FrameGeometry fg (::GetNormalizedFrameGeometry(inFrameGeometry));
4171  // Look for a video format that matches the given frame rate, geometry and standard...
4173  {
4174  if (!NTV2_IS_VALID_VIDEO_FORMAT(vFmt))
4175  continue;
4179  if (fr == inFrameRate && std == inStandard && fg == geo)
4180  return ::NTV2DeviceCanDoVideoFormat(inDeviceID, vFmt);
4181  }
4182  return false;
4183 }
4184 
4186 {
4188  return fd.GetRasterHeight(/*visOnly?*/false); // Include VANC
4189 }
4190 
4192 {
4194  return fd.GetRasterWidth();
4195 }
4196 
4197 
4198 // Displayable width of format, not counting HANC/VANC
4200 {
4201  const NTV2FormatDescriptor fd (inVideoFormat, NTV2_FBF_8BIT_YCBCR);
4202  return fd.GetRasterWidth();
4203 } // GetDisplayWidth
4204 
4205 
4206 // Displayable height of format, not counting HANC/VANC
4208 {
4209  const NTV2FormatDescriptor fd (inVideoFormat, NTV2_FBF_8BIT_YCBCR);
4210  return fd.GetVisibleRasterHeight();
4211 } // GetDisplayHeight
4212 
4213 
4214 
4215 // NTV2SmpteLineNumber::NTV2SmpteLineNumber (const NTV2Standard inStandard)
4216 // IMPLEMENTATION MOVED INTO 'ntv2formatdescriptor.cpp'
4217 // SO AS TO USE SAME LineNumbersF1/LineNumbersF2 TABLES
4218 
4220 {
4221  if (!NTV2_IS_VALID_FIELD (inFieldID))
4222  return 0;
4223 
4224  if (inFieldID == NTV2_FIELD0)
4225  return firstFieldTop ? smpteFirstActiveLine : smpteSecondActiveLine;
4226  else
4227  return firstFieldTop ? smpteSecondActiveLine : smpteFirstActiveLine;
4228 }
4229 
4230 
4231 ostream & NTV2SmpteLineNumber::Print (ostream & inOutStream) const
4232 {
4233  if (!IsValid ())
4234  inOutStream << "INVALID ";
4235  inOutStream << "SMPTELineNumber(";
4236  if (IsValid ())
4237  inOutStream << "1st=" << smpteFirstActiveLine << (firstFieldTop ? "(top)" : "")
4238  << ", 2nd=" << smpteSecondActiveLine << (firstFieldTop ? "" : "(top)")
4239  << ", std=" << ::NTV2StandardToString (mStandard) << ")";
4240  else
4241  inOutStream << "INVALID)";
4242  return inOutStream;
4243 }
4244 
4245 
4246 string NTV2SmpteLineNumber::PrintLineNumber (const ULWord inLineOffset, const NTV2FieldID inRasterFieldID) const
4247 {
4248  ostringstream oss;
4249  if (NTV2_IS_VALID_FIELD (inRasterFieldID) && !NTV2_IS_PROGRESSIVE_STANDARD (mStandard))
4250  oss << "F" << (inRasterFieldID == 0 ? "1" : "2") << " ";
4251  oss << "L" << dec << inLineOffset+GetFirstActiveLine(inRasterFieldID);
4252  return oss.str();
4253 }
4254 
4255 
4256 string NTV2ACFrameRange::setFromString (const string & inStr)
4257 {
4258  makeInvalid();
4259  if (inStr.empty())
4260  return "Frame count/range not specified";
4261  const bool hasCount(inStr.find('@') != string::npos);
4262  const bool hasRange(inStr.find('-') != string::npos);
4263  NTV2StringList strs;
4264  if (hasCount && hasRange)
4265  return "'@' and '-' cannot both be specified";
4266  else if (hasCount)
4267  aja::split(inStr, '@', strs);
4268  else if (hasRange)
4269  aja::split(inStr, '-', strs);
4270  else
4271  strs.push_back(inStr);
4272  if (strs.empty())
4273  return "No frame count/range values parsed";
4274  if (strs.size() > 2)
4275  return "More than 2 frame count/range values parsed";
4276  if (hasCount || hasRange)
4277  if (strs.size() != 2)
4278  return "Expected exactly 2 frame count/range values";
4279 
4280  // Check that all characters are decimal digits...
4281  for (size_t strNdx(0); strNdx < strs.size(); strNdx++)
4282  { string str(strs.at(strNdx));
4283  if (aja::strip(str).empty())
4284  return "Expected unsigned decimal integer value";
4285  for (size_t chNdx(0); chNdx < str.length(); chNdx++)
4286  if (!isdigit(str.at(chNdx)))
4287  return "Non-digit character encountered in '" + str + "'";
4288  }
4289 
4290  UWordSequence numbers;
4291  for (NTV2StringListConstIter it(strs.begin()); it != strs.end(); ++it)
4292  {
4293  string str(*it);
4294  numbers.push_back(UWord(aja::stoul(aja::strip(str))));
4295  }
4296  bool isValid(false);
4297  if (hasCount)
4298  isValid = setRangeWithCount(numbers[0], numbers[1]);
4299  else if (hasRange)
4300  isValid = setExactRange(numbers[0], numbers[1]);
4301  else
4302  isValid = setCountOnly(numbers[0]);
4303  return isValid ? "" : "First frame past last frame";
4304 }
4305 
4306 string NTV2ACFrameRange::toString (const bool inNormalized) const
4307 {
4308  ostringstream oss;
4309  if (inNormalized)
4310  {
4311  if (!valid())
4312  ;
4313  else if (isFrameRange())
4314  {
4315  if (false)
4316  oss << DEC(count()) << "@" << DEC(firstFrame());
4317  else
4318  oss << DEC(firstFrame()) << "-" << DEC(lastFrame());
4319  }
4320  else
4321  oss << DEC(count());
4322  }
4323  else
4324  {
4325  if (!valid())
4326  oss << "<invalid>";
4327  else if (isFrameRange())
4328  oss << "Frames " << DEC(firstFrame()) << "-" << DEC(lastFrame()) << " (" << DEC(lastFrame()-firstFrame()+1) << "@" << DEC(firstFrame()) << ")";
4329  else
4330  oss << DEC(count()) << " frames (auto-allocated)";
4331  }
4332  return oss.str();
4333 }
4334 
4335 
4336 // Extracts a channel pair or all channels from the
4337 // NTV2 channel buffer that is retrieved from the hardware.
4338 int RecordCopyAudio(PULWord pAja, PULWord pSR, int iStartSample, int iNumBytes, int iChan0,
4339  int iNumChans, bool bKeepAudio24Bits)
4340 {
4341  const int SAMPLE_SIZE = NTV2_NUMAUDIO_CHANNELS * NTV2_AUDIOSAMPLESIZE;
4342 
4343  // Insurance to prevent bogus array sizes causing havoc
4344 // if (iNumBytes > 48048) // 23.98 == 2002 * 24
4345 // iNumBytes = 48048;
4346 
4347  // Adjust the offset of the first valid channel
4348  if (iStartSample)
4349  {
4350  iChan0 += (NTV2_NUMAUDIO_CHANNELS - iStartSample);
4351  }
4352 
4353  // Driver records audio to offset 24 bytes
4354  PULWord pIn = &pAja[NTV2_NUMAUDIO_CHANNELS];
4355  UWord * puwOut = reinterpret_cast<UWord*>(pSR);
4356 
4357  // If our transfer size has a remainder and our chans are in it,
4358  // adjust number samples
4359  int iNumSamples = iNumBytes / SAMPLE_SIZE;
4360  int iMod = (iNumBytes % SAMPLE_SIZE) / 4;
4361  if (iMod > iChan0)
4362  iNumSamples++;
4363  // else if we have remainder with chans && chans total > number of chans
4364  // reduce start offset by the number of chans
4365  else if (iMod && iChan0 >= NTV2_NUMAUDIO_CHANNELS)
4366  {
4367  iNumSamples++;
4368  iChan0 -= NTV2_NUMAUDIO_CHANNELS;
4369  }
4370  // else if no remainder but start sample adjustment gives more chans
4371  // than number of chans, drop the start offset back by num chans
4372  else if (iChan0 >= NTV2_NUMAUDIO_CHANNELS)
4373  {
4374  iChan0 -= NTV2_NUMAUDIO_CHANNELS;
4375  }
4376 
4377  // Copy incoming audio to the outgoing array
4378  if (bKeepAudio24Bits)
4379  {
4380  for (int s = 0; s < iNumSamples; s++)
4381  {
4382  for (int c = iChan0; c < iChan0 + iNumChans; c++)
4383  {
4384  *pSR++ = pIn[c];
4385  }
4386 
4387  pIn += NTV2_NUMAUDIO_CHANNELS;
4388  }
4389  }
4390  else // convert audio to 16 bits
4391  {
4392  for (int s = 0; s < iNumSamples; s++)
4393  {
4394  for (int c = iChan0; c < iChan0 + iNumChans; c++)
4395  {
4396  *puwOut++ = UWord(pIn[c] >> 16);
4397  }
4398 
4399  pIn += NTV2_NUMAUDIO_CHANNELS;
4400  }
4401  }
4402 
4403  return iNumSamples;
4404 }
4405 
4406 #include "math.h"
4407 // M_PI is defined on RedHat Linux 9 in math.h
4408 #ifndef M_PI
4409 #define M_PI (3.14159265358979323846)
4410 #endif
4411 
4412 
4413 bool AddAudioTone ( ULWord & outNumBytesWritten,
4414  NTV2Buffer & inAudioBuffer,
4415  ULWord & inOutCurrentSample,
4416  const ULWord inNumSamples,
4417  const double inSampleRate,
4418  const double inAmplitude,
4419  const double inFrequency,
4420  const ULWord inNumBitsPerSample,
4421  const bool inByteSwap,
4422  const ULWord inNumChannels)
4423 {
4424  outNumBytesWritten = 0;
4425  if (inAudioBuffer.IsNULL())
4426  return false; // NULL buffer
4427 
4428  const ULWord numBytes (4 * inNumSamples * inNumChannels);
4429  if (inAudioBuffer.GetByteCount() < numBytes)
4430  return false; // buffer too small
4431 
4432  double j (inOutCurrentSample);
4433  const double cycleLength (inSampleRate / inFrequency);
4434  const double scale (double(ULWord(1 << (inNumBitsPerSample - 1))) - 1.0);
4435  ULWord * pAudioBuffer(inAudioBuffer);
4436  NTV2_ASSERT(pAudioBuffer);
4437 
4438  for (ULWord i(0); i < inNumSamples; i++)
4439  {
4440  const double nextFloat = double(::sin (j / cycleLength * (M_PI * 2.0)) * inAmplitude);
4441  LWord value = LWord((nextFloat * scale) + double(0.5));
4442 
4443  if (inByteSwap)
4444  value = LWord(NTV2EndianSwap32(value));
4445 
4446  for (ULWord channel(0); channel < inNumChannels; channel++)
4447  *pAudioBuffer++ = ULWord(value);
4448 
4449  j += 1.0;
4450  if (j > cycleLength)
4451  j -= cycleLength;
4452  inOutCurrentSample++;
4453  } // for each sample
4454 
4455  outNumBytesWritten = numBytes;
4456  return true;
4457 
4458 } // AddAudioTone (NTV2Buffer)
4459 
4460 
4461 ULWord AddAudioTone ( ULWord * pAudioBuffer,
4462  ULWord & inOutCurrentSample,
4463  const ULWord inNumSamples,
4464  const double inSampleRate,
4465  const double inAmplitude,
4466  const double inFrequency,
4467  const ULWord inNumBits,
4468  const bool inByteSwap,
4469  const ULWord inNumChannels)
4470 {
4471  double j (inOutCurrentSample);
4472  const double cycleLength (inSampleRate / inFrequency);
4473  const double scale (double (ULWord (1 << (inNumBits - 1))) - 1.0);
4474 
4475  if (pAudioBuffer)
4476  {
4477  for (ULWord i = 0; i < inNumSamples; i++)
4478  {
4479  const double nextFloat = double(::sin (j / cycleLength * (M_PI * 2.0)) * inAmplitude);
4480  LWord value = LWord((nextFloat * scale) + double(0.5));
4481 
4482  if (inByteSwap)
4483  value = LWord(NTV2EndianSwap32(value)); //odprintf("%f",(float)(LWord)value/(float)0x7FFFFFFF);
4484 
4485  for (ULWord channel = 0; channel < inNumChannels; channel++)
4486  *pAudioBuffer++ = ULWord(value);
4487 
4488  j += 1.0;
4489  if (j > cycleLength)
4490  j -= cycleLength;
4491  inOutCurrentSample++;
4492  } // for each sample
4493  } // if pAudioBuffer
4494 
4495  return inNumSamples * 4 * inNumChannels;
4496 
4497 } // AddAudioTone (ULWord)
4498 
4499 
4500 ULWord AddAudioTone ( UWord * pAudioBuffer,
4501  ULWord & inOutCurrentSample,
4502  const ULWord inNumSamples,
4503  const double inSampleRate,
4504  const double inAmplitude,
4505  const double inFrequency,
4506  const ULWord inNumBits,
4507  const bool inByteSwap,
4508  const ULWord inNumChannels)
4509 {
4510  double j (inOutCurrentSample);
4511  const double cycleLength (inSampleRate / inFrequency);
4512  const double scale (double (ULWord (1 << (inNumBits - 1))) - 1.0);
4513 
4514  if (pAudioBuffer)
4515  {
4516  for (ULWord i(0); i < inNumSamples; i++)
4517  {
4518  const double nextFloat = double(::sin (j / cycleLength * (M_PI * 2.0)) * inAmplitude);
4519  Word value = Word((nextFloat * scale) + double(0.5));
4520 
4521  if (inByteSwap)
4522  value = Word(NTV2EndianSwap16(value));
4523 
4524  for (ULWord channel(0); channel < inNumChannels; channel++)
4525  *pAudioBuffer++ = UWord(value);
4526 
4527  j += 1.0;
4528  if (j > cycleLength)
4529  j -= cycleLength;
4530  inOutCurrentSample++;
4531  } // for each sample
4532  } // if pAudioBuffer
4533 
4534  return inNumSamples * 4 * inNumChannels;
4535 
4536 } // AddAudioTone (UWord)
4537 
4538 
4539 ULWord AddAudioTone ( ULWord * pAudioBuffer,
4540  ULWord & inOutCurrentSample,
4541  const ULWord inNumSamples,
4542  const double inSampleRate,
4543  const double * pInAmplitudes,
4544  const double * pInFrequencies,
4545  const ULWord inNumBits,
4546  const bool inByteSwap,
4547  const ULWord inNumChannels)
4548 {
4549  double j [kNumAudioChannelsMax];
4550  double cycleLength [kNumAudioChannelsMax];
4551  const double scale (double(ULWord (1 << (inNumBits - 1))) - 1.0);
4552 
4553  for (ULWord channel(0); channel < inNumChannels; channel++)
4554  {
4555  cycleLength[channel] = inSampleRate / pInFrequencies[channel];
4556  j [channel] = inOutCurrentSample;
4557  }
4558 
4559  if (pAudioBuffer && pInAmplitudes && pInFrequencies)
4560  {
4561  for (ULWord i(0); i < inNumSamples; i++)
4562  {
4563  for (ULWord channel(0); channel < inNumChannels; channel++)
4564  {
4565  const double nextFloat = double(::sin(j[channel] / cycleLength[channel] * (M_PI * 2.0)) * pInAmplitudes[channel]);
4566  LWord value = LWord((nextFloat * scale) + double(0.5));
4567 
4568  if (inByteSwap)
4569  value = NTV2EndianSwap32(value);
4570 
4571  *pAudioBuffer++ = ULWord(value);
4572 
4573  j[channel] += 1.0;
4574  if (j[channel] > cycleLength[channel])
4575  j[channel] -= cycleLength[channel];
4576 
4577  }
4578  inOutCurrentSample++;
4579  } // for each sample
4580  } // if pAudioBuffer && pInFrequencies
4581 
4582  return inNumSamples * 4 * inNumChannels;
4583 
4584 } // AddAudioTone (per-chl freq & ampl)
4585 
4586 
4588  ULWord & inOutCurrentSample,
4589  const ULWord inNumSamples,
4590  const ULWord inModulus,
4591  const bool inEndianConvert,
4592  const ULWord inNumChannels)
4593 {
4594 
4595  for (ULWord i(0); i < inNumSamples; i++)
4596  {
4597  ULWord value ((inOutCurrentSample % inModulus) << 16);
4598  if (inEndianConvert)
4599  value = NTV2EndianSwap32(value);
4600  for (ULWord channel(0); channel < inNumChannels; channel++)
4601  *pAudioBuffer++ = value;
4602  inOutCurrentSample++;
4603  }
4604  return inNumSamples * 4 * inNumChannels;
4605 }
4606 
4607 
4608 std::string NTV2DeviceIDToString (const NTV2DeviceID inValue, const bool inForRetailDisplay)
4609 {
4610  switch (inValue)
4611  {
4612  case DEVICE_ID_CORVID1: return inForRetailDisplay ? "Corvid 1" : "Corvid";
4613  case DEVICE_ID_CORVID22: return inForRetailDisplay ? "Corvid 22" : "Corvid22";
4614  case DEVICE_ID_CORVID24: return inForRetailDisplay ? "Corvid 24" : "Corvid24";
4615  case DEVICE_ID_CORVID3G: return inForRetailDisplay ? "Corvid 3G" : "Corvid3G";
4616  case DEVICE_ID_CORVID44: return inForRetailDisplay ? "Corvid 44" : "Corvid44";
4617  case DEVICE_ID_CORVID44_GEN3: return inForRetailDisplay ? "Corvid 44 Gen3" : "Corvid-44-Gen3";
4618  case DEVICE_ID_CORVID44_2X4K: return inForRetailDisplay ? "Corvid 44 12G 2x4K" : "Corvid44-12G-2x4K";
4619  case DEVICE_ID_CORVID44_8K: return inForRetailDisplay ? "Corvid 44 12G 8K" : "Corvid44-12G-8K";
4620  case DEVICE_ID_CORVID44_8KMK: return inForRetailDisplay ? "Corvid 44 12G 8KMK" : "Corvid44-12G-8KMK";
4621  case DEVICE_ID_CORVID44_PLNR: return inForRetailDisplay ? "Corvid 44 12G PLNR" : "Corvid44-12G-PLNR";
4622  case DEVICE_ID_CORVID88: return inForRetailDisplay ? "Corvid 88" : "Corvid88";
4623  case DEVICE_ID_CORVID88_GEN3: return inForRetailDisplay ? "Corvid 88 Gen3" : "Corvid-88-Gen3";
4624  case DEVICE_ID_CORVIDHBR: return inForRetailDisplay ? "Corvid HB-R" : "CorvidHBR";
4625  case DEVICE_ID_CORVIDHEVC: return inForRetailDisplay ? "Corvid HEVC" : "CorvidHEVC";
4626  case DEVICE_ID_IO4K: return "Io4K";
4627  case DEVICE_ID_IO4KPLUS: return inForRetailDisplay ? "Avid DNxIV" : "Io4KPlus";
4628  case DEVICE_ID_IO4KUFC: return inForRetailDisplay ? "Io4K UFC" : "Io4KUfc";
4629  case DEVICE_ID_IOEXPRESS: return inForRetailDisplay ? "IoExpress" : "IoExpress";
4630  case DEVICE_ID_IOIP_2022: return inForRetailDisplay ? "Avid DNxIP s2022" : "IoIP-s2022";
4631  case DEVICE_ID_IOIP_2110: return inForRetailDisplay ? "Avid DNxIP s2110" : "IoIP-s2110";
4632  case DEVICE_ID_IOIP_2110_RGB12: return inForRetailDisplay ? "Avid DNxIP s2110_RGB12" : "IoIP-s2110_RGB12";
4633  case DEVICE_ID_IOX3: return "IoX3";
4634  case DEVICE_ID_IOXT: return "IoXT";
4635  case DEVICE_ID_IP25_R: return "IP25-R";
4636  case DEVICE_ID_IP25_T: return "IP25-T";
4637  case DEVICE_ID_KONA1: return inForRetailDisplay ? "Kona 1" : "Kona1";
4638  case DEVICE_ID_KONA3G: return inForRetailDisplay ? "KONA 3G" : "Kona3G";
4639  case DEVICE_ID_KONA3GQUAD: return inForRetailDisplay ? "KONA 3G QUAD" : "Kona3GQuad"; // Used to be "KONA 3G" for retail display
4640  case DEVICE_ID_KONA4: return inForRetailDisplay ? "KONA 4" : "Kona4";
4641  case DEVICE_ID_KONA4UFC: return inForRetailDisplay ? "KONA 4 UFC" : "Kona4Ufc";
4642  case DEVICE_ID_KONA5: return inForRetailDisplay ? "KONA 5" : "Kona5";
4643  case DEVICE_ID_KONA5_2X4K: return inForRetailDisplay ? "KONA 5 (12-Bit)" : "Kona5-12Bit";
4644  case DEVICE_ID_KONA5_3DLUT: return inForRetailDisplay ? "KONA 5 3DLUT" : "Kona5-3DLUT";
4645  case DEVICE_ID_KONA5_8K: return inForRetailDisplay ? "KONA 5 8K" : "Kona5-8K";
4646  case DEVICE_ID_KONA5_8KMK: return inForRetailDisplay ? "KONA 5 8KMK" : "Kona5-8KMK";
4647  case DEVICE_ID_KONA5_8K_MV_TX: return inForRetailDisplay ? "KONA 5 8K MV TX" : "Kona5-8K-MV-TX";
4648  case DEVICE_ID_KONA5_OE1: return "Kona5-OE1";
4649  case DEVICE_ID_KONA5_OE10: return "Kona5-OE10";
4650  case DEVICE_ID_KONA5_OE11: return "Kona5-OE11";
4651  case DEVICE_ID_KONA5_OE12: return "Kona5-OE12";
4652  case DEVICE_ID_KONA5_OE2: return "Kona5-OE2";
4653  case DEVICE_ID_KONA5_OE3: return "Kona5-OE3";
4654  case DEVICE_ID_KONA5_OE4: return "Kona5-OE4";
4655  case DEVICE_ID_KONA5_OE5: return "Kona5-OE5";
4656  case DEVICE_ID_KONA5_OE6: return "Kona5-OE6";
4657  case DEVICE_ID_KONA5_OE7: return "Kona5-OE7";
4658  case DEVICE_ID_KONA5_OE8: return "Kona5-OE8";
4659  case DEVICE_ID_KONA5_OE9: return "Kona5-OE9";
4660  case DEVICE_ID_KONAHDMI: return inForRetailDisplay ? "Kona HDMI" : "KonaHDMI";
4661  case DEVICE_ID_KONAIP_1RX_1TX_1SFP_J2K: return "KonaIP J2K 1I 1O";
4662  case DEVICE_ID_KONAIP_1RX_1TX_2110: return "KonaIP s2110 1I 1O";
4663  case DEVICE_ID_KONAIP_2022: return "KonaIP s2022";
4664  case DEVICE_ID_KONAIP_2110: return "KonaIP s2110";
4665  case DEVICE_ID_KONAIP_2110_RGB12: return "KonaIP s2110 RGB12";
4666  case DEVICE_ID_KONAIP_2TX_1SFP_J2K: return "KonaIP J2K 2O";
4667  case DEVICE_ID_KONAIP_4CH_2SFP: return "KonaIP s2022 2+2";
4668  case DEVICE_ID_KONALHEPLUS: return inForRetailDisplay ? "KONA LHe+" : "KonaLHe+";
4669  case DEVICE_ID_KONALHI: return inForRetailDisplay ? "KONA LHi" : "KonaLHi";
4670  case DEVICE_ID_KONALHIDVI: return inForRetailDisplay ? "KONA LHi DVI" : "KonaLHiDVI";
4671  case DEVICE_ID_KONAX: return inForRetailDisplay ? "KONA X" : "KonaX";
4672  case DEVICE_ID_KONAXM: return inForRetailDisplay ? "KONA XM" : "KonaXM";
4673  case DEVICE_ID_KONAX_4CH: return inForRetailDisplay ? "KONA X 4CH" : "KonaX_4CH";
4674  case DEVICE_ID_KONAIP_25G: return "KonaIP 25G";
4675  case DEVICE_ID_SOJI_3DLUT: return "SOJI-3DLUT";
4676  case DEVICE_ID_SOJI_DIAGS: return "SOJI-DIAGS";
4677  case DEVICE_ID_SOJI_OE1: return "SOJI-OE1";
4678  case DEVICE_ID_SOJI_OE2: return "SOJI-OE2";
4679  case DEVICE_ID_SOJI_OE3: return "SOJI-OE3";
4680  case DEVICE_ID_SOJI_OE4: return "SOJI-OE4";
4681  case DEVICE_ID_SOJI_OE5: return "SOJI-OE5";
4682  case DEVICE_ID_SOJI_OE6: return "SOJI-OE6";
4683  case DEVICE_ID_SOJI_OE7: return "SOJI-OE7";
4684  case DEVICE_ID_TTAP: return inForRetailDisplay ? "T-TAP" : "TTap";
4685  case DEVICE_ID_TTAP_PRO: return inForRetailDisplay ? "T-TAP Pro" : "TTapPro";
4686  case DEVICE_ID_SOFTWARE: return inForRetailDisplay ? "Software" : "Software";
4687  case DEVICE_ID_NOTFOUND: return inForRetailDisplay ? "AJA Device" : "(Not Found)";
4688 #if defined(_DEBUG)
4689 #else
4690  default: break;
4691 #endif
4692  }
4693  return inForRetailDisplay ? "Unknown" : "???";
4694 }
4695 
4696 
4698 {
4699  return inIndex < NTV2_MAX_NUM_CHANNELS ? NTV2Channel(inIndex) : NTV2_CHANNEL1;
4700 }
4701 
4703 {
4704  return NTV2_IS_VALID_CHANNEL(inChannel) ? ULWord(inChannel) : 0;
4705 }
4706 
4707 
4709 {
4710  switch (inCrosspointChannel)
4711  {
4714  case NTV2CROSSPOINT_INPUT1: return NTV2_CHANNEL1;
4715  case NTV2CROSSPOINT_INPUT2: return NTV2_CHANNEL2;
4720  case NTV2CROSSPOINT_INPUT3: return NTV2_CHANNEL3;
4721  case NTV2CROSSPOINT_INPUT4: return NTV2_CHANNEL4;
4726  case NTV2CROSSPOINT_INPUT5: return NTV2_CHANNEL5;
4727  case NTV2CROSSPOINT_INPUT6: return NTV2_CHANNEL6;
4728  case NTV2CROSSPOINT_INPUT7: return NTV2_CHANNEL7;
4729  case NTV2CROSSPOINT_INPUT8: return NTV2_CHANNEL8;
4731  }
4732  return NTV2_CHANNEL_INVALID;
4733 }
4734 
4735 
4737 {
4738  switch(index)
4739  {
4740  default:
4741  case 0: return NTV2CROSSPOINT_CHANNEL1;
4742  case 1: return NTV2CROSSPOINT_CHANNEL2;
4743  case 2: return NTV2CROSSPOINT_CHANNEL3;
4744  case 3: return NTV2CROSSPOINT_CHANNEL4;
4745  case 4: return NTV2CROSSPOINT_CHANNEL5;
4746  case 5: return NTV2CROSSPOINT_CHANNEL6;
4747  case 6: return NTV2CROSSPOINT_CHANNEL7;
4748  case 7: return NTV2CROSSPOINT_CHANNEL8;
4749  }
4750 }
4751 
4753 {
4754  switch(channel)
4755  {
4756  default:
4757  case NTV2CROSSPOINT_CHANNEL1: return 0;
4758  case NTV2CROSSPOINT_CHANNEL2: return 1;
4759  case NTV2CROSSPOINT_CHANNEL3: return 2;
4760  case NTV2CROSSPOINT_CHANNEL4: return 3;
4761  case NTV2CROSSPOINT_CHANNEL5: return 4;
4762  case NTV2CROSSPOINT_CHANNEL6: return 5;
4763  case NTV2CROSSPOINT_CHANNEL7: return 6;
4764  case NTV2CROSSPOINT_CHANNEL8: return 7;
4765  }
4766 }
4767 
4769 {
4770  switch(index)
4771  {
4772  default:
4773  case 0: return NTV2CROSSPOINT_INPUT1;
4774  case 1: return NTV2CROSSPOINT_INPUT2;
4775  case 2: return NTV2CROSSPOINT_INPUT3;
4776  case 3: return NTV2CROSSPOINT_INPUT4;
4777  case 4: return NTV2CROSSPOINT_INPUT5;
4778  case 5: return NTV2CROSSPOINT_INPUT6;
4779  case 6: return NTV2CROSSPOINT_INPUT7;
4780  case 7: return NTV2CROSSPOINT_INPUT8;
4781  }
4782 }
4783 
4785 {
4786  switch(channel)
4787  {
4788  default:
4789  case NTV2CROSSPOINT_INPUT1: return 0;
4790  case NTV2CROSSPOINT_INPUT2: return 1;
4791  case NTV2CROSSPOINT_INPUT3: return 2;
4792  case NTV2CROSSPOINT_INPUT4: return 3;
4793  case NTV2CROSSPOINT_INPUT5: return 4;
4794  case NTV2CROSSPOINT_INPUT6: return 5;
4795  case NTV2CROSSPOINT_INPUT7: return 6;
4796  case NTV2CROSSPOINT_INPUT8: return 7;
4797  }
4798 }
4799 
4801 {
4802  switch(index)
4803  {
4804  default:
4805  case 0: return NTV2CROSSPOINT_CHANNEL1;
4806  case 1: return NTV2CROSSPOINT_CHANNEL2;
4807  case 2: return NTV2CROSSPOINT_CHANNEL3;
4808  case 3: return NTV2CROSSPOINT_CHANNEL4;
4809  case 4: return NTV2CROSSPOINT_INPUT1;
4810  case 5: return NTV2CROSSPOINT_INPUT2;
4811  case 6: return NTV2CROSSPOINT_INPUT3;
4812  case 7: return NTV2CROSSPOINT_INPUT4;
4813  case 8: return NTV2CROSSPOINT_CHANNEL5;
4814  case 9: return NTV2CROSSPOINT_CHANNEL6;
4815  case 10:return NTV2CROSSPOINT_CHANNEL7;
4816  case 11:return NTV2CROSSPOINT_CHANNEL8;
4817  case 12:return NTV2CROSSPOINT_INPUT5;
4818  case 13:return NTV2CROSSPOINT_INPUT6;
4819  case 14:return NTV2CROSSPOINT_INPUT7;
4820  case 15:return NTV2CROSSPOINT_INPUT8;
4821  }
4822 }
4823 
4825 {
4826  switch(channel)
4827  {
4828  default:
4829  case NTV2CROSSPOINT_CHANNEL1: return 0;
4830  case NTV2CROSSPOINT_CHANNEL2: return 1;
4831  case NTV2CROSSPOINT_CHANNEL3: return 2;
4832  case NTV2CROSSPOINT_CHANNEL4: return 3;
4833  case NTV2CROSSPOINT_INPUT1: return 4;
4834  case NTV2CROSSPOINT_INPUT2: return 5;
4835  case NTV2CROSSPOINT_INPUT3: return 6;
4836  case NTV2CROSSPOINT_INPUT4: return 7;
4837  case NTV2CROSSPOINT_CHANNEL5: return 8;
4838  case NTV2CROSSPOINT_CHANNEL6: return 9;
4839  case NTV2CROSSPOINT_CHANNEL7: return 10;
4840  case NTV2CROSSPOINT_CHANNEL8: return 11;
4841  case NTV2CROSSPOINT_INPUT5: return 12;
4842  case NTV2CROSSPOINT_INPUT6: return 13;
4843  case NTV2CROSSPOINT_INPUT7: return 14;
4844  case NTV2CROSSPOINT_INPUT8: return 15;
4845  }
4846 }
4847 
4848 
4850 {
4851  return NTV2_IS_INPUT_CROSSPOINT(inChannel);
4852 }
4853 
4854 
4856 {
4857  return NTV2_IS_OUTPUT_CROSSPOINT(inChannel);
4858 }
4859 
4860 
4862 {
4865  return static_cast<NTV2EmbeddedAudioInput>(inChannel);
4866 }
4867 
4868 
4870 {
4873  return static_cast<NTV2AudioSystem>(inChannel);
4874 }
4875 
4876 
4878 {
4879  static const NTV2EmbeddedAudioInput gInputSourceToEmbeddedAudioInputs [] = { /* NTV2_INPUTSOURCE_ANALOG1 */ NTV2_MAX_NUM_EmbeddedAudioInputs,
4880  /* NTV2_INPUTSOURCE_HDMI1 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_1,
4881  /* NTV2_INPUTSOURCE_HDMI2 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_2,
4882  /* NTV2_INPUTSOURCE_HDMI3 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_3,
4883  /* NTV2_INPUTSOURCE_HDMI4 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_4,
4884  /* NTV2_INPUTSOURCE_SDI1 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_1,
4885  /* NTV2_INPUTSOURCE_SDI2 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_2,
4886  /* NTV2_INPUTSOURCE_SDI3 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_3,
4887  /* NTV2_INPUTSOURCE_SDI4 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_4,
4888  /* NTV2_INPUTSOURCE_SDI5 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_5,
4889  /* NTV2_INPUTSOURCE_SDI6 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_6,
4890  /* NTV2_INPUTSOURCE_SDI7 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_7,
4891  /* NTV2_INPUTSOURCE_SDI8 */ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_8,
4892  /* NTV2_INPUTSOURCE_INVALID */ NTV2_MAX_NUM_EmbeddedAudioInputs};
4893  if (inInputSource < NTV2_NUM_INPUTSOURCES && inInputSource < NTV2InputSource(sizeof(gInputSourceToEmbeddedAudioInputs) / sizeof(NTV2EmbeddedAudioInput)))
4894  return gInputSourceToEmbeddedAudioInputs [inInputSource];
4895  else
4897 
4898 } // InputSourceToEmbeddedAudioInput
4899 
4900 
4902 {
4903  if (!NTV2_IS_VALID_INPUT_SOURCE (inInputSource))
4905  if (NTV2_INPUT_SOURCE_IS_SDI (inInputSource))
4906  return NTV2_AUDIO_EMBEDDED;
4907  else if (NTV2_INPUT_SOURCE_IS_HDMI (inInputSource))
4908  return NTV2_AUDIO_HDMI;
4909  else if (NTV2_INPUT_SOURCE_IS_ANALOG (inInputSource))
4910  return NTV2_AUDIO_ANALOG;
4912 }
4913 
4914 
4916 {
4919  if (NTV2_IS_VALID_CHANNEL (inChannel))
4920  return gChannelToInputChannelSpec [inChannel];
4921  else
4922  return NTV2CROSSPOINT_INVALID;
4923 }
4924 
4925 
4927 {
4930  if (inChannel >= NTV2_CHANNEL1 && inChannel < NTV2_MAX_NUM_CHANNELS)
4931  return gChannelToOutputChannelSpec [inChannel];
4932  else
4933  return NTV2CROSSPOINT_INVALID;
4934 }
4935 
4936 
4938 {
4940  if (NTV2_IS_VALID_CHANNEL (inChannel))
4941  return gChannelToInputInterrupt [inChannel];
4942  else
4943  return eNumInterruptTypes;
4944 }
4945 
4946 
4948 {
4950  if (NTV2_IS_VALID_CHANNEL (inChannel))
4951  return gChannelToOutputInterrupt [inChannel];
4952  else
4953  return eNumInterruptTypes;
4954 }
4955 
4956 
4960 
4961 
4962 NTV2TCIndex NTV2ChannelToTimecodeIndex (const NTV2Channel inChannel, const bool inEmbeddedLTC, const bool inIsF2)
4963 {
4964  if (NTV2_IS_VALID_CHANNEL(inChannel))
4965  return inEmbeddedLTC ? gChanATCLTC[inChannel] : (inIsF2 ? gChanVITC2[inChannel] : gChanVITC1[inChannel]);
4966  return NTV2_TCINDEX_INVALID;
4967 }
4968 
4969 
4971 {
4972  NTV2TCIndexes result;
4973  if (NTV2_IS_VALID_CHANNEL(inSDI))
4974  {result.insert(gChanVITC1[inSDI]); result.insert(gChanVITC2[inSDI]); result.insert(gChanATCLTC[inSDI]);}
4975  return result;
4976 }
4977 
4978 
4980 {
4984  return NTV2_IS_VALID_TIMECODE_INDEX (inTCIndex) ? gTCIndexToChannel [inTCIndex] : NTV2_CHANNEL_INVALID;
4985 }
4986 
4987 
4989 {
4995  return NTV2_IS_VALID_TIMECODE_INDEX (inTCIndex) ? gTCIndexToInputSource [inTCIndex] : NTV2_INPUTSOURCE_INVALID;
4996 }
4997 
4998 
5000 {
5001  static const NTV2Crosspoint gInputSourceToChannelSpec [] = { /* NTV2_INPUTSOURCE_ANALOG1 */ NTV2CROSSPOINT_INPUT1,
5002  /* NTV2_INPUTSOURCE_HDMI1 */ NTV2CROSSPOINT_INPUT1,
5003  /* NTV2_INPUTSOURCE_HDMI2 */ NTV2CROSSPOINT_INPUT2,
5004  /* NTV2_INPUTSOURCE_HDMI3 */ NTV2CROSSPOINT_INPUT3,
5005  /* NTV2_INPUTSOURCE_HDMI4 */ NTV2CROSSPOINT_INPUT4,
5006  /* NTV2_INPUTSOURCE_SDI1 */ NTV2CROSSPOINT_INPUT1,
5007  /* NTV2_INPUTSOURCE_SDI2 */ NTV2CROSSPOINT_INPUT2,
5008  /* NTV2_INPUTSOURCE_SDI3 */ NTV2CROSSPOINT_INPUT3,
5009  /* NTV2_INPUTSOURCE_SDI4 */ NTV2CROSSPOINT_INPUT4,
5010  /* NTV2_INPUTSOURCE_SDI5 */ NTV2CROSSPOINT_INPUT5,
5011  /* NTV2_INPUTSOURCE_SDI6 */ NTV2CROSSPOINT_INPUT6,
5012  /* NTV2_INPUTSOURCE_SDI7 */ NTV2CROSSPOINT_INPUT7,
5013  /* NTV2_INPUTSOURCE_SDI8 */ NTV2CROSSPOINT_INPUT8,
5014  /* NTV2_NUM_INPUTSOURCES */ NTV2_NUM_CROSSPOINTS};
5015  if (inInputSource < NTV2_NUM_INPUTSOURCES && size_t (inInputSource) < sizeof (gInputSourceToChannelSpec) / sizeof (NTV2Channel))
5016  return gInputSourceToChannelSpec [inInputSource];
5017  else
5018  return NTV2_NUM_CROSSPOINTS;
5019 
5020 } // NTV2InputSourceToChannelSpec
5021 
5022 
5024 {
5025  static const NTV2ReferenceSource gInputSourceToReferenceSource [] = { /* NTV2_INPUTSOURCE_ANALOG1 */ NTV2_REFERENCE_ANALOG_INPUT1,
5026  /* NTV2_INPUTSOURCE_HDMI1 */ NTV2_REFERENCE_HDMI_INPUT1,
5027  /* NTV2_INPUTSOURCE_HDMI2 */ NTV2_REFERENCE_HDMI_INPUT2,
5028  /* NTV2_INPUTSOURCE_HDMI3 */ NTV2_REFERENCE_HDMI_INPUT3,
5029  /* NTV2_INPUTSOURCE_HDMI4 */ NTV2_REFERENCE_HDMI_INPUT4,
5030  /* NTV2_INPUTSOURCE_SDI1 */ NTV2_REFERENCE_INPUT1,
5031  /* NTV2_INPUTSOURCE_SDI2 */ NTV2_REFERENCE_INPUT2,
5032  /* NTV2_INPUTSOURCE_SDI3 */ NTV2_REFERENCE_INPUT3,
5033  /* NTV2_INPUTSOURCE_SDI4 */ NTV2_REFERENCE_INPUT4,
5034  /* NTV2_INPUTSOURCE_SDI5 */ NTV2_REFERENCE_INPUT5,
5035  /* NTV2_INPUTSOURCE_SDI6 */ NTV2_REFERENCE_INPUT6,
5036  /* NTV2_INPUTSOURCE_SDI7 */ NTV2_REFERENCE_INPUT7,
5037  /* NTV2_INPUTSOURCE_SDI8 */ NTV2_REFERENCE_INPUT8,
5038  /* NTV2_NUM_INPUTSOURCES */ NTV2_NUM_REFERENCE_INPUTS};
5039  if (NTV2_IS_VALID_INPUT_SOURCE (inInputSource) && size_t (inInputSource) < sizeof (gInputSourceToReferenceSource) / sizeof (NTV2ReferenceSource))
5040  return gInputSourceToReferenceSource [inInputSource];
5041  else
5042  return NTV2_REFERENCE_INVALID;
5043 
5044 } // NTV2InputSourceToReferenceSource
5045 
5046 
5048 {
5049  static const NTV2Channel gInputSourceToChannel [] = { /* NTV2_INPUTSOURCE_ANALOG1 */ NTV2_CHANNEL1,
5050  /* NTV2_INPUTSOURCE_HDMI1 */ NTV2_CHANNEL1,
5051  /* NTV2_INPUTSOURCE_HDMI2 */ NTV2_CHANNEL2,
5052  /* NTV2_INPUTSOURCE_HDMI3 */ NTV2_CHANNEL3,
5053  /* NTV2_INPUTSOURCE_HDMI4 */ NTV2_CHANNEL4,
5054  /* NTV2_INPUTSOURCE_SDI1 */ NTV2_CHANNEL1,
5055  /* NTV2_INPUTSOURCE_SDI2 */ NTV2_CHANNEL2,
5056  /* NTV2_INPUTSOURCE_SDI3 */ NTV2_CHANNEL3,
5057  /* NTV2_INPUTSOURCE_SDI4 */ NTV2_CHANNEL4,
5058  /* NTV2_INPUTSOURCE_SDI5 */ NTV2_CHANNEL5,
5059  /* NTV2_INPUTSOURCE_SDI6 */ NTV2_CHANNEL6,
5060  /* NTV2_INPUTSOURCE_SDI7 */ NTV2_CHANNEL7,
5061  /* NTV2_INPUTSOURCE_SDI8 */ NTV2_CHANNEL8,
5062  /* NTV2_NUM_INPUTSOURCES */ NTV2_CHANNEL_INVALID};
5063  if (inInputSource < NTV2_NUM_INPUTSOURCES && size_t (inInputSource) < sizeof (gInputSourceToChannel) / sizeof (NTV2Channel))
5064  return gInputSourceToChannel [inInputSource];
5065  else
5066  return NTV2_MAX_NUM_CHANNELS;
5067 
5068 } // NTV2InputSourceToChannel
5069 
5070 
5072 {
5073  static const NTV2AudioSystem gInputSourceToAudioSystem [] = { /* NTV2_INPUTSOURCE_ANALOG1 */ NTV2_AUDIOSYSTEM_1,
5074  /* NTV2_INPUTSOURCE_HDMI1 */ NTV2_AUDIOSYSTEM_1,
5075  /* NTV2_INPUTSOURCE_HDMI2 */ NTV2_AUDIOSYSTEM_2,
5076  /* NTV2_INPUTSOURCE_HDMI3 */ NTV2_AUDIOSYSTEM_3,
5077  /* NTV2_INPUTSOURCE_HDMI4 */ NTV2_AUDIOSYSTEM_4,
5078  /* NTV2_INPUTSOURCE_SDI1 */ NTV2_AUDIOSYSTEM_1,
5079  /* NTV2_INPUTSOURCE_SDI2 */ NTV2_AUDIOSYSTEM_2,
5080  /* NTV2_INPUTSOURCE_SDI3 */ NTV2_AUDIOSYSTEM_3,
5081  /* NTV2_INPUTSOURCE_SDI4 */ NTV2_AUDIOSYSTEM_4,
5082  /* NTV2_INPUTSOURCE_SDI5 */ NTV2_AUDIOSYSTEM_5,
5083  /* NTV2_INPUTSOURCE_SDI6 */ NTV2_AUDIOSYSTEM_6,
5084  /* NTV2_INPUTSOURCE_SDI7 */ NTV2_AUDIOSYSTEM_7,
5085  /* NTV2_INPUTSOURCE_SDI8 */ NTV2_AUDIOSYSTEM_8,
5086  /* NTV2_NUM_INPUTSOURCES */ NTV2_NUM_AUDIOSYSTEMS};
5087  if (inInputSource < NTV2_NUM_INPUTSOURCES && inInputSource < NTV2InputSource(sizeof(gInputSourceToAudioSystem) / sizeof(NTV2AudioSystem)))
5088  return gInputSourceToAudioSystem [inInputSource];
5089  else
5090  return NTV2_AUDIOSYSTEM_INVALID;
5091 
5092 } // NTV2InputSourceToAudioSystem
5093 
5094 
5095 NTV2TimecodeIndex NTV2InputSourceToTimecodeIndex (const NTV2InputSource inInputSource, const bool inEmbeddedLTC)
5096 {
5097  static const NTV2TimecodeIndex gInputSourceToTCIndex []= { /* NTV2_INPUTSOURCE_ANALOG1 */ NTV2_TCINDEX_LTC1,
5098  /* NTV2_INPUTSOURCE_HDMI1 */ NTV2_TCINDEX_INVALID,
5099  /* NTV2_INPUTSOURCE_HDMI2 */ NTV2_TCINDEX_INVALID,
5100  /* NTV2_INPUTSOURCE_HDMI3 */ NTV2_TCINDEX_INVALID,
5101  /* NTV2_INPUTSOURCE_HDMI4 */ NTV2_TCINDEX_INVALID,
5102  /* NTV2_INPUTSOURCE_SDI1 */ NTV2_TCINDEX_SDI1,
5103  /* NTV2_INPUTSOURCE_SDI2 */ NTV2_TCINDEX_SDI2,
5104  /* NTV2_INPUTSOURCE_SDI3 */ NTV2_TCINDEX_SDI3,
5105  /* NTV2_INPUTSOURCE_SDI4 */ NTV2_TCINDEX_SDI4,
5106  /* NTV2_INPUTSOURCE_SDI5 */ NTV2_TCINDEX_SDI5,
5107  /* NTV2_INPUTSOURCE_SDI6 */ NTV2_TCINDEX_SDI6,
5108  /* NTV2_INPUTSOURCE_SDI7 */ NTV2_TCINDEX_SDI7,
5109  /* NTV2_INPUTSOURCE_SDI8 */ NTV2_TCINDEX_SDI8,
5110  /* NTV2_NUM_INPUTSOURCES */ NTV2_TCINDEX_INVALID};
5111  static const NTV2TimecodeIndex gInputSourceToLTCIndex []= { /* NTV2_INPUTSOURCE_ANALOG1 */ NTV2_TCINDEX_LTC1,
5112  /* NTV2_INPUTSOURCE_HDMI1 */ NTV2_TCINDEX_INVALID,
5113  /* NTV2_INPUTSOURCE_HDMI2 */ NTV2_TCINDEX_INVALID,
5114  /* NTV2_INPUTSOURCE_HDMI3 */ NTV2_TCINDEX_INVALID,
5115  /* NTV2_INPUTSOURCE_HDMI4 */ NTV2_TCINDEX_INVALID,
5116  /* NTV2_INPUTSOURCE_SDI1 */ NTV2_TCINDEX_SDI1_LTC,
5117  /* NTV2_INPUTSOURCE_SDI2 */ NTV2_TCINDEX_SDI2_LTC,
5118  /* NTV2_INPUTSOURCE_SDI3 */ NTV2_TCINDEX_SDI3_LTC,
5119  /* NTV2_INPUTSOURCE_SDI4 */ NTV2_TCINDEX_SDI4_LTC,
5120  /* NTV2_INPUTSOURCE_SDI5 */ NTV2_TCINDEX_SDI5_LTC,
5121  /* NTV2_INPUTSOURCE_SDI6 */ NTV2_TCINDEX_SDI6_LTC,
5122  /* NTV2_INPUTSOURCE_SDI7 */ NTV2_TCINDEX_SDI7_LTC,
5123  /* NTV2_INPUTSOURCE_SDI8 */ NTV2_TCINDEX_SDI8_LTC,
5124  /* NTV2_NUM_INPUTSOURCES */ NTV2_TCINDEX_INVALID};
5125  if (inInputSource < NTV2_NUM_INPUTSOURCES && size_t (inInputSource) < sizeof (gInputSourceToTCIndex) / sizeof (NTV2TimecodeIndex))
5126  return inEmbeddedLTC ? gInputSourceToLTCIndex [inInputSource] : gInputSourceToTCIndex [inInputSource];
5127  else
5128  return NTV2_TCINDEX_INVALID;
5129 }
5130 
5131 
5133 {
5143  if (NTV2_IS_VALID_CHANNEL(inChannel))
5144  switch (inSourceType)
5145  {
5146  case NTV2_IOKINDS_SDI: return gChannelToSDIInputSource[inChannel];
5147  case NTV2_IOKINDS_HDMI: return gChannelToHDMIInputSource[inChannel];
5148  case NTV2_IOKINDS_ANALOG: return gChannelToAnlgInputSource[inChannel];
5149  default: break;
5150  }
5151  return NTV2_INPUTSOURCE_INVALID;
5152 }
5153 
5154 
5156 {
5157  if (!NTV2_IS_VALID_OUTPUT_DEST (inOutputDest))
5158  return NTV2_CHANNEL_INVALID;
5159 
5160  static const NTV2Channel gOutputDestToChannel [] = { NTV2_CHANNEL1, NTV2_CHANNEL1,
5163  return gOutputDestToChannel [inOutputDest];
5164 }
5165 
5166 
5168 {
5169  if (!NTV2_IS_VALID_CHANNEL(inChannel))
5171  if (!NTV2_IS_VALID_IOKINDS(inKinds))
5174  return NTV2_OUTPUTDESTINATION_INVALID; // Ambiguous request
5176  return NTV2_OUTPUTDESTINATION_INVALID; // Ambiguous request
5178  return NTV2_OUTPUTDESTINATION_INVALID; // Ambiguous request
5179  if ((inKinds & NTV2_IOKINDS_ALL) == NTV2_IOKINDS_ALL)
5180  return NTV2_OUTPUTDESTINATION_INVALID; // Ambiguous request
5181  if ((inKinds & NTV2_IOKINDS_HDMI) == NTV2_IOKINDS_HDMI)
5183  if ((inKinds & NTV2_IOKINDS_ANALOG) == NTV2_IOKINDS_ANALOG)
5185 
5189  return gChannelToOutputDest [inChannel];
5190 }
5191 
5192 
5193 // if formats are transport equivalent (e.g. 1080i30 / 1080psf30) return the target version of the format
5195 {
5196  // compatible return target version
5197  if (::IsTransportCompatibleFormat (inFormat, inTargetFormat))
5198  return inTargetFormat;
5199 
5200  // not compatible, return original format
5201  return inFormat;
5202 }
5203 
5204 
5205 // determine if 2 formats are transport compatible (e.g. 1080i30 / 1080psf30)
5206 bool IsTransportCompatibleFormat (const NTV2VideoFormat inFormat1, const NTV2VideoFormat inFormat2)
5207 {
5208  if (inFormat1 == inFormat2)
5209  return true;
5210 
5211  switch (inFormat1)
5212  {
5213  case NTV2_FORMAT_1080i_5000: return inFormat2 == NTV2_FORMAT_1080psf_2500_2;
5214  case NTV2_FORMAT_1080i_5994: return inFormat2 == NTV2_FORMAT_1080psf_2997_2;
5215  case NTV2_FORMAT_1080i_6000: return inFormat2 == NTV2_FORMAT_1080psf_3000_2;
5216  case NTV2_FORMAT_1080psf_2500_2: return inFormat2 == NTV2_FORMAT_1080i_5000;
5217  case NTV2_FORMAT_1080psf_2997_2: return inFormat2 == NTV2_FORMAT_1080i_5994;
5218  case NTV2_FORMAT_1080psf_3000_2: return inFormat2 == NTV2_FORMAT_1080i_6000;
5219  default: return false;
5220  }
5221 }
5222 
5223 
5225 {
5229  static const NTV2InputSource sANLGInputSources[] = { NTV2_INPUTSOURCE_ANALOG1 };
5230  switch (inKinds)
5231  {
5232  case NTV2_IOKINDS_SDI:
5233  if (inIndex0 < sizeof(sSDIInputSources) / sizeof(NTV2InputSource))
5234  return sSDIInputSources[inIndex0];
5235  break;
5236  case NTV2_IOKINDS_HDMI:
5237  if (inIndex0 < sizeof(sHDMIInputSources) / sizeof(NTV2InputSource))
5238  return sHDMIInputSources[inIndex0];
5239  break;
5240  case NTV2_IOKINDS_ANALOG:
5241  if (inIndex0 < sizeof(sANLGInputSources) / sizeof(NTV2InputSource))
5242  return sANLGInputSources[inIndex0];
5243  break;
5244  #if defined(_DEBUG)
5245  case NTV2_IOKINDS_NONE:
5246  case NTV2_IOKINDS_ALL:
5247  break;
5248  #else
5249  default: break;
5250  #endif
5251  }
5252  return NTV2_INPUTSOURCE_INVALID;
5253 }
5254 
5255 
5257 {
5258  if (NTV2_INPUT_SOURCE_IS_SDI(inSrc))
5259  return NTV2_IOKINDS_SDI;
5260  if (NTV2_INPUT_SOURCE_IS_HDMI(inSrc))
5261  return NTV2_IOKINDS_HDMI;
5262  if (NTV2_INPUT_SOURCE_IS_ANALOG(inSrc))
5263  return NTV2_IOKINDS_ANALOG;
5264  return NTV2_IOKINDS_NONE;
5265 }
5266 
5267 
5268 NTV2InputSource GetNTV2HDMIInputSourceForIndex (const ULWord inIndex0) // NTV2_SHOULD_BE_DEPRECATED
5269 {
5271 }
5272 
5273 
5275 {
5276  static const ULWord sInputSourcesIndexes [] = { 0, // NTV2_INPUTSOURCE_ANALOG1,
5277  0, 1, 2, 3, // NTV2_INPUTSOURCE_HDMI1 ... NTV2_INPUTSOURCE_HDMI4,
5278  0, 1, 2, 3, 4, 5, 6, 7 }; // NTV2_INPUTSOURCE_SDI1 ... NTV2_INPUTSOURCE_SDI8
5279  if (size_t(inValue) < sizeof(sInputSourcesIndexes) / sizeof(ULWord))
5280  return sInputSourcesIndexes [inValue];
5281  else
5282  return 0xFFFFFFFF;
5283 
5284 } // GetIndexForNTV2InputSource
5285 
5286 
5288 {
5289  static const ULWord gFrameSizeToByteCount[] = { 2 /* NTV2_FRAMESIZE_2MB */, 4 /* NTV2_FRAMESIZE_4MB */, 8 /* NTV2_FRAMESIZE_8MB */, 16 /* NTV2_FRAMESIZE_16MB */,
5290  6 /* NTV2_FRAMESIZE_6MB */, 10 /* NTV2_FRAMESIZE_10MB */, 12 /* NTV2_FRAMESIZE_12MB */, 14 /* NTV2_FRAMESIZE_14MB */,
5291  18 /* NTV2_FRAMESIZE_18MB */, 20 /* NTV2_FRAMESIZE_20MB */, 22 /* NTV2_FRAMESIZE_22MB */, 24 /* NTV2_FRAMESIZE_24MB */,
5292  26 /* NTV2_FRAMESIZE_26MB */, 28 /* NTV2_FRAMESIZE_28MB */, 30 /* NTV2_FRAMESIZE_30MB */, 32 /* NTV2_FRAMESIZE_32MB */,
5293  0 };
5294  if (inFrameSize < NTV2_MAX_NUM_Framesizes && inFrameSize < NTV2Framesize(sizeof(gFrameSizeToByteCount) / sizeof(ULWord)))
5295  return gFrameSizeToByteCount [inFrameSize] * 1024 * 1024;
5296  else
5297  return 0;
5298 
5299 } // NTV2FramesizeToByteCount
5300 
5301 
5303 { // STANDARD BIG MEDIUM BIGGER INVALID
5304  static const ULWord gBufferSizeToByteCount[] = { 1 * 1024*1024, 4 * 1024*1024, 2 * 1024*1024, 3 * 1024*1024, 0 };
5305  if (NTV2_IS_VALID_AUDIO_BUFFER_SIZE(inBufferSize))
5306  return gBufferSizeToByteCount[inBufferSize];
5307  return 0;
5308 }
5309 
5310 typedef std::set<NTV2FrameRate> NTV2FrameRates;
5311 typedef NTV2FrameRates::const_iterator NTV2FrameRatesConstIter;
5312 typedef std::vector<NTV2FrameRates> NTV2FrameRateFamilies;
5313 typedef NTV2FrameRateFamilies::const_iterator NTV2FrameRateFamiliesConstIter;
5314 
5317 
5318 
5320 {
5321  if (!sFRFamMutex.IsValid())
5322  return false;
5323 
5324  AJAAutoLock autoLock (&sFRFamMutex);
5325  if (sFRFamilies.empty())
5326  {
5327  NTV2FrameRates FR1498, FR1500, FR2398, FR2400, FR2500;
5328  FR1498.insert(NTV2_FRAMERATE_1498); FR1498.insert(NTV2_FRAMERATE_2997); FR1498.insert(NTV2_FRAMERATE_5994); FR1498.insert(NTV2_FRAMERATE_11988);
5329  sFRFamilies.push_back(FR1498);
5330  FR1500.insert(NTV2_FRAMERATE_1500); FR1500.insert(NTV2_FRAMERATE_3000); FR1500.insert(NTV2_FRAMERATE_6000); FR1500.insert(NTV2_FRAMERATE_12000);
5331  sFRFamilies.push_back(FR1500);
5332  FR2398.insert(NTV2_FRAMERATE_2398); FR2398.insert(NTV2_FRAMERATE_4795);
5333  sFRFamilies.push_back(FR2398);
5334  FR2400.insert(NTV2_FRAMERATE_2400); FR2400.insert(NTV2_FRAMERATE_4800);
5335  sFRFamilies.push_back(FR2400);
5336  FR2500.insert(NTV2_FRAMERATE_2500); FR2500.insert(NTV2_FRAMERATE_5000);
5337  sFRFamilies.push_back(FR2500);
5338  }
5339  return !sFRFamilies.empty();
5340 }
5341 
5342 
5344 {
5346  for (NTV2FrameRateFamiliesConstIter it(sFRFamilies.begin()); it != sFRFamilies.end(); ++it)
5347  {
5348  const NTV2FrameRates & family (*it);
5349  NTV2FrameRatesConstIter iter(family.find(inFrameRate));
5350  if (iter != family.end())
5351  return *(family.begin());
5352  }
5353  return NTV2_FRAMERATE_INVALID;
5354 }
5355 
5356 
5357 bool IsMultiFormatCompatible (const NTV2FrameRate inFrameRate1, const NTV2FrameRate inFrameRate2)
5358 {
5359  if (inFrameRate1 == inFrameRate2)
5360  return true;
5361 
5362  if (!NTV2_IS_SUPPORTED_NTV2FrameRate(inFrameRate1) || !NTV2_IS_SUPPORTED_NTV2FrameRate(inFrameRate2))
5363  return false;
5364 
5365  const NTV2FrameRate frFamily1 (GetFrameRateFamily(inFrameRate1));
5366  const NTV2FrameRate frFamily2 (GetFrameRateFamily(inFrameRate2));
5367 
5369  return false; // Probably uninitialized
5370 
5371  return frFamily1 == frFamily2;
5372 
5373 } // IsMultiFormatCompatible (NTV2FrameRate)
5374 
5375 
5376 AJAExport bool IsMultiFormatCompatible (const NTV2VideoFormat inFormat1, const NTV2VideoFormat inFormat2)
5377 {
5378  if (inFormat1 == NTV2_FORMAT_UNKNOWN || inFormat2 == NTV2_FORMAT_UNKNOWN)
5379  return false;
5381 
5382 } // IsMultiFormatCompatible (NTV2VideoFormat)
5383 
5384 
5385 AJAExport bool IsPSF (const NTV2VideoFormat format)
5386 {
5387  return NTV2_IS_PSF_VIDEO_FORMAT(format);
5388 }
5389 
5390 
5392 {
5394 }
5395 
5396 
5398 {
5399  NTV2Standard standard (::GetNTV2StandardFromVideoFormat(format));
5400  return IsProgressiveTransport(standard);
5401 }
5402 
5403 
5405 {
5406  return NTV2_IS_PROGRESSIVE_STANDARD(standard);
5407 }
5408 
5409 
5411 {
5412  return NTV2_IS_FBF_RGB(format);
5413 }
5414 
5415 
5417 {
5418  return !NTV2_IS_FBF_RGB(format); // works for now
5419 }
5420 
5421 
5423 {
5424  return NTV2_FBF_HAS_ALPHA(format);
5425 }
5426 
5427 
5429 {
5430  return NTV2_IS_2K_1080_VIDEO_FORMAT(format) || NTV2_IS_2K_VIDEO_FORMAT(format);
5431 }
5432 
5433 
5435 {
5437 }
5438 
5439 
5441 {
5442  return NTV2_IS_QUAD_QUAD_FORMAT(format);
5443 }
5444 
5445 
5446 AJAExport bool IsRaw (const NTV2FrameBufferFormat frameBufferFormat)
5447 {
5448  return NTV2_FBF_IS_RAW(frameBufferFormat);
5449 }
5450 
5451 
5453 {
5454  return NTV2_IS_FBF_8BIT(format);
5455 }
5456 
5457 
5459 {
5460  return NTV2_VIDEO_FORMAT_IS_A(format);
5461 }
5462 
5463 
5465 {
5466  return NTV2_IS_3Gb_FORMAT(format);
5467 }
5468 
5470 {
5471  return NTV2_VIDEO_FORMAT_IS_J2K_SUPPORTED(format);
5472 }
5473 
5474 
5476 {
5478 
5479  switch( inFormat )
5480  {
5481  case NTV2_FORMAT_720p_5994:
5482  if ( outFormat == NTV2_FORMAT_525_5994 )
5483  cMode = NTV2_720p_5994to525_5994;
5484  else if ( outFormat == NTV2_FORMAT_1080i_5994)
5486  else if ( outFormat == NTV2_FORMAT_1080psf_2997_2)
5488  break;
5489 
5490  case NTV2_FORMAT_720p_5000:
5491  if ( outFormat == NTV2_FORMAT_625_5000 )
5492  cMode = NTV2_720p_5000to625_2500;
5493  else if ( outFormat == NTV2_FORMAT_1080i_5000) // NTV2_FORMAT_1080psf_2500
5495  else if ( outFormat == NTV2_FORMAT_1080psf_2500_2)
5497  break;
5498 
5499  case NTV2_FORMAT_525_2398:
5500  if ( outFormat == NTV2_FORMAT_1080psf_2398 )
5501  cMode = NTV2_525_2398to1080i_2398;
5502  break;
5503 
5504  case NTV2_FORMAT_525_5994:
5505  if ( outFormat == NTV2_FORMAT_1080i_5994 )
5506  cMode = NTV2_525_5994to1080i_5994;
5507  else if (outFormat == NTV2_FORMAT_1080psf_2997_2)
5508  cMode = NTV2_525_5994to1080i_5994;
5509  else if ( outFormat == NTV2_FORMAT_720p_5994 )
5510  cMode = NTV2_525_5994to720p_5994;
5511  else if ( outFormat == NTV2_FORMAT_525_5994 )
5512  cMode = NTV2_525_5994to525_5994;
5513  else if ( outFormat == NTV2_FORMAT_525psf_2997 )
5515  break;
5516 
5517  case NTV2_FORMAT_625_5000:
5518  if ( outFormat == NTV2_FORMAT_1080i_5000) // NTV2_FORMAT_1080psf_2500
5519  cMode = NTV2_625_2500to1080i_2500;
5520  else if ( outFormat == NTV2_FORMAT_1080psf_2500_2)
5521  cMode = NTV2_625_2500to1080i_2500;
5522  else if ( outFormat == NTV2_FORMAT_720p_5000 )
5523  cMode = NTV2_625_2500to720p_5000;
5524  else if ( outFormat == NTV2_FORMAT_625_5000 )
5525  cMode = NTV2_625_2500to625_2500;
5526  else if ( outFormat == NTV2_FORMAT_625psf_2500 )
5528  break;
5529 
5530  case NTV2_FORMAT_720p_6000:
5531  if ( outFormat == NTV2_FORMAT_1080i_6000) // NTV2_FORMAT_1080psf_3000
5533  else if (outFormat == NTV2_FORMAT_1080psf_3000_2 )
5535  break;
5536 
5538  if ( outFormat == NTV2_FORMAT_525_2398 )
5539  cMode = NTV2_1080i2398to525_2398;
5540  else if ( outFormat == NTV2_FORMAT_525_5994 )
5541  cMode = NTV2_1080i2398to525_2997;
5542  else if ( outFormat == NTV2_FORMAT_720p_2398 )
5544  else if ( outFormat == NTV2_FORMAT_1080i_5994 )
5546  break;
5547 
5549  if ( outFormat == NTV2_FORMAT_1080i_6000 )
5551  break;
5552 
5554  if ( outFormat == NTV2_FORMAT_625_5000 )
5555  cMode = NTV2_1080i_2500to625_2500;
5556  else if ( outFormat == NTV2_FORMAT_720p_5000 )
5558  else if ( outFormat == NTV2_FORMAT_1080psf_2500_2 )
5560  else if ( outFormat == NTV2_FORMAT_1080psf_2500_2 )
5562  break;
5563 
5565  if ( outFormat == NTV2_FORMAT_1080i_5994 )
5567  break;
5568 
5570  if ( outFormat == NTV2_FORMAT_1080i_6000 )
5572  break;
5573 
5575  if ( outFormat == NTV2_FORMAT_1080i_5000 )
5577  break;
5578 
5580  if ( outFormat == NTV2_FORMAT_625_5000 )
5581  cMode = NTV2_1080i_2500to625_2500;
5582  else if ( outFormat == NTV2_FORMAT_720p_5000 )
5584  else if ( outFormat == NTV2_FORMAT_1080psf_2500_2 )
5586  break;
5587 
5590  if ( outFormat == NTV2_FORMAT_525_5994 )
5591  cMode = NTV2_1080i_5994to525_5994;
5592  else if ( outFormat == NTV2_FORMAT_720p_5994 )
5594  else if ( outFormat == NTV2_FORMAT_1080psf_2997_2 )
5596  break;
5597 
5600  if ( outFormat == NTV2_FORMAT_720p_6000 )
5602  else if ( outFormat == NTV2_FORMAT_1080psf_3000_2 )
5604  break;
5605 
5606  case NTV2_FORMAT_720p_2398:
5607  if ( outFormat == NTV2_FORMAT_1080psf_2398 )
5609  break;
5610 
5612  if ( outFormat == NTV2_FORMAT_720p_6000 )
5614  break;
5615 
5616  default:
5617  break;
5618  }
5619 
5620  return cMode;
5621 }
5622 
5624 {
5625  NTV2VideoFormat inputFormat = NTV2_FORMAT_UNKNOWN;
5626 
5627  switch( conversionMode )
5628  {
5629  case NTV2_525_5994to525_5994: inputFormat = NTV2_FORMAT_525_5994; break;
5630  case NTV2_525_5994to720p_5994: inputFormat = NTV2_FORMAT_525_5994; break;
5631  case NTV2_525_5994to1080i_5994: inputFormat = NTV2_FORMAT_525_5994; break;
5632  case NTV2_525_2398to1080i_2398: inputFormat = NTV2_FORMAT_525_2398; break;
5633  case NTV2_525_5994to525psf_2997: inputFormat = NTV2_FORMAT_525_5994; break;
5634 
5635  case NTV2_625_2500to625_2500: inputFormat = NTV2_FORMAT_625_5000; break;
5636  case NTV2_625_2500to720p_5000: inputFormat = NTV2_FORMAT_625_5000; break;
5637  case NTV2_625_2500to1080i_2500: inputFormat = NTV2_FORMAT_625_5000; break;
5638  case NTV2_625_5000to625psf_2500: inputFormat = NTV2_FORMAT_625_5000; break;
5639 
5640  case NTV2_720p_5000to625_2500: inputFormat = NTV2_FORMAT_720p_5000; break;
5641  case NTV2_720p_5000to1080i_2500: inputFormat = NTV2_FORMAT_720p_5000; break;
5642  case NTV2_720p_5994to525_5994: inputFormat = NTV2_FORMAT_720p_5994; break;
5643  case NTV2_720p_5994to1080i_5994: inputFormat = NTV2_FORMAT_720p_5994; break;
5644  case NTV2_720p_6000to1080i_3000: inputFormat = NTV2_FORMAT_720p_6000; break;
5645  case NTV2_720p_2398to1080i_2398: inputFormat = NTV2_FORMAT_720p_2398; break;
5646 
5647  case NTV2_1080i2398to525_2398: inputFormat = NTV2_FORMAT_1080psf_2398; break;
5648  case NTV2_1080i2398to525_2997: inputFormat = NTV2_FORMAT_1080psf_2398; break;
5649  case NTV2_1080i_2398to720p_2398: inputFormat = NTV2_FORMAT_1080psf_2398; break;
5650 
5651  case NTV2_1080i_2500to625_2500: inputFormat = NTV2_FORMAT_1080i_5000; break;
5652  case NTV2_1080i_2500to720p_5000: inputFormat = NTV2_FORMAT_1080i_5000; break;
5653  case NTV2_1080i_5994to525_5994: inputFormat = NTV2_FORMAT_1080i_5994; break;
5654  case NTV2_1080i_5994to720p_5994: inputFormat = NTV2_FORMAT_1080i_5994; break;
5655  case NTV2_1080i_3000to720p_6000: inputFormat = NTV2_FORMAT_1080i_6000; break;
5656  case NTV2_1080i_5000to1080psf_2500: inputFormat = NTV2_FORMAT_1080i_5000; break;
5657  case NTV2_1080i_5994to1080psf_2997: inputFormat = NTV2_FORMAT_1080i_5994; break;
5658  case NTV2_1080i_6000to1080psf_3000: inputFormat = NTV2_FORMAT_1080i_6000; break;
5659  case NTV2_1080p_3000to720p_6000: inputFormat = NTV2_FORMAT_1080p_3000; break;
5660 
5661  default: inputFormat = NTV2_FORMAT_UNKNOWN; break;
5662  }
5663  return inputFormat;
5664 }
5665 
5666 
5668 {
5669  NTV2VideoFormat outputFormat = NTV2_FORMAT_UNKNOWN;
5670 
5671  switch( conversionMode )
5672  {
5673  case NTV2_525_5994to525_5994: outputFormat = NTV2_FORMAT_525_5994; break;
5674  case NTV2_525_5994to720p_5994: outputFormat = NTV2_FORMAT_720p_5994; break;
5675  case NTV2_525_5994to1080i_5994: outputFormat = NTV2_FORMAT_1080i_5994; break;
5676  case NTV2_525_2398to1080i_2398: outputFormat = NTV2_FORMAT_1080psf_2398; break;
5677  case NTV2_525_5994to525psf_2997: outputFormat = NTV2_FORMAT_525psf_2997; break;
5678 
5679  case NTV2_625_2500to625_2500: outputFormat = NTV2_FORMAT_625_5000; break;
5680  case NTV2_625_2500to720p_5000: outputFormat = NTV2_FORMAT_720p_5000; break;
5681  case NTV2_625_2500to1080i_2500: outputFormat = NTV2_FORMAT_1080i_5000; break;
5682  case NTV2_625_5000to625psf_2500: outputFormat = NTV2_FORMAT_625psf_2500; break;
5683 
5684  case NTV2_720p_5000to625_2500: outputFormat = NTV2_FORMAT_625_5000; break;
5685  case NTV2_720p_5000to1080i_2500: outputFormat = NTV2_FORMAT_1080i_5000; break;
5686  case NTV2_720p_5994to525_5994: outputFormat = NTV2_FORMAT_525_5994; break;
5687  case NTV2_720p_5994to1080i_5994: outputFormat = NTV2_FORMAT_1080i_5994; break;
5688  case NTV2_720p_6000to1080i_3000: outputFormat = NTV2_FORMAT_1080i_6000; break;
5689  case NTV2_720p_2398to1080i_2398: outputFormat = NTV2_FORMAT_1080psf_2398; break;
5690 
5691  case NTV2_1080i2398to525_2398: outputFormat = NTV2_FORMAT_525_2398; break;
5692  case NTV2_1080i2398to525_2997: outputFormat = NTV2_FORMAT_525_5994; break;
5693  case NTV2_1080i_2398to720p_2398: outputFormat = NTV2_FORMAT_720p_2398; break;
5694  //case NTV2_1080i2400to525_2400: outputFormat = NTV2_FORMAT_525_2400; break;
5695 
5696  //case NTV2_1080p2398to525_2398: outputFormat = NTV2_FORMAT_525_2398; break;
5697  //case NTV2_1080p2398to525_2997: outputFormat = NTV2_FORMAT_525_5994; break;
5698  //case NTV2_1080p2400to525_2400: outputFormat = NTV2_FORMAT_525_2400; break;
5699 
5700  case NTV2_1080i_2500to625_2500: outputFormat = NTV2_FORMAT_625_5000; break;
5701  case NTV2_1080i_2500to720p_5000: outputFormat = NTV2_FORMAT_720p_5000; break;
5702  case NTV2_1080i_5994to525_5994: outputFormat = NTV2_FORMAT_525_5994; break;
5703  case NTV2_1080i_5994to720p_5994: outputFormat = NTV2_FORMAT_720p_5994; break;
5704  case NTV2_1080i_3000to720p_6000: outputFormat = NTV2_FORMAT_720p_6000; break;
5705  case NTV2_1080i_5000to1080psf_2500: outputFormat = NTV2_FORMAT_1080psf_2500_2; break;
5706  case NTV2_1080i_5994to1080psf_2997: outputFormat = NTV2_FORMAT_1080psf_2997_2; break;
5707  case NTV2_1080i_6000to1080psf_3000: outputFormat = NTV2_FORMAT_1080psf_3000_2; break;
5708  case NTV2_1080p_3000to720p_6000: outputFormat = NTV2_FORMAT_720p_6000; break;
5709  default: outputFormat = NTV2_FORMAT_UNKNOWN; break;
5710  }
5711  return outputFormat;
5712 }
5713 
5714 
5715 ostream & operator << (ostream & inOutStream, const NTV2FrameSize & inFrameDimensions)
5716 {
5717  return inOutStream << inFrameDimensions.width() << "Wx" << inFrameDimensions.height() << "H";
5718 }
5719 
5720 
5721 ostream & operator << (ostream & inOutStream, const NTV2SmpteLineNumber & inSmpteLineNumber)
5722 {
5723  return inSmpteLineNumber.Print (inOutStream);
5724 }
5725 
5726 
5727 string NTV2ChannelToString (const NTV2Channel inValue, const bool inForRetailDisplay)
5728 {
5729  switch (inValue)
5730  {
5731  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Ch1", NTV2_CHANNEL1);
5732  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Ch2", NTV2_CHANNEL2);
5733  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Ch3", NTV2_CHANNEL3);
5734  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Ch4", NTV2_CHANNEL4);
5735  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Ch5", NTV2_CHANNEL5);
5736  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Ch6", NTV2_CHANNEL6);
5737  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Ch7", NTV2_CHANNEL7);
5738  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Ch8", NTV2_CHANNEL8);
5740  }
5741  return "";
5742 }
5743 
5744 
5745 string NTV2AudioSystemToString (const NTV2AudioSystem inValue, const bool inCompactDisplay)
5746 {
5747  ostringstream oss;
5748  if (NTV2_IS_VALID_AUDIO_SYSTEM(inValue))
5749  oss << (inCompactDisplay ? "AudSys" : "NTV2_AUDIOSYSTEM_") << (inValue + 1);
5750  else
5751  oss << (inCompactDisplay ? "NoAudio" : "NTV2_AUDIOSYSTEM_INVALID");
5752  return oss.str();
5753 }
5754 
5755 
5756 string NTV2AudioRateToString (const NTV2AudioRate inValue, const bool inForRetailDisplay)
5757 {
5758  switch (inValue)
5759  {
5760  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "48 kHz", NTV2_AUDIO_48K);
5761  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "96 kHz", NTV2_AUDIO_96K);
5762  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "192 kHz", NTV2_AUDIO_192K);
5764  }
5765  return "";
5766 }
5767 
5768 
5769 string NTV2AudioBufferSizeToString (const NTV2AudioBufferSize inValue, const bool inForRetailDisplay)
5770 {
5771  switch (inValue)
5772  {
5776  }
5777  return "";
5778 }
5779 
5780 
5781 string NTV2AudioLoopBackToString (const NTV2AudioLoopBack inValue, const bool inForRetailDisplay)
5782 {
5783  switch (inValue)
5784  {
5787  case NTV2_AUDIO_LOOPBACK_INVALID: break; //special case
5788  }
5789  return "???";
5790 }
5791 
5792 
5793 string NTV2EmbeddedAudioClockToString (const NTV2EmbeddedAudioClock inValue, const bool inForRetailDisplay)
5794 {
5795  switch (inValue)
5796  {
5797  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "from device reference", NTV2_EMBEDDED_AUDIO_CLOCK_REFERENCE);
5800  }
5801  return "???";
5802 }
5803 
5804 
5805 string NTV2CrosspointToString (const NTV2Crosspoint inChannel)
5806 {
5807  std::ostringstream oss;
5808  oss << (::IsNTV2CrosspointInput(inChannel) ? "Capture " : "Playout ")
5809  << (::IsNTV2CrosspointInput(inChannel) ? ::GetIndexForNTV2CrosspointInput(inChannel) : ::GetIndexForNTV2CrosspointChannel(inChannel)) + 1;
5810  return oss.str ();
5811 }
5812 
5813 
5814 string NTV2InputCrosspointIDToString (const NTV2InputCrosspointID inValue, const bool inForRetailDisplay)
5815 {
5816  switch (inValue)
5817  {
5834  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 1 Vid", NTV2_XptCSC1VidInput);
5835  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 1 Key", NTV2_XptCSC1KeyInput);
5836  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 2 Vid", NTV2_XptCSC2VidInput);
5837  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 2 Key", NTV2_XptCSC2KeyInput);
5838  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 3 Vid", NTV2_XptCSC3VidInput);
5839  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 3 Key", NTV2_XptCSC3KeyInput);
5840  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 4 Vid", NTV2_XptCSC4VidInput);
5841  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 4 Key", NTV2_XptCSC4KeyInput);
5842  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 5 Vid", NTV2_XptCSC5VidInput);
5843  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 5 Key", NTV2_XptCSC5KeyInput);
5844  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 6 Vid", NTV2_XptCSC6VidInput);
5845  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 6 Key", NTV2_XptCSC6KeyInput);
5846  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 7 Vid", NTV2_XptCSC7VidInput);
5847  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 7 Key", NTV2_XptCSC7KeyInput);
5848  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 8 Vid", NTV2_XptCSC8VidInput);
5849  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 8 Key", NTV2_XptCSC8KeyInput);
5850  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 1", NTV2_XptLUT1Input);
5851  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 2", NTV2_XptLUT2Input);
5852  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 3", NTV2_XptLUT3Input);
5853  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 4", NTV2_XptLUT4Input);
5854  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 5", NTV2_XptLUT5Input);
5855  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 6", NTV2_XptLUT6Input);
5856  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 7", NTV2_XptLUT7Input);
5857  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 8", NTV2_XptLUT8Input);
5862  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 1", NTV2_XptSDIOut1Input);
5863  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 1 DS2", NTV2_XptSDIOut1InputDS2);
5864  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 2", NTV2_XptSDIOut2Input);
5865  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 2 DS2", NTV2_XptSDIOut2InputDS2);
5866  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 3", NTV2_XptSDIOut3Input);
5867  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 3 DS2", NTV2_XptSDIOut3InputDS2);
5868  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 4", NTV2_XptSDIOut4Input);
5869  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 4 DS2", NTV2_XptSDIOut4InputDS2);
5870  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 5", NTV2_XptSDIOut5Input);
5871  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 5 DS2", NTV2_XptSDIOut5InputDS2);
5872  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 6", NTV2_XptSDIOut6Input);
5873  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 6 DS2", NTV2_XptSDIOut6InputDS2);
5874  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 7", NTV2_XptSDIOut7Input);
5875  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 7 DS2", NTV2_XptSDIOut7InputDS2);
5876  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 8", NTV2_XptSDIOut8Input);
5877  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI Out 8 DS2", NTV2_XptSDIOut8InputDS2);
5902  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 1 BG Key", NTV2_XptMixer1BGKeyInput);
5903  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 1 BG Vid", NTV2_XptMixer1BGVidInput);
5904  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 1 FG Key", NTV2_XptMixer1FGKeyInput);
5905  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 1 FG Vid", NTV2_XptMixer1FGVidInput);
5906  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 2 BG Key", NTV2_XptMixer2BGKeyInput);
5907  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 2 BG Vid", NTV2_XptMixer2BGVidInput);
5908  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 2 FG Key", NTV2_XptMixer2FGKeyInput);
5909  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 2 FG Vid", NTV2_XptMixer2FGVidInput);
5910  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 3 BG Key", NTV2_XptMixer3BGKeyInput);
5911  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 3 BG Vid", NTV2_XptMixer3BGVidInput);
5912  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 3 FG Key", NTV2_XptMixer3FGKeyInput);
5913  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 3 FG Vid", NTV2_XptMixer3FGVidInput);
5914  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 4 BG Key", NTV2_XptMixer4BGKeyInput);
5915  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 4 BG Vid", NTV2_XptMixer4BGVidInput);
5916  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 4 FG Key", NTV2_XptMixer4FGKeyInput);
5917  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 4 FG Vid", NTV2_XptMixer4FGVidInput);
5918  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI Out", NTV2_XptHDMIOutInput);
5919  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI Out Q2", NTV2_XptHDMIOutQ2Input);
5920  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI Out Q3", NTV2_XptHDMIOutQ3Input);
5921  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI Out Q4", NTV2_XptHDMIOutQ4Input);
5922  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "4K DownConv Q1", NTV2_Xpt4KDCQ1Input);
5923  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "4K DownConv Q2", NTV2_Xpt4KDCQ2Input);
5924  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "4K DownConv Q3", NTV2_Xpt4KDCQ3Input);
5925  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "4K DownConv Q4", NTV2_Xpt4KDCQ4Input);
5926  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 1A", NTV2_Xpt425Mux1AInput);
5927  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 1B", NTV2_Xpt425Mux1BInput);
5928  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 2A", NTV2_Xpt425Mux2AInput);
5929  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 2B", NTV2_Xpt425Mux2BInput);
5930  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 3A", NTV2_Xpt425Mux3AInput);
5931  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 3B", NTV2_Xpt425Mux3BInput);
5932  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 4A", NTV2_Xpt425Mux4AInput);
5933  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 4B", NTV2_Xpt425Mux4BInput);
5934  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Analog Out", NTV2_XptAnalogOutInput);
5935  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Analog Composite Out", NTV2_XptAnalogOutCompositeOut);
5936  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Stereo Left", NTV2_XptStereoLeftInput);
5937  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Stereo Right", NTV2_XptStereoRightInput);
5938  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Pro Amp", NTV2_XptProAmpInput);
5939  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "IICT1", NTV2_XptIICT1Input);
5940  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Water Marker 1", NTV2_XptWaterMarker1Input);
5941  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Water Marker 2", NTV2_XptWaterMarker2Input);
5942  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Update Register", NTV2_XptUpdateRegister);
5943  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Compression Module", NTV2_XptCompressionModInput);
5944  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Conversion Module", NTV2_XptConversionModInput);
5945  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 1 Key From In 2", NTV2_XptCSC1KeyFromInput2);
5946  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FrameSync2", NTV2_XptFrameSync2Input);
5947  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FrameSync1", NTV2_XptFrameSync1Input);
5948  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "3D LUT 1", NTV2_Xpt3DLUT1Input);
5951  }
5952  return "";
5953 
5954 } // NTV2InputCrosspointIDToString
5955 
5956 
5957 string NTV2OutputCrosspointIDToString (const NTV2OutputCrosspointID inValue, const bool inForRetailDisplay)
5958 {
5959  switch (inValue)
5960  {
5961  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Black", NTV2_XptBlack);
5962  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 1", NTV2_XptSDIIn1);
5963  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 1 DS2", NTV2_XptSDIIn1DS2);
5964  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 2", NTV2_XptSDIIn2);
5965  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 2 DS2", NTV2_XptSDIIn2DS2);
5966  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 1 YUV", NTV2_XptLUT1YUV);
5967  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 1 Vid YUV", NTV2_XptCSC1VidYUV);
5968  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Conversion Module", NTV2_XptConversionModule);
5969  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Compression Module", NTV2_XptCompressionModule);
5971  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FrameSync 1 YUV", NTV2_XptFrameSync1YUV);
5972  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FrameSync 2 YUV", NTV2_XptFrameSync2YUV);
5973  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 1", NTV2_XptDuallinkOut1);
5974  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 1 DS2", NTV2_XptDuallinkOut1DS2);
5975  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 2", NTV2_XptDuallinkOut2);
5976  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 2 DS2", NTV2_XptDuallinkOut2DS2);
5977  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 3", NTV2_XptDuallinkOut3);
5978  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 3 DS2", NTV2_XptDuallinkOut3DS2);
5979  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 4", NTV2_XptDuallinkOut4);
5980  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 4 DS2", NTV2_XptDuallinkOut4DS2);
5981  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Alpha Out", NTV2_XptAlphaOut);
5982  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Analog In", NTV2_XptAnalogIn);
5983  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 1", NTV2_XptHDMIIn1);
5984  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 1 Q2", NTV2_XptHDMIIn1Q2);
5985  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 1 Q3", NTV2_XptHDMIIn1Q3);
5986  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 1 Q4", NTV2_XptHDMIIn1Q4);
5987  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 1 RGB", NTV2_XptHDMIIn1RGB);
5988  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 1 Q2 RGB", NTV2_XptHDMIIn1Q2RGB);
5989  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 1 Q3 RGB", NTV2_XptHDMIIn1Q3RGB);
5990  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 1 Q4 RGB", NTV2_XptHDMIIn1Q4RGB);
5991  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 2", NTV2_XptHDMIIn2);
5992  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 2 Q2", NTV2_XptHDMIIn2Q2);
5993  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 2 Q3", NTV2_XptHDMIIn2Q3);
5994  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 2 Q4", NTV2_XptHDMIIn2Q4);
5995  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 2 RGB", NTV2_XptHDMIIn2RGB);
5996  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 2 Q2 RGB", NTV2_XptHDMIIn2Q2RGB);
5997  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 2 Q3 RGB", NTV2_XptHDMIIn2Q3RGB);
5998  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 2 Q4 RGB", NTV2_XptHDMIIn2Q4RGB);
5999  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 3", NTV2_XptHDMIIn3);
6000  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 3 RGB", NTV2_XptHDMIIn3RGB);
6001  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 4", NTV2_XptHDMIIn4);
6002  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "HDMI In 4 RGB", NTV2_XptHDMIIn4RGB);
6003  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 1", NTV2_XptDuallinkIn1);
6004  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 2", NTV2_XptDuallinkIn2);
6005  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 3", NTV2_XptDuallinkIn3);
6006  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 4", NTV2_XptDuallinkIn4);
6007  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 1", NTV2_XptLUT1Out);
6008  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 1 Vid RGB", NTV2_XptCSC1VidRGB);
6010  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FrameSync 1 RGB", NTV2_XptFrameSync1RGB);
6011  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FrameSync 2 RGB", NTV2_XptFrameSync2RGB);
6012  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 2", NTV2_XptLUT2Out);
6013  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 1 Key YUV", NTV2_XptCSC1KeyYUV);
6016  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 2 Vid YUV", NTV2_XptCSC2VidYUV);
6017  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 2 Vid RGB", NTV2_XptCSC2VidRGB);
6018  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 2 Key YUV", NTV2_XptCSC2KeyYUV);
6019  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 1 Vid YUV", NTV2_XptMixer1VidYUV);
6020  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 1 Key YUV", NTV2_XptMixer1KeyYUV);
6021  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 1 Vid RGB", NTV2_XptMixer1VidRGB);
6022  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "IICT RGB", NTV2_XptIICTRGB);
6023  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "IICT 2 RGB", NTV2_XptIICT2RGB);
6024  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Test Pattern YUV", NTV2_XptTestPatternYUV);
6025  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 2 Vid YUV", NTV2_XptMixer2VidYUV);
6026  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 2 Key YUV", NTV2_XptMixer2KeyYUV);
6027  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 2 Vid RGB", NTV2_XptMixer2VidRGB);
6028  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Stereo Compressor Out", NTV2_XptStereoCompressorOut);
6029  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 3", NTV2_XptLUT3Out);
6030  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 4", NTV2_XptLUT4Out);
6035  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 3", NTV2_XptSDIIn3);
6036  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 3 DS2", NTV2_XptSDIIn3DS2);
6037  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 4", NTV2_XptSDIIn4);
6038  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 4 DS2", NTV2_XptSDIIn4DS2);
6039  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 3 Vid YUV", NTV2_XptCSC3VidYUV);
6040  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 3 Vid RGB", NTV2_XptCSC3VidRGB);
6041  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 3 Key YUV", NTV2_XptCSC3KeyYUV);
6042  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 4 Vid YUV", NTV2_XptCSC4VidYUV);
6043  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 4 Vid RGB", NTV2_XptCSC4VidRGB);
6044  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 4 Key YUV", NTV2_XptCSC4KeyYUV);
6045  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 5 Vid YUV", NTV2_XptCSC5VidYUV);
6046  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 5 Vid RGB", NTV2_XptCSC5VidRGB);
6047  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 5 Key YUV", NTV2_XptCSC5KeyYUV);
6048  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 5", NTV2_XptLUT5Out);
6049  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 5", NTV2_XptDuallinkOut5);
6050  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 5 DS2", NTV2_XptDuallinkOut5DS2);
6051  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "4K DownConv Out", NTV2_Xpt4KDownConverterOut);
6052  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "4K DownConv Out RGB", NTV2_Xpt4KDownConverterOutRGB);
6061  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 5", NTV2_XptSDIIn5);
6062  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 5 DS2", NTV2_XptSDIIn5DS2);
6063  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 6", NTV2_XptSDIIn6);
6064  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 6 DS2", NTV2_XptSDIIn6DS2);
6065  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 7", NTV2_XptSDIIn7);
6066  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 7 DS2", NTV2_XptSDIIn7DS2);
6067  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 8", NTV2_XptSDIIn8);
6068  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 8 DS2", NTV2_XptSDIIn8DS2);
6069  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 6 Vid YUV", NTV2_XptCSC6VidYUV);
6070  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 6 Vid RGB", NTV2_XptCSC6VidRGB);
6071  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 6 Key YUV", NTV2_XptCSC6KeyYUV);
6072  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 7 Vid YUV", NTV2_XptCSC7VidYUV);
6073  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 7 Vid RGB", NTV2_XptCSC7VidRGB);
6074  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 7 Key YUV", NTV2_XptCSC7KeyYUV);
6075  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 8 Vid YUV", NTV2_XptCSC8VidYUV);
6076  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 8 Vid RGB", NTV2_XptCSC8VidRGB);
6077  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "CSC 8 Key YUV", NTV2_XptCSC8KeyYUV);
6078  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 6", NTV2_XptLUT6Out);
6079  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 7", NTV2_XptLUT7Out);
6080  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "LUT 8", NTV2_XptLUT8Out);
6081  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 6", NTV2_XptDuallinkOut6);
6082  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 6 DS2", NTV2_XptDuallinkOut6DS2);
6083  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 7", NTV2_XptDuallinkOut7);
6084  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 7 DS2", NTV2_XptDuallinkOut7DS2);
6085  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 8", NTV2_XptDuallinkOut8);
6086  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL Out 8 DS2", NTV2_XptDuallinkOut8DS2);
6087  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 3 Vid YUV", NTV2_XptMixer3VidYUV);
6088  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 3 Key YUV", NTV2_XptMixer3KeyYUV);
6089  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 3 Vid RGB", NTV2_XptMixer3VidRGB);
6090  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 4 Vid YUV", NTV2_XptMixer4VidYUV);
6091  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 4 Key YUV", NTV2_XptMixer4KeyYUV);
6092  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Mixer 4 Vid RGB", NTV2_XptMixer4VidRGB);
6093  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 5", NTV2_XptDuallinkIn5);
6094  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 6", NTV2_XptDuallinkIn6);
6095  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 7", NTV2_XptDuallinkIn7);
6096  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 8", NTV2_XptDuallinkIn8);
6097  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 1 DS2", NTV2_XptDuallinkIn1DS2);
6098  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 2 DS2", NTV2_XptDuallinkIn2DS2);
6099  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 3 DS2", NTV2_XptDuallinkIn3DS2);
6100  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 4 DS2", NTV2_XptDuallinkIn4DS2);
6101  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 5 DS2", NTV2_XptDuallinkIn5DS2);
6102  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 6 DS2", NTV2_XptDuallinkIn6DS2);
6103  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 7 DS2", NTV2_XptDuallinkIn7DS2);
6104  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DL In 8 DS2", NTV2_XptDuallinkIn8DS2);
6105  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 1a YUV", NTV2_Xpt425Mux1AYUV);
6106  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 1a RGB", NTV2_Xpt425Mux1ARGB);
6107  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 1b YUV", NTV2_Xpt425Mux1BYUV);
6108  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 1b RGB", NTV2_Xpt425Mux1BRGB);
6109  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 2a YUV", NTV2_Xpt425Mux2AYUV);
6110  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 2a RGB", NTV2_Xpt425Mux2ARGB);
6111  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 2b YUV", NTV2_Xpt425Mux2BYUV);
6112  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 2b RGB", NTV2_Xpt425Mux2BRGB);
6113  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 3a YUV", NTV2_Xpt425Mux3AYUV);
6114  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 3a RGB", NTV2_Xpt425Mux3ARGB);
6115  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 3b YUV", NTV2_Xpt425Mux3BYUV);
6116  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 3b RGB", NTV2_Xpt425Mux3BRGB);
6117  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 4a YUV", NTV2_Xpt425Mux4AYUV);
6118  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 4a RGB", NTV2_Xpt425Mux4ARGB);
6119  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 4b YUV", NTV2_Xpt425Mux4BYUV);
6120  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "425Mux 4b RGB", NTV2_Xpt425Mux4BRGB);
6121  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 1 DS2 YUV", NTV2_XptFrameBuffer1_DS2YUV);
6122  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 1 DS2 RGB", NTV2_XptFrameBuffer1_DS2RGB);
6123  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 2 DS2 YUV", NTV2_XptFrameBuffer2_DS2YUV);
6124  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 2 DS2 RGB", NTV2_XptFrameBuffer2_DS2RGB);
6125  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 3 DS2 YUV", NTV2_XptFrameBuffer3_DS2YUV);
6126  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 3 DS2 RGB", NTV2_XptFrameBuffer3_DS2RGB);
6127  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 4 DS2 YUV", NTV2_XptFrameBuffer4_DS2YUV);
6128  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 4 DS2 RGB", NTV2_XptFrameBuffer4_DS2RGB);
6129  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 5 DS2 YUV", NTV2_XptFrameBuffer5_DS2YUV);
6130  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 5 DS2 RGB", NTV2_XptFrameBuffer5_DS2RGB);
6131  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 6 DS2 YUV", NTV2_XptFrameBuffer6_DS2YUV);
6132  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 6 DS2 RGB", NTV2_XptFrameBuffer6_DS2RGB);
6133  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 7 DS2 YUV", NTV2_XptFrameBuffer7_DS2YUV);
6134  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 7 DS2 RGB", NTV2_XptFrameBuffer7_DS2RGB);
6135  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 8 DS2 YUV", NTV2_XptFrameBuffer8_DS2YUV);
6136  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "FB 8 DS2 RGB", NTV2_XptFrameBuffer8_DS2RGB);
6137  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Runtime Calc", NTV2_XptRuntimeCalc);
6138  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Multi-Link Out 1 DS1", NTV2_XptMultiLinkOut1DS1);
6139  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Multi-Link Out 1 DS2", NTV2_XptMultiLinkOut1DS2);
6140  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Multi-Link Out 1 DS3", NTV2_XptMultiLinkOut1DS3);
6141  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Multi-Link Out 1 DS4", NTV2_XptMultiLinkOut1DS4);
6142  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Multi-Link Out 2 DS1", NTV2_XptMultiLinkOut2DS1);
6143  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Multi-Link Out 2 DS2", NTV2_XptMultiLinkOut2DS2);
6144  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Multi-Link Out 2 DS3", NTV2_XptMultiLinkOut2DS3);
6145  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Multi-Link Out 2 DS4", NTV2_XptMultiLinkOut2DS4);
6146  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "3D LUT 1 YUV", NTV2_Xpt3DLUT1YUV);
6147  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "3D LUT 1 RGB", NTV2_Xpt3DLUT1RGB);
6148  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "OE Out YUV", NTV2_XptOEOutYUV);
6149  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "OE Out RGB", NTV2_XptOEOutRGB);
6150  #if !defined(NTV2_DEPRECATE_16_0)
6151  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "WaterMarker 1 RGB", NTV2_XptWaterMarkerRGB);
6152  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "WaterMarker 2 RGB", NTV2_XptWaterMarker2RGB);
6153  #endif
6154  #if !defined(_DEBUG)
6155  default: break;
6156  #endif
6157  } // switch on inValue
6158  return "";
6159 } // NTV2OutputCrosspointIDToString
6160 
6161 
6162 string NTV2WidgetIDToString (const NTV2WidgetID inValue, const bool inCompactDisplay)
6163 {
6164  switch (inValue)
6165  {
6170  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "CSC1", NTV2_WgtCSC1);
6171  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "CSC2", NTV2_WgtCSC2);
6172  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "LUT1", NTV2_WgtLUT1);
6173  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "LUT2", NTV2_WgtLUT2);
6176  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDIIn1", NTV2_WgtSDIIn1);
6177  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDIIn2", NTV2_WgtSDIIn2);
6178  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIIn1", NTV2_Wgt3GSDIIn1);
6179  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIIn2", NTV2_Wgt3GSDIIn2);
6180  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIIn3", NTV2_Wgt3GSDIIn3);
6181  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIIn4", NTV2_Wgt3GSDIIn4);
6182  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDIOut1", NTV2_WgtSDIOut1);
6183  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDIOut2", NTV2_WgtSDIOut2);
6184  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDIOut3", NTV2_WgtSDIOut3);
6185  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDIOut4", NTV2_WgtSDIOut4);
6186  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIOut1", NTV2_Wgt3GSDIOut1);
6187  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIOut2", NTV2_Wgt3GSDIOut2);
6188  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIOut3", NTV2_Wgt3GSDIOut3);
6189  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIOut4", NTV2_Wgt3GSDIOut4);
6197  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "AnlgIn1", NTV2_WgtAnalogIn1);
6198  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "AnlgOut1", NTV2_WgtAnalogOut1);
6200  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIIn1", NTV2_WgtHDMIIn1);
6201  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIOut1", NTV2_WgtHDMIOut1);
6204  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Mixer1", NTV2_WgtMixer1);
6205  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Compress1", NTV2_WgtCompression1);
6206  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "ProcAmp1", NTV2_WgtProcAmp1);
6207  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "WaterMrkr1", NTV2_WgtWaterMarker1);
6208  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "WaterMrkr2", NTV2_WgtWaterMarker2);
6209  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "IICT1", NTV2_WgtIICT1);
6210  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "IICT2", NTV2_WgtIICT2);
6212  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "GenLock", NTV2_WgtGenLock);
6213  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "DCIMixer1", NTV2_WgtDCIMixer1);
6214  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Mixer2", NTV2_WgtMixer2);
6216  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "LUT3", NTV2_WgtLUT3);
6217  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "LUT4", NTV2_WgtLUT4);
6222  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "CSC3", NTV2_WgtCSC3);
6223  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "CSC4", NTV2_WgtCSC4);
6224  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv2In1", NTV2_WgtHDMIIn1v2);
6225  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv2Out1", NTV2_WgtHDMIOut1v2);
6226  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDIMonOut1", NTV2_WgtSDIMonOut1);
6227  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "CSC5", NTV2_WgtCSC5);
6228  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "LUT5", NTV2_WgtLUT5);
6231  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIIn5", NTV2_Wgt3GSDIIn5);
6232  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIIn6", NTV2_Wgt3GSDIIn6);
6233  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIIn7", NTV2_Wgt3GSDIIn7);
6234  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIIn8", NTV2_Wgt3GSDIIn8);
6235  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIOut5", NTV2_Wgt3GSDIOut5);
6236  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIOut6", NTV2_Wgt3GSDIOut6);
6237  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIOut7", NTV2_Wgt3GSDIOut7);
6238  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3GSDIOut8", NTV2_Wgt3GSDIOut8);
6246  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "CSC6", NTV2_WgtCSC6);
6247  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "CSC7", NTV2_WgtCSC7);
6248  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "CSC8", NTV2_WgtCSC8);
6249  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "LUT6", NTV2_WgtLUT6);
6250  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "LUT7", NTV2_WgtLUT7);
6251  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "LUT8", NTV2_WgtLUT8);
6252  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Mixer3", NTV2_WgtMixer3);
6253  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Mixer4", NTV2_WgtMixer4);
6258  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv3In1", NTV2_WgtHDMIIn1v3);
6259  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv3Out1", NTV2_WgtHDMIOut1v3);
6260  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "425Mux1", NTV2_Wgt425Mux1);
6261  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "425Mux2", NTV2_Wgt425Mux2);
6262  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "425Mux3", NTV2_Wgt425Mux3);
6263  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "425Mux4", NTV2_Wgt425Mux4);
6264  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIIn1", NTV2_Wgt12GSDIIn1);
6265  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIIn2", NTV2_Wgt12GSDIIn2);
6266  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIIn3", NTV2_Wgt12GSDIIn3);
6267  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIIn4", NTV2_Wgt12GSDIIn4);
6268  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIIn5", NTV2_Wgt12GSDIIn5);
6269  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIIn6", NTV2_Wgt12GSDIIn6);
6270  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIIn7", NTV2_Wgt12GSDIIn7);
6271  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIIn8", NTV2_Wgt12GSDIIn8);
6272  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIOut1", NTV2_Wgt12GSDIOut1);
6273  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIOut2", NTV2_Wgt12GSDIOut2);
6274  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIOut3", NTV2_Wgt12GSDIOut3);
6275  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIOut4", NTV2_Wgt12GSDIOut4);
6276  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIOut5", NTV2_Wgt12GSDIOut5);
6277  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIOut6", NTV2_Wgt12GSDIOut6);
6278  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIOut7", NTV2_Wgt12GSDIOut7);
6279  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "12GSDIOut8", NTV2_Wgt12GSDIOut8);
6280  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv4In1", NTV2_WgtHDMIIn1v4);
6281  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv4In2", NTV2_WgtHDMIIn2v4);
6282  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv4In3", NTV2_WgtHDMIIn3v4);
6283  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv4In4", NTV2_WgtHDMIIn4v4);
6284  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv5In1", NTV2_WgtHDMIIn1v5);
6285  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv4Out1", NTV2_WgtHDMIOut1v4);
6286  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv5Out1", NTV2_WgtHDMIOut1v5);
6287  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv6Out1", NTV2_WgtHDMIOut1v6);
6288  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv6Out2", NTV2_WgtHDMIOut2v6);
6289  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv6Out3", NTV2_WgtHDMIOut3v6);
6290  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMIv6Out4", NTV2_WgtHDMIOut4v6);
6291  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "MultiLinkOut1", NTV2_WgtMultiLinkOut1);
6292  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "MultiLinkOut2", NTV2_WgtMultiLinkOut2);
6293  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "3DLUT1", NTV2_Wgt3DLUT1);
6294  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "OE1", NTV2_WgtOE1);
6295  case NTV2_WgtModuleTypeCount: return "???"; //special case
6296  }
6297  return "";
6298 
6299 } // NTV2WidgetIDToString
6300 
6301 string NTV2WidgetTypeToString (const NTV2WidgetType inValue, const bool inCompactDisplay)
6302 {
6303  switch (inValue) {
6308  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI Input", NTV2WidgetType_SDIIn);
6309  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI Input 3G", NTV2WidgetType_SDIIn3G);
6310  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI Output", NTV2WidgetType_SDIOut);
6311  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI Output 3G", NTV2WidgetType_SDIOut3G);
6312  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI Monitor Output", NTV2WidgetType_SDIMonOut);
6313  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "DualLink Input V1", NTV2WidgetType_DualLinkV1In);
6314  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "DualLink Input V2", NTV2WidgetType_DualLinkV2In);
6315  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "DualLink Output V1", NTV2WidgetType_DualLinkV1Out);
6316  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "DualLink Output V2", NTV2WidgetType_DualLinkV2Out);
6317  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Analog Input", NTV2WidgetType_AnalogIn);
6318  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Analog Output", NTV2WidgetType_AnalogOut);
6319  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Analog Composite Output", NTV2WidgetType_AnalogCompositeOut);
6320  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMI Input V1", NTV2WidgetType_HDMIInV1);
6321  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMI Input V2", NTV2WidgetType_HDMIInV2);
6322  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMI Input V3", NTV2WidgetType_HDMIInV3);
6323  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMI Input V4", NTV2WidgetType_HDMIInV4);
6324  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMI Input V5", NTV2WidgetType_HDMIInV5);
6325  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Up-Down Converter", NTV2WidgetType_UpDownConverter);
6329  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Stereo Compressor", NTV2WidgetType_StereoCompressor);
6332  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "4K Down Converter", NTV2WidgetType_4KDownConverter);
6333  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMI Output V1", NTV2WidgetType_HDMIOutV1);
6334  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMI Output V2", NTV2WidgetType_HDMIOutV2);
6335  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMI Output V3", NTV2WidgetType_HDMIOutV3);
6336  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMI Output V4", NTV2WidgetType_HDMIOutV4);
6337  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMI Output V5", NTV2WidgetType_HDMIOutV5);
6338  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "HDMI Output V6", NTV2WidgetType_HDMIOutV6);
6339  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SMPTE 425 Mux", NTV2WidgetType_SMPTE425Mux);
6340  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI Input 12G", NTV2WidgetType_SDIIn12G);
6341  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI Output 12G", NTV2WidgetType_SDIOut12G);
6342  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Multi-Link Output", NTV2WidgetType_MultiLinkOut);
6348  case NTV2WidgetType_Max: return "???";
6349  }
6350  return "";
6351 }
6352 
6353 string NTV2TaskModeToString (const NTV2TaskMode inValue, const bool inCompactDisplay)
6354 {
6355  switch (inValue)
6356  {
6357  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Disabled", NTV2_DISABLE_TASKS);
6358  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Standard", NTV2_STANDARD_TASKS);
6361  }
6362  return "";
6363 }
6364 
6365 
6367 {
6368  ostringstream oss;
6369  oss << inObj;
6370  return oss.str ();
6371 }
6372 
6373 
6374 ostream & operator << (ostream & inOutStr, const NTV2RegisterNumberSet & inObj)
6375 {
6376  inOutStr << "[" << inObj.size () << " regs: ";
6377  for (NTV2RegNumSetConstIter iter (inObj.begin ()); iter != inObj.end (); )
6378  {
6379  inOutStr << ::NTV2RegisterNumberToString (NTV2RegisterNumber (*iter));
6380  if (++iter != inObj.end ())
6381  inOutStr << ", ";
6382  }
6383  return inOutStr << "]";
6384 }
6385 
6386 
6388 {
6389  inOutSet.insert (inRegisterNumber);
6390  return inOutSet;
6391 }
6392 
6393 
6394 string NTV2TCIndexToString (const NTV2TCIndex inValue, const bool inCompactDisplay)
6395 {
6396  switch (inValue)
6397  {
6399  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI1-VITC", NTV2_TCINDEX_SDI1);
6400  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI2-VITC", NTV2_TCINDEX_SDI2);
6401  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI3-VITC", NTV2_TCINDEX_SDI3);
6402  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI4-VITC", NTV2_TCINDEX_SDI4);
6407  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI5-VITC", NTV2_TCINDEX_SDI5);
6408  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI6-VITC", NTV2_TCINDEX_SDI6);
6409  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI7-VITC", NTV2_TCINDEX_SDI7);
6410  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI8-VITC", NTV2_TCINDEX_SDI8);
6417  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI1-VITC2", NTV2_TCINDEX_SDI1_2);
6418  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI2-VITC2", NTV2_TCINDEX_SDI2_2);
6419  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI3-VITC2", NTV2_TCINDEX_SDI3_2);
6420  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI4-VITC2", NTV2_TCINDEX_SDI4_2);
6421  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI5-VITC2", NTV2_TCINDEX_SDI5_2);
6422  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI6-VITC2", NTV2_TCINDEX_SDI6_2);
6423  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI7-VITC2", NTV2_TCINDEX_SDI7_2);
6424  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SDI8-VITC2", NTV2_TCINDEX_SDI8_2);
6426  }
6427  return "";
6428 }
6429 
6430 
6431 string NTV2AudioChannelPairToString (const NTV2AudioChannelPair inValue, const bool inCompactDisplay)
6432 {
6433  ostringstream oss;
6434  if (NTV2_IS_VALID_AUDIO_CHANNEL_PAIR(inValue))
6435  oss << (inCompactDisplay ? "" : "NTV2_AudioChannel")
6436  << DEC(inValue * 2 + 1) << (inCompactDisplay ? "-" : "_") << DEC(inValue * 2 + 2);
6437  else if (!inCompactDisplay)
6438  oss << "NTV2_AUDIO_CHANNEL_PAIR_INVALID";
6439  return oss.str();
6440 }
6441 
6442 
6443 string NTV2AudioChannelQuadToString (const NTV2Audio4ChannelSelect inValue, const bool inCompactDisplay)
6444 {
6445  ostringstream oss;
6446  if (NTV2_IS_VALID_AUDIO_CHANNEL_QUAD(inValue))
6447  oss << (inCompactDisplay ? "" : "NTV2_AudioChannel")
6448  << (inValue * 4 + 1) << (inCompactDisplay ? "-" : "_") << (inValue * 4 + 4);
6449  else if (!inCompactDisplay)
6450  oss << "NTV2_AUDIO_CHANNEL_QUAD_INVALID";
6451  return oss.str ();
6452 }
6453 
6454 
6455 string NTV2AudioChannelOctetToString (const NTV2Audio8ChannelSelect inValue, const bool inCompactDisplay)
6456 {
6457  ostringstream oss;
6458  if (NTV2_IS_VALID_AUDIO_CHANNEL_OCTET(inValue))
6459  oss << (inCompactDisplay ? "" : "NTV2_AudioChannel")
6460  << (inValue * 8 + 1) << (inCompactDisplay ? "-" : "_") << (inValue * 8 + 8);
6461  else if (!inCompactDisplay)
6462  oss << "NTV2_AUDIO_CHANNEL_OCTET_INVALID";
6463  return oss.str ();
6464 }
6465 
6466 
6467 string NTV2FramesizeToString (const NTV2Framesize inValue, const bool inCompactDisplay)
6468 {
6469  switch (inValue)
6470  {
6488  }
6489  return "";
6490 }
6491 
6492 
6493 string NTV2ModeToString (const NTV2Mode inValue, const bool inCompactDisplay)
6494 {
6495  switch (inValue)
6496  {
6500  }
6501  return "";
6502 }
6503 
6504 
6505 string NTV2VANCModeToString (const NTV2VANCMode inValue, const bool inCompactDisplay)
6506 {
6507  switch (inValue)
6508  {
6513  }
6514  return "";
6515 }
6516 
6517 
6518 string NTV2MixerKeyerModeToString (const NTV2MixerKeyerMode inValue, const bool inCompactDisplay)
6519 {
6520  switch(inValue)
6521  {
6527  }
6528  return "";
6529 }
6530 
6531 
6532 string NTV2MixerInputControlToString (const NTV2MixerKeyerInputControl inValue, const bool inCompactDisplay)
6533 {
6534  switch(inValue)
6535  {
6540  }
6541  return "";
6542 }
6543 
6544 
6545 string NTV2VideoLimitingToString (const NTV2VideoLimiting inValue, const bool inCompactDisplay)
6546 {
6547  switch(inValue)
6548  {
6553  }
6554  return "";
6555 }
6556 
6557 
6558 string NTV2BreakoutTypeToString (const NTV2BreakoutType inValue, const bool inCompactDisplay)
6559 {
6560  switch(inValue)
6561  {
6565  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "KBox", NTV2_KBox);
6566  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "KLBox", NTV2_KLBox);
6567  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "K3Box", NTV2_K3Box);
6568  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "KLHiBox", NTV2_KLHiBox);
6569  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "KLHePlusBox", NTV2_KLHePlusBox);
6570  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "K3GBox", NTV2_K3GBox);
6572  case NTV2_MAX_NUM_BreakoutTypes: break; //special case
6573  }
6574  return "";
6575 }
6576 
6577 string NTV2AncDataRgnToStr (const NTV2AncDataRgn inValue, const bool inCompactDisplay)
6578 {
6579  switch(inValue)
6580  {
6585  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "AncAll", NTV2_AncRgn_All);
6586  case NTV2_MAX_NUM_AncRgns: break; //special case
6587  }
6588  return "";
6589 }
6590 
6591 string NTV2UpConvertModeToString (const NTV2UpConvertMode inValue, const bool inCompact)
6592 {
6593  switch(inValue)
6594  {
6596  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompact, "4" "\xC3\x97" "3 Pillar Box", NTV2_UpConvertPillarbox4x3);
6597  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompact, "Zoomed 14" "\xC3\x97" "9", NTV2_UpConvertZoom14x9);
6600  case NTV2_MAX_NUM_UpConvertModes: break; //special case
6601  }
6602  return "";
6603 }
6604 
6605 string NTV2DownConvertModeToString (const NTV2DownConvertMode inValue, const bool inCompact)
6606 {
6607  switch(inValue)
6608  {
6612  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompact, "Zoomed 14" "\xC3\x97" "9", NTV2_DownConvert14x9);
6613  case NTV2_MAX_NUM_DownConvertModes: break; //special case
6614  }
6615  return "";
6616 }
6617 
6618 string NTV2ScanMethodToString (const NTV2ScanMethod inValue, const bool inCompact)
6619 {
6620  switch(inValue)
6621  {
6625  case NTV2_NUM_SCANMETHODS: break;
6626  }
6627  return "";
6628 }
6629 
6630 string NTV2IsoConvertModeToString (const NTV2IsoConvertMode inValue, const bool inCompact)
6631 {
6632  switch(inValue)
6633  {
6635  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompact, "Horiz Cropped", NTV2_IsoHCrop);
6636  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompact, "Vert Cropped", NTV2_IsoVCrop);
6638  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompact, "14" "\xC3\x97" "9", NTV2_Iso14x9);
6640  case NTV2_MAX_NUM_IsoConvertModes: break; //special case
6641  }
6642  return "";
6643 }
6644 
6645 string NTV2HDMIBitDepthToString (const NTV2HDMIBitDepth inValue, const bool inCompact)
6646 {
6647  switch(inValue)
6648  {
6652  case NTV2_INVALID_HDMIBitDepth: break;
6653  }
6654  return "";
6655 }
6656 
6657 string NTV2HDMIAudioChannelsToString (const NTV2HDMIAudioChannels inValue, const bool inCompact)
6658 {
6659  switch(inValue)
6660  {
6664  }
6665  return "";
6666 }
6667 
6668 string NTV2HDMIProtocolToString (const NTV2HDMIProtocol inValue, const bool inCompact)
6669 {
6670  switch(inValue)
6671  {
6674  case NTV2_INVALID_HDMI_PROTOCOL: break;
6675  }
6676  return "";
6677 }
6678 
6679 string NTV2HDMIRangeToString (const NTV2HDMIRange inValue, const bool inCompact)
6680 {
6681  switch(inValue)
6682  {
6685  case NTV2_INVALID_HDMI_RANGE: break;
6686  }
6687  return "";
6688 }
6689 
6690 string NTV2HDMIColorSpaceToString (const NTV2HDMIColorSpace inValue, const bool inCompact)
6691 {
6692  switch(inValue)
6693  {
6697  case NTV2_INVALID_HDMI_COLORSPACE: break;
6698  }
6699  return "";
6700 }
6701 
6702 string NTV2AudioFormatToString (const NTV2AudioFormat inValue, const bool inCompact)
6703 {
6704  switch(inValue)
6705  {
6708  case NTV2_AUDIO_FORMAT_INVALID: break;
6709  }
6710  return "";
6711 }
6712 
6713 string NTV2EmbeddedAudioInputToString (const NTV2EmbeddedAudioInput inValue, const bool inCompactDisplay)
6714 {
6715  switch(inValue)
6716  {
6726  }
6727  return "";
6728 }
6729 
6730 
6731 string NTV2AudioSourceToString (const NTV2AudioSource inValue, const bool inCompactDisplay)
6732 {
6733  switch (inValue)
6734  {
6741  }
6742  return "";
6743 }
6744 
6745 
6746 string NTV2VideoFormatToString (const NTV2VideoFormat inFormat, const bool inUseFrameRate)
6747 {
6748  switch (inFormat)
6749  {
6750  case NTV2_FORMAT_1080i_5000: return inUseFrameRate ? "1080i25" : "1080i50";
6751  case NTV2_FORMAT_1080i_5994: return inUseFrameRate ? "1080i29.97" : "1080i59.94";
6752  case NTV2_FORMAT_1080i_6000: return inUseFrameRate ? "1080i30" : "1080i60";
6753  case NTV2_FORMAT_720p_5994: return "720p59.94";
6754  case NTV2_FORMAT_720p_6000: return "720p60";
6755  case NTV2_FORMAT_1080psf_2398: return "1080sf23.98";
6756  case NTV2_FORMAT_1080psf_2400: return "1080sf24";
6757  case NTV2_FORMAT_1080p_2997: return "1080p29.97";
6758  case NTV2_FORMAT_1080p_3000: return "1080p30";
6759  case NTV2_FORMAT_1080p_2500: return "1080p25";
6760  case NTV2_FORMAT_1080p_2398: return "1080p23.98";
6761  case NTV2_FORMAT_1080p_2400: return "1080p24";
6762  case NTV2_FORMAT_1080p_2K_2398: return "2Kp23.98";
6763  case NTV2_FORMAT_1080p_2K_2400: return "2Kp24";
6764  case NTV2_FORMAT_1080psf_2K_2398: return "2Ksf23.98";
6765  case NTV2_FORMAT_1080psf_2K_2400: return "2Ksf24";
6766  case NTV2_FORMAT_720p_5000: return "720p50";
6767  case NTV2_FORMAT_1080p_5000_B: return "1080p50b";
6768  case NTV2_FORMAT_1080p_5994_B: return "1080p59.94b";
6769  case NTV2_FORMAT_1080p_6000_B: return "1080p60b";
6770  case NTV2_FORMAT_720p_2398: return "720p23.98";
6771  case NTV2_FORMAT_720p_2500: return "720p25";
6772  case NTV2_FORMAT_1080p_5000_A: return "1080p50a";
6773  case NTV2_FORMAT_1080p_5994_A: return "1080p59.94a";
6774  case NTV2_FORMAT_1080p_6000_A: return "1080p60a";
6775  case NTV2_FORMAT_1080p_2K_2500: return "2Kp25";
6776  case NTV2_FORMAT_1080psf_2K_2500: return "2Ksf25";
6777  case NTV2_FORMAT_1080psf_2500_2: return "1080sf25";
6778  case NTV2_FORMAT_1080psf_2997_2: return "1080sf29.97";
6779  case NTV2_FORMAT_1080psf_3000_2: return "1080sf30";
6780  case NTV2_FORMAT_525_5994: return inUseFrameRate ? "525i29.97" : "525i59.94";
6781  case NTV2_FORMAT_625_5000: return inUseFrameRate ? "625i25" : "625i50";
6782  case NTV2_FORMAT_525_2398: return "525i23.98";
6783  case NTV2_FORMAT_525_2400: return "525i24";
6784  case NTV2_FORMAT_525psf_2997: return "525sf29.97";
6785  case NTV2_FORMAT_625psf_2500: return "625sf25";
6786  case NTV2_FORMAT_2K_1498: return "2Kx1556sf14.98";
6787  case NTV2_FORMAT_2K_1500: return "2Kx1556sf15";
6788  case NTV2_FORMAT_2K_2398: return "2Kx1556sf23.98";
6789  case NTV2_FORMAT_2K_2400: return "2Kx1556sf24";
6790  case NTV2_FORMAT_2K_2500: return "2Kx1556sf25";
6791  case NTV2_FORMAT_4x1920x1080psf_2398: return "UHDsf23.98";
6792  case NTV2_FORMAT_4x1920x1080psf_2400: return "UHDsf24";
6793  case NTV2_FORMAT_4x1920x1080psf_2500: return "UHDsf25";
6794  case NTV2_FORMAT_4x1920x1080p_2398: return "UHDp23.98";
6795  case NTV2_FORMAT_4x1920x1080p_2400: return "UHDp24";
6796  case NTV2_FORMAT_4x1920x1080p_2500: return "UHDp25";
6797  case NTV2_FORMAT_4x2048x1080psf_2398: return "4Ksf23.98";
6798  case NTV2_FORMAT_4x2048x1080psf_2400: return "4Ksf24";
6799  case NTV2_FORMAT_4x2048x1080psf_2500: return "4Ksf25";
6800  case NTV2_FORMAT_4x2048x1080p_2398: return "4Kp23.98";
6801  case NTV2_FORMAT_4x2048x1080p_2400: return "4Kp24";
6802  case NTV2_FORMAT_4x2048x1080p_2500: return "4Kp25";
6803  case NTV2_FORMAT_4x1920x1080p_2997: return "UHDp29.97";
6804  case NTV2_FORMAT_4x1920x1080p_3000: return "UHDp30";
6805  case NTV2_FORMAT_4x1920x1080psf_2997: return "UHDsf29.97";
6806  case NTV2_FORMAT_4x1920x1080psf_3000: return "UHDsf30";
6807  case NTV2_FORMAT_4x2048x1080p_2997: return "4Kp29.97";
6808  case NTV2_FORMAT_4x2048x1080p_3000: return "4Kp30";
6809  case NTV2_FORMAT_4x2048x1080psf_2997: return "4Ksf29.97";
6810  case NTV2_FORMAT_4x2048x1080psf_3000: return "4Ksf30";
6811  case NTV2_FORMAT_4x1920x1080p_5000: return "UHDp50";
6812  case NTV2_FORMAT_4x1920x1080p_5994: return "UHDp59.94";
6813  case NTV2_FORMAT_4x1920x1080p_6000: return "UHDp60";
6814  case NTV2_FORMAT_4x2048x1080p_5000: return "4Kp50";
6815  case NTV2_FORMAT_4x2048x1080p_5994: return "4Kp59.94";
6816  case NTV2_FORMAT_4x2048x1080p_6000: return "4Kp60";
6817  case NTV2_FORMAT_4x2048x1080p_4795: return "4Kp47.95";
6818  case NTV2_FORMAT_4x2048x1080p_4800: return "4Kp48";
6819  case NTV2_FORMAT_4x2048x1080p_11988: return "4Kp119";
6820  case NTV2_FORMAT_4x2048x1080p_12000: return "4Kp120";
6821  case NTV2_FORMAT_1080p_2K_6000_A: return "2Kp60a";
6822  case NTV2_FORMAT_1080p_2K_5994_A: return "2Kp59.94a";
6823  case NTV2_FORMAT_1080p_2K_2997: return "2Kp29.97";
6824  case NTV2_FORMAT_1080p_2K_3000: return "2Kp30";
6825  case NTV2_FORMAT_1080p_2K_5000_A: return "2Kp50a";
6826  case NTV2_FORMAT_1080p_2K_4795_A: return "2Kp47.95a";
6827  case NTV2_FORMAT_1080p_2K_4800_A: return "2Kp48a";
6828  case NTV2_FORMAT_1080p_2K_4795_B: return "2Kp47.95b";
6829  case NTV2_FORMAT_1080p_2K_4800_B: return "2Kp48b";
6830  case NTV2_FORMAT_1080p_2K_5000_B: return "2Kp50b";
6831  case NTV2_FORMAT_1080p_2K_5994_B: return "2Kp59.94b";
6832  case NTV2_FORMAT_1080p_2K_6000_B: return "2Kp60b";
6833  case NTV2_FORMAT_3840x2160psf_2398: return "UHDsf23.98";
6834  case NTV2_FORMAT_3840x2160psf_2400: return "UHDsf24";
6835  case NTV2_FORMAT_3840x2160psf_2500: return "UHDsf25";
6836  case NTV2_FORMAT_3840x2160p_2398: return "UHDp23.98";
6837  case NTV2_FORMAT_3840x2160p_2400: return "UHDp24";
6838  case NTV2_FORMAT_3840x2160p_2500: return "UHDp25";
6839  case NTV2_FORMAT_3840x2160p_2997: return "UHDp29.97";
6840  case NTV2_FORMAT_3840x2160p_3000: return "UHDp30";
6841  case NTV2_FORMAT_3840x2160psf_2997: return "UHDsf29.97";
6842  case NTV2_FORMAT_3840x2160psf_3000: return "UHDsf30";
6843  case NTV2_FORMAT_3840x2160p_5000: return "UHDp50";
6844  case NTV2_FORMAT_3840x2160p_5994: return "UHDp59.94";
6845  case NTV2_FORMAT_3840x2160p_6000: return "UHDp60";
6846  case NTV2_FORMAT_4096x2160psf_2398: return "4Ksf23.98";
6847  case NTV2_FORMAT_4096x2160psf_2400: return "4Ksf24";
6848  case NTV2_FORMAT_4096x2160psf_2500: return "4Ksf25";
6849  case NTV2_FORMAT_4096x2160p_2398: return "4Kp23.98";
6850  case NTV2_FORMAT_4096x2160p_2400: return "4Kp24";
6851  case NTV2_FORMAT_4096x2160p_2500: return "4Kp25";
6852  case NTV2_FORMAT_4096x2160p_2997: return "4Kp29.97";
6853  case NTV2_FORMAT_4096x2160p_3000: return "4Kp30";
6854  case NTV2_FORMAT_4096x2160psf_2997: return "4Ksf29.97";
6855  case NTV2_FORMAT_4096x2160psf_3000: return "4Ksf30";
6856  case NTV2_FORMAT_4096x2160p_4795: return "4Kp47.95";
6857  case NTV2_FORMAT_4096x2160p_4800: return "4Kp48";
6858  case NTV2_FORMAT_4096x2160p_5000: return "4Kp50";
6859  case NTV2_FORMAT_4096x2160p_5994: return "4Kp59.94";
6860  case NTV2_FORMAT_4096x2160p_6000: return "4Kp60";
6861  case NTV2_FORMAT_4096x2160p_11988: return "4Kp119";
6862  case NTV2_FORMAT_4096x2160p_12000: return "4Kp120";
6863  case NTV2_FORMAT_4x1920x1080p_5000_B: return "UHDp50b";
6864  case NTV2_FORMAT_4x1920x1080p_5994_B: return "UHDp59.94b";
6865  case NTV2_FORMAT_4x1920x1080p_6000_B: return "UHDp60b";
6866  case NTV2_FORMAT_4x2048x1080p_5000_B: return "4Kp50b";
6867  case NTV2_FORMAT_4x2048x1080p_5994_B: return "4Kp59.94b";
6868  case NTV2_FORMAT_4x2048x1080p_6000_B: return "4Kp60b";
6869  case NTV2_FORMAT_4x2048x1080p_4795_B: return "4Kp47.95b";
6870  case NTV2_FORMAT_4x2048x1080p_4800_B: return "4Kp48b";
6871  case NTV2_FORMAT_3840x2160p_5000_B: return "UHDp50b";
6872  case NTV2_FORMAT_3840x2160p_5994_B: return "UHDp59.94b";
6873  case NTV2_FORMAT_3840x2160p_6000_B: return "UHDp60b";
6874  case NTV2_FORMAT_4096x2160p_4795_B: return "4Kp47.95b";
6875  case NTV2_FORMAT_4096x2160p_4800_B: return "4Kp48b";
6876  case NTV2_FORMAT_4096x2160p_5000_B: return "4Kp50b";
6877  case NTV2_FORMAT_4096x2160p_5994_B: return "4Kp59.94b";
6878  case NTV2_FORMAT_4096x2160p_6000_B: return "4Kp60b";
6879  case NTV2_FORMAT_4x3840x2160p_2398: return "UHD2p23.98";
6880  case NTV2_FORMAT_4x3840x2160p_2400: return "UHD2p24";
6881  case NTV2_FORMAT_4x3840x2160p_2500: return "UHD2p25";
6882  case NTV2_FORMAT_4x3840x2160p_2997: return "UHD2p29.97";
6883  case NTV2_FORMAT_4x3840x2160p_3000: return "UHD2p30";
6884  case NTV2_FORMAT_4x3840x2160p_5000: return "UHD2p50";
6885  case NTV2_FORMAT_4x3840x2160p_5994: return "UHD2p59.94";
6886  case NTV2_FORMAT_4x3840x2160p_6000: return "UHD2p60";
6887  case NTV2_FORMAT_4x3840x2160p_5000_B: return "UHD2p50b";
6888  case NTV2_FORMAT_4x3840x2160p_5994_B: return "UHD2p59.94b";
6889  case NTV2_FORMAT_4x3840x2160p_6000_B: return "UHD2p60b";
6890  case NTV2_FORMAT_4x4096x2160p_2398: return "8Kp23.98";
6891  case NTV2_FORMAT_4x4096x2160p_2400: return "8Kp24";
6892  case NTV2_FORMAT_4x4096x2160p_2500: return "8Kp25";
6893  case NTV2_FORMAT_4x4096x2160p_2997: return "8Kp29.97";
6894  case NTV2_FORMAT_4x4096x2160p_3000: return "8Kp30";
6895  case NTV2_FORMAT_4x4096x2160p_4795: return "8Kp47.95";
6896  case NTV2_FORMAT_4x4096x2160p_4800: return "8Kp48";
6897  case NTV2_FORMAT_4x4096x2160p_5000: return "8Kp50";
6898  case NTV2_FORMAT_4x4096x2160p_5994: return "8Kp59.94";
6899  case NTV2_FORMAT_4x4096x2160p_6000: return "8Kp60";
6900  case NTV2_FORMAT_4x4096x2160p_4795_B: return "8Kp47.95b";
6901  case NTV2_FORMAT_4x4096x2160p_4800_B: return "8Kp48b";
6902  case NTV2_FORMAT_4x4096x2160p_5000_B: return "8Kp50b";
6903  case NTV2_FORMAT_4x4096x2160p_5994_B: return "8Kp59.94b";
6904  case NTV2_FORMAT_4x4096x2160p_6000_B: return "8Kp60b";
6905  default: return "Unknown";
6906  }
6907 } // NTV2VideoFormatToString
6908 
6909 
6910 string NTV2StandardToString (const NTV2Standard inValue, const bool inForRetailDisplay)
6911 {
6912  switch (inValue)
6913  {
6914  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "1080i", NTV2_STANDARD_1080);
6924  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "UHD HFR", NTV2_STANDARD_3840HFR);
6931  }
6932  return "";
6933 }
6934 
6935 
6936 string NTV2FrameBufferFormatToString (const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay)
6937 {
6938  switch (inValue)
6939  {
6942  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "RGBA-8", NTV2_FBF_ARGB);
6943  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "ARGB-8", NTV2_FBF_RGBA);
6944  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "RGB-10", NTV2_FBF_10BIT_RGB);
6946  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "ABGR-8", NTV2_FBF_ABGR);
6947  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "RGB-10DPX", NTV2_FBF_10BIT_DPX);
6948  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "YUV-10DPX", NTV2_FBF_10BIT_YCBCR_DPX);
6949  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "DVCProHD", NTV2_FBF_8BIT_DVCPRO);
6952  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "RGB-8", NTV2_FBF_24BIT_RGB);
6953  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "BGR-8", NTV2_FBF_24BIT_BGR);
6954  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "YUVA-10", NTV2_FBF_10BIT_YCBCRA);
6955  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "RGB-10LDPX", NTV2_FBF_10BIT_DPX_LE);
6956  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "RGB-12", NTV2_FBF_48BIT_RGB);
6958  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "ProRes-DVC", NTV2_FBF_PRORES_DVCPRO);
6959  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "ProRes-HDV", NTV2_FBF_PRORES_HDV);
6961  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "ARGB-10", NTV2_FBF_10BIT_ARGB);
6962  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "ARGB-16", NTV2_FBF_16BIT_ARGB);
6964  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "RAW-RGB10", NTV2_FBF_10BIT_RAW_RGB);
6965  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "RAW-YUV10", NTV2_FBF_10BIT_RAW_YCBCR);
6968  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "YUV-P420-10", NTV2_FBF_10BIT_YCBCR_420PL2);
6972  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Unknown", NTV2_FBF_INVALID);
6973  }
6974  return "";
6975 }
6976 
6977 #if !defined(NTV2_DEPRECATE_17_6)
6978  // More UI-friendly versions of above (used in Cables app)...
6979  static const char * m31Presets [M31_NUMVIDEOPRESETS] =
6980  {
6981  "FILE 720x480 420 Planar 8 Bit 59.94i", // M31_FILE_720X480_420_8_5994i // 0
6982  "FILE 720x480 420 Planar 8 Bit 59.94p", // M31_FILE_720X480_420_8_5994p // 1
6983  "FILE 720x480 420 Planar 8 Bit 60i", // M31_FILE_720X480_420_8_60i // 2
6984  "FILE 720x480 420 Planar 8 Bit 60p", // M31_FILE_720X480_420_8_60p // 3
6985  "FILE 720x480 422 Planar 10 Bit 59.94i", // M31_FILE_720X480_422_10_5994i // 4
6986  "FILE 720x480 422 Planar 10 Bit 59.94p", // M31_FILE_720X480_422_10_5994p // 5
6987  "FILE 720x480 422 Planar 10 Bit 60i", // M31_FILE_720X480_422_10_60i // 6
6988  "FILE 720x480 422 Planar 10 Bit 60p", // M31_FILE_720X480_422_10_60p // 7
6989 
6990  "FILE 720x576 420 Planar 8 Bit 50i", // M31_FILE_720X576_420_8_50i // 8
6991  "FILE 720x576 420 Planar 8 Bit 50p", // M31_FILE_720X576_420_8_50p // 9
6992  "FILE 720x576 422 Planar 10 Bit 50i", // M31_FILE_720X576_422_10_50i // 10
6993  "FILE 720x576 422 Planar 10 Bit 50p", // M31_FILE_720X576_422_10_50p // 11
6994 
6995  "FILE 1280x720 420 Planar 8 Bit 2398p", // M31_FILE_1280X720_420_8_2398p // 12
6996  "FILE 1280x720 420 Planar 8 Bit 24p", // M31_FILE_1280X720_420_8_24p // 13
6997  "FILE 1280x720 420 Planar 8 Bit 25p", // M31_FILE_1280X720_420_8_25p // 14
6998  "FILE 1280x720 420 Planar 8 Bit 29.97p", // M31_FILE_1280X720_420_8_2997p // 15
6999  "FILE 1280x720 420 Planar 8 Bit 30p", // M31_FILE_1280X720_420_8_30p // 16
7000  "FILE 1280x720 420 Planar 8 Bit 50p", // M31_FILE_1280X720_420_8_50p // 17
7001  "FILE 1280x720 420 Planar 8 Bit 59.94p", // M31_FILE_1280X720_420_8_5994p // 18
7002  "FILE 1280x720 420 Planar 8 Bit 60p", // M31_FILE_1280X720_420_8_60p // 19
7003 
7004  "FILE 1280x720 422 Planar 10 Bit 2398p", // M31_FILE_1280X720_422_10_2398p // 20
7005  "FILE 1280x720 422 Planar 10 Bit 25p", // M31_FILE_1280X720_422_10_24p // 21
7006  "FILE 1280x720 422 Planar 10 Bit 25p", // M31_FILE_1280X720_422_10_25p // 22
7007  "FILE 1280x720 422 Planar 10 Bit 29.97p", // M31_FILE_1280X720_422_10_2997p // 23
7008  "FILE 1280x720 422 Planar 10 Bit 30p", // M31_FILE_1280X720_422_10_30p // 24
7009  "FILE 1280x720 422 Planar 10 Bit 50p", // M31_FILE_1280X720_422_10_50p // 25
7010  "FILE 1280x720 422 Planar 10 Bit 59.94p", // M31_FILE_1280X720_422_10_5994p // 26
7011  "FILE 1280x720 422 Planar 10 Bit 60p", // M31_FILE_1280X720_422_10_60p // 27
7012 
7013  "FILE 1920x1080 420 Planar 8 Bit 2398p", // M31_FILE_1920X1080_420_8_2398p // 28
7014  "FILE 1920x1080 420 Planar 8 Bit 24p", // M31_FILE_1920X1080_420_8_24p // 29
7015  "FILE 1920x1080 420 Planar 8 Bit 25p", // M31_FILE_1920X1080_420_8_25p // 30
7016  "FILE 1920x1080 420 Planar 8 Bit 29.97p", // M31_FILE_1920X1080_420_8_2997p // 31
7017  "FILE 1920x1080 420 Planar 8 Bit 30p", // M31_FILE_1920X1080_420_8_30p // 32
7018  "FILE 1920x1080 420 Planar 8 Bit 50i", // M31_FILE_1920X1080_420_8_50i // 33
7019  "FILE 1920x1080 420 Planar 8 Bit 50p", // M31_FILE_1920X1080_420_8_50p // 34
7020  "FILE 1920x1080 420 Planar 8 Bit 59.94i", // M31_FILE_1920X1080_420_8_5994i // 35
7021  "FILE 1920x1080 420 Planar 8 Bit 59.94p", // M31_FILE_1920X1080_420_8_5994p // 36
7022  "FILE 1920x1080 420 Planar 8 Bit 60i", // M31_FILE_1920X1080_420_8_60i // 37
7023  "FILE 1920x1080 420 Planar 8 Bit 60p", // M31_FILE_1920X1080_420_8_60p // 38
7024 
7025  "FILE 1920x1080 422 Planar 10 Bit 2398p", // M31_FILE_1920X1080_422_10_2398p // 39
7026  "FILE 1920x1080 422 Planar 10 Bit 24p", // M31_FILE_1920X1080_422_10_24p // 40
7027  "FILE 1920x1080 422 Planar 10 Bit 25p", // M31_FILE_1920X1080_422_10_25p // 41
7028  "FILE 1920x1080 422 Planar 10 Bit 29.97p", // M31_FILE_1920X1080_422_10_2997p // 42
7029  "FILE 1920x1080 422 Planar 10 Bit 30p", // M31_FILE_1920X1080_422_10_30p // 43
7030  "FILE 1920x1080 422 Planar 10 Bit 50i", // M31_FILE_1920X1080_422_10_50i // 44
7031  "FILE 1920x1080 422 Planar 10 Bit 50p", // M31_FILE_1920X1080_422_10_50p // 45
7032  "FILE 1920x1080 422 Planar 10 Bit 59.94i", // M31_FILE_1920X1080_422_10_5994i // 46
7033  "FILE 1920x1080 422 Planar 10 Bit 59.94p", // M31_FILE_1920X1080_422_10_5994p // 47
7034  "FILE 1920x1080 422 Planar 10 Bit 60i", // M31_FILE_1920X1080_422_10_60i // 48
7035  "FILE 1920x1080 422 Planar 10 Bit 60p", // M31_FILE_1920X1080_422_10_60p // 49
7036 
7037  "FILE 2048x1080 420 Planar 8 Bit 2398p", // M31_FILE_2048X1080_420_8_2398p // 50
7038  "FILE 2048x1080 420 Planar 8 Bit 24p", // M31_FILE_2048X1080_420_8_24p // 51
7039  "FILE 2048x1080 420 Planar 8 Bit 25p", // M31_FILE_2048X1080_420_8_25p // 52
7040  "FILE 2048x1080 420 Planar 8 Bit 29.97p", // M31_FILE_2048X1080_420_8_2997p // 53
7041  "FILE 2048x1080 420 Planar 8 Bit 30p", // M31_FILE_2048X1080_420_8_30p // 54
7042  "FILE 2048x1080 420 Planar 8 Bit 50p", // M31_FILE_2048X1080_420_8_50p // 55
7043  "FILE 2048x1080 420 Planar 8 Bit 59.94p", // M31_FILE_2048X1080_420_8_5994p // 56
7044  "FILE 2048x1080 420 Planar 8 Bit 60p", // M31_FILE_2048X1080_420_8_60p // 57
7045 
7046  "FILE 2048x1080 422 Planar 10 Bit 2398p", // M31_FILE_2048X1080_422_10_2398p // 58
7047  "FILE 2048x1080 422 Planar 10 Bit 24p", // M31_FILE_2048X1080_422_10_24p // 59
7048  "FILE 2048x1080 422 Planar 10 Bit 25p", // M31_FILE_2048X1080_422_10_25p // 60
7049  "FILE 2048x1080 422 Planar 10 Bit 29.97p", // M31_FILE_2048X1080_422_10_2997p // 61
7050  "FILE 2048x1080 422 Planar 10 Bit 30p", // M31_FILE_2048X1080_422_10_30p // 62
7051  "FILE 2048x1080 422 Planar 10 Bit 50p", // M31_FILE_2048X1080_422_10_50p // 63
7052  "FILE 2048x1080 422 Planar 10 Bit 59.94p", // M31_FILE_2048X1080_422_10_5994p // 64
7053  "FILE 2048x1080 422 Planar 10 Bit 60p", // M31_FILE_2048X1080_422_10_60p // 65
7054 
7055  "FILE 3840x2160 420 Planar 8 Bit 2398p", // M31_FILE_3840X2160_420_8_2398p // 66
7056  "FILE 3840x2160 420 Planar 8 Bit 24p", // M31_FILE_3840X2160_420_8_24p // 67
7057  "FILE 3840x2160 420 Planar 8 Bit 25p", // M31_FILE_3840X2160_420_8_25p // 68
7058  "FILE 3840x2160 420 Planar 8 Bit 29.97p", // M31_FILE_3840X2160_420_8_2997p // 69
7059  "FILE 3840x2160 420 Planar 8 Bit 30p", // M31_FILE_3840X2160_420_8_30p // 70
7060  "FILE 3840x2160 420 Planar 8 Bit 50p", // M31_FILE_3840X2160_420_8_50p // 71
7061  "FILE 3840x2160 420 Planar 8 Bit 59.94p", // M31_FILE_3840X2160_420_8_5994p // 72
7062  "FILE 3840x2160 420 Planar 8 Bit 60p", // M31_FILE_3840X2160_420_8_60p // 73
7063 
7064  "FILE 3840x2160 420 Planar 10 Bit 50p", // M31_FILE_3840X2160_420_10_50p // 74
7065  "FILE 3840x2160 420 Planar 10 Bit 59.94p", // M31_FILE_3840X2160_420_10_5994p // 75
7066  "FILE 3840x2160 420 Planar 10 Bit 60p", // M31_FILE_3840X2160_420_10_60p // 76
7067 
7068  "FILE 3840x2160 422 Planar 8 Bit 2398p", // M31_FILE_3840X2160_422_8_2398p // 77
7069  "FILE 3840x2160 422 Planar 8 Bit 24p", // M31_FILE_3840X2160_422_8_24p // 78
7070  "FILE 3840x2160 422 Planar 8 Bit 25p", // M31_FILE_3840X2160_422_8_25p // 79
7071  "FILE 3840x2160 422 Planar 8 Bit 29.97p", // M31_FILE_3840X2160_422_8_2997p // 80
7072  "FILE 3840x2160 422 Planar 8 Bit 30p", // M31_FILE_3840X2160_422_8_30p // 81
7073  "FILE 3840x2160 422 Planar 8 Bit 50p", // M31_FILE_3840X2160_422_8_60p // 82
7074  "FILE 3840x2160 422 Planar 8 Bit 59.94p", // M31_FILE_3840X2160_422_8_5994p // 83
7075  "FILE 3840x2160 422 Planar 8 Bit 60p", // M31_FILE_3840X2160_422_8_60p // 84
7076 
7077  "FILE 3840x2160 422 Planar 10 Bit 2398p", // M31_FILE_3840X2160_422_10_2398p // 85
7078  "FILE 3840x2160 422 Planar 10 Bit 24p", // M31_FILE_3840X2160_422_10_24p // 86
7079  "FILE 3840x2160 422 Planar 10 Bit 25p", // M31_FILE_3840X2160_422_10_25p // 87
7080  "FILE 3840x2160 422 Planar 10 Bit 29.97p", // M31_FILE_3840X2160_422_10_2997p // 88
7081  "FILE 3840x2160 422 Planar 10 Bit 30p", // M31_FILE_3840X2160_422_10_30p // 89
7082  "FILE 3840x2160 422 Planar 10 Bit 50p", // M31_FILE_3840X2160_422_10_50p // 90
7083  "FILE 3840x2160 422 Planar 10 Bit 59.94p", // M31_FILE_3840X2160_422_10_5994p // 91
7084  "FILE 3840x2160 422 Planar 10 Bit 60p", // M31_FILE_3840X2160_422_10_60p // 92
7085 
7086  "FILE 4096x2160 420 Planar 10 Bit 5994p", // M31_FILE_4096X2160_420_10_5994p, // 93
7087  "FILE 4096x2160 420 Planar 10 Bit 60p", // M31_FILE_4096X2160_420_10_60p, // 94
7088  "FILE 4096x2160 422 Planar 10 Bit 50p", // M31_FILE_4096X2160_422_10_50p, // 95
7089  "FILE 4096x2160 422 Planar 10 Bit 5994p IOnly", // M31_FILE_4096X2160_422_10_5994p_IF, // 96
7090  "FILE 4096x2160 422 Planar 10 Bit 60p IOnly", // M31_FILE_4096X2160_422_10_60p_IF, // 97
7091 
7092  "VIF 720x480 420 Planar 8 Bit 59.94i", // M31_VIF_720X480_420_8_5994i // 98
7093  "VIF 720x480 420 Planar 8 Bit 59.94p", // M31_VIF_720X480_420_8_5994p // 99
7094  "VIF 720x480 420 Planar 8 Bit 60i", // M31_VIF_720X480_420_8_60i // 100
7095  "VIF 720x480 420 Planar 8 Bit 60p", // M31_VIF_720X480_420_8_60p // 101
7096  "VIF 720x480 422 Planar 10 Bit 59.94i", // M31_VIF_720X480_422_10_5994i // 102
7097  "VIF 720x480 422 Planar 10 Bit 59.94p", // M31_VIF_720X480_422_10_5994p // 103
7098  "VIF 720x480 422 Planar 10 Bit 60i", // M31_VIF_720X480_422_10_60i // 104
7099  "VIF 720x480 422 Planar 10 Bit 60p", // M31_VIF_720X480_422_10_60p // 105
7100 
7101  "VIF 720x576 420 Planar 8 Bit 50i", // M31_VIF_720X576_420_8_50i // 106
7102  "VIF 720x576 420 Planar 8 Bit 50p", // M31_VIF_720X576_420_8_50p // 107
7103  "VIF 720x576 422 Planar 10 Bit 50i", // M31_VIF_720X576_422_10_50i // 108
7104  "VIF 720x576 422 Planar 10 Bit 50p", // M31_VIF_720X576_422_10_50p // 109
7105 
7106  "VIF 1280x720 420 Planar 8 Bit 50p", // M31_VIF_1280X720_420_8_50p // 110
7107  "VIF 1280x720 420 Planar 8 Bit 59.94p", // M31_VIF_1280X720_420_8_5994p // 111
7108  "VIF 1280x720 420 Planar 8 Bit 60p", // M31_VIF_1280X720_420_8_60p // 112
7109  "VIF 1280x720 422 Planar 10 Bit 50p", // M31_VIF_1280X720_422_10_50p // 113
7110  "VIF 1280x720 422 Planar 10 Bit 59.94p", // M31_VIF_1280X720_422_10_5994p // 114
7111  "VIF 1280x720 422 Planar 10 Bit 60p", // M31_VIF_1280X720_422_10_60p // 115
7112 
7113  "VIF 1920x1080 420 Planar 8 Bit 50i", // M31_VIF_1920X1080_420_8_50i // 116
7114  "VIF 1920x1080 420 Planar 8 Bit 50p", // M31_VIF_1920X1080_420_8_50p // 117
7115  "VIF 1920x1080 420 Planar 8 Bit 59.94i", // M31_VIF_1920X1080_420_8_5994i // 118
7116  "VIF 1920x1080 420 Planar 8 Bit 59.94p", // M31_VIF_1920X1080_420_8_5994p // 119
7117  "VIF 1920x1080 420 Planar 8 Bit 60i", // M31_VIF_1920X1080_420_8_60i // 120
7118  "VIF 1920x1080 420 Planar 8 Bit 60p", // M31_VIF_1920X1080_420_8_60p // 121
7119  "VIF 1920x1080 420 Planar 10 Bit 50i", // M31_VIF_1920X1080_420_10_50i // 122
7120  "VIF 1920x1080 420 Planar 10 Bit 50p", // M31_VIF_1920X1080_420_10_50p // 123
7121  "VIF 1920x1080 420 Planar 10 Bit 59.94i", // M31_VIF_1920X1080_420_10_5994i // 124
7122  "VIF 1920x1080 420 Planar 10 Bit 59.94p", // M31_VIF_1920X1080_420_10_5994p // 125
7123  "VIF 1920x1080 420 Planar 10 Bit 60i", // M31_VIF_1920X1080_420_10_60i // 126
7124  "VIF 1920x1080 420 Planar 10 Bit 60p", // M31_VIF_1920X1080_420_10_60p // 127
7125  "VIF 1920x1080 422 Planar 10 Bit 59.94i", // M31_VIF_1920X1080_422_10_5994i // 128
7126  "VIF 1920x1080 422 Planar 10 Bit 59.94p", // M31_VIF_1920X1080_422_10_5994p // 129
7127  "VIF 1920x1080 422 Planar 10 Bit 60i", // M31_VIF_1920X1080_422_10_60i // 130
7128  "VIF 1920x1080 422 Planar 10 Bit 60p", // M31_VIF_1920X1080_422_10_60p // 131
7129 
7130  "VIF 3840x2160 420 Planar 8 Bit 30p", // M31_VIF_3840X2160_420_8_30p // 132
7131  "VIF 3840x2160 420 Planar 8 Bit 50p", // M31_VIF_3840X2160_420_8_50p // 133
7132  "VIF 3840x2160 420 Planar 8 Bit 59.94p", // M31_VIF_3840X2160_420_8_5994p // 134
7133  "VIF 3840x2160 420 Planar 8 Bit 60p", // M31_VIF_3840X2160_420_8_5994p // 135
7134  "VIF 3840x2160 420 Planar 10 Bit 50p", // M31_VIF_3840X2160_420_8_60p // 136
7135  "VIF 3840x2160 420 Planar 10 Bit 59.94p", // M31_VIF_3840X2160_420_8_60p // 137
7136  "VIF 3840x2160 420 Planar 10 Bit 60p", // M31_VIF_3840X2160_420_10_5994p // 138
7137 
7138  "VIF 3840x2160 422 Planar 10 Bit 30p", // M31_VIF_3840X2160_422_10_30p // 139
7139  "VIF 3840x2160 422 Planar 10 Bit 50p", // M31_VIF_3840X2160_422_10_50p // 140
7140  "VIF 3840x2160 422 Planar 10 Bit 59.94p", // M31_VIF_3840X2160_422_10_5994p // 141
7141  "VIF 3840x2160 422 Planar 10 Bit 60p", // M31_VIF_3840X2160_422_10_60p // 142
7142  };
7143 
7144  string NTV2M31VideoPresetToString (const M31VideoPreset inValue, const bool inForRetailDisplay)
7145  {
7146  if (inForRetailDisplay)
7147  return m31Presets [inValue]; // frameBufferFormatString (inValue);
7148 
7149  switch (inValue)
7150  {
7159 
7164 
7173 
7182 
7194 
7206 
7215 
7224 
7236 
7245 
7254 
7260 
7269 
7274 
7281 
7298 
7310  case M31_NUMVIDEOPRESETS: return ""; //special case
7311  }
7312  return "";
7313  }
7314 #endif
7315 
7316 string NTV2FrameGeometryToString (const NTV2FrameGeometry inValue, const bool inForRetailDisplay)
7317 {
7318  switch (inValue)
7319  {
7320  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "1920x1080", NTV2_FG_1920x1080);
7321  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "1280x720", NTV2_FG_1280x720);
7322  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "720x486", NTV2_FG_720x486);
7323  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "720x576", NTV2_FG_720x576);
7324  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "1920x1114", NTV2_FG_1920x1114);
7325  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "2048x1114", NTV2_FG_2048x1114);
7326  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "720x508", NTV2_FG_720x508);
7327  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "720x598", NTV2_FG_720x598);
7328  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "1920x1112", NTV2_FG_1920x1112);
7329  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "1280x740", NTV2_FG_1280x740);
7330  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "2048x1080", NTV2_FG_2048x1080);
7331  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "2048x1556", NTV2_FG_2048x1556);
7332  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "2048x1588", NTV2_FG_2048x1588);
7333  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "2048x1112", NTV2_FG_2048x1112);
7334  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "720x514", NTV2_FG_720x514);
7335  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "720x612", NTV2_FG_720x612);
7336  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "3840x2160", NTV2_FG_4x1920x1080);
7337  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "4096x2160", NTV2_FG_4x2048x1080);
7338  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "7680x4320", NTV2_FG_4x3840x2160);
7339  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "8192x4320", NTV2_FG_4x4096x2160);
7340  case NTV2_FG_NUMFRAMEGEOMETRIES: return ""; //special case
7341  }
7342  return "";
7343 }
7344 
7345 
7346 string NTV2FrameRateToString (const NTV2FrameRate inValue, const bool inForRetailDisplay)
7347 {
7348  switch (inValue)
7349  {
7365 #if !defined(NTV2_DEPRECATE_16_0)
7370 #endif
7371  case NTV2_NUM_FRAMERATES: return ""; //special case
7372  }
7373  return "";
7374 }
7375 
7376 
7377 string NTV2InputSourceToString (const NTV2InputSource inValue, const bool inForRetailDisplay)
7378 {
7379  switch (inValue)
7380  {
7395  }
7396  return "";
7397 }
7398 
7399 
7400 string NTV2OutputDestinationToString (const NTV2OutputDestination inValue, const bool inForRetailDisplay)
7401 {
7402  switch (inValue)
7403  {
7415  }
7416  return "";
7417 }
7418 
7419 
7420 string NTV2ReferenceSourceToString (const NTV2ReferenceSource inValue, const bool inForRetailDisplay)
7421 {
7422  switch (inValue)
7423  {
7424  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Reference In", NTV2_REFERENCE_EXTERNAL);
7425  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 1", NTV2_REFERENCE_INPUT1);
7426  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 2", NTV2_REFERENCE_INPUT2);
7427  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Free Run", NTV2_REFERENCE_FREERUN);
7430  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 3", NTV2_REFERENCE_INPUT3);
7431  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 4", NTV2_REFERENCE_INPUT4);
7432  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 5", NTV2_REFERENCE_INPUT5);
7433  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 6", NTV2_REFERENCE_INPUT6);
7434  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 7", NTV2_REFERENCE_INPUT7);
7435  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SDI In 8", NTV2_REFERENCE_INPUT8);
7436  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SFP 1 PCR", NTV2_REFERENCE_SFP1_PCR);
7437  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SFP 1 PTP", NTV2_REFERENCE_SFP1_PTP);
7438  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SFP 2 PCR", NTV2_REFERENCE_SFP2_PCR);
7439  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "SFP 2 PTP", NTV2_REFERENCE_SFP2_PTP);
7443  case NTV2_NUM_REFERENCE_INPUTS: return ""; //special case
7444  }
7445  return "";
7446 }
7447 
7448 
7449 string NTV2RegisterWriteModeToString (const NTV2RegisterWriteMode inValue, const bool inForRetailDisplay)
7450 {
7451  switch (inValue)
7452  {
7453  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Sync To Field", NTV2_REGWRITE_SYNCTOFIELD);
7454  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Sync To Frame", NTV2_REGWRITE_SYNCTOFRAME);
7455  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inForRetailDisplay, "Immediate", NTV2_REGWRITE_IMMEDIATE);
7456  case NTV2_REGWRITE_SYNCTOFIELD_AFTER10LINES: return ""; //special case
7457  }
7458  return "";
7459 }
7460 
7461 
7462 std::string NTV2InterruptEnumToString (const INTERRUPT_ENUMS inInterruptEnumValue)
7463 {
7464  switch(inInterruptEnumValue)
7465  {
7507  case eNumInterruptTypes: return ""; //special case
7508  }
7509  return "";
7510 }
7511 
7512 std::string NTV2IpErrorEnumToString (const NTV2IpError inIpErrorEnumValue)
7513 {
7514  switch (inIpErrorEnumValue)
7515  {
7516  case NTV2IpErrNone: return "";
7517  case NTV2IpErrInvalidChannel: return "Invalid channel";
7518  case NTV2IpErrInvalidFormat: return "Invalid format";
7519  case NTV2IpErrInvalidBitdepth: return "Invalid bit depth";
7520  case NTV2IpErrInvalidUllHeight: return "Invalid height in ull mode";
7521  case NTV2IpErrInvalidUllLevels: return "Invalid number of levels in ull mode";
7522  case NTV2IpErrUllNotSupported: return "Ull mode not supported";
7523  case NTV2IpErrNotReady: return "KonaIP card not ready";
7524  case NTV2IpErrSoftwareMismatch: return "Host software does not match device firmware";
7525  case NTV2IpErrSFP1NotConfigured: return "SFP 1 not configured";
7526  case NTV2IpErrSFP2NotConfigured: return "SFP 2 not configured";
7527  case NTV2IpErrInvalidIGMPVersion: return "Invalid IGMP version";
7528  case NTV2IpErrCannotGetMacAddress: return "Failed to retrieve MAC address from ARP table";
7529  case NTV2IpErrNotSupported: return "Not supported for by this firmware";
7530  case NTV2IpErrWriteSOMToMB: return "Could not write SOM to MB";
7531  case NTV2IpErrWriteSeqToMB: return "Could not write sequence number to MB";
7532  case NTV2IpErrWriteCountToMB: return "Could not write count to MB";
7533  case NTV2IpErrTimeoutNoSOM: return "MB response timeout (no SOM)";
7534  case NTV2IpErrTimeoutNoSeq: return "MB response timeout (no sequence number)";
7535  case NTV2IpErrTimeoutNoBytecount: return "MB response timeout (no bytecount)";
7536  case NTV2IpErrExceedsFifo: return "Response exceeds FIFO length";
7537  case NTV2IpErrNoResponseFromMB: return "No response from MB";
7538  case NTV2IpErrAcquireMBTimeout: return "AcquireMailBoxLock timeout";
7539  case NTV2IpErrInvalidMBResponse: return "Invalid response from MB";
7540  case NTV2IpErrInvalidMBResponseSize: return "Invalid response size from MB";
7541  case NTV2IpErrInvalidMBResponseNoMac: return "MAC Address not found in response from MB";
7542  case NTV2IpErrMBStatusFail: return "MB Status Failure";
7543  case NTV2IpErrGrandMasterInfo: return "PTP Grand Master Info not found";
7544  case NTV2IpErrSDPTooLong: return "SDP too long";
7545  case NTV2IpErrSDPNotFound: return "SDP not found";
7546  case NTV2IpErrSDPEmpty: return "SDP is empty";
7547  case NTV2IpErrSDPInvalid: return "SDP is not valid";
7548  case NTV2IpErrSDPURLInvalid: return "Invalid SDP URL";
7549  case NTV2IpErrSDPNoVideo: return "SDP does not contain video";
7550  case NTV2IpErrSDPNoAudio: return "SDP does not contain audio";
7551  case NTV2IpErrSDPNoANC: return "SDP does not contain metadata";
7552  case NTV2IpErrSFPNotFound: return "SFP data not found";
7553  case NTV2IpErrInvalidConfig: return "Invalid configuration";
7554  default: return "Unknown IP error";
7555  }
7556 }
7557 
7558 ostream & operator << (ostream & inOutStream, const RP188_STRUCT & inObj)
7559 {
7560  return inOutStream << "DBB=0x" << hex << setw (8) << setfill ('0') << inObj.DBB
7561  << "|HI=0x" << hex << setw (8) << setfill ('0') << inObj.High
7562  << "|LO=0x" << hex << setw (8) << setfill ('0') << inObj.Low
7563  << dec;
7564 } // RP188_STRUCT ostream operator
7565 
7566 
7567 string NTV2GetBitfileName (const NTV2DeviceID inBoardID)
7568 {
7569  switch (inBoardID)
7570  {
7571  case DEVICE_ID_NOTFOUND: break;
7572  case DEVICE_ID_CORVID1: return "corvid1.bit";
7573  case DEVICE_ID_CORVID22: return "corvid22.bit";
7574  case DEVICE_ID_CORVID24: return "corvid24.bit";
7575  case DEVICE_ID_CORVID3G: return "corvid3G.bit";
7576  case DEVICE_ID_CORVID44: return "corvid44.bit";
7577  case DEVICE_ID_CORVID88: return "corvid88.bit";
7578  case DEVICE_ID_CORVIDHEVC: return "corvid.bit";
7579  case DEVICE_ID_IO4K: return "io4k.bit";
7580  case DEVICE_ID_IO4KUFC: return "io4kufc.bit";
7581  case DEVICE_ID_IOEXPRESS: return "ioexpress.bit";
7582  case DEVICE_ID_IOXT: return "ioxt.bit";
7583  case DEVICE_ID_KONA3G: return "kona3gufc.bit";
7584  case DEVICE_ID_KONA3GQUAD: return "kona3gquad.bit";
7585  case DEVICE_ID_KONA4: return "kona4.bit";
7586  case DEVICE_ID_KONA4UFC: return "kona4ufc.bit";
7587  case DEVICE_ID_KONAIP_2022: return "konaip2022.mcs";
7588  case DEVICE_ID_KONAIP_4CH_2SFP: return "s2022_56_2p2ch_rxtx.mcs";
7589  case DEVICE_ID_KONAIP_1RX_1TX_1SFP_J2K: return "kip_j2k_1i1o.mcs";
7590  case DEVICE_ID_KONAIP_2TX_1SFP_J2K: return "kip_j2k_2o.mcs";
7591  case DEVICE_ID_KONAIP_1RX_1TX_2110: return "s2110_1rx_1tx.mcs";
7592  case DEVICE_ID_KONALHEPLUS: return "konalheplus.bit";
7593  case DEVICE_ID_KONALHI: return "konalhi.bit";
7594  case DEVICE_ID_TTAP: return "ttap.bit";
7595  case DEVICE_ID_IO4KPLUS: return "io4kplus.bit";
7596  case DEVICE_ID_IOIP_2022: return "ioip2022.mcs";
7597  case DEVICE_ID_IOIP_2110: return "ioip2110.mcs";
7598  case DEVICE_ID_IOIP_2110_RGB12: return "ioip2110rgb.mcs";
7599  case DEVICE_ID_KONAIP_2110: return "konaip2110.mcs";
7600  case DEVICE_ID_KONAIP_2110_RGB12: return "konaip2110rgb.mcs";
7601  case DEVICE_ID_KONAHDMI: return "konahdmi4rx.bit";
7602  case DEVICE_ID_KONA1: return "kona1.bit";
7603  case DEVICE_ID_KONA5: return "kona5_retail_tprom.bit";
7604  case DEVICE_ID_KONA5_2X4K: return "kona5_2x4k_tprom.bit";
7605  case DEVICE_ID_KONA5_8KMK: return "kona5_8k_mk_tprom.bit";
7606  case DEVICE_ID_KONA5_8K: return "kona5_8k_tprom.bit";
7607  case DEVICE_ID_KONA5_3DLUT: return "kona5_3d_lut_tprom.bit";
7608  case DEVICE_ID_KONA5_OE1: return "kona5_oe_cfg1_tprom.bit";
7609  case DEVICE_ID_KONA5_OE2: return "kona5_oe_cfg3_tprom.bit";
7610  case DEVICE_ID_KONA5_OE3: return "kona5_oe_cfg3_tprom.bit";
7611  case DEVICE_ID_KONA5_OE4: return "kona5_oe_cfg4_tprom.bit";
7612  case DEVICE_ID_KONA5_OE5: return "kona5_oe_cfg5_tprom.bit";
7613  case DEVICE_ID_KONA5_OE6: return "kona5_oe_cfg6_tprom.bit";
7614  case DEVICE_ID_KONA5_OE7: return "kona5_oe_cfg7_tprom.bit";
7615  case DEVICE_ID_KONA5_OE8: return "kona5_oe_cfg8_tprom.bit";
7616  case DEVICE_ID_KONA5_OE9: return "kona5_oe_cfg9_tprom.bit";
7617  case DEVICE_ID_KONA5_OE10: return "kona5_oe_cfg10_tprom.bit";
7618  case DEVICE_ID_KONA5_OE11: return "kona5_oe_cfg11_tprom.bit";
7619  case DEVICE_ID_KONA5_OE12: return "kona5_oe_cfg12_tprom.bit";
7620  case DEVICE_ID_SOJI_OE1: return "soji_oe_cfg1.bit";
7621  case DEVICE_ID_SOJI_OE2: return "soji_oe_cfg3.bit";
7622  case DEVICE_ID_SOJI_OE3: return "soji_oe_cfg3.bit";
7623  case DEVICE_ID_SOJI_OE4: return "soji_oe_cfg4.bit";
7624  case DEVICE_ID_SOJI_OE5: return "soji_oe_cfg5.bit";
7625  case DEVICE_ID_SOJI_OE6: return "soji_oe_cfg6.bit";
7626  case DEVICE_ID_SOJI_OE7: return "soji_oe_cfg7.bit";
7627  case DEVICE_ID_SOJI_3DLUT: return "soji_3dlut.bit";
7628  case DEVICE_ID_SOJI_DIAGS: return "soji_diags.bit";
7629  case DEVICE_ID_KONA5_8K_MV_TX: return "kona5_8k_mv_tx_tprom.bit";
7630  case DEVICE_ID_CORVID44_8KMK: return "c44_12g_8k_mk_tprom.bit";
7631  case DEVICE_ID_CORVID44_8K: return "corvid44_12g_8k.bit";
7632  case DEVICE_ID_CORVID44_2X4K: return "c44_12g_2x4k_tprom.bit";
7633  case DEVICE_ID_CORVID44_PLNR: return "c44_12g_plnr_tprom.bit";
7634  case DEVICE_ID_TTAP_PRO: return "ttappro.bit";
7635  case DEVICE_ID_IOX3: return "iox3.bit";
7636  case DEVICE_ID_KONAX: return "konax.bit";
7637  case DEVICE_ID_KONAXM: return "konaxm.bit";
7638  case DEVICE_ID_KONAX_4CH: return "konax_4ch.bit";
7639  case DEVICE_ID_CORVID44_GEN3: return "corvid44gen3.bit";
7640  case DEVICE_ID_CORVID88_GEN3: return "corvid88gen3.bit";
7641  default: return "";
7642  }
7643  return "";
7644 } // NTV2GetBitfileName
7645 
7646 
7647 bool NTV2IsCompatibleBitfileName (const string & inBitfileName, const NTV2DeviceID inDeviceID)
7648 {
7649  const string deviceBitfileName (::NTV2GetBitfileName(inDeviceID));
7650  if (inBitfileName == deviceBitfileName)
7651  return true;
7652 
7653  switch (inDeviceID)
7654  {
7657 
7660 
7663 
7664  default: break;
7665  }
7666  return false;
7667 
7668 } // IsCompatibleBitfileName
7669 
7670 
7671 NTV2DeviceID NTV2GetDeviceIDFromBitfileName (const string & inBitfileName)
7672 {
7673  typedef map<string, NTV2DeviceID> BitfileName2DevID;
7674  typedef BitfileName2DevID::const_iterator BitfileName2DevCI;
7675  static BitfileName2DevID sBitfileName2DevID;
7676  static AJALock sBFN2DevIDMutex;
7677  AJAAutoLock tmpLock(&sBFN2DevIDMutex);
7678  if (sBitfileName2DevID.empty())
7679  {
7680  const NTV2DeviceIDSet supportedDevices (::NTV2GetSupportedDevices());
7681  for (NTV2DeviceIDSetConstIter it(supportedDevices.begin()); it != supportedDevices.end(); ++it)
7682  {
7683  const string bitFileName(::NTV2GetBitfileName(*it));
7684  if (!bitFileName.empty())
7685  sBitfileName2DevID[bitFileName] = *it;
7686  }
7687  }
7688  BitfileName2DevCI it(sBitfileName2DevID.find(inBitfileName));
7689  return it != sBitfileName2DevID.end() ? it->second : DEVICE_ID_INVALID;
7690 }
7691 
7692 
7693 string NTV2GetFirmwareFolderPath (const bool inAddTrailingPathDelim)
7694 {
7695  string fwPath;
7698  const char c (fwPath.empty() ? 0 : fwPath.at(fwPath.length()-1));
7699  if (!inAddTrailingPathDelim)
7700  if (c == '/' || c == '\\')
7701  fwPath.erase(fwPath.length()-1, 1); // lop off trailing '/'
7702  return fwPath;
7703 }
7704 
7705 string NTV2GetPluginsFolderPath (const bool inAddTrailingPathDelim)
7706 {
7707  string fwPath;
7710  const char c (fwPath.empty() ? 0 : fwPath.at(fwPath.length()-1));
7711  if (!inAddTrailingPathDelim)
7712  if (c == '/' || c == '\\')
7713  fwPath.erase(fwPath.length()-1, 1); // lop off trailing '/'
7714  return fwPath;
7715 }
7716 
7717 string NTV2GetVDevFolderPath (const bool inAddTrailingPathDelim)
7718 {
7719  string fwPath;
7722  const char c (fwPath.empty() ? 0 : fwPath.at(fwPath.length()-1));
7723  if (!inAddTrailingPathDelim)
7724  if (c == '/' || c == '\\')
7725  fwPath.erase(fwPath.length()-1, 1); // lop off trailing '/'
7726  return fwPath;
7727 }
7728 
7729 
7731 {
7732  static const NTV2DeviceID sValidDeviceIDs [] = { DEVICE_ID_CORVID1,
7808  if (inKinds == NTV2_DEVICEKIND_NONE)
7809  return NTV2DeviceIDSet();
7810 
7811  NTV2DeviceIDSet result;
7812  if (inKinds == NTV2_DEVICEKIND_SOFTWARE)
7813  {result.insert(DEVICE_ID_SOFTWARE); return result;}
7814 
7815  for (unsigned ndx(0); ndx < sizeof(sValidDeviceIDs) / sizeof(NTV2DeviceID); ndx++)
7816  {
7817  const NTV2DeviceID deviceID(sValidDeviceIDs[ndx]);
7818  if (deviceID == DEVICE_ID_NOTFOUND)
7819  continue;
7820  bool insertIt (false);
7821  if (inKinds == NTV2_DEVICEKIND_ALL)
7822  insertIt = true;
7823  else if (inKinds & NTV2_DEVICEKIND_INPUT && ::NTV2DeviceCanDoCapture(deviceID))
7824  insertIt = true;
7825  else if (inKinds & NTV2_DEVICEKIND_OUTPUT && ::NTV2DeviceCanDoPlayback(deviceID))
7826  insertIt = true;
7827  else if (inKinds & NTV2_DEVICEKIND_SDI && (::NTV2DeviceGetNumVideoInputs(deviceID)+::NTV2DeviceGetNumVideoOutputs(deviceID)) > 0)
7828  insertIt = true;
7829  else if (inKinds & NTV2_DEVICEKIND_HDMI && (::NTV2DeviceGetNumHDMIVideoInputs(deviceID)+::NTV2DeviceGetNumHDMIVideoOutputs(deviceID)) > 0)
7830  insertIt = true;
7831  else if (inKinds & NTV2_DEVICEKIND_ANALOG && (::NTV2DeviceGetNumAnalogVideoInputs(deviceID)+::NTV2DeviceGetNumAnalogVideoOutputs(deviceID)) > 0)
7832  insertIt = true;
7833  else if (inKinds & NTV2_DEVICEKIND_SFP && ::NTV2DeviceCanDoIP(deviceID))
7834  insertIt = true;
7835  else if (inKinds & NTV2_DEVICEKIND_EXTERNAL && ::NTV2DeviceIsExternalToHost(deviceID))
7836  insertIt = true;
7837  else if (inKinds & NTV2_DEVICEKIND_4K && ::NTV2DeviceCanDo4KVideo(deviceID))
7838  insertIt = true;
7839  else if (inKinds & NTV2_DEVICEKIND_12G && ::NTV2DeviceCanDo12GSDI(deviceID))
7840  insertIt = true;
7841  else if (inKinds & NTV2_DEVICEKIND_6G && ::NTV2DeviceCanDo12GSDI(deviceID))
7842  insertIt = true;
7843  else if (inKinds & NTV2_DEVICEKIND_CUSTOM_ANC && ::NTV2DeviceCanDoCustomAnc(deviceID))
7844  insertIt = true;
7845  else if (inKinds & NTV2_DEVICEKIND_RELAYS && ::NTV2DeviceHasSDIRelays(deviceID))
7846  insertIt = true;
7847  if (insertIt)
7848  result.insert (deviceID);
7849  } // for each supported device
7850  return result;
7851 }
7852 
7853 ostream & operator << (std::ostream & inOutStr, const NTV2DeviceIDList & inList)
7854 {
7855  for (NTV2DeviceIDListConstIter iter(inList.begin()); iter != inList.end (); ++iter)
7856  inOutStr << (iter != inList.begin() ? ", " : "") << ::NTV2DeviceIDToString(*iter);
7857  return inOutStr;
7858 }
7859 
7860 ostream & operator << (ostream & inOutStr, const NTV2DeviceIDSet & inSet)
7861 {
7862  for (NTV2DeviceIDSetConstIter iter(inSet.begin()); iter != inSet.end(); ++iter)
7863  inOutStr << (iter != inSet.begin() ? ", " : "") << ::NTV2DeviceIDToString(*iter);
7864  return inOutStr;
7865 }
7866 
7867 
7868 std::string NTV2GetVersionString (const bool inDetailed)
7869 {
7870  ostringstream oss;
7871 
7873  if (!string (AJA_NTV2_SDK_BUILD_TYPE).empty ())
7875  if (inDetailed)
7876  oss << " built on " << AJA_NTV2_SDK_BUILD_DATETIME;
7877  return oss.str ();
7878 }
7879 
7880 UWord NTV2GetSDKVersionComponent (const int inVersionComponent)
7881 {
7882  switch (inVersionComponent)
7883  {
7884  case 0: return AJA_NTV2_SDK_VERSION_MAJOR;
7885  case 1: return AJA_NTV2_SDK_VERSION_MINOR;
7886  case 2: return AJA_NTV2_SDK_VERSION_POINT;
7887  case 3: return AJA_NTV2_SDK_BUILD_NUMBER;
7888  default: break;
7889  }
7890  return 0;
7891 }
7892 
7893 
7895 {
7896  return CNTV2RegisterExpert::GetDisplayName(inValue);
7897 }
7898 
7899 
7900 string AutoCircVidProcModeToString (const AutoCircVidProcMode inValue, const bool inCompactDisplay)
7901 {
7902  switch (inValue)
7903  {
7909  }
7910  return "??";
7911 }
7912 
7913 
7914 string NTV2ColorCorrectionModeToString (const NTV2ColorCorrectionMode inValue, const bool inCompactDisplay)
7915 {
7916  switch (inValue)
7917  {
7923  }
7924  return "??";
7925 }
7926 
7927 string NTV2BitfileTypeToString (const NTV2BitfileType inValue, const bool inCompactDisplay)
7928 {
7929  switch (inValue)
7930  {
7931  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Corvid1 Main", NTV2_BITFILE_CORVID1_MAIN);
7932  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Corvid22 Main", NTV2_BITFILE_CORVID22_MAIN);
7933  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona 3G Main", NTV2_BITFILE_KONA3G_MAIN);
7935  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "IoExpress Main", NTV2_BITFILE_IOEXPRESS_MAIN);
7936  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Corvid3G Main", NTV2_BITFILE_CORVID3G_MAIN);
7937  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona 3G Quad", NTV2_BITFILE_KONA3G_QUAD);
7940  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Corvid24 Main", NTV2_BITFILE_CORVID24_MAIN);
7941  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "T-Tap Main", NTV2_BITFILE_TTAP_MAIN);
7947  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Corvid88 Main", NTV2_BITFILE_CORVID88);
7948  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Corvid88Gen3 Main", NTV2_BITFILE_CORVID88_GEN3);
7949  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Corvid44 Main", NTV2_BITFILE_CORVID44);
7950  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Corvid44Gen3 Main", NTV2_BITFILE_CORVID44_GEN3);
7951  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Corvid HEVC", NTV2_BITFILE_CORVIDHEVC);
7952  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "KonaIP 2022", NTV2_BITFILE_KONAIP_2022);
7953  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "KonaIP 4CH 2SFP", NTV2_BITFILE_KONAIP_4CH_2SFP);
7954  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "KonaIP 1Rx 1Tx 1SFP J2K", NTV2_BITFILE_KONAIP_1RX_1TX_1SFP_J2K);
7955  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "KonaIP 2Tx 1SFP J2K", NTV2_BITFILE_KONAIP_2TX_1SFP_J2K);
7956  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "KonaIP 1Rx 1Tx 2110", NTV2_BITFILE_KONAIP_1RX_1TX_2110);
7961  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "KonaIP 2110", NTV2_BITFILE_KONAIP_2110);
7963  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona HDMI", NTV2_BITFILE_KONAHDMI);
7969  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "T-Tap Pro Main", NTV2_BITFILE_TTAP_PRO_MAIN);
7970  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 2x4K Main", NTV2_BITFILE_KONA5_2X4K_MAIN);
7971  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Corvid44 2x4K Main", NTV2_BITFILE_CORVID44_2X4K_MAIN);
7972  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 3D LUT Main", NTV2_BITFILE_KONA5_3DLUT_MAIN);
7973  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Corvid44 Planar Main", NTV2_BITFILE_CORVID44_PLNR_MAIN);
7975  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE1 Main", NTV2_BITFILE_KONA5_OE1_MAIN);
7976  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE2 Main", NTV2_BITFILE_KONA5_OE2_MAIN);
7977  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE3 Main", NTV2_BITFILE_KONA5_OE3_MAIN);
7978  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE4 Main", NTV2_BITFILE_KONA5_OE4_MAIN);
7979  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE5 Main", NTV2_BITFILE_KONA5_OE5_MAIN);
7980  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE6 Main", NTV2_BITFILE_KONA5_OE6_MAIN);
7981  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE7 Main", NTV2_BITFILE_KONA5_OE7_MAIN);
7982  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE8 Main", NTV2_BITFILE_KONA5_OE8_MAIN);
7983  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE9 Main", NTV2_BITFILE_KONA5_OE9_MAIN);
7984  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE10 Main", NTV2_BITFILE_KONA5_OE10_MAIN);
7985  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE11 Main", NTV2_BITFILE_KONA5_OE11_MAIN);
7986  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "Kona5 OE12 Main", NTV2_BITFILE_KONA5_OE12_MAIN);
7987  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SOJI OE1 Main", NTV2_BITFILE_SOJI_OE1_MAIN);
7988  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SOJI OE2 Main", NTV2_BITFILE_SOJI_OE2_MAIN);
7989  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SOJI OE3 Main", NTV2_BITFILE_SOJI_OE3_MAIN);
7990  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SOJI OE4 Main", NTV2_BITFILE_SOJI_OE4_MAIN);
7991  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SOJI OE5 Main", NTV2_BITFILE_SOJI_OE5_MAIN);
7992  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SOJI OE6 Main", NTV2_BITFILE_SOJI_OE6_MAIN);
7993  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SOJI OE7 Main", NTV2_BITFILE_SOJI_OE7_MAIN);
7994  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SOJI 3DLUT Main", NTV2_BITFILE_SOJI_3DLUT_MAIN);
7995  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "SOJI DIAGS Main", NTV2_BITFILE_SOJI_DIAGS_MAIN);
7997  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "KonaIP 2110 RGB12", NTV2_BITFILE_KONAIP_2110_RGB12);
7998  NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(inCompactDisplay, "IoIP 2110 RGB12", NTV2_BITFILE_IOIP_2110_RGB12);
8004  }
8005  return "(bad bitfile type)";
8006 }
8007 
8008 string NTV2DieTempScaleToString (const NTV2DieTempScale inValue, const bool inUseUTF8)
8009 {
8010  static const NTV2StringList sScalesUTF8 = { "\xE2\x84\x83", "\xE2\x84\x89", "\xC2\xB0""K", "\xC2\xB0""R"};
8011  static const NTV2StringList sScales = { "C", "F", "K", "R"};
8012  if (size_t(inValue) < sScales.size())
8013  return inUseUTF8 ? sScalesUTF8.at(inValue) : sScales.at(inValue);
8014  return "";
8015 }
8016 
8017 #if !defined(NTV2_DEPRECATE_17_6)
8018  bool convertHDRFloatToRegisterValues (const HDRFloatValues & inFloatValues, HDRRegValues & outRegisterValues)
8019  {
8020  return inFloatValues.toRegValues(outRegisterValues);
8021  }
8022 
8023  bool convertHDRRegisterToFloatValues (const HDRRegValues & inRegisterValues, HDRFloatValues & outFloatValues)
8024  {
8025  return outFloatValues.setFromRegValues(inRegisterValues);
8026  }
8027 
8028  void setHDRDefaultsForBT2020 (HDRRegValues & outRegisterValues)
8029  {
8030  outRegisterValues.setBT2020();
8031  }
8032 
8033  void setHDRDefaultsForDCIP3(HDRRegValues & outRegisterValues)
8034  {
8035  outRegisterValues.setDCIP3();
8036  }
8037 #endif // !defined(NTV2_DEPRECATE_17_6)
8038 
8039 
8040 ostream & operator << (ostream & inOutStr, const NTV2OutputCrosspointIDs & inList)
8041 {
8042  inOutStr << "[";
8043  for (NTV2OutputCrosspointIDsConstIter it (inList.begin()); it != inList.end(); )
8044  {
8045  inOutStr << ::NTV2OutputCrosspointIDToString(*it);
8046  ++it;
8047  if (it != inList.end())
8048  inOutStr << ",";
8049  }
8050  inOutStr << "]";
8051  return inOutStr;
8052 }
8053 
8054 /*
8055 static ostream & operator << (ostream & inOutStr, const NTV2InputCrosspointIDs & inList)
8056 {
8057  inOutStr << "[";
8058  for (NTV2InputCrosspointIDsConstIter it (inList.begin()); it != inList.end(); )
8059  {
8060  inOutStr << ::NTV2InputCrosspointIDToString(*it);
8061  ++it;
8062  if (it != inList.end())
8063  inOutStr << ",";
8064  }
8065  inOutStr << "]";
8066  return inOutStr;
8067 }
8068 */
8069 
8070 ostream & operator << (ostream & inOutStream, const NTV2StringList & inData)
8071 {
8072  for (NTV2StringListConstIter it(inData.begin()); it != inData.end(); )
8073  {
8074  inOutStream << *it;
8075  if (++it != inData.end())
8076  inOutStream << ", ";
8077  }
8078  return inOutStream;
8079 }
8080 
8081 ostream & operator << (ostream & inOutStream, const NTV2StringSet & inData)
8082 {
8083  for (NTV2StringSetConstIter it(inData.begin()); it != inData.end(); )
8084  {
8085  inOutStream << *it;
8086  if (++it != inData.end())
8087  inOutStream << ", ";
8088  }
8089  return inOutStream;
8090 }
8091 
8092 
8094 {
8095  NTV2RegisterReads result;
8096  for (NTV2RegNumSetConstIter it (inRegNumSet.begin()); it != inRegNumSet.end(); ++it)
8097  result.push_back (NTV2RegInfo (*it));
8098  return result;
8099 }
8100 
8102 {
8103  NTV2RegNumSet result;
8104  for (NTV2RegisterReadsConstIter it (inRegReads.begin()); it != inRegReads.end(); ++it)
8105  result.insert (it->registerNumber);
8106  return result;
8107 }
8108 
8109 bool GetRegNumChanges (const NTV2RegNumSet & inBefore, const NTV2RegNumSet & inAfter, NTV2RegNumSet & outGone, NTV2RegNumSet & outSame, NTV2RegNumSet & outNew)
8110 {
8111  outGone.clear(); outSame.clear(); outNew.clear();
8112  set_difference (inBefore.begin(), inBefore.end(), inAfter.begin(), inAfter.end(), std::inserter(outGone, outGone.begin()));
8113  set_difference (inAfter.begin(), inAfter.end(), inBefore.begin(), inBefore.end(), std::inserter(outNew, outNew.begin()));
8114  set_intersection (inBefore.begin(), inBefore.end(), inAfter.begin(), inAfter.end(), std::inserter(outSame, outSame.begin()));
8115  return true;
8116 }
8117 
8118 bool GetChangedRegisters (const NTV2RegisterReads & inBefore, const NTV2RegisterReads & inAfter, NTV2RegNumSet & outChanged)
8119 {
8120  outChanged.clear();
8121  if (&inBefore == &inAfter)
8122  return false; // Same vector, identical!
8123  if (inBefore.size() != inAfter.size())
8124  { // Only check common reg nums...
8125  NTV2RegNumSet before(::ToRegNumSet(inBefore)), after(::ToRegNumSet(inAfter)), commonRegNums;
8126  set_intersection (before.begin(), before.end(), after.begin(), after.end(),
8127  std::inserter(commonRegNums, commonRegNums.begin()));
8128  for (NTV2RegNumSetConstIter it(commonRegNums.begin()); it != commonRegNums.end(); ++it)
8129  {
8132  if (beforeIt != inBefore.end() && afterIt != inAfter.end() && beforeIt->registerValue != afterIt->registerValue)
8133  outChanged.insert(*it);
8134  }
8135  }
8136  else if (inBefore.at(0).registerNumber == inAfter.at(0).registerNumber
8137  && inBefore.at(inBefore.size()-1).registerNumber == inAfter.at(inAfter.size()-1).registerNumber)
8138  { // Assume identical reg num layout
8139  for (size_t ndx(0); ndx < inBefore.size(); ndx++)
8140  if (inBefore[ndx].registerValue != inAfter[ndx].registerValue)
8141  outChanged.insert(inBefore[ndx].registerNumber);
8142  }
8143  else for (size_t ndx(0); ndx < inBefore.size(); ndx++)
8144  {
8145  const NTV2RegInfo & beforeInfo(inBefore.at(ndx));
8146  const NTV2RegInfo & afterInfo(inAfter.at(ndx));
8147  if (beforeInfo.registerNumber == afterInfo.registerNumber)
8148  {
8149  if (beforeInfo.registerValue != afterInfo.registerValue)
8150  outChanged.insert(beforeInfo.registerNumber);
8151  }
8152  else
8153  {
8154  NTV2RegisterReadsConstIter it(::FindFirstMatchingRegisterNumber(beforeInfo.registerNumber, inAfter));
8155  if (it != inAfter.end())
8156  if (beforeInfo.registerValue != it->registerValue)
8157  outChanged.insert(beforeInfo.registerNumber);
8158  }
8159  }
8160  return !outChanged.empty();
8161 }
8162 
8163 
8164 string PercentEncode (const string & inStr)
8165 { ostringstream oss;
8166  for (size_t ndx(0); ndx < inStr.size(); ndx++)
8167  {
8168  const char chr(inStr.at(size_t(ndx)));
8169  if (::isalnum(chr) || chr == '-' || chr == '_' || chr == '.' || chr == '~')
8170  oss << chr;
8171  else
8172  oss << "%" << HEX0N(unsigned(chr),2);
8173  }
8174  return oss.str();
8175 }
8176 
8177 string PercentDecode (const string & inStr)
8178 { ostringstream oss;
8179  unsigned hexNum(0), state(0); // 0=unreserved expected, 1=1st hex digit expected, 2=2nd hex digit expected
8180  for (size_t ndx(0); ndx < inStr.size(); ndx++)
8181  {
8182  const char chr(inStr.at(size_t(ndx)));
8183  switch (state)
8184  {
8185  case 0:
8186  if (::isalnum(chr) || chr == '-' || chr == '_' || chr == '.' || chr == '~')
8187  oss << chr;
8188  if (chr == '%')
8189  {state++; break;}
8190  break;
8191  case 1:
8192  if (chr >= 'A' && chr <= 'F')
8193  hexNum = unsigned(chr + 10 - 'A') << 4;
8194  else if (chr >= 'a' && chr <= 'f')
8195  hexNum = unsigned(chr + 10 - 'a') << 4;
8196  else if (chr >= '0' && chr <= '9')
8197  hexNum = unsigned(chr - '0') << 4;
8198  else
8199  hexNum = 0;
8200  state++;
8201  break;
8202  case 2:
8203  if (chr >= 'A' && chr <= 'F')
8204  hexNum += unsigned(chr + 10 - 'A');
8205  else if (chr >= 'a' && chr <= 'f')
8206  hexNum += unsigned(chr + 10 - 'a');
8207  else if (chr >= '0' && chr <= '9')
8208  hexNum += unsigned(chr - '0');
8209  oss << char(hexNum);
8210  hexNum = 0;
8211  state = 0;
8212  break;
8213  default: NTV2_ASSERT(false); break;
8214  }
8215  }
8216  return oss.str();
8217 }
8218 
8219 bool StringToSerialNum64 (const string & inSerNumStr, uint64_t & outSerNum)
8220 {
8221  outSerNum = 0;
8222  if (inSerNumStr.length() < 8 || inSerNumStr.length() > 9)
8223  return false;
8224  string serNumStr(inSerNumStr);
8225  if (inSerNumStr.length() == 9) // Special case Io4K/DNXIV
8226  serNumStr.erase(0,1); // Lop off the first character
8227  uint64_t serNum(0);
8228  for (size_t ndx(0); ndx < serNumStr.length(); ndx++)
8229  {
8230  const char ch (serNumStr.at(ndx));
8231  // Allow only 0-9, A-Z, a-z, blank, and dash only
8232  if ( ! ( ( (ch >= '0') && (ch <= '9') ) ||
8233  ( (ch >= 'A') && (ch <= 'Z') ) ||
8234  ( (ch >= 'a') && (ch <= 'z') ) ||
8235  (ch == ' ') || (ch == '-') ) )
8236  return false; // Invalid character -- assume no Serial Number programmed
8237  serNum |= uint64_t(ch) << (ndx*8); // ((7-ndx)*8);
8238  }
8239  outSerNum = serNum;
8240  return true;
8241 }
8242 
8243 string SerialNum64ToString (const uint64_t & inSerNum)
8244 {
8245  const ULWord serialNumHigh (inSerNum >> 32);
8246  const ULWord serialNumLow (inSerNum & 0x00000000FFFFFFFF);
8247  char serialNum [9];
8248 
8249  serialNum[0] = char((serialNumLow & 0x000000FF) );
8250  serialNum[1] = char((serialNumLow & 0x0000FF00) >> 8);
8251  serialNum[2] = char((serialNumLow & 0x00FF0000) >> 16);
8252  serialNum[3] = char((serialNumLow & 0xFF000000) >> 24);
8253  serialNum[4] = char((serialNumHigh & 0x000000FF) );
8254  serialNum[5] = char((serialNumHigh & 0x0000FF00) >> 8);
8255  serialNum[6] = char((serialNumHigh & 0x00FF0000) >> 16);
8256  serialNum[7] = char((serialNumHigh & 0xFF000000) >> 24);
8257  serialNum[8] = '\0';
8258 
8259  for (unsigned ndx(0); ndx < 8; ndx++)
8260  {
8261  if (serialNum[ndx] == 0)
8262  {
8263  if (ndx == 0)
8264  return ""; // No characters: no serial number
8265  break; // End of string -- stop scanning
8266  }
8267 
8268  // Allow only 0-9, A-Z, a-z, blank, and dash only.
8269  if ( ! ( ( (serialNum[ndx] >= '0') && (serialNum[ndx] <= '9') ) ||
8270  ( (serialNum[ndx] >= 'A') && (serialNum[ndx] <= 'Z') ) ||
8271  ( (serialNum[ndx] >= 'a') && (serialNum[ndx] <= 'z') ) ||
8272  (serialNum[ndx] == ' ') || (serialNum[ndx] == '-') ) )
8273  return ""; // Invalid character -- assume no Serial Number programmed...
8274  }
8275  return serialNum;
8276 }
8277 
8278 #if defined (AJAMac)
8279  #include <fstream>
8280  #include "ajabase/common/common.h"
8281  // Poor man's plist reader
8282  // Fetches version components out of CFBundleShortVersionString
8283  // Returns true if the Info.plist exists; otherwise false
8284  // NOTE: This will fail for binary plist files!
8285  static const string AJAMacDriverInfoPlistPath ("/Library/Extensions/AJANTV2.kext/Contents/Info.plist");
8286  bool GetInstalledMacDriverVersion (UWord & outMaj, UWord & outMin, UWord & outPt, UWord & outBld, UWord & outType)
8287  {
8288  outMaj = outMin = outPt = outBld = outType = 0;
8289  ifstream ifs;
8290  ifs.open(AJAMacDriverInfoPlistPath.c_str(), std::ios::in);
8291  if (!ifs.is_open())
8292  return false;
8293  if (!ifs.good())
8294  return false;
8295  const string key("<key>CFBundleShortVersionString</key>");
8296  for (string line; std::getline(ifs, line); )
8297  {
8298  size_t keyPos(line.find(key));
8299  if (keyPos == string::npos)
8300  continue;
8301  if (!std::getline(ifs, line))
8302  break;
8303  //"<string>16.1.0b58</string>" or "<string>16.0.1</string>"
8304  size_t startPos(line.find("<string>")), endPos(line.find("</string>"));
8305  if (startPos == string::npos || endPos == string::npos)
8306  continue;
8307  startPos += 8;
8308  if (endPos < startPos)
8309  continue;
8310  string versStr(line.substr(startPos, endPos-startPos)); // "16.1.0b58" or "16.0.1"
8311  NTV2StringList versComps;
8312  aja::split(versStr, '.', versComps);
8313  if (versComps.size() < 3 || versComps.size() > 4)
8314  continue;
8315  const string sBuildTypes("_bad"); // 1=beta 2=alpha 3=dev
8316  for (size_t bt(1); bt < 4; bt++)
8317  if (versComps.at(2).find(sBuildTypes[bt]) != string::npos)
8318  { NTV2StringList lastComps;
8319  aja::split(versComps.at(2), sBuildTypes[bt], lastComps);
8320  versComps.erase(versComps.begin()+2);
8321  versComps.push_back(lastComps.at(0));
8322  outBld = UWord(aja::stoul(lastComps.at(1)));
8323  outType = UWord(bt);
8324  break;
8325  }
8326  for (size_t ndx(0); ndx < versComps.size(); ndx++)
8327  {
8328  if (versComps.at(ndx).empty())
8329  continue;
8330  UWord val(UWord(aja::stoul(versComps.at(ndx))));
8331  if (ndx == 0)
8332  outMaj = val;
8333  else if (ndx == 1)
8334  outMin = val;
8335  else if (ndx == 2)
8336  outPt = val;
8337  else if (ndx == 3 && outType == 0)
8338  outBld = val;
8339  else
8340  break;
8341  }
8342  break;
8343  }
8344  return true;
8345  }
8346 #endif // AJAMac
bool IsProgressivePicture(const NTV2VideoFormat format)
Definition: ntv2utils.cpp:5391
Fractional rate of 15,000 frames per 1,001 seconds.
Definition: ntv2enums.h:429
string NTV2ScanMethodToString(const NTV2ScanMethod inValue, const bool inCompact)
Definition: ntv2utils.cpp:6618
Declares common video macros and structs used in the SDK.
void ConvertARGBYCbCrToRGBA(UByte *rgbaBuffer, ULWord numPixels)
Passes only foreground video + key to the Mixer output.
Definition: ntv2enums.h:1793
See Io XT.
Definition: ntv2enums.h:44
ULWord GetVideoActiveSize(const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inFBFormat, const NTV2VANCMode inVancMode)
Definition: ntv2utils.cpp:2858
Levels are 0 - 255 (Full)
Definition: ntv2enums.h:3638
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
The invalid video input.
Definition: ntv2enums.h:1277
void MaskYCbCrLine(UWord *ycbcrLine, UWord signalMask, ULWord numPixels)
Definition: ntv2utils.cpp:728
void Make10BitLine(UWord *pOutLineData, const UWord Y, const UWord Cb, const UWord Cr, const ULWord inNumPixels)
Definition: ntv2utils.cpp:829
static const char * m31Presets[M31_NUMVIDEOPRESETS]
Definition: ntv2utils.cpp:6979
bool AddAudioTone(ULWord &outNumBytesWritten, NTV2Buffer &inAudioBuffer, ULWord &inOutCurrentSample, const ULWord inNumSamples, const double inSampleRate, const double inAmplitude, const double inFrequency, const ULWord inNumBitsPerSample, const bool inByteSwap, const ULWord inNumChannels)
Fills the given buffer with 32-bit (ULWord) audio tone samples.
Definition: ntv2utils.cpp:4413
#define NTV2_NUMAUDIO_CHANNELS
Specifies devices with SFP connectors.
Definition: ntv2enums.h:1388
string NTV2GetVDevFolderPath(const bool inAddTrailingPathDelim)
Definition: ntv2utils.cpp:7717
#define NTV2UTILS_ENUM_CASE_RETURN_STR(enum_name)
Definition: ntv2utils.cpp:37
string NTV2FramesizeToString(const NTV2Framesize inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6467
Identifies the 4th HDMI video input.
Definition: ntv2enums.h:1268
Identifies the 5th SDI video input.
Definition: ntv2enums.h:1273
Specifies devices with HDMI connectors.
Definition: ntv2enums.h:1386
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
Definition: ntv2enums.h:3895
#define AJA_NTV2_SDK_BUILD_NUMBER
The SDK build number, an unsigned decimal integer.
Definition: ntv2version.h:16
double GetAudioSamplesPerSecond(const NTV2AudioRate inAudioRate)
Returns the audio sample rate as a number of audio samples per second.
Definition: ntv2utils.cpp:3303
ULWord GetNTV2FrameGeometryHeight(const NTV2FrameGeometry inGeometry)
Definition: ntv2utils.cpp:4185
bool NTV2IsCompatibleBitfileName(const string &inBitfileName, const NTV2DeviceID inDeviceID)
Definition: ntv2utils.cpp:7647
NTV2AudioSystem NTV2ChannelToAudioSystem(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2AudioSystem.
Definition: ntv2utils.cpp:4869
Declares a number of pixel format transcoder functions.
NTV2Standard GetNTV2StandardFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:2375
YCbCr color space.
Definition: ntv2enums.h:3609
Declares the AJALock class.
Specifies SDI input/output kinds.
Definition: ntv2enums.h:1292
std::set< NTV2TCIndex > NTV2TCIndexes
NTV2FrameRate GetNTV2FrameRateFromNumeratorDenominator(const ULWord inNumerator, const ULWord inDenominator)
Definition: ntv2utils.cpp:3588
SDI 3 embedded VITC 2.
Definition: ntv2enums.h:3974
bool CopyRaster(const NTV2PixelFormat inPixelFormat, UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
Copies all or part of a source raster image into a destination raster at a given position.
Definition: ntv2utils.cpp:1735
Specifies the SDI In 6 connector.
Definition: ntv2enums.h:1465
string NTV2HDMIColorSpaceToString(const NTV2HDMIColorSpace inValue, const bool inCompact)
Definition: ntv2utils.cpp:6690
Identifies SMPTE HD 1080p.
Definition: ntv2enums.h:171
NTV2FrameGeometry GetGeometryFromStandard(const NTV2Standard inStandard)
Definition: ntv2utils.cpp:4068
Specifies devices with analog video connectors.
Definition: ntv2enums.h:1387
Specifies devices with SDI connectors.
Definition: ntv2enums.h:1385
bool UnpackLine_10BitYUVtoU16s(vector< uint16_t > &outYCbCrLine, const NTV2Buffer &inFrameBuffer, const NTV2FormatDescriptor &inDescriptor, const UWord inLineOffset)
Unpacks up to one raster line of an NTV2_FBF_10BIT_YCBCR frame buffer into an array of uint16_t value...
Definition: ntv2utils.cpp:646
NTV2FrameBufferFormat GetPixelFormat(void) const
NTV2Crosspoint
Logically, these are an NTV2Channel combined with an NTV2Mode.
Definition: ntv2enums.h:1700
Specifies the device&#39;s internal clock.
Definition: ntv2enums.h:1459
#define NTV2_VIDEO_FORMAT_IS_B(__f__)
Definition: ntv2enums.h:1129
This identifies the invalid (unspecified, uninitialized) VANC mode.
Definition: ntv2enums.h:3802
void UnPack10BitDPXtoRGBAlpha10BitPixel(RGBAlpha10BitPixel *rgba10BitBuffer, const ULWord *DPXLinebuffer, ULWord numPixels, bool bigEndian)
Definition: ntv2utils.cpp:685
string SerialNum64ToString(const uint64_t &inSerNum)
Definition: ntv2utils.cpp:8243
void StackQuadrants(uint8_t *pSrc, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcRowBytes, uint8_t *pDst)
Definition: ntv2utils.cpp:450
NTV2AudioBufferSize
Represents the size of the audio buffer used by a device audio system for storing captured samples or...
Definition: ntv2enums.h:1914
NTV2HDMIColorSpace
Indicates or specifies HDMI Color Space.
Definition: ntv2enums.h:3605
ULWordSet NTV2RegisterNumberSet
A set of distinct ULWord values.
string NTV2AncDataRgnToStr(const NTV2AncDataRgn inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6577
#define NTV2_IS_2K_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:756
ULWord GetBytesPerRow(const UWord inPlaneIndex0=0) const
bool IsNULL(void) const
Specifies devices that have 12G SDI connectors.
Definition: ntv2enums.h:1393
Identifies the 2nd HDMI video input.
Definition: ntv2enums.h:1266
NTV2InputSource GetNTV2InputSourceForIndex(const ULWord inIndex0, const NTV2IOKinds inKinds)
Definition: ntv2utils.cpp:5224
See KONA IP.
Definition: ntv2enums.h:71
See Io IP.
Definition: ntv2enums.h:41
1920x1080, for 1080i and 1080p, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:359
See KONA 5.
Definition: ntv2enums.h:55
ostream & operator<<(ostream &inOutStream, const NTV2FrameSize &inFrameDimensions)
Definition: ntv2utils.cpp:5715
static bool SetRasterLinesBlack10BitYCbCr(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
Definition: ntv2utils.cpp:1058
NTV2FieldID
These values are used to identify fields for interlaced video. See Field/Frame Interrupts and CNTV2Ca...
Definition: ntv2enums.h:1840
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
Definition: ntv2enums.h:219
defined(NTV2_DEPRECATE_17_6)
NTV2TaskMode
Describes the task mode state. See also: Sharing AJA Devices With Other Applications.
Doesn&#39;t specify any kind of device.
Definition: ntv2enums.h:1398
#define NTV2_VIDEO_FORMAT_IS_A(__f__)
Definition: ntv2enums.h:1094
uint32_t * PULWord
Definition: ajatypes.h:224
Obtain audio samples from the device AES inputs, if available.
Definition: ntv2enums.h:2008
std::string NTV2GetVersionString(const bool inDetailed)
Definition: ntv2utils.cpp:7868
See KONA 5.
Definition: ntv2enums.h:63
Specifies the HDMI In 1 connector.
Definition: ntv2enums.h:1461
10-Bit 4:2:2 2-Plane YCbCr
Definition: ntv2enums.h:252
NTV2OutputDestination
Identifies a specific video output destination.
Definition: ntv2enums.h:1324
NTV2DeviceIDSet NTV2GetSupportedDevices(const NTV2DeviceKinds inKinds)
Returns an NTV2DeviceIDSet of devices supported by the SDK.
Definition: ntv2utils.cpp:7730
See KONA LHe Plus.
Definition: ntv2enums.h:77
bool CopyFrom(const void *pInSrcBuffer, const ULWord inByteCount)
Replaces my contents from the given memory buffer, resizing me to the new byte count.
720x576, for PAL 625i, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:358
Obtain audio samples from the device HDMI input, if available.
Definition: ntv2enums.h:2010
See 10-Bit YCbCr Format.
Definition: ntv2enums.h:222
See KONA 5.
Definition: ntv2enums.h:56
See Corvid 88.
Definition: ntv2enums.h:32
enum _NTV2ScanMethod NTV2ScanMethod
Identifies a particular scan method.
SDI 1 embedded VITC 2.
Definition: ntv2enums.h:3972
Apple ProRes DVC Pro.
Definition: ntv2enums.h:241
1280x720, for 720p, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:352
string NTV2EmbeddedAudioClockToString(const NTV2EmbeddedAudioClock inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:5793
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
ULWord GetDisplayWidth(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:4199
SDI 3 embedded VITC.
Definition: ntv2enums.h:3956
Used to describe Start of Active Video (SAV) location and field dominance for a given NTV2Standard...
Definition: ntv2utils.h:879
#define NTV2_VIDEO_FORMAT_IS_J2K_SUPPORTED(__f__)
Definition: ntv2enums.h:1164
string NTV2RegisterWriteModeToString(const NTV2RegisterWriteMode inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:7449
#define NTV2_IS_TALLER_VANC_GEOMETRY(__g__)
Definition: ntv2enums.h:400
ULWord width(void) const
std::string NTV2InterruptEnumToString(const INTERRUPT_ENUMS inInterruptEnumValue)
Definition: ntv2utils.cpp:7462
SDI 4 embedded ATC LTC.
Definition: ntv2enums.h:3967
Identifies the 1st HDMI video input.
Definition: ntv2enums.h:1265
string NTV2ReferenceSourceToString(const NTV2ReferenceSource inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:7420
Fractional rate of 120,000 frames per 1,001 seconds.
Definition: ntv2enums.h:427
static AJALock sFRFamMutex
Definition: ntv2utils.cpp:5316
NTV2GeometrySet GetRelatedGeometries(const NTV2FrameGeometry inFG)
Definition: ntv2utils.cpp:4002
See Corvid 24.
Definition: ntv2enums.h:24
#define NTV2_IS_VALID_AUDIO_RATE(_x_)
Definition: ntv2enums.h:1937
Identifies the "monitor" or "auxiliary" Field 2 ancillary data region.
Definition: ntv2enums.h:4232
Identifies SMPTE SD 525i.
Definition: ntv2enums.h:169
void ConvertARGBYCbCrToABGR(UByte *rgbaBuffer, ULWord numPixels)
New in SDK 16.0.
Definition: ntv2enums.h:2564
See 10-Bit Raw YCbCr (CION).
Definition: ntv2enums.h:248
Identifies 4K psf.
Definition: ntv2enums.h:182
bool NTV2DeviceCanDo12GSDI(const NTV2DeviceID inDeviceID)
string NTV2CrosspointToString(const NTV2Crosspoint inChannel)
Definition: ntv2utils.cpp:5805
ULWord GetFullRasterHeight(void) const
AutoCircVidProcMode
#define NTV2_IS_TALL_VANC_GEOMETRY(__g__)
Definition: ntv2enums.h:393
#define NTV2_VIDEO_FORMAT_HAS_PROGRESSIVE_PICTURE(__f__)
Definition: ntv2enums.h:1049
static const NTV2TCIndex gChanVITC1[]
Definition: ntv2utils.cpp:4957
Identifies the AES/EBU audio breakout cable that has XLR connectors.
Definition: ntv2enums.h:3106
ULWord GetByteCount(void) const
bool GetRegNumChanges(const NTV2RegNumSet &inBefore, const NTV2RegNumSet &inAfter, NTV2RegNumSet &outGone, NTV2RegNumSet &outSame, NTV2RegNumSet &outNew)
Definition: ntv2utils.cpp:8109
string NTV2BitfileTypeToString(const NTV2BitfileType inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:7927
NTV2FrameGeometry GetVANCFrameGeometry(const NTV2FrameGeometry inFrameGeometry, const NTV2VANCMode inVancMode)
Definition: ntv2utils.cpp:3904
Capture (input) mode, which writes into device SDRAM.
Definition: ntv2enums.h:1243
See Alternate 8-Bit YCbCr (&#39;YUY2&#39;).
Definition: ntv2enums.h:227
ULWord GetIndexForNTV2Crosspoint(const NTV2Crosspoint channel)
Definition: ntv2utils.cpp:4824
#define NTV2_IS_VALID_AUDIO_BUFFER_SIZE(_x_)
Definition: ntv2enums.h:1925
See 10-Bit YCbCr - DPX Format.
Definition: ntv2enums.h:231
void PackRGB10BitFor10BitRGBPacked(RGBAlpha10BitPixel *pBuffer, const ULWord inNumPixels)
Identifies high frame-rate UHD.
Definition: ntv2enums.h:177
NTV2AudioSystem NTV2InputSourceToAudioSystem(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2AudioSystem value.
Definition: ntv2utils.cpp:5071
ULWordSetConstIter NTV2RegNumSetConstIter
A const iterator that iterates over a set of distinct NTV2RegisterNumbers.
void UnPack10BitYCbCrBuffer(uint32_t *packedBuffer, uint16_t *ycbcrBuffer, uint32_t numPixels)
Definition: ntv2utils.cpp:201
int32_t LWord
Definition: ajatypes.h:222
NTV2InputSource GetNTV2HDMIInputSourceForIndex(const ULWord inIndex0)
Definition: ntv2utils.cpp:5268
NTV2FrameRates::const_iterator NTV2FrameRatesConstIter
Definition: ntv2utils.cpp:5311
Specifies devices that have 6G SDI connectors.
Definition: ntv2enums.h:1392
Analog LTC 2.
Definition: ntv2enums.h:3961
bool GetInstalledMacDriverVersion(UWord &outMaj, UWord &outMin, UWord &outPt, UWord &outBld, UWord &outType)
Definition: ntv2utils.cpp:8286
See 3-Plane 10-Bit YCbCr 4:2:2 (&#39;I422_10LE&#39; a.k.a. &#39;YUV-P-L10&#39;).
Definition: ntv2enums.h:250
Specifies HDMI input/output kinds.
Definition: ntv2enums.h:1293
bool IsMultiFormatCompatible(const NTV2FrameRate inFrameRate1, const NTV2FrameRate inFrameRate2)
Compares two frame rates and returns true if they are "compatible" (with respect to a multiformat-cap...
Definition: ntv2utils.cpp:5357
void PackLine_16BitYUVto10BitYUV(const UWord *pIn16BitYUVLine, ULWord *pOut10BitYUVLine, const ULWord inNumPixels)
Packs a line of 16-bit-per-component YCbCr (NTV2_FBF_10BIT_YCBCR) video into 10-bit-per-component YCb...
Definition: ntv2utils.cpp:564
Obtain audio samples from the audio that&#39;s embedded in the video HANC.
Definition: ntv2enums.h:2007
NTV2EmbeddedAudioClock
This enum value determines/states the device audio clock reference source. It was important to set th...
Definition: ntv2enums.h:1990
NTV2InputSource NTV2TimecodeIndexToInputSource(const NTV2TCIndex inTCIndex)
Converts the given NTV2TCIndex value into the appropriate NTV2InputSource value.
Definition: ntv2utils.cpp:4988
The ordinally first geometry (New in SDK 16.0)
Definition: ntv2enums.h:351
ULWord GetTotalBytes(void) const
string NTV2HDMIBitDepthToString(const NTV2HDMIBitDepth inValue, const bool inCompact)
Definition: ntv2utils.cpp:6645
NTV2Channel NTV2CrosspointToNTV2Channel(const NTV2Crosspoint inCrosspointChannel)
Definition: ntv2utils.cpp:4708
LWord64 GetTotalAudioSamplesFromFrameNbrZeroUpToFrameNbr(const NTV2FrameRate inFrameRate, const NTV2AudioRate inAudioRate, const ULWord inFrameNumNonInclusive)
Definition: ntv2utils.cpp:3146
See KONA 4 (Quad Mode).
Definition: ntv2enums.h:48
void Convert8BitYCbCrToYUY2(UByte *ycbcrBuffer, ULWord numPixels)
Specifies any/all input/output kinds.
Definition: ntv2enums.h:1295
#define NTV2_IS_2K_1080_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:763
Definition: lock.h:28
#define NTV2_IS_VALID_OUTPUT_DEST(_dest_)
Definition: ntv2enums.h:1347
Defines a number of handy byte-swapping macros.
#define CCIR601_8BIT_BLACK
Identifies 8K.
Definition: ntv2enums.h:180
The "default" timecode (mostly used by the AJA "Retail" service and Control Panel) ...
Definition: ntv2enums.h:3953
std::string setFromString(const std::string &inStr)
Definition: ntv2utils.cpp:4256
void ConvertLineto10BitRGB(UWord *ycbcrBuffer, RGBAlpha10BitPixel *rgbaBuffer, ULWord numPixels, bool fUseSDMatrix, bool fUseSMPTERange=false, bool fAlphaFromLuma=false)
#define NTV2_IS_VALID_AUDIO_CHANNEL_OCTET(__p__)
Definition: ntv2enums.h:3344
This identifies the mode in which there are some + extra VANC lines in the frame buffer.
Definition: ntv2enums.h:3801
string NTV2AudioRateToString(const NTV2AudioRate inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:5756
See 3-Plane 8-Bit YCbCr 4:2:0 (&#39;I420&#39; a.k.a. &#39;YUV-P420&#39;).
Definition: ntv2enums.h:233
HDMI protocol.
Definition: ntv2enums.h:3623
#define NTV2_IS_VALID_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3984
2048x1080, for 2Kx1080p, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:364
Definition: json.hpp:5362
Output Cb if set, elso Output Cb to 0x200.
Definition: ntv2enums.h:1691
NTV2HDMIAudioChannels
Indicates or specifies the HDMI audio channel count.
Definition: ntv2enums.h:3667
Interlaced.
Definition: ntv2enums.h:497
This identifies the 3rd Audio System.
Definition: ntv2enums.h:3899
bool UnpackLine_10BitARGBtoUWordSequence(const void *pIn10BitARGBLine, const NTV2FormatDescriptor &inFormatDesc, UWordSequence &out16BitARGBLine)
Unpacks a line of NTV2_FBF_10BIT_ARGB video into 16-bit-per-component ARGB data.
Definition: ntv2utils.cpp:172
Fractional rate of 60,000 frames per 1,001 seconds.
Definition: ntv2enums.h:417
See KONA 5.
Definition: ntv2enums.h:58
Declares common audio macros and structs used in the SDK.
static const UByte * GetReadAddress_2vuy(const UByte *pInFrameBuffer, const ULWord inBytesPerVertLine, const UWord inVertLineOffset, const UWord inHorzPixelOffset, const UWord inBytesPerHorzPixel)
Definition: ntv2utils.cpp:1238
bool IsYCbCrFormat(const NTV2FrameBufferFormat format)
Definition: ntv2utils.cpp:5416
UWord NTV2DeviceGetNumAnalogVideoInputs(const NTV2DeviceID inDeviceID)
See 8-Bit DVCPro.
Definition: ntv2enums.h:232
string NTV2MixerKeyerModeToString(const NTV2MixerKeyerMode inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6518
See KONA 1.
Definition: ntv2enums.h:45
#define AJA_NTV2_SDK_VERSION_POINT
The SDK "point" release version, an unsigned decimal integer.
Definition: ntv2version.h:15
NTV2HDMIRange
Indicates or specifies the HDMI RGB range.
Definition: ntv2enums.h:3635
uint32_t ULWord
Definition: ajatypes.h:223
static bool SetRasterLinesWhite10BitYCbCr(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
Definition: ntv2utils.cpp:1096
Embeds SDI input source audio into the data stream.
Definition: ntv2enums.h:2031
static const NTV2TCIndex gChanVITC2[]
Definition: ntv2utils.cpp:4958
NTV2AudioFormat
Definition: ntv2enums.h:1951
See KONA 5.
Definition: ntv2enums.h:65
ULWord GetVideoWriteSize(const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inFBFormat, const NTV2VANCMode inVancMode)
Identical to the GetVideoActiveSize function, except rounds the result up to the nearest 4K page size...
Definition: ntv2utils.cpp:2875
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1357
NTV2Standard Get4xSizedStandard(const NTV2Standard inStandard, const bool bIs4k)
Definition: ntv2utils.cpp:2357
string NTV2GetBitfileName(const NTV2DeviceID inBoardID)
Definition: ntv2utils.cpp:7567
const void * GetRowAddress(const void *pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const
string NTV2OutputCrosspointIDToString(const NTV2OutputCrosspointID inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:5957
Identifies the 8th SDI video input.
Definition: ntv2enums.h:1276
See Io 4K Plus.
Definition: ntv2enums.h:37
NTV2VideoFormat GetOutputForConversionMode(const NTV2ConversionMode conversionMode)
Definition: ntv2utils.cpp:5667
NTV2WidgetType
Definition: ntv2enums.h:3047
string NTV2AudioChannelPairToString(const NTV2AudioChannelPair inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6431
bool NTV2DeviceCanDoFormat(const NTV2DeviceID inDeviceID, const NTV2FrameRate inFrameRate, const NTV2FrameGeometry inFrameGeometry, const NTV2Standard inStandard)
Definition: ntv2utils.cpp:4158
3840x2160, for UHD, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:367
This identifies the 5th Audio System.
Definition: ntv2enums.h:3901
See Corvid 44.
Definition: ntv2enums.h:26
bool Is4KFormat(const NTV2VideoFormat format)
Definition: ntv2utils.cpp:5434
void PackRGB10BitFor10BitRGB(RGBAlpha10BitPixel *pBuffer, const ULWord inNumPixels)
Identifies the 2nd SDI video input.
Definition: ntv2enums.h:1270
bool IsRaw(const NTV2FrameBufferFormat frameBufferFormat)
Definition: ntv2utils.cpp:5446
NTV2VideoFormat GetQuadSizedVideoFormat(const NTV2VideoFormat inVideoFormat, const bool isSquareDivision)
Definition: ntv2utils.cpp:2129
#define NTV2_ASSERT(_expr_)
Definition: ajatypes.h:476
Identifies SMPTE HD 2K1080psf.
Definition: ntv2enums.h:174
See 3-Plane 8-Bit YCbCr 4:2:2 (Weitek &#39;Y42B&#39; a.k.a. &#39;YUV-P8&#39;).
Definition: ntv2enums.h:246
See KONA 3G (Quad Mode).
Definition: ntv2enums.h:47
SDI 8 embedded VITC.
Definition: ntv2enums.h:3965
Represents an unknown or invalid frame rate.
Definition: ntv2enums.h:414
bool SetRasterLinesWhite(const NTV2PixelFormat inPixelFormat, UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
Sets all or part of a destination raster image to legal white.
Definition: ntv2utils.cpp:1178
Obtain audio samples from the device analog input(s), if available.
Definition: ntv2enums.h:2009
string NTV2FrameGeometryToString(const NTV2FrameGeometry inValue, const bool inForRetailDisplay)
defined(NTV2_DEPRECATE_17_6)
Definition: ntv2utils.cpp:7316
NTV2VideoFormat GetInputForConversionMode(const NTV2ConversionMode conversionMode)
Definition: ntv2utils.cpp:5623
NTV2RegWritesConstIter NTV2RegisterReadsConstIter
SDI 8 embedded ATC LTC.
Definition: ntv2enums.h:3971
50 frames per second
Definition: ntv2enums.h:423
ULWord height(void) const
M31VideoPreset
Definition: ntv2m31enums.h:13
unsigned long stoul(const std::string &str, std::size_t *idx, int base)
Definition: common.cpp:143
New in SDK 16.0.
Definition: ntv2enums.h:2562
NTV2InputSource NTV2ChannelToInputSource(const NTV2Channel inChannel, const NTV2IOKinds inSourceType)
Definition: ntv2utils.cpp:5132
SDI 6 embedded VITC 2.
Definition: ntv2enums.h:3977
static UByte * GetWriteAddress_2vuy(UByte *pInFrameBuffer, const ULWord inBytesPerVertLine, const UWord inVertLineOffset, const UWord inHorzPixelOffset, const UWord inBytesPerHorzPixel)
Definition: ntv2utils.cpp:1249
ULWord numPixels
Width – total number of pixels per line.
Identifies SMPTE HD 720p.
Definition: ntv2enums.h:168
void setHDRDefaultsForBT2020(HDRRegValues &outRegisterValues)
Definition: ntv2utils.cpp:8028
See KONA 5.
Definition: ntv2enums.h:66
string PercentDecode(const string &inStr)
Definition: ntv2utils.cpp:8177
Specifies devices that output (playout).
Definition: ntv2enums.h:1382
See T-TAP.
Definition: ntv2enums.h:93
2048x1556, for 2Kx1556psf film format, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:362
static bool CopyRaster36BytesPer8Pixels(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
Definition: ntv2utils.cpp:1451
NTV2TCIndex
These enum values are indexes into the capture/playout AutoCirculate timecode arrays.
Definition: ntv2enums.h:3951
bool Fill(const T &inValue)
Fills me with the given scalar value.
Specifies the External Reference connector.
Definition: ntv2enums.h:1456
Fractional rate of 48,000 frames per 1,001 seconds.
Definition: ntv2enums.h:425
30 frames per second
Definition: ntv2enums.h:418
string NTV2DieTempScaleToString(const NTV2DieTempScale inValue, const bool inUseUTF8)
Definition: ntv2utils.cpp:8008
Field Mode: Register changes take effect at the next field VBI.
Definition: ntv2enums.h:1681
#define NTV2_IS_VALID_AUDIO_CHANNEL_QUAD(__p__)
Definition: ntv2enums.h:3311
Specifies the SDI In 2 connector.
Definition: ntv2enums.h:1458
UWord NTV2DeviceGetNumHDMIVideoOutputs(const NTV2DeviceID inDeviceID)
SDI 3 embedded ATC LTC.
Definition: ntv2enums.h:3966
NTV2FrameRate
Identifies a particular video frame rate.
Definition: ntv2enums.h:412
7680x4320, for UHD2, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:371
See KONA 5.
Definition: ntv2enums.h:62
Analog LTC 1.
Definition: ntv2enums.h:3960
2048x1080, NTV2_VANCMODE_TALLER
Definition: ntv2enums.h:356
8-Bit 4:2:2 2-Plane YCbCr
Definition: ntv2enums.h:254
0: Disabled (never recommended): device configured exclusively by client application(s).
NTV2Standard
Identifies a particular video standard.
Definition: ntv2enums.h:165
string NTV2GetFirmwareFolderPath(const bool inAddTrailingPathDelim)
Definition: ntv2utils.cpp:7693
Playout (output) mode, which reads from device SDRAM.
Definition: ntv2enums.h:1241
bool IsProgressiveTransport(const NTV2VideoFormat format)
Definition: ntv2utils.cpp:5397
This identifies the 6th Audio System.
Definition: ntv2enums.h:3902
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
static const NTV2TCIndex gChanATCLTC[]
Definition: ntv2utils.cpp:4959
void * GetWriteableRowAddress(void *pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const
Specifies the HDMI In 3 connector.
Definition: ntv2enums.h:1473
See KONA 5.
Definition: ntv2enums.h:57
bool NTV2DeviceCanDoVideoFormat(const NTV2DeviceID inDeviceID, const NTV2VideoFormat inVideoFormat)
static bool CopyRaster16BytesPer6Pixels(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
Definition: ntv2utils.cpp:1330
Identifies UHD2.
Definition: ntv2enums.h:179
ULWord GetIndexForNTV2Channel(const NTV2Channel inChannel)
Definition: ntv2utils.cpp:4702
int16_t Word
Definition: ajatypes.h:220
1920x1080, for 1080i and 1080p, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:350
void ConvertLineTo8BitYCbCr(const uint16_t *ycbcr10BitBuffer, uint8_t *ycbcr8BitBuffer, const uint32_t numPixels)
Definition: ntv2utils.cpp:244
See Io 4K (Quad Mode).
Definition: ntv2enums.h:36
string NTV2AudioSystemToString(const NTV2AudioSystem inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:5745
void ConvertLineto16BitRGB(UWord *ycbcrBuffer, RGBAlpha16BitPixel *rgbaBuffer, ULWord numPixels, bool fUseSDMatrix, bool fUseSMPTERange=false)
The invalid mode.
Definition: ntv2enums.h:1245
#define CCIR601_10BIT_WHITE
16-Bit ARGB
Definition: ntv2enums.h:245
ULWord GetRasterHeight(const bool inVisibleOnly=false) const
string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:5727
See KONA LHi.
Definition: ntv2enums.h:78
Invalid or "not found".
Definition: ntv2enums.h:98
NTV2Crosspoint GetNTV2CrosspointInputForIndex(const ULWord index)
Definition: ntv2utils.cpp:4768
static bool CopyRaster4BytesPerPixel(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
Definition: ntv2utils.cpp:1568
void setHDRDefaultsForDCIP3(HDRRegValues &outRegisterValues)
Definition: ntv2utils.cpp:8033
NTV2VideoFormat GetSupportedNTV2VideoFormatFromInputVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:2598
#define AJA_NTV2_SDK_VERSION_MAJOR
The SDK major version number, an unsigned decimal integer.
Definition: ntv2version.h:13
See Corvid HB-R.
Definition: ntv2enums.h:34
NTV2DeviceIDSet::const_iterator NTV2DeviceIDSetConstIter
A convenient const iterator for NTV2DeviceIDSet.
Definition: ntv2utils.h:1046
NTV2ReferenceSource
These enum values identify a specific source for the device&#39;s (output) reference clock.
Definition: ntv2enums.h:1454
RGB color space.
Definition: ntv2enums.h:3608
NTV2BreakoutType
Identifies the Breakout Boxes and Cables that may be attached to an AJA NTV2 device.
Definition: ntv2enums.h:3103
Identifies "all" ancillary data regions.
Definition: ntv2enums.h:4237
#define NTV2_INPUT_SOURCE_IS_HDMI(_inpSrc_)
Definition: ntv2enums.h:1281
ULWord GetIndexForNTV2CrosspointChannel(const NTV2Crosspoint channel)
Definition: ntv2utils.cpp:4752
bool IsNTV2CrosspointInput(const NTV2Crosspoint inChannel)
Definition: ntv2utils.cpp:4849
Specifies analog input/output kinds.
Definition: ntv2enums.h:1294
Identifies Ultra-High-Definition (UHD) psf.
Definition: ntv2enums.h:181
1280x720, for 720p, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:360
enum NTV2AncillaryDataRegion NTV2AncDataRgn
SDI 6 embedded ATC LTC.
Definition: ntv2enums.h:3969
#define AJA_NULL
Definition: ajatypes.h:167
#define NTV2_IS_VALID_IOKINDS(_k_)
Definition: ntv2enums.h:1312
See 10-Bit RGB Format.
Definition: ntv2enums.h:226
ULWord GetVaricamRepeatCount(const NTV2FrameRate inSequenceRate, const NTV2FrameRate inPlayRate, const ULWord inCadenceFrame)
Definition: ntv2utils.cpp:3315
NTV2StringSet::const_iterator NTV2StringSetConstIter
Definition: ntv2utils.h:1159
#define NTV2_IS_FBF_RGB(__fbf__)
Definition: ntv2enums.h:283
NTV2Channel NTV2TimecodeIndexToChannel(const NTV2TCIndex inTCIndex)
Converts the given NTV2TCIndex value into the appropriate NTV2Channel value.
Definition: ntv2utils.cpp:4979
See KONA 5.
Definition: ntv2enums.h:61
Identifies the 3rd SDI video input.
Definition: ntv2enums.h:1271
bool IsTransportCompatibleFormat(const NTV2VideoFormat inFormat1, const NTV2VideoFormat inFormat2)
Definition: ntv2utils.cpp:5206
See KONA 5.
Definition: ntv2enums.h:67
New in SDK 16.0.
Definition: ntv2enums.h:2585
NTV2FrameGeometry GetQuarterSizedGeometry(const NTV2FrameGeometry inGeometry)
Definition: ntv2utils.cpp:2315
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
NTV2AudioLoopBack
This enum value determines/states if an audio output embedder will embed silence (zeroes) or de-embed...
Definition: ntv2enums.h:2028
See Corvid 44 12G.
Definition: ntv2enums.h:31
NTV2FrameGeometry GetNormalizedFrameGeometry(const NTV2FrameGeometry inFrameGeometry)
Definition: ntv2utils.cpp:3856
Disables normal FrameBuffer Y/C value read limiting (NOT RECOMMENDED).
Definition: ntv2enums.h:3781
bool YUVComponentsTo10BitYUVPackedBuffer(const vector< uint16_t > &inYCbCrLine, NTV2Buffer &inFrameBuffer, const NTV2FormatDescriptor &inDescriptor, const UWord inLineOffset)
Packs up to one raster line of uint16_t YUV components into an NTV2_FBF_10BIT_YCBCR frame buffer...
Definition: ntv2utils.cpp:603
Describes a video frame for a given video standard or format and pixel format, including the total nu...
NTV2FrameRate GetFrameRateFromScale(long scale, long duration, NTV2FrameRate playFrameRate)
Definition: ntv2utils.cpp:3491
Defines for the NTV2 SDK version number, used by ajantv2/includes/ntv2enums.h. See the ajantv2/includ...
enum _INTERRUPT_ENUMS_ INTERRUPT_ENUMS
string NTV2OutputDestinationToString(const NTV2OutputDestination inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:7400
void Fill4k8BitYCbCrVideoFrame(PULWord _baseVideoAddress, NTV2FrameBufferFormat frameBufferFormat, YCbCrPixel color, bool vancEnabled, bool b4k, bool wideVANC)
Definition: ntv2utils.cpp:954
See KONA 5.
Definition: ntv2enums.h:54
void split(const std::string &str, const char delim, std::vector< std::string > &elems)
Definition: common.cpp:350
string NTV2InputSourceToString(const NTV2InputSource inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:7377
void PackRGB10BitFor10BitARGBPacked(RGBAlpha10BitPixel *pBuffer, const ULWord inNumPixels)
string NTV2AudioSourceToString(const NTV2AudioSource inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6731
NTV2ColorCorrectionMode
Definition: ntv2enums.h:2079
void Make10BitBlackLine(UWord *pOutLineData, const ULWord inNumPixels)
Writes a line of unpacked, legal SMPTE 10-bit Y/C black values into the given buffer.
Definition: ntv2utils.cpp:803
NTV2VideoFormat GetFirstMatchingVideoFormat(const NTV2FrameRate inFrameRate, const UWord inHeightLines, const UWord inWidthPixels, const bool inIsInterlaced, const bool inIsLevelB, const bool inIsPSF)
Definition: ntv2utils.cpp:1921
Specifies the SDI In 8 connector.
Definition: ntv2enums.h:1467
2: OEM (recommended): device configured by client application(s) with some driver involvement...
New in SDK 16.0.
Definition: ntv2enums.h:2561
NTV2RegisterNumberSet NTV2RegNumSet
A set of distinct NTV2RegisterNumbers.
bool Is8BitFrameBufferFormat(const NTV2FrameBufferFormat format)
Definition: ntv2utils.cpp:5452
NTV2AudioChannelPair
Identifies a pair of audio channels.
Definition: ntv2enums.h:3131
NTV2FrameRateFamilies::const_iterator NTV2FrameRateFamiliesConstIter
Definition: ntv2utils.cpp:5313
bool UnpackLine_10BitYUVtoUWordSequence(const void *pIn10BitYUVLine, UWordSequence &out16BitYUVLine, ULWord inNumPixels)
Unpacks a line of NTV2_FBF_10BIT_YCBCR video into 16-bit-per-component YUV data.
Definition: ntv2utils.cpp:123
std::vector< std::string > NTV2StringList
Definition: ntv2utils.h:1155
void Make8BitBlackLine(UByte *lineData, ULWord numPixels, NTV2FrameBufferFormat fbFormat)
Definition: ntv2utils.cpp:865
bool SetRasterLinesBlack(const NTV2PixelFormat inPixelFormat, UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
Sets all or part of a destination raster image to legal black.
Definition: ntv2utils.cpp:1118
Specifies any/all devices.
Definition: ntv2enums.h:1380
NTV2EmbeddedAudioInput NTV2ChannelToEmbeddedAudioInput(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2EmbeddedAudioInput.
Definition: ntv2utils.cpp:4861
NTV2MixerKeyerInputControl
These enum values identify the Mixer/Keyer foreground and background input control values...
Definition: ntv2enums.h:1776
Software device that doesn&#39;t emulate one of the above devices.
Definition: ntv2enums.h:83
NTV2Channel GetNTV2ChannelForIndex(const ULWord inIndex)
Definition: ntv2utils.cpp:4697
Automatic (not for OEM use)
Definition: ntv2enums.h:3607
#define NTV2_IS_PSF_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:1016
int64_t LWord64
Definition: ajatypes.h:225
uint32_t CalcRowBytesForFormat(const NTV2FrameBufferFormat inPixelFormat, const uint32_t inPixelWidth)
Definition: ntv2utils.cpp:46
NTV2RegWrites NTV2RegisterReads
string NTV2ModeToString(const NTV2Mode inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6493
ULWord firstActiveLine
First active line of video (0 if NTV2_VANCMODE_OFF)
New in SDK 16.0.
Definition: ntv2enums.h:2584
std::vector< uint16_t > UWordSequence
An ordered sequence of UWord (uint16_t) values.
NTV2UpConvertMode
Definition: ntv2enums.h:2219
Specifies the SDI In 3 connector.
Definition: ntv2enums.h:1462
SDI 4 embedded VITC.
Definition: ntv2enums.h:3957
#define NTV2_IS_INPUT_CROSSPOINT(__x__)
Definition: ntv2enums.h:1724
std::set< NTV2FrameGeometry > NTV2GeometrySet
A set of distinct NTV2FrameGeometry values.
#define NTV2_IS_3Gb_FORMAT(__f__)
Definition: ntv2enums.h:975
string NTV2MixerInputControlToString(const NTV2MixerKeyerInputControl inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6532
See KONA 5.
Definition: ntv2enums.h:59
NTV2Crosspoint NTV2ChannelToInputCrosspoint(const NTV2Channel inChannel)
Definition: ntv2utils.cpp:4915
See 8-Bit ARGB, RGBA, ABGR Formats.
Definition: ntv2enums.h:228
NTV2HDMIProtocol
Indicates or specifies the HDMI protocol.
Definition: ntv2enums.h:3621
See 8-Bit ARGB, RGBA, ABGR Formats.
Definition: ntv2enums.h:224
void ConvertARGBToRGB(UByte *rgbaLineBuffer, UByte *rgbLineBuffer, ULWord numPixels)
Embeds silence (zeroes) into the data stream.
Definition: ntv2enums.h:2030
string AutoCircVidProcModeToString(const AutoCircVidProcMode inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:7900
string NTV2HDMIAudioChannelsToString(const NTV2HDMIAudioChannels inValue, const bool inCompact)
Definition: ntv2utils.cpp:6657
Passes only background video + key to the Mixer output.
Definition: ntv2enums.h:1796
UWord NTV2DeviceGetNumAnalogVideoOutputs(const NTV2DeviceID inDeviceID)
NTV2Channel NTV2OutputDestinationToChannel(const NTV2OutputDestination inOutputDest)
Converts a given NTV2OutputDestination to its equivalent NTV2Channel value.
Definition: ntv2utils.cpp:5155
Specifies channel or FrameStore 8 (or the 8th item).
Definition: ntv2enums.h:1366
See KONA HDMI.
Definition: ntv2enums.h:68
New in SDK 16.0.
Definition: ntv2enums.h:2797
#define NTV2_IS_FBF_8BIT(__fbf__)
Definition: ntv2enums.h:299
Identifies SMPTE HD 2K1080p.
Definition: ntv2enums.h:173
Specifies the PTP source on SFP 1.
Definition: ntv2enums.h:1468
NTV2DownConvertMode
Definition: ntv2enums.h:2242
Register changes take effect immediately, without waiting for a field or frame VBI.
Definition: ntv2enums.h:1683
string NTV2IsoConvertModeToString(const NTV2IsoConvertMode inValue, const bool inCompact)
Definition: ntv2utils.cpp:6630
string NTV2RegisterNumberToString(const NTV2RegisterNumber inValue)
Definition: ntv2utils.cpp:7894
Specifies software devices (that don&#39;t model "real" ones).
Definition: ntv2enums.h:1384
bool NTV2DeviceCanDoPlayback(const NTV2DeviceID inDeviceID)
Specifies channel or FrameStore 2 (or the 2nd item).
Definition: ntv2enums.h:1360
See Corvid 44 12G.
Definition: ntv2enums.h:27
bool NTV2DeviceHasSDIRelays(const NTV2DeviceID inDeviceID)
Specifies the SDI In 1 connector.
Definition: ntv2enums.h:1457
string NTV2FrameRateToString(const NTV2FrameRate inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:7346
This identifies the 7th Audio System.
Definition: ntv2enums.h:3903
Specifies the PCR source on SFP 1.
Definition: ntv2enums.h:1469
void PackTo10BitYCbCrBuffer(const uint16_t *ycbcrBuffer, uint32_t *packedBuffer, const uint32_t numPixels)
Definition: ntv2utils.cpp:216
NTV2BitfileType
Definition: ntv2enums.h:3368
See 12-Bit Packed RGB.
Definition: ntv2enums.h:240
NTV2OutputDestination NTV2ChannelToOutputDestination(const NTV2Channel inChannel, const NTV2IOKinds inKinds)
Converts the given NTV2Channel value into its ordinary equivalent NTV2OutputDestination.
Definition: ntv2utils.cpp:5167
Register changes take effect after 10 lines after the next field VBI (not commonly used)...
Definition: ntv2enums.h:1684
string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:6936
void Make8BitLine(UByte *lineData, UByte Y, UByte Cb, UByte Cr, ULWord numPixels, NTV2FrameBufferFormat fbFormat)
Definition: ntv2utils.cpp:911
Output Cr if set, elso Output Cr to 0x200.
Definition: ntv2enums.h:1692
See Io Express.
Definition: ntv2enums.h:39
HDRRegValues & setDCIP3(void)
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:4608
static bool CopyRaster3BytesPerPixel(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
Definition: ntv2utils.cpp:1624
string NTV2DownConvertModeToString(const NTV2DownConvertMode inValue, const bool inCompact)
Definition: ntv2utils.cpp:6605
uint8_t UByte
Definition: ajatypes.h:218
NTV2Crosspoint NTV2ChannelToOutputCrosspoint(const NTV2Channel inChannel)
Definition: ntv2utils.cpp:4926
NTV2VANCMode GetVANCModeForGeometry(const NTV2FrameGeometry inFG)
Definition: ntv2utils.cpp:4056
static const INTERRUPT_ENUMS gChannelToInputInterrupt[]
Specifies the HDMI In 2 connector.
Definition: ntv2enums.h:1472
ULWord GetNTV2FrameGeometryWidth(const NTV2FrameGeometry inGeometry)
Definition: ntv2utils.cpp:4191
1920x1080, NTV2_VANCMODE_TALLER
Definition: ntv2enums.h:355
UWord NTV2DeviceGetNumVideoInputs(const NTV2DeviceID inDeviceID)
720x486, for NTSC 525i, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:357
INTERRUPT_ENUMS NTV2ChannelToInputInterrupt(const NTV2Channel inChannel)
Converts the given NTV2Channel value into the equivalent input INTERRUPT_ENUMS value.
Definition: ntv2utils.cpp:4937
See 3-Plane 10-Bit YCbCr 4:2:0 (&#39;I420_10LE&#39; a.k.a. &#39;YUV-P420-L10&#39;).
Definition: ntv2enums.h:249
See KONA LHi.
Definition: ntv2enums.h:79
string NTV2VideoLimitingToString(const NTV2VideoLimiting inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6545
void ConvertARGBToBGR(const UByte *pInRGBALineBuffer, UByte *pOutRGBLineBuffer, const ULWord inNumPixels)
ULWord GetScaleFromFrameRate(const NTV2FrameRate inFrameRate)
Definition: ntv2utils.cpp:3454
NTV2Crosspoint NTV2InputSourceToChannelSpec(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Crosspoint value.
Definition: ntv2utils.cpp:4999
NTV2Crosspoint GetNTV2CrosspointForIndex(const ULWord index)
Definition: ntv2utils.cpp:4800
bool PackLine_UWordSequenceTo10BitYUV(const UWordSequence &in16BitYUVLine, ULWord *pOut10BitYUVLine, const ULWord inNumPixels)
Packs a line of 16-bit-per-component YCbCr (NTV2_FBF_10BIT_YCBCR) video into 10-bit-per-component YCb...
Definition: ntv2utils.cpp:581
bool NTV2DeviceCanDo4KVideo(const NTV2DeviceID inDeviceID)
#define NTV2_IS_VANCMODE_ON(__v__)
Definition: ntv2enums.h:3808
Overlays foreground video on top of background video.
Definition: ntv2enums.h:1794
#define AJA_NTV2_SDK_BUILD_TYPE
The SDK build type, where "a"=alpha, "b"=beta, "d"=development, ""=release.
Definition: ntv2version.h:18
void MakeUnPacked10BitYCbCrBuffer(uint16_t *buffer, uint16_t Y, uint16_t Cb, uint16_t Cr, uint32_t numPixels)
Definition: ntv2utils.cpp:229
4096x2160, for 4K, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:369
Identifies the 4th SDI video input.
Definition: ntv2enums.h:1272
NTV2Framesize
Kona2/Xena2 specific enums.
Definition: ntv2enums.h:2116
Specifies the PCR source on SFP 2.
Definition: ntv2enums.h:1471
static bool SetRasterLinesWhite8BitYCbCr(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
Definition: ntv2utils.cpp:1080
NTV2VideoFormat GetTransportCompatibleFormat(const NTV2VideoFormat inFormat, const NTV2VideoFormat inTargetFormat)
Definition: ntv2utils.cpp:5194
void Convert16BitARGBTo12BitRGBPacked(RGBAlpha16BitPixel *rgbaLineBuffer, UByte *rgbLineBuffer, ULWord numPixels)
8192x4320, for 8K, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:373
void Make8BitWhiteLine(UByte *lineData, ULWord numPixels, NTV2FrameBufferFormat fbFormat)
Definition: ntv2utils.cpp:887
#define NTV2_IS_VALID_CHANNEL(__x__)
Definition: ntv2enums.h:1371
10-Bit DPX Little-Endian
Definition: ntv2enums.h:238
string NTV2AudioLoopBackToString(const NTV2AudioLoopBack inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:5781
See KONA 5.
Definition: ntv2enums.h:50
bool Fill10BitYCbCrVideoFrame(void *pBaseVideoAddress, const NTV2Standard inStandard, const NTV2FrameBufferFormat inFBF, const YCbCr10BitPixel inPixelColor, const NTV2VANCMode inVancMode)
Definition: ntv2utils.cpp:842
Describes a user-space buffer on the host computer. I have an address and a length, plus some optional attributes (allocated by SDK?, page-aligned? etc.).
unsigned char cr
string NTV2StandardToString(const NTV2Standard inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:6910
Identifies SMPTE HD 1080i or 1080psf.
Definition: ntv2enums.h:167
Identifies Ultra-High-Definition (UHD)
Definition: ntv2enums.h:175
NTV2Mode
Used to identify the mode of a widget_framestore, or the direction of an AutoCirculate stream: either...
Definition: ntv2enums.h:1239
See KONA IP.
Definition: ntv2enums.h:72
std::string toString(const bool inNormalized=false) const
Definition: ntv2utils.cpp:4306
Fractional rate of 30,000 frames per 1,001 seconds.
Definition: ntv2enums.h:419
10-Bit 4:2:0 2-Plane YCbCr
Definition: ntv2enums.h:251
Identifies the "Legal SDI" mode (Ymax=0x3AC, Cmax=0x3C0)
Definition: ntv2enums.h:3780
string NTV2GetPluginsFolderPath(const bool inAddTrailingPathDelim)
Definition: ntv2utils.cpp:7705
NTV2InputSource
Identifies a specific video input source.
Definition: ntv2enums.h:1262
unsigned char y
Identifies SMPTE SD 625i.
Definition: ntv2enums.h:170
static bool CopyRaster20BytesPer16Pixels(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
Definition: ntv2utils.cpp:1391
#define M_PI
Definition: ntv2utils.cpp:4409
Identifies the 6th SDI video input.
Definition: ntv2enums.h:1274
std::string & strip(std::string &str, const std::string &ws)
Definition: common.cpp:461
double GetFramesPerSecond(const NTV2FrameRate inFrameRate)
Definition: ntv2utils.cpp:1833
UWord NTV2GetSDKVersionComponent(const int inVersionComponent)
Returns an SDK version component value.
Definition: ntv2utils.cpp:7880
NTV2TimecodeIndex NTV2InputSourceToTimecodeIndex(const NTV2InputSource inInputSource, const bool inEmbeddedLTC)
Converts a given NTV2InputSource to its equivalent NTV2TimecodeIndex value.
Definition: ntv2utils.cpp:5095
2048x1080, for 2Kx1080p, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:361
Invalid/uninitialized.
Definition: ntv2enums.h:1797
Identifies 4K.
Definition: ntv2enums.h:176
static bool CopyRaster5BytesPerPixel(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
Definition: ntv2utils.cpp:1512
See KONA 5.
Definition: ntv2enums.h:64
bool IsRGBFormat(const NTV2FrameBufferFormat format)
Definition: ntv2utils.cpp:5410
#define AJA_NTV2_SDK_BUILD_DATETIME
The date and time the SDK was built, in ISO-8601 format.
Definition: ntv2version.h:17
2 audio channels
Definition: ntv2enums.h:3669
#define DEC(__x__)
NTV2RegisterNumber
See Corvid 22.
Definition: ntv2enums.h:23
#define AJAExport
Definition: export.h:33
NTV2FrameGeometry
Identifies a particular video frame geometry.
Definition: ntv2enums.h:348
ULWord GetIndexForNTV2CrosspointInput(const NTV2Crosspoint channel)
Definition: ntv2utils.cpp:4784
ULWord NTV2FramesizeToByteCount(const NTV2Framesize inFrameSize)
Converts the given NTV2Framesize value into an exact byte count.
Definition: ntv2utils.cpp:5287
720x576, for PAL 625i, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:354
NTV2FrameGeometry GetNTV2FrameGeometryFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:2644
This identifies the first Audio System.
Definition: ntv2enums.h:3897
Progressive Segmented Frame.
Definition: ntv2enums.h:498
See Corvid HEVC.
Definition: ntv2enums.h:35
std::string NTV2IpErrorEnumToString(const NTV2IpError inIpErrorEnumValue)
Definition: ntv2utils.cpp:7512
See 8-Bit HDV.
Definition: ntv2enums.h:234
SDI 2 embedded VITC 2.
Definition: ntv2enums.h:3973
Apple ProRes HDV.
Definition: ntv2enums.h:242
60 frames per second
Definition: ntv2enums.h:415
#define NTV2_IS_VALID_INPUT_SOURCE(_inpSrc_)
Definition: ntv2enums.h:1284
15 frames per second
Definition: ntv2enums.h:428
string NTV2UpConvertModeToString(const NTV2UpConvertMode inValue, const bool inCompact)
Definition: ntv2utils.cpp:6591
void UnPack10BitDPXtoForRP215(UWord *rawrp215Buffer, ULWord *DPXLinebuffer, ULWord numPixels)
Definition: ntv2utils.cpp:716
10-Bit ARGB
Definition: ntv2enums.h:244
Identifies the 7th SDI video input.
Definition: ntv2enums.h:1275
bool Is8KFormat(const NTV2VideoFormat format)
Definition: ntv2utils.cpp:5440
Declares numerous NTV2 utility functions.
static const INTERRUPT_ENUMS gChannelToOutputInterrupt[]
static bool CheckFrameRateFamiliesInitialized(void)
Definition: ntv2utils.cpp:5319
void ConvertLinetoRGB(UByte *ycbcrBuffer, RGBAlphaPixel *rgbaBuffer, ULWord numPixels, bool fUseSDMatrix, bool fUseSMPTERange=false)
ULWord numLines
Height – total number of lines.
static bool SetRasterLinesBlack8BitYCbCr(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
Definition: ntv2utils.cpp:1042
void RePackLineDataForYCbCrDPX(ULWord *packedycbcrLine, ULWord numULWords)
Definition: ntv2utils.cpp:674
Describes the horizontal and vertical size dimensions of a raster, bitmap, frame or image...
#define CCIR601_8BIT_CHROMAOFFSET
Specifies the SDI In 7 connector.
Definition: ntv2enums.h:1466
SDI 4 embedded VITC 2.
Definition: ntv2enums.h:3975
New in SDK 16.0.
Definition: ntv2enums.h:2873
NTV2OutputCrosspointID
Identifies a widget output, a signal source, that potentially can drive another widget&#39;s input (ident...
Definition: ntv2enums.h:2527
#define CCIR601_8BIT_WHITE
Declares the AJASystemInfo class.
NTV2IsoConvertMode
Definition: ntv2enums.h:2253
NTV2InputCrosspointID
Identifies a widget input that potentially can accept a signal emitted from another widget&#39;s output (...
Definition: ntv2enums.h:2752
Identifies the "normal" Field 2 ancillary data region.
Definition: ntv2enums.h:4230
This identifies the 4th Audio System.
Definition: ntv2enums.h:3900
SDI 7 embedded ATC LTC.
Definition: ntv2enums.h:3970
ULWord GetFirstActiveLine(const NTV2FieldID inRasterFieldID=NTV2_FIELD0) const
Definition: ntv2utils.cpp:4219
uint16_t NTV2DeviceKinds
A combination of NTV2DeviceKindFilter values.
Definition: ntv2enums.h:1401
#define NTV2_AUDIOSAMPLESIZE
SDI 8 embedded VITC 2.
Definition: ntv2enums.h:3979
static const string AJAMacDriverInfoPlistPath("/Library/Extensions/AJANTV2.kext/Contents/Info.plist")
Specifies devices that input (capture).
Definition: ntv2enums.h:1381
Specifies the Analog In 1 connector.
Definition: ntv2enums.h:1460
string NTV2HDMIProtocolToString(const NTV2HDMIProtocol inValue, const bool inCompact)
Definition: ntv2utils.cpp:6668
string NTV2BreakoutTypeToString(const NTV2BreakoutType inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6558
Specifies the PTP source on SFP 2.
Definition: ntv2enums.h:1470
#define NTV2_IS_QUAD_QUAD_FORMAT(__f__)
Definition: ntv2enums.h:819
See 8-Bit ARGB, RGBA, ABGR Formats.
Definition: ntv2enums.h:225
SDI 6 embedded VITC.
Definition: ntv2enums.h:3963
720x486, for NTSC 525i and 525p60, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:353
#define NTV2_IS_VANCMODE_TALL(__v__)
Definition: ntv2enums.h:3806
See Io X3.
Definition: ntv2enums.h:43
NTV2WidgetID
Definition: ntv2enums.h:2909
New in SDK 16.0.
Definition: ntv2enums.h:2795
#define NTV2_IS_OUTPUT_CROSSPOINT(__x__)
Definition: ntv2enums.h:1733
Identifies high frame-rate 4K.
Definition: ntv2enums.h:178
ULWord GetVisibleRasterHeight(void) const
uint16_t UWord
Definition: ajatypes.h:221
ULWord GetRasterWidth(void) const
1: Standard/Retail: device configured by AJA ControlPanel, service/daemon, and driver.
Specifies channel or FrameStore 1 (or the first item).
Definition: ntv2enums.h:1359
120 frames per second
Definition: ntv2enums.h:426
See 48-Bit RGB.
Definition: ntv2enums.h:239
string NTV2AudioBufferSizeToString(const NTV2AudioBufferSize inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:5769
Obtain audio samples from the device microphone input, if available.
Definition: ntv2enums.h:2011
NTV2VideoLimiting
These enum values identify the available SDI video output limiting modes.
Definition: ntv2enums.h:3778
string NTV2AudioFormatToString(const NTV2AudioFormat inValue, const bool inCompact)
Definition: ntv2utils.cpp:6702
bool Fill8BitYCbCrVideoFrame(void *pBaseVideoAddress, const NTV2Standard inStandard, const NTV2FrameBufferFormat inFBF, const YCbCrPixel inPixelColor, const NTV2VANCMode inVancMode)
Definition: ntv2utils.cpp:937
NTV2DeviceID NTV2GetDeviceIDFromBitfileName(const string &inBitfileName)
Definition: ntv2utils.cpp:7671
See Corvid 44 12G.
Definition: ntv2enums.h:29
NTV2FrameGeometry Get4xSizedGeometry(const NTV2FrameGeometry inGeometry)
Definition: ntv2utils.cpp:2328
See Io IP.
Definition: ntv2enums.h:40
std::set< NTV2FrameRate > NTV2FrameRates
Definition: ntv2utils.cpp:5310
void PackRGB10BitFor10BitDPX(RGBAlpha10BitPixel *pBuffer, const ULWord inNumPixels, const bool bigEndian=true)
bool NTV2DeviceIsExternalToHost(const NTV2DeviceID inDeviceID)
Output Black.
Definition: ntv2enums.h:1689
NTV2VANCMode
These enum values identify the available VANC modes.
Definition: ntv2enums.h:3797
NTV2TCIndexes GetTCIndexesForSDIConnector(const NTV2Channel inSDI)
Definition: ntv2utils.cpp:4970
NTV2EmbeddedAudioInput NTV2InputSourceToEmbeddedAudioInput(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2EmbeddedAudioInput value.
Definition: ntv2utils.cpp:4877
25 frames per second
Definition: ntv2enums.h:420
Doesn&#39;t specify any kind of input/output.
Definition: ntv2enums.h:1291
static std::string GetDisplayName(const uint32_t inRegNum)
string NTV2ColorCorrectionModeToString(const NTV2ColorCorrectionMode inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:7914
std::vector< NTV2OutputCrosspointID > NTV2OutputCrosspointIDs
An ordered sequence of NTV2OutputCrosspointID values.
Definition: ntv2utils.h:1067
See Io 4K (UFC Mode).
Definition: ntv2enums.h:38
NTV2Standard GetNTV2StandardFromScanGeometry(const UByte inScanGeometry, const bool inIsProgressiveTransport)
Definition: ntv2utils.cpp:1903
#define NTV2_IS_SUPPORTED_NTV2FrameRate(__r__)
Definition: ntv2enums.h:445
string NTV2EmbeddedAudioInputToString(const NTV2EmbeddedAudioInput inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6713
Identifies the AES/EBU audio breakout cable that has BNC connectors.
Definition: ntv2enums.h:3107
#define NTV2_IS_VALID_AUDIO_SYSTEM(__x__)
Definition: ntv2enums.h:3914
Identifies the 3rd HDMI video input.
Definition: ntv2enums.h:1267
NTV2RegisterWriteMode
These values are used to determine when certain register writes actually take effect. See CNTV2Card::SetRegisterWriteMode or Field/Frame Interrupts.
Definition: ntv2enums.h:1679
See Corvid, Corvid 3G.
Definition: ntv2enums.h:22
string NTV2WidgetIDToString(const NTV2WidgetID inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6162
10-Bit YCbCrA
Definition: ntv2enums.h:237
Declares the NTV2FormatDescriptor class.
#define NTV2_INPUT_SOURCE_IS_ANALOG(_inpSrc_)
Definition: ntv2enums.h:1282
NTV2FrameRate GetFrameRateFamily(const NTV2FrameRate inFrameRate)
Definition: ntv2utils.cpp:5343
bool toRegValues(HDRRegValues &outVals) const
ULWord AddAudioTestPattern(ULWord *pAudioBuffer, ULWord &inOutCurrentSample, const ULWord inNumSamples, const ULWord inModulus, const bool inEndianConvert, const ULWord inNumChannels)
Definition: ntv2utils.cpp:4587
std::string PrintLineNumber(const ULWord inLineOffset=0, const NTV2FieldID inRasterFieldID=NTV2_FIELD0) const
Definition: ntv2utils.cpp:4246
NTV2ReferenceSource NTV2InputSourceToReferenceSource(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2ReferenceSource value.
Definition: ntv2utils.cpp:5023
string NTV2WidgetTypeToString(const NTV2WidgetType inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6301
static bool CopyRaster4BytesPer2Pixels(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
Definition: ntv2utils.cpp:1261
string NTV2TaskModeToString(const NTV2TaskMode inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6353
std::vector< NTV2FrameRates > NTV2FrameRateFamilies
Definition: ntv2utils.cpp:5312
See KONA 5.
Definition: ntv2enums.h:51
string NTV2HDMIRangeToString(const NTV2HDMIRange inValue, const bool inCompact)
Definition: ntv2utils.cpp:6679
bool setFromRegValues(const HDRRegValues &inRegValues)
void CopyToQuadrant(uint8_t *srcBuffer, uint32_t srcHeight, uint32_t srcRowBytes, uint32_t dstQuadrant, uint8_t *dstBuffer, uint32_t quad13Offset)
Definition: ntv2utils.cpp:519
string PercentEncode(const string &inStr)
Definition: ntv2utils.cpp:8164
See Corvid 44.
Definition: ntv2enums.h:33
NTV2AudioSource
This enum value determines/states where an audio system will obtain its audio samples.
Definition: ntv2enums.h:2005
bool convertHDRRegisterToFloatValues(const HDRRegValues &inRegisterValues, HDRFloatValues &outFloatValues)
Definition: ntv2utils.cpp:8023
Levels are 16 - 235 (SMPTE)
Definition: ntv2enums.h:3637
Identifies the "monitor" or "auxiliary" Field 1 ancillary data region.
Definition: ntv2enums.h:4231
NTV2FrameRate GetNTV2FrameRateFromVideoFormat(const NTV2VideoFormat videoFormat)
Definition: ntv2utils.cpp:3630
Specifies channel or FrameStore 4 (or the 4th item).
Definition: ntv2enums.h:1362
static bool CopyRaster6BytesPerPixel(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
Definition: ntv2utils.cpp:1680
See Corvid 44 12G.
Definition: ntv2enums.h:28
SDI 5 embedded VITC 2.
Definition: ntv2enums.h:3976
bool convertHDRFloatToRegisterValues(const HDRFloatValues &inFloatValues, HDRRegValues &outRegisterValues)
Definition: ntv2utils.cpp:8018
std::ostream & Print(std::ostream &inOutStream) const
Writes a human-readable description of me into the given output stream.
Definition: ntv2utils.cpp:4231
string NTV2TCIndexToString(const NTV2TCIndex inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6394
UWord NTV2DeviceGetNumVideoOutputs(const NTV2DeviceID inDeviceID)
#define NTV2_IS_VALID_FIELD(__x__)
Definition: ntv2enums.h:1847
NTV2OutputCrosspointIDs::const_iterator NTV2OutputCrosspointIDsConstIter
A convenient const iterator for NTV2OutputCrosspointIDs.
Definition: ntv2utils.h:1069
int RecordCopyAudio(PULWord pAja, PULWord pSR, int iStartSample, int iNumBytes, int iChan0, int iNumChans, bool bKeepAudio24Bits)
Definition: ntv2utils.cpp:4338
Specifies channel or FrameStore 5 (or the 5th item).
Definition: ntv2enums.h:1363
string NTV2VideoFormatToString(const NTV2VideoFormat inFormat, const bool inUseFrameRate)
Definition: ntv2utils.cpp:6746
Identifies the first analog video input.
Definition: ntv2enums.h:1264
Private include file for all ajabase sources.
New in SDK 16.0.
Definition: ntv2enums.h:2557
See 10-Bit RGB - DPX Format.
Definition: ntv2enums.h:230
bool NTV2DeviceCanDoCustomAnc(const NTV2DeviceID inDeviceID)
This identifies the 8th Audio System.
Definition: ntv2enums.h:3904
NTV2AudioRate
Definition: ntv2enums.h:1928
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:725
New in SDK 16.0.
Definition: ntv2enums.h:2556
Specifies the HDMI In 4 connector.
Definition: ntv2enums.h:1474
string NTV2M31VideoPresetToString(const M31VideoPreset inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:7144
static NTV2FrameRateFamilies sFRFamilies
Definition: ntv2utils.cpp:5315
SDI 2 embedded ATC LTC.
Definition: ntv2enums.h:3959
Output Y if set, else Output Y=0x40.
Definition: ntv2enums.h:1690
bool IsVideoFormatA(const NTV2VideoFormat format)
Definition: ntv2utils.cpp:5458
virtual AJAStatus GetValue(const AJASystemInfoTag inTag, std::string &outValue) const
Answers with the host system info value string for the given AJASystemInfoTag.
Definition: info.cpp:153
NTV2ConversionMode
Definition: ntv2enums.h:3714
See 24-Bit RGB.
Definition: ntv2enums.h:235
SDI 1 embedded ATC LTC.
Definition: ntv2enums.h:3958
10-Bit Raw RGB
Definition: ntv2enums.h:247
No identifiable breakout hardware appears to be attached.
Definition: ntv2enums.h:3105
#define NTV2_FBF_HAS_ALPHA(__fbf__)
Definition: ntv2enums.h:323
Progressive.
Definition: ntv2enums.h:495
std::set< NTV2DeviceID > NTV2DeviceIDSet
A set of NTV2DeviceIDs.
Definition: ntv2utils.h:1044
void CopyRGBAImageToFrame(ULWord *pSrcBuffer, ULWord srcWidth, ULWord srcHeight, ULWord *pDstBuffer, ULWord dstWidth, ULWord dstHeight)
Definition: ntv2utils.cpp:986
void * GetHostPointer(void) const
See KONA X™.
Definition: ntv2enums.h:82
#define CCIR601_10BIT_CHROMAOFFSET
New in SDK 16.0.
Definition: ntv2enums.h:2563
Identifies the first field in time for an interlaced video frame, or the first and only field in a pr...
Definition: ntv2enums.h:1842
NTV2FrameGeometry GetGeometryFromFrameDimensions(const NTV2FrameSize &inFD)
Definition: ntv2utils.cpp:3957
bool NTV2DeviceCanDoCapture(const NTV2DeviceID inDeviceID)
SDI 2 embedded VITC.
Definition: ntv2enums.h:3955
ULWord GetDisplayHeight(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:4207
ULWord linePitch
Number of 32-bit words per line – shadows mLinePitch[0] / sizeof(ULWord)
Specifies the SDI In 4 connector.
Definition: ntv2enums.h:1463
See Corvid 44.
Definition: ntv2enums.h:30
2048x1556, for 2Kx1556psf film format, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:363
Audio clock derived from the device reference.
Definition: ntv2enums.h:1992
bool NTV2DeviceCanDoIP(const NTV2DeviceID inDeviceID)
NTV2RegisterReads FromRegNumSet(const NTV2RegNumSet &inRegNumSet)
Definition: ntv2utils.cpp:8093
Identifies the "Legal Broadcast" mode (Ymax=0x340, Cmax=0x340)
Definition: ntv2enums.h:3782
This identifies the 2nd Audio System.
Definition: ntv2enums.h:3898
SDI 5 embedded VITC.
Definition: ntv2enums.h:3962
8 audio channels
Definition: ntv2enums.h:3670
NTV2Audio4ChannelSelect
Identifies a contiguous, adjacent group of four audio channels.
Definition: ntv2enums.h:3271
NTV2ConversionMode GetConversionMode(const NTV2VideoFormat inFormat, const NTV2VideoFormat outFormat)
Definition: ntv2utils.cpp:5475
NTV2RegNumSet ToRegNumSet(const NTV2RegisterReads &inRegReads)
Definition: ntv2utils.cpp:8101
Specifies channel or FrameStore 6 (or the 6th item).
Definition: ntv2enums.h:1364
NTV2TCIndex NTV2ChannelToTimecodeIndex(const NTV2Channel inChannel, const bool inEmbeddedLTC, const bool inIsF2)
Converts the given NTV2Channel value into the equivalent NTV2TCIndex value.
Definition: ntv2utils.cpp:4962
See KONA 3G (UFC Mode).
Definition: ntv2enums.h:46
#define HEX0N(__x__, __n__)
Definition: debug.cpp:1175
#define NTV2_IS_VALID_VANCMODE(__v__)
Definition: ntv2enums.h:3805
string NTV2AudioChannelQuadToString(const NTV2Audio4ChannelSelect inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6443
48 frames per second
Definition: ntv2enums.h:424
NTV2AudioSource NTV2InputSourceToAudioSource(const NTV2InputSource inInputSource)
Definition: ntv2utils.cpp:4901
bool StringToSerialNum64(const string &inSerNumStr, uint64_t &outSerNum)
Definition: ntv2utils.cpp:8219
DVI protocol.
Definition: ntv2enums.h:3624
#define NTV2_IS_4K_QUADHD_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:860
Frame Mode: Register changes take effect at the next frame VBI (power-up default).
Definition: ntv2enums.h:1682
Specifies channel or FrameStore 7 (or the 7th item).
Definition: ntv2enums.h:1365
#define NTV2_INPUT_SOURCE_IS_SDI(_inpSrc_)
Definition: ntv2enums.h:1283
NTV2IOKinds GetNTV2InputSourceKind(const NTV2InputSource inSrc)
Definition: ntv2utils.cpp:5256
NTV2Crosspoint GetNTV2CrosspointChannelForIndex(const ULWord index)
Definition: ntv2utils.cpp:4736
void UnpackLine_10BitYUVto16BitYUV(const ULWord *pIn10BitYUVLine, UWord *pOut16BitYUVLine, const ULWord inNumPixels)
Unpacks a line of 10-bit-per-component YCbCr video into 16-bit-per-component YCbCr (NTV2_FBF_10BIT_YC...
Definition: ntv2utils.cpp:548
See KONA X™.
Definition: ntv2enums.h:80
SDI 7 embedded VITC 2.
Definition: ntv2enums.h:3978
Specifies devices that have Anc/Aux inserters/extractors.
Definition: ntv2enums.h:1394
NTV2IpError
Definition: ntv2enums.h:4313
void * GetHostAddress(const ULWord inByteOffset, const bool inFromEnd=false) const
string NTV2AudioChannelOctetToString(const NTV2Audio8ChannelSelect inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6455
See KONA 4 (UFC Mode).
Definition: ntv2enums.h:49
bool IsVideoFormatB(const NTV2VideoFormat format)
Definition: ntv2utils.cpp:5464
Identifies the "normal" Field 1 ancillary data region.
Definition: ntv2enums.h:4229
24 frames per second
Definition: ntv2enums.h:421
#define NTV2EndianSwap16(__val__)
Definition: ntv2endian.h:15
10-Bit Packed RGB
Definition: ntv2enums.h:243
8-Bit 4:2:0 2-Plane YCbCr
Definition: ntv2enums.h:253
720x576, for PAL 625i, NTV2_VANCMODE_TALLER
Definition: ntv2enums.h:366
unsigned char cb
void MaskUnPacked10BitYCbCrBuffer(uint16_t *ycbcrUnPackedBuffer, uint16_t signalMask, uint32_t numPixels)
Definition: ntv2utils.cpp:367
UWord NTV2DeviceGetNumHDMIVideoInputs(const NTV2DeviceID inDeviceID)
string NTV2VANCModeToString(const NTV2VANCMode inValue, const bool inCompactDisplay)
Definition: ntv2utils.cpp:6505
void ConvertUnpacked10BitYCbCrToPixelFormat(uint16_t *unPackedBuffer, uint32_t *packedBuffer, uint32_t numPixels, NTV2FrameBufferFormat pixelFormat, bool bUseSmpteRange, bool bAlphaFromLuma)
Definition: ntv2utils.cpp:255
Specifies devices that have SDI bypass relays.
Definition: ntv2enums.h:1396
Identifies the 1st SDI video input.
Definition: ntv2enums.h:1269
ULWord GetIndexForNTV2InputSource(const NTV2InputSource inValue)
Definition: ntv2utils.cpp:5274
bool IsNTV2CrosspointOutput(const NTV2Crosspoint inChannel)
Definition: ntv2utils.cpp:4855
INTERRUPT_ENUMS NTV2ChannelToOutputInterrupt(const NTV2Channel inChannel)
Converts the given NTV2Channel value into the equivalent output INTERRUPT_ENUMS value.
Definition: ntv2utils.cpp:4947
void CopyFromQuadrant(uint8_t *srcBuffer, uint32_t srcHeight, uint32_t srcRowBytes, uint32_t srcQuadrant, uint8_t *dstBuffer, uint32_t quad13Offset)
Definition: ntv2utils.cpp:491
NTV2Standard GetQuarterSizedStandard(const NTV2Standard inStandard)
Definition: ntv2utils.cpp:2340
Specifies external devices (e.g. Thunderbolt).
Definition: ntv2enums.h:1383
bool Is2KFormat(const NTV2VideoFormat format)
Definition: ntv2utils.cpp:5428
std::vector< NTV2DeviceID > NTV2DeviceIDList
An ordered list of NTV2DeviceIDs.
Definition: ntv2utils.h:1037
Specifies devices that can do 4K video.
Definition: ntv2enums.h:1390
NTV2Channel NTV2InputSourceToChannel(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Channel value.
Definition: ntv2utils.cpp:5047
bool IsAlphaChannelFormat(const NTV2FrameBufferFormat format)
Definition: ntv2utils.cpp:5422
#define NTV2_IS_PROGRESSIVE_STANDARD(__s__)
Definition: ntv2enums.h:189
ULWord NTV2AudioBufferSizeToByteCount(const NTV2AudioBufferSize inBufferSize)
Converts the given NTV2BufferSize value into its exact byte count.
Definition: ntv2utils.cpp:5302
NTV2DeviceIDList::const_iterator NTV2DeviceIDListConstIter
A convenient const iterator for NTV2DeviceIDList.
Definition: ntv2utils.h:1039
#define NTV2_IS_VALID_NTV2FrameGeometry(__s__)
Definition: ntv2enums.h:380
Specifies the SDI In 5 connector.
Definition: ntv2enums.h:1464
NTV2EmbeddedAudioInput
This enum value determines/states which SDI video input will be used to supply audio samples to an au...
Definition: ntv2enums.h:1967
bool IsVideoFormatJ2KSupported(const NTV2VideoFormat format)
Definition: ntv2utils.cpp:5469
ULWord GetAudioSamplesPerFrame(const NTV2FrameRate inFrameRate, const NTV2AudioRate inAudioRate, ULWord inCadenceFrame, const bool inIsSMPTE372Enabled)
Returns the number of audio samples for a given video frame rate, audio sample rate, and frame number. This is useful since AJA devices use fixed audio sample rates (typically 48KHz), and some video frame rates will necessarily result in some frames having more audio samples than others.
Definition: ntv2utils.cpp:2889
NTV2HDMIBitDepth
Indicates or specifies the HDMI video bit depth.
Definition: ntv2enums.h:3692
#define NTV2_IS_VALID_AUDIO_CHANNEL_PAIR(__p__)
Definition: ntv2enums.h:3203
#define NTV2EndianSwap32(__val__)
Definition: ntv2endian.h:19
#define AJA_NTV2_SDK_VERSION_MINOR
The SDK minor version number, an unsigned decimal integer.
Definition: ntv2version.h:14
void Make10BitWhiteLine(UWord *pOutLineData, const ULWord inNumPixels)
Writes a line of unpacked, legal SMPTE 10-bit Y/C white values into the given buffer.
Definition: ntv2utils.cpp:816
void UnPack10BitDPXtoForRP215withEndianSwap(UWord *rawrp215Buffer, ULWord *DPXLinebuffer, ULWord numPixels)
Definition: ntv2utils.cpp:706
bool GetChangedRegisters(const NTV2RegisterReads &inBefore, const NTV2RegisterReads &inAfter, NTV2RegNumSet &outChanged)
Definition: ntv2utils.cpp:8118
Declares device capability functions.
See 24-Bit BGR.
Definition: ntv2enums.h:236
SDI 1 embedded VITC.
Definition: ntv2enums.h:3954
This identifies the "tall" mode in which there are some VANC lines in the frame buffer.
Definition: ntv2enums.h:3800
HDRRegValues & setBT2020(void)
NTV2VideoFormat GetQuarterSizedVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:1940
NTV2MixerKeyerMode
These enum values identify the mixer mode.
Definition: ntv2enums.h:1791
NTV2Audio8ChannelSelect
Identifies a contiguous, adjacent group of eight audio channels.
Definition: ntv2enums.h:3320
This identifies the mode in which there are no VANC lines in the frame buffer.
Definition: ntv2enums.h:3799
720x486, for NTSC 525i and 525p60, NTV2_VANCMODE_TALLER
Definition: ntv2enums.h:365
Fractional rate of 24,000 frames per 1,001 seconds.
Definition: ntv2enums.h:422
NTV2StringList::const_iterator NTV2StringListConstIter
Definition: ntv2utils.h:1157
bool IsPSF(const NTV2VideoFormat format)
Definition: ntv2utils.cpp:5385
Specifies channel or FrameStore 3 (or the 3rd item).
Definition: ntv2enums.h:1361
See KONA 5.
Definition: ntv2enums.h:52
See T-TAP Pro.
Definition: ntv2enums.h:94
#define NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(condition, retail_name, enum_name)
Definition: ntv2utils.cpp:39
string NTV2InputCrosspointIDToString(const NTV2InputCrosspointID inValue, const bool inForRetailDisplay)
Definition: ntv2utils.cpp:5814
std::set< std::string > NTV2StringSet
Definition: ntv2utils.h:1158
enum NTV2TCIndex NTV2TimecodeIndex
See KONA IP25.
Definition: ntv2enums.h:74
void Convert16BitARGBTo16BitRGB(RGBAlpha16BitPixel *rgbaLineBuffer, UWord *rgbLineBuffer, ULWord numPixels)
bool HasVANCGeometries(const NTV2FrameGeometry inFG)
Definition: ntv2utils.cpp:3966
ULWord NTV2IOKinds
Definition: ntv2enums.h:1310
#define NTV2_FBF_IS_RAW(__fbf__)
Definition: ntv2enums.h:331
Declares the CNTV2RegisterExpert class.
NTV2RegReadsConstIter FindFirstMatchingRegisterNumber(const uint32_t inRegNum, const NTV2RegReads &inRegInfos)
Returns a const iterator to the first entry in the NTV2RegInfo collection with a matching register nu...
SDI 7 embedded VITC.
Definition: ntv2enums.h:3964
See KONA XM™.
Definition: ntv2enums.h:81
See 8-Bit YCbCr Format.
Definition: ntv2enums.h:223
#define NTV2_IS_4K_4096_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:833
Audio clock derived from the video input.
Definition: ntv2enums.h:1993
See Corvid, Corvid 3G.
Definition: ntv2enums.h:25
See KONA 5.
Definition: ntv2enums.h:60
NTV2Standard GetStandardFromGeometry(const NTV2FrameGeometry inGeometry, const bool inIsProgressive)
Definition: ntv2utils.cpp:4104
SDI 5 embedded ATC LTC.
Definition: ntv2enums.h:3968
string NTV2RegNumSetToString(const NTV2RegisterNumberSet &inObj)
Definition: ntv2utils.cpp:6366
virtual bool IsValid(void) const
Definition: lock.h:65
NTV2DieTempScale
Definition: ntv2enums.h:4210
#define CCIR601_10BIT_BLACK