AJA NTV2 SDK  18.1.0.2439
NTV2 SDK 18.1.0.2439
ntv2publicinterface.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef NTV2PUBLICINTERFACE_H
9 #define NTV2PUBLICINTERFACE_H
10 
11 #include "ajatypes.h"
12 #include "ntv2enums.h"
13 #if !defined(NTV2_BUILDING_DRIVER)
14  #include <iostream>
15  #include <set>
16  #include <map>
17  #include <vector>
18  #include <string>
19  #include <iomanip>
20  #include <bitset>
21  #include <string>
22  #include <bitset>
23  #include "string.h" // for memcpy
24  #include "ajaexport.h"
25  #if defined(MSWindows)
26  #pragma warning(disable:4800) // int/bool conversion
27  #pragma warning(disable:4127) // Stop MSVC from bitching about "do{...}while(false)" macros
28  #endif
29 #endif // user-space clients only
30 
31 #if defined (MSWindows)
32  #include <basetsd.h>
33 #elif defined (AJAMac)
34  #pragma GCC diagnostic ignored "-Wunused-private-field"
35 #endif
36 
37 #if !defined (NTV2_BUILDING_DRIVER)
38  typedef std::vector<uint8_t> UByteSequence;
39  typedef UByteSequence::const_iterator UByteSequenceConstIter;
40  typedef UByteSequence::iterator UByteSequenceIter;
41 
42  typedef std::vector<uint16_t> UWordSequence;
43  typedef UWordSequence::const_iterator UWordSequenceConstIter;
44  typedef UWordSequence::iterator UWordSequenceIter;
45 
46  typedef std::vector<uint32_t> ULWordSequence;
47  typedef ULWordSequence::const_iterator ULWordSequenceConstIter;
48  typedef ULWordSequence::iterator ULWordSequenceIter;
49 
50  typedef std::vector<uint64_t> ULWord64Sequence;
51  typedef ULWord64Sequence::const_iterator ULWord64SequenceConstIter;
52  typedef ULWord64Sequence::iterator ULWord64SequenceIter;
53 
54  typedef std::set<ULWord> ULWordSet;
55  typedef ULWordSet::const_iterator ULWordSetConstIter;
56  typedef ULWordSet::iterator ULWordSetIter;
57 
58  typedef std::vector <std::string> NTV2StringList; // New in SDK 12.5
59  typedef NTV2StringList::iterator NTV2StringListIter; // New in SDK 16.0
60  typedef NTV2StringList::const_iterator NTV2StringListConstIter;// New in SDK 12.5
61  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2StringList & inData); // New in SDK 15.5
62 
63  typedef std::set <std::string> NTV2StringSet; // New in SDK 12.5
64  typedef NTV2StringSet::const_iterator NTV2StringSetConstIter; // New in SDK 12.5
65  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2StringSet & inData);
66 
67  typedef std::set <NTV2AudioChannelPair> NTV2AudioChannelPairs;
68  typedef NTV2AudioChannelPairs::const_iterator NTV2AudioChannelPairsConstIter;
69  AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioChannelPairs & inSet);
70 
71  typedef std::set <NTV2AudioChannelQuad> NTV2AudioChannelQuads;
72  typedef NTV2AudioChannelQuads::const_iterator NTV2AudioChannelQuadsConstIter;
73  AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioChannelQuads & inSet);
74 
75  typedef std::set <NTV2AudioChannelOctet> NTV2AudioChannelOctets;
76  typedef NTV2AudioChannelOctets::const_iterator NTV2AudioChannelOctetsConstIter;
77  AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioChannelOctets & inSet);
78 
79  typedef std::vector <double> NTV2DoubleArray;
80  typedef NTV2DoubleArray::iterator NTV2DoubleArrayIter;
81  typedef NTV2DoubleArray::const_iterator NTV2DoubleArrayConstIter;
82  AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2DoubleArray & inVector);
83 
84  typedef UByte NTV2DID;
85  typedef std::set <UByte> NTV2DIDSet;
86  typedef NTV2DIDSet::iterator NTV2DIDSetIter;
87  typedef NTV2DIDSet::const_iterator NTV2DIDSetConstIter;
88  AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2DIDSet & inDIDs);
89 
90  typedef std::bitset<16> NTV2AudioChannelsMuted16;
94 #endif // NTV2_BUILDING_DRIVER
95 
96 
97 #if !defined (NTV2_BUILDING_DRIVER)
99  #define NTV2_RPC_ENCODE_DECL bool RPCEncode (NTV2_RPC_BLOB_TYPE & outBlob);
100  #define NTV2_RPC_DECODE_DECL bool RPCDecode (const NTV2_RPC_BLOB_TYPE & inBlob, size_t & inOutIndex);
101  #define NTV2_RPC_DECODECLIENT_DECL bool RPCDecodeClient (const NTV2_RPC_BLOB_TYPE & inBlob, size_t & inOutIndex);
102  #define NTV2_RPC_ENCODECLIENT_DECL bool RPCEncodeClient (NTV2_RPC_BLOB_TYPE & inBlob);
103  #define NTV2_RPC_DECODESERVER_DECL bool RPCDecodeServer (const NTV2_RPC_BLOB_TYPE & inBlob, size_t & inOutIndex);
104  #define NTV2_RPC_ENCODESERVER_DECL bool RPCEncodeServer (NTV2_RPC_BLOB_TYPE & inBlob);
105 
106  #define NTV2_RPC_CODEC_DECLS public: \
107  NTV2_RPC_ENCODE_DECL \
108  NTV2_RPC_DECODE_DECL \
109  NTV2_RPC_DECODECLIENT_DECL \
110  NTV2_RPC_ENCODECLIENT_DECL \
111  NTV2_RPC_DECODESERVER_DECL \
112  NTV2_RPC_ENCODESERVER_DECL
113 
114  // NTV2Buffer has its own RPC encode/decode methods
115  #define NTV2_RPC_BUFFER_ENCODE_DECL bool RPCEncode (NTV2_RPC_BLOB_TYPE & outBlob, bool fillBuffer=true);
116  #define NTV2_RPC_BUFFER_DECODE_DECL bool RPCDecode (const NTV2_RPC_BLOB_TYPE & inBlob, size_t & inOutIndex, bool fillBuffer=true);
117  #define NTV2_RPC_BUFFER_DECODE2_DECL bool RPCDecodeNoAllocate (const NTV2_RPC_BLOB_TYPE & inBlob, size_t & inOutIndex);
118 
119  #define NTV2_RPC_BUFFER_CODEC_DECLS public: \
120  NTV2_RPC_BUFFER_ENCODE_DECL \
121  NTV2_RPC_BUFFER_DECODE_DECL \
122  NTV2_RPC_BUFFER_DECODE2_DECL
123 #else
124  #define NTV2_RPC_CODEC_DECLS
125  #define NTV2_RPC_BUFFER_CODEC_DECLS
126 #endif // NTV2_BUILDING_DRIVER
127 
128 
129 typedef enum
130 {
152  kRegStatus, // 21
181  kRegBoardID, // 50
198  kRegCanDoStatus, // 67 SDK 15.6 and later
199  kRegCh1ColorCorrectionControl, // 68 CamelCase fix in SDK 16.0
200  kRegCh2ColorCorrectionControl, // 69 CamelCase fix SDK 16.0
212 
222 
233 
242 
244  kRegReserved109, // 109 // Used for camera record flag kRegLANCAndLensTap = kRegReserved109, // Borg //Note: Lens Tap is no longer supported by software. ref bug 3342. 4/5/2012
249 
256 
267 
280 
286 
292 
293  kRegField1Line21CaptionDecode, // 152 // OBSOLETE
294  kRegField2Line21CaptionDecode, // 153 // OBSOLETE
295  kRegField1Line21CaptionEncode, // 154 // OBSOLETE
296  kRegField2Line21CaptionEncode, // 155 // OBSOLETE
297  kRegVANCGrabberSetup, // 156 // OBSOLETE
298  kRegVANCGrabberStatus1, // 157 // OBSOLETE
299  kRegVANCGrabberStatus2, // 158 // OBSOLETE
300  kRegVANCGrabberDataBuffer, // 159 // OBSOLETE
301  kRegVANCInserterSetup1, // 160 // OBSOLETE
302  kRegVANCInserterSetup2, // 161 // OBSOLETE
303  kRegVANCInserterDataBuffer, // 162 // OBSOLETE
304 
315  kRegAudioChannelMappingCh1, // 173 // OBSOLETE
318  kRegAudioChannelMappingCh4, // 176 // OBSOLETE
319  kRegAudioChannelMappingCh5, // 177 // OBSOLETE
320  kRegAudioChannelMappingCh6, // 178 // OBSOLETE
321  kRegAudioChannelMappingCh7, // 179 // OBSOLETE
322  kRegAudioChannelMappingCh8, // 180 // OBSOLETE
323 
408  kRegStatus2, // 265
434 
440 
446 
450 
453 
458 
465 
468 
471 
481 
483 
484  //HDMI HDR Registers
492 
496 
500 
502 
505 
507 
513 
515 
517 
518  kRegDC1, // 354
519  kRegDC2, // 355
521 
524 
525  //HDMI V2 In Registers
543 
545 
546  //Scott: New Dax/Multi-channel Registers
554 
559 
564 
569 
574 
585 
588 
598 
608 
618 
620 
625 
630 
635 
640 
642 
644 
647 
653 
659 
665 
669 
677 
681 
685 
687 
692 
695 
704 
709 
712 
713  kRegNumRegisters // 512 // MUST REMAIN LAST DEFINED ENUM
714 #if 1 // LEGACY ENUMs
715  ,kRegOutputTimingFinePhase = kRegAud1Delay // 19 (was kRegReserved3)
723 #endif
725 
727 
728 #define kRegCh1ColorCorrectioncontrol kRegCh1ColorCorrectionControl // CamelCase fixed in SDK 16.0
729 #define kRegCh2ColorCorrectioncontrol kRegCh2ColorCorrectionControl // CamelCase fixed in SDK 16.0
730 
731 // Discontinuous block of registers used for monitoring the incoming SDI signals
733 {
734  kRegRXSDI1Status = 2048, // 2048
742 
751 
760 
769 
778 
787 
796 
805 
808 
809  kRegNumRXSDIRegisters = 2113 - 2048 + 1
811 
812 typedef enum
813 {
814  kReg1DLUTLoadControl1 = 2200, //2200
823 
824 typedef enum
825 {
857 
858 // Discontinuous block of registers used for detecting non-PCM embedded audio.
860 {
872 
873 // New in SDK 15.6:
874 // Some boards have new firmware that implements a "valid route" bitmap ROM accessed by a contiguous block of registers:
876 {
877  kRegFirstValidXptROMRegister = 3072, // Starts at reg 3072
878  kRegNumValidXptROMRegisters = 1024, // It's 4096 bytes long
882 
883 // Discontinuous block of registers used to control the enhanced color space converters
884 typedef enum
885 {
886  kRegEnhancedCSC1Mode = 5120, // 5120
903 
904  kRegNumEnhancedCSCRegisters = 5136 - 5120 + 1,
905 
906  kRegEnhancedCSC2Mode = 5184, // 5184
923 
924  kRegEnhancedCSC3Mode = 5248, // 5248
941 
942  kRegEnhancedCSC4Mode = 5312, // 5312
959 
960  kRegEnhancedCSC5Mode = 5376, // 5376
977 
978  kRegEnhancedCSC6Mode = 5440, // 5440 or fight
995 
996  kRegEnhancedCSC7Mode = 5504, // 5504
1013 
1014  kRegEnhancedCSC8Mode = 5568, // 5568
1031 
1033 
1034 typedef enum _NTV2OERegisters
1035 {
1036  kRegOEData1 = 0x1700,
1037  kRegOEData256 = 0x173F
1038 } NTV2OERegisters;
1039 
1040 typedef enum
1041 {
1044 
1046 {
1061 
1063 {
1069  kRegMRSupport = 0x1747
1071 
1072 typedef enum
1073 {
1076 
1077 typedef enum
1078 {
1079  kRegIDSwitch = 0x40020
1081 
1082 typedef enum
1083 {
1087 
1088 typedef enum
1089 {
1090  kRegBOBStatus = 0x3680,
1096 
1097 typedef enum
1098 {
1108 
1109 typedef enum
1110 {
1111  kRegCMWControl = 0x36c0,
1118 
1119 typedef enum
1120 {
1121  kRegLPRJ45IP = 14080, // External IP Address
1122  kRegLPTunnelIP = 14081, // ajatun IP Address
1123  kRegLPSFP1IP = 14082, // SFP 1 IP Address
1124  kRegLPSFP2IP = 14083, // SFP 1 IP Address
1125  kRegLPIPVidStatus = 14084, // Video Enabled/Active Statuses : 0-7: Input enabled
1126  kRegLPIPAudStatus = 14085, // Audio Enabled/Active Statuses : 16-23: Output enabled
1127  kRegLPIPAncStatus = 14086, // Anc Enabled/Active Statuses : 24-31: Output Active
1128  kRegLPIPOut1Config = 14087, // Stuff beyond VPID definition Out 1
1129  kRegLPIPOut2Config = 14088, // " Out 2
1130  kRegLPIPOut3Config = 14089, // " Out 3
1131  kRegLPIPOut4Config = 14090, // " Out 4
1132  kRegLPPTPSFPStatus = 14091, // Which SFP is PTP locked to
1133  //14092 - 14093 Available
1134  kRegLPHeartBeat = 14094, // Local Proc isAlive counter
1135  kRegLPFrameTask = 14095 // Used to report OEM/Retail configuration
1137 
1138 typedef enum
1139 {
1152 
1155 
1156 typedef enum
1157 {
1170 
1173 
1174 
1175 
1176 #define NTV2_HDMIAuxMaxFrames 8
1177 #define NTV2_HDMIAuxDataSize 32
1178 
1179 // Virtual registers
1180 #include "ntv2virtualregisters.h"
1181 
1182 typedef struct
1183 {
1188  ULWord CbOffset; // Not user controllable
1189  ULWord CrOffset; // Not user controllable
1193 
1194 typedef struct
1195 {
1199 
1200 // These have a nice mapping to the virtual registers
1201 typedef struct
1202 {
1206  UByte CbOffset; // Not user controllable
1207  UByte CrOffset; // Not user controllable
1210 } ADV7189BProcAmpRegisters; // Works for SD portion of ADV7402A also
1211 
1212 // These do not have a nice mapping to the virtual registers
1213 // All are 10-bit registers spread out over two I2C addresses.
1214 typedef struct
1215 {
1216  UByte hex73; // [7:6] set, [5:0] upper bits contrast
1217  UByte hex74; // [7:4] lower bits contrast, [3:0] upper bits saturation Cb
1218  UByte hex75; // [7:2] lower bits saturation Cb, [1:0] upper bits saturation Cr
1219  UByte hex76; // [7:0] lower bits saturation Cr
1220  UByte hex77; // [7:6] clear, [5:0] upper bits brightness.
1221  UByte hex78; // [7:4] lower bits brightness, [3:0] high bits Cb offset
1222  UByte hex79; // [7:2] lower bits Cb offset, [1:0] high bits Cr offset
1223  UByte hex7A; // [7:0] lower bits Cr offset
1225 
1226 // Kind of a hack
1227 // This will have to be a union or something if/when we add another proc amp processor
1228 typedef struct
1229 {
1230  ADV7189BProcAmpRegisters SD; // Works for SD portion of ADV7402A also
1233 
1234 // SD procamp regs
1235 typedef enum
1236 {
1244 } ADV7189BRegisterNum; // Works for SD portion of ADV7402A also
1245 
1246 typedef enum
1247 {
1248  // Global Control
1249  kRegMaskFrameRate = BIT(0) + BIT(1) + BIT(2),
1251  kRegMaskGeometry = BIT(3) + BIT(4) + BIT(5) + BIT(6),
1252  kRegMaskStandard = BIT(7) + BIT(8) + BIT(9),
1253  kRegMaskRefSource = BIT(10) + BIT(11) + BIT(12),
1254  kRegMaskRefInputVoltage = BIT(12), // DEPRECATED! - Now part of kRegMaskRefSource - do not use on new boards
1256  kRegMaskLED = BIT(16) + BIT(17) + BIT(18) + BIT(19),
1265 
1266  // Global Control 2
1296 
1297  // kRegGlobalControl3 (reg 108)
1306  kRegMaskFramePulseRefSelect = BIT(8) + BIT(9) + BIT(10) + BIT(11),
1307 
1308  // Audio Control 2
1317 
1318  // Channel Control - kRegCh1Control, kRegCh2Control, kRegCh3Control, kRegCh4Control
1320  kRegMaskFrameFormat = BIT(1) + BIT(2) + BIT(3) + BIT(4),
1337  kRegMaskQuality2 = BIT(25) + BIT(26),
1338  kRegCh1BlackOutputMask = BIT(27), // KiPro black output bit
1342 
1343  // Video Crosspoint Control
1346  kRegMaskVidXptFGKey = BIT(8) + BIT(9) + BIT(10),
1347  kRegMaskVidXptBGKey = BIT(12) + BIT(13) + BIT(14),
1348  kRegMaskVidXptSecVideo = BIT(16) + BIT(17) + BIT(18),
1349 
1350  // Video Processing Control
1355  kRegMaskVidProcMux5 = BIT(8) + BIT(9) + BIT(10),
1366  kRegMaskVidProcSplitStd = BIT(28) + BIT(29) + BIT(30),
1368 
1369  // kRegStatus
1370  kRegMaskHardwareVersion = BIT(0) + BIT(1) + BIT(2) + BIT(3),
1371  kRegMaskFPGAVersion = BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11),
1373 
1374  // Video Interrupt Control
1375  kRegMaskIntEnableMask = BIT(5) + BIT(4) + BIT(3) + BIT(2) + BIT(1) + BIT(0),
1376 
1377  // Audio Control
1379  kRegMaskNumBits = BIT(1), // shouldn't this be BIT(2)?
1386  kRegMaskInputStartAtVBI = BIT(10), // New in 15.6
1388  kRegMaskEmbeddedOutputMuteCh1 = BIT(12), // added for FS1
1389  kRegMaskEmbeddedOutputSupressCh1 = BIT(13), // added for FS1 but available on other boards
1390  kRegMaskOutputStartAtVBI = BIT(14), // New in 15.6
1391  kRegMaskEmbeddedOutputSupressCh2 = BIT(15), // added for FS1 but available on other boards
1393  kRegMaskEmbeddedOutputMuteCh2 = BIT(17), // added for FS1
1395  kRegMaskEncodedAudioMode = BIT(19), // addded for FS1 but available on other boards
1407  kK2RegMaskAverageAudioLevel = 0xFFFFffff, // read the entire register
1408 
1411  // FS1 output control "Freeze (last good frame) On Input Loss"
1413 
1414  // Audio Source Select
1415  kRegMaskAudioSource = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1424 
1425  // Input Status
1443 
1444  // RP-188 Source
1445  kRegMaskRP188SourceSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1446  kRegMaskRP188DBB = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7),
1447 
1448  // DMA Control
1451  kRegMaskFirmWareRev = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1453 
1454  // Color Correction Control - kRegCh1ColorCorrectionControl (68), kRegCh2ColorCorrectionControl (69)
1455  kRegMaskSaturationValue = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9),
1464 
1465  // kRegCanDoStatus
1473 
1474  // kRegLUTV2Control
1501 
1502 
1503  // RS422 Control
1515  kRegMaskRS422ParitySense = BIT(12), // 0 = Odd, 1 = Even
1516  kRegMaskRS422ParityDisable = BIT(13), // 0 = Use bit 12 setting, 1 = No parity
1518 
1519 
1520  // FS1 ProcAmp Control
1521  kFS1RegMaskProcAmpC1Y = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11),
1522  kFS1RegMaskProcAmpC1CB = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27),
1523  kFS1RegMaskProcAmpC1CR = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11),
1524  kFS1RegMaskProcAmpC2CB = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27),
1525  kFS1RegMaskProcAmpC2CR = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11),
1526  kFS1RegMaskProcAmpOffsetY = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27),
1527 
1528 
1529  kRegMaskAudioInDelay = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12),
1530  kRegMaskAudioOutDelay = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28),
1531 
1532  // FS1 Audio Delay
1533  kFS1RegMaskAudioDelay = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12),
1534 
1535  // Borg Audio Delay
1536  kBorgRegMaskPlaybackEEAudioDelay = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1537  kBorgRegMaskCaputreAudioDelay = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1538 
1539 
1540  // kRegOutputTimingControl
1541  kBorgRegMaskOutTimingCtrlHorzOfs = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12),
1542  kBorgRegMaskOutTimingCtrlVertOfs = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28),
1543 
1544 
1545  // FS1 I2C
1554 
1555  kFS1RegMaskI2CAddress = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4) + BIT(5)+BIT(6)+BIT(7),
1556  kFS1RegMaskI2CSubAddress = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1557  kFS1RegMaskI2CWriteData = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4) + BIT(5)+BIT(6)+BIT(7),
1558  kFS1RegMaskI2CReadData = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1559 
1560  // kRegFS1ReferenceSelect (in Reg 95)
1568  kFS1RegMaskProcAmpInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1569  kFS1RegMaskSecondAnalogOutInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1570 
1571  // FS1 AFD Mode
1581 
1582  // FS1 AFD Inserter
1586  kFS1RegMaskAFDVANCInserter_Line = BIT(26)+BIT(25)+BIT(24)+BIT(23)+BIT(22)+BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16),
1587 
1588  // FS1 Audio Channel Mapping
1589  kFS1RegMaskAudioChannelMapping_Gain = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4) + BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9),
1593 
1594  // FS1 Output Timing Fine Phase Adjust
1595  kRegMaskOutputTimingFinePhase = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4) + BIT(5)+BIT(6)+BIT(7)+BIT(8),
1596 
1597  //kRegAnalogInputStatus
1602 
1603  //kRegAnalogInputControl (Note - on some boards, ADC mode is set in Reg 128, kK2RegAnalogOutControl!)
1605 
1606  //kRegHDMIOut3DControl
1609 
1610  //kRegHDMIOutControl
1631 
1632  //kRegHDMIInputStatus
1633  kRegMaskInputStatusLock = BIT(0), // rename to kRegMaskAnalogInputStatusLock
1648  kRegMaskInputStatusFPS = BIT(28)+BIT(29)+BIT(30)+BIT(31),
1649 
1650  //kRegHDMIInputControl
1670 
1671  //kRegHDMIInputControl / kRegHDMIOutControl
1673  kRegMaskHDMIPolarity = BIT(16)+BIT(17)+BIT(18)+BIT(19),
1674 
1675  //kK2RegAnalogOutControl - (controls Analog Inputs also, for some boards)
1679  kLSRegMaskVideoADCMode = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20),
1681  kLHIRegMaskVideoDACSetup = BIT(21), // bitwise interpretation of kLHIRegMaskVideoDACMode
1682  kLHIRegMaskVideoDACJapan = BIT(22), // bitwise interpretation of kLHIRegMaskVideoDACMode
1683  kLHIRegMaskVideoDACRGB = BIT(23), // bitwise interpretation of kLHIRegMaskVideoDACMode
1684  kLHIRegMaskVideoDACComponent = BIT(24), // bitwise interpretation of kLHIRegMaskVideoDACMode
1685  kK2RegMaskOutHTiming = BIT(31)+BIT(30)+BIT(29)+BIT(28)+BIT(27)+BIT(26)+BIT(25)+BIT(24),
1686 
1687  //kK2RegSDIOut1Control + kK2RegSDIOut2Control + kK2RegSDIOut3Control + kK2RegSDIOut4Control + kK2RegAnalogOutControl
1709 
1710 
1711  //kK2RegConversionControl and kK2Reg2ndConversionControl,
1723 
1724  //kK2RegFrameSync1Control and kK2RegFrameSync2Control
1729 
1730  //kK2RegXptSelectGroup1
1731  kK2RegMaskCompressionModInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1732  kK2RegMaskConversionModInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1734  kK2RegMaskXptLUTInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7),
1735 
1736  //kK2RegXptSelectGroup2
1737  kK2RegMaskDuallinkOutInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1738  kK2RegMaskFrameSync2InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1739  kK2RegMaskFrameSync1InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1741 
1742  //kK2RegXptSelectGroup3
1743  kK2RegMaskCSC1KeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1744  kK2RegMaskSDIOut2InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1745  kK2RegMaskSDIOut1InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1747 
1748  //kK2RegXptSelectGroup4
1749  kK2RegMaskMixerBGKeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1750  kK2RegMaskMixerBGVidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1751  kK2RegMaskMixerFGKeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1753 
1754  //kK2RegXptSelectGroup5
1755  kK2RegMaskCSC2KeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1756  kK2RegMaskCSC2VidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1757  kK2RegMaskXptLUT2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1759 
1760  //kK2RegXptSelectGroup6
1762  kK2RegMaskIICTInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1763  kK2RegMaskHDMIOutInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1764  kK2RegMaskSecondConverterInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1765 
1766  //kK2RegXptSelectGroup7
1768  kK2RegMaskIICT2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1769  kK2RegMaskDuallinkOut2InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1770 
1771  //kK2RegXptSelectGroup8
1772  kK2RegMaskSDIOut3InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7),
1773  kK2RegMaskSDIOut4InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1774  kK2RegMaskSDIOut5InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1775 
1776  //kRegCh1ControlExtended
1777  //kRegCh2ControlExtended
1779 
1780  //kK2RegXptSelectGroup9
1782  kK2RegMaskMixer2FGKeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1783  kK2RegMaskMixer2BGVidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1784  kK2RegMaskMixer2BGKeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1785 
1786  //kK2RegXptSelectGroup10
1788  kK2RegMaskSDIOut2DS2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1789 
1790  //kK2RegXptSelectGroup11
1792  kK2RegMaskDuallinkIn1DSInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1793  kK2RegMaskDuallinkIn2InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1794  kK2RegMaskDuallinkIn2DSInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1795 
1796  //kK2RegXptSelectGroup12
1797  kK2RegMaskXptLUT3InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7),
1798  kK2RegMaskXptLUT4InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1799  kK2RegMaskXptLUT5InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1800  kK2RegMaskXpt3DLUT1InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1801 
1802  //kK2RegXptSelectGroup13
1804  kK2RegMaskFrameBuffer4InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1805 
1806  //kK2RegXptSelectGroup14
1807  kK2RegMaskSDIOut3DS2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1808  kK2RegMaskSDIOut5DS2InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1809  kK2RegMaskSDIOut4DS2InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1810 
1811  //kRegXptSelectGroup15
1813  kK2RegMaskDuallinkIn3DSInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1814  kK2RegMaskDuallinkIn4InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1815  kK2RegMaskDuallinkIn4DSInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1816 
1817  //kRegXptSelectGroup16
1819  kK2RegMaskDuallinkOut4InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1820  kK2RegMaskDuallinkOut5InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1821 
1822  //kK2RegXptSelectGroup17
1823  kK2RegMaskCSC3VidInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7),
1824  kK2RegMaskCSC3KeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1825  kK2RegMaskCSC4VidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1826  kK2RegMaskCSC4KeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1827 
1828  //kRegXptSelectGroup18
1829  kK2RegMaskCSC5VidInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7),
1830  kK2RegMaskCSC5KeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1831 
1832  //kRegXptSelectGroup19
1833  kK2RegMask4KDCQ1InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7),
1834  kK2RegMask4KDCQ2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1835  kK2RegMask4KDCQ3InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1836  kK2RegMask4KDCQ4InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1837 
1838  //kRegXptSelectGroup20
1840  kK2RegMaskHDMIOutV2Q2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1841  kK2RegMaskHDMIOutV2Q3InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1842  kK2RegMaskHDMIOutV2Q4InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1843 
1844  //kRegXptSelectGroup21
1846  kK2RegMaskFrameBuffer6InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1847  kK2RegMaskFrameBuffer7InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1848  kK2RegMaskFrameBuffer8InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1849 
1850  //kRegXptSelectGroup22
1851  kK2RegMaskSDIOut6InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7),
1852  kK2RegMaskSDIOut6DS2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1853  kK2RegMaskSDIOut7InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1854  kK2RegMaskSDIOut7DS2InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1855 
1856  //kRegXptSelectGroup23
1857  kK2RegMaskCSC7VidInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7),
1858  kK2RegMaskCSC7KeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1859  kK2RegMaskCSC8VidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1860  kK2RegMaskCSC8KeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1861 
1862  //kRegXptSelectGroup24
1863  kK2RegMaskXptLUT6InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7),
1864  kK2RegMaskXptLUT7InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1865  kK2RegMaskXptLUT8InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1866 
1867  //kRegXptSelectGroup25
1869  kK2RegMaskDuallinkIn5DSInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1870  kK2RegMaskDuallinkIn6InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1871  kK2RegMaskDuallinkIn6DSInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1872 
1873  //kRegXptSelectGroup26
1875  kK2RegMaskDuallinkIn7DSInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1876  kK2RegMaskDuallinkIn8InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1877  kK2RegMaskDuallinkIn8DSInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1878 
1879  //kRegXptSelectGroup27
1881  kK2RegMaskDuallinkOut7InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1882  kK2RegMaskDuallinkOut8InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1883 
1884  //kRegXptSelectGroup28
1886  kK2RegMaskMixer3FGKeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1887  kK2RegMaskMixer3BGVidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1888  kK2RegMaskMixer3BGKeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1889 
1890  //kRegXptSelectGroup29
1892  kK2RegMaskMixer4FGKeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1893  kK2RegMaskMixer4BGVidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1894  kK2RegMaskMixer4BGKeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1895 
1896  //kRegXptSelectGroup30
1897  kK2RegMaskSDIOut8InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7),
1898  kK2RegMaskSDIOut8DS2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1899  kK2RegMaskCSC6VidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1900  kK2RegMaskCSC6KeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1901 
1902  //kRegXptSelectGroup32
1904  kK2RegMask425Mux1BInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1905  kK2RegMask425Mux2AInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1906  kK2RegMask425Mux2BInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1907 
1908  //kRegXptSelectGroup33
1910  kK2RegMask425Mux3BInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1911  kK2RegMask425Mux4AInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1912  kK2RegMask425Mux4BInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1913 
1914  //kRegXptSelectGroup34
1916  kK2RegMaskFrameBuffer2BInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1917  kK2RegMaskFrameBuffer3BInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1918  kK2RegMaskFrameBuffer4BInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1919 
1920  //kRegXptSelectGroup35
1922  kK2RegMaskFrameBuffer6BInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15),
1923  kK2RegMaskFrameBuffer7BInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23),
1924  kK2RegMaskFrameBuffer8BInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
1925 
1926  //kRegXptSelectGroup36
1929 
1930  //kK2RegCSCoefficients1_2
1931  //kK2RegCSC2oefficients1_2,
1932  //kK2RegCSC3oefficients1_2,
1933  //kK2RegCSC4oefficients1_2,
1934  //kK2RegCSC5Coefficients1_2,
1935  //kK2RegCSC6Coefficients1_2,
1936  //kK2RegCSC7Coefficients1_2,
1937  //kK2RegCSC8Coefficients1_2,
1942 
1943  //kRegCSCoefficients3_4,
1944  //kRegCS2Coefficients3_4,
1945  //kRegCS3Coefficients3_4,
1946  //kRegCS4Coefficients3_4,
1947  //kRegCS5Coefficients3_4,
1948  //kRegCS6Coefficients3_4,
1949  //kRegCS7Coefficients3_4,
1950  //kRegCS8Coefficients3_4,
1952 
1953  //kK2RegCSCoefficients5_6,
1955 
1956  //kK2RegCSCoefficients5_6,
1958 
1959  //custom coefficients
1960  kK2RegMaskCustomCoefficientLow = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10),
1961  kK2RegMaskCustomCoefficientHigh = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26),
1962 
1963  // Enhanced Color Space Converter contol
1970 
1973 
1974  // Xena2K and Konax video processing
1979 
1980  // 12(13 with sign) bit custom coefficients - backwards compatible with the 10(11 with sign) bit soft and hardware - jac
1981  kK2RegMaskCustomCoefficient12BitLow = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12),
1982  kK2RegMaskCustomCoefficient12BitHigh = BIT(14)+BIT(15)+BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26),
1983 
1984  //kRegLTCStatusControl (see register 233 -- kRegLTCStatusControl)
1989 
1990  // kRegAudioOutputSourceMap
1991  kRegMaskMonitorSource = BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16),
1992  kRegMaskHDMIOutAudioSource = BIT(31)+BIT(30)+BIT(29)+BIT(28)+BIT(27)+BIT(26)+BIT(25)+BIT(24),
1993 
1994  // kRegSDIInput3GStatus
2010 
2011 
2012  // kRegSDIInput3GStatus2
2027 
2028  // kRegSDI5678Input3GStatus
2057 
2058  // kRegVPID
2074  kRegMaskVPIDStandard = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31),
2076 
2077  //Borg Test Pattern Generator
2078  kRegMaskTPGChromaSample = BIT(9)+BIT(8)+BIT(7)+BIT(6)+BIT(5)+BIT(4)+BIT(3)+BIT(2)+BIT(1)+BIT(0),
2080  kRegMaskTPGFrameRate = BIT(15)+BIT(14)+BIT(13)+BIT(12),
2081  kRegMaskTPGLuma = BIT(25)+BIT(24)+BIT(23)+BIT(22)+BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16),
2084  kRegMaskTPGStandard = BIT(30) + BIT(29) + BIT(28),
2086 
2087  // Bones Actel Registers
2088  kRegMaskCFS1 = BIT(0) + BIT(1),
2089  kRegMaskCFS2 = BIT(2) + BIT(3) ,
2090 
2091  // Audio Channel Control 2 or 8 channel playback mask
2093 
2094  // Stereo Compressor Control
2102  kRegMaskStereoCompressorLeftSource = BIT(23)+BIT(22)+BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16),
2103  kRegMaskStereoCompressorRightSource = BIT(31)+BIT(30)+BIT(29)+BIT(28)+BIT(27)+BIT(26)+BIT(25)+BIT(24),
2104 
2105  // SDI Direction Control
2114 
2115  // SDI watchdog control
2123 
2124  // 4K Down Convert
2129 
2130  // Quadrant Rasterizer Control
2135 
2136  // kRegRXSDI1Status, kRegRXSDI2Status, etc
2137  kRegMaskSDIInUnlockCount = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2142 
2143  kRegMaskSDIInCRCErrorCountA = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2144  kRegMaskSDIInCRCErrorCountB = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2145  kRegMask2MFrameSize = BIT(4)+BIT(3)+BIT(2)+BIT(1)+BIT(0),
2146  kRegMaskChannelBar = BIT(24)+BIT(23)+BIT(22)+BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16),
2147 
2156 
2165 
2174 
2183 
2192 
2201 
2210 
2219 
2221  kRegThermalMask = BIT(17) + BIT(18) + BIT(19),
2222 
2223  //kRegHDMIHDR.... 330-336
2224  kRegMaskHDMIHDRGreenPrimaryX = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2225  kRegMaskHDMIHDRGreenPrimaryY = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2226  kRegMaskHDMIHDRBluePrimaryX = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2227  kRegMaskHDMIHDRBluePrimaryY = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2228  kRegMaskHDMIHDRRedPrimaryX = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2229  kRegMaskHDMIHDRRedPrimaryY = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2230  kRegMaskHDMIHDRWhitePointX = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2231  kRegMaskHDMIHDRWhitePointY = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2232  kRegMaskHDMIHDRMaxMasteringLuminance = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2233  kRegMaskHDMIHDRMinMasteringLuminance = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2234  kRegMaskHDMIHDRMaxContentLightLevel = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2235  kRegMaskHDMIHDRMaxFrameAverageLightLevel = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2236 
2240  kRegMaskElectroOpticalTransferFunction = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23),
2241  kRegMaskHDRStaticMetadataDescriptorID = BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2242 
2247  kRegMaskAudioMixerOutputChannelsMute = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2267  kRegMaskAudioMixerAux1Channel1Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2268  kRegMaskAudioMixerAux1Channel2Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2269  kRegMaskAudioMixerAux2Channel1Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2270  kRegMaskAudioMixerAux2Channel2Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2271  kRegMaskAudioMixerMainChannel1Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2272  kRegMaskAudioMixerMainChannel2Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2273  kRegMaskAudioMixerMainChannel3Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2274  kRegMaskAudioMixerMainChannel4Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2275  kRegMaskAudioMixerMainChannel5Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2276  kRegMaskAudioMixerMainChannel6Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2277  kRegMaskAudioMixerMainChannel7Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2278  kRegMaskAudioMixerMainChannel8Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2279  kRegMaskAudioMixerMainChannel9Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2280  kRegMaskAudioMixerMainChannel10Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2281  kRegMaskAudioMixerMainChannel11Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2282  kRegMaskAudioMixerMainChannel12Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2283  kRegMaskAudioMixerMainChannel13Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2284  kRegMaskAudioMixerMainChannel14Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2285  kRegMaskAudioMixerMainChannel15Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2286  kRegMaskAudioMixerMainChannel16Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2287  kRegMaskAudioMixerMainMixedOutputChannel1Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2288  kRegMaskAudioMixerMainMixedOutputChannel2Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2289  kRegMaskAudioMixerInputLeftLevel = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2290  kRegMaskAudioMixerInputRightLevel = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
2291  kRegMaskAudioMixerLevelSampleCount = BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
2292 
2293  kRegMaskRotaryEncoderValue = BIT(7)+BIT(6)+BIT(5)+BIT(4)+BIT(3)+BIT(2)+BIT(1)+BIT(0),
2294  kRegMaskRotaryEncoderGain = BIT(13)+BIT(12)+BIT(11)+BIT(10)+BIT(9)+BIT(8),
2295 
2296  kRegMaskLUTAddress = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15) + \
2297  BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29),
2299 
2300  kRegMaskMRStandard = BIT(3) + BIT(2) + BIT(1) + BIT(0),
2301  kRegMaskMRFrameLocation = BIT(15) + BIT(14) + BIT(13) + BIT(12) + BIT(11) + BIT(10) + BIT(9) + BIT(8),
2304  kRegMaskMRSupport = BIT(2) + BIT(1) + BIT(0),
2305 
2310 
2311  kRegMaskPWMFanSpeed = BIT(7)+BIT(6)+BIT(5)+BIT(4)+BIT(3)+BIT(2)+BIT(1)+BIT(0),
2313 
2316 
2320 
2324  kRegMaskBOBGPIIn4Data = BIT(15)+BIT(14)+BIT(13)+BIT(12),
2325 
2330 
2334  kRegMaskBOBGPIOut4Data = BIT(15)+BIT(14)+BIT(13)+BIT(12),
2335 
2339 
2340  kRegMaskLEDBlueControl = BIT(7)+BIT(6)+BIT(5)+BIT(4)+BIT(3)+BIT(2)+BIT(1)+BIT(0),
2341  kRegMaskLEDGreenControl = BIT(15)+BIT(14)+BIT(13)+BIT(12)+BIT(11)+BIT(10)+BIT(9)+BIT(8),
2342  kRegMaskLEDRedControl = BIT(23)+BIT(22)+BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16),
2343 } RegisterMask;
2344 
2345 typedef enum
2346 {
2347  // Global Control
2364 
2365  // Global Control 2
2395 
2396  // kRegGlobalControl3 (reg 108)
2404 
2405  // Audio Control 2
2414 
2415  // Channel Control - kRegCh1Control, kRegCh2Control, kRegCh3Control, kRegCh4Control
2433  kRegShiftVBlankRGBRangeMode = 24, // Deprecated
2436  kRegCh1BlackOutputShift = 27, // KiPro bit set results in black output video and muted audio in capture mode, black output video in playback
2440 
2441  // Video Crosspoint Control
2447 
2448  // Video Processing Control
2466 
2467 
2468  // Note: See more bitfields for this register below, in the 'Xena2K and Konax Video Processing.' section
2469 
2470  // kRegStatus
2474 
2475  // Video Interrupt Control
2477 
2478  // Audio Control
2480  kRegShiftNumBits = 1, // shouldn't this be 2?
2487  kRegShiftInputStartAtVBI = 10, // New in 15.6
2489  kRegShiftEmbeddedOutputMuteCh1 = 12, // added for FS1
2490  kRegShiftEmbeddedOutputSupressCh1 = 13, // added for FS1 but available on other boards
2491  kRegShiftOutputStartAtVBI = 14, // New in 15.6
2492  kRegShiftEmbeddedOutputSupressCh2 = 15, // added for FS1 but available on other boards
2494  kRegShiftEmbeddedOutputMuteCh2 = 17, // added for FS1
2509 
2510  // Audio Source Select
2520 
2522 
2523  // Input Status
2541 
2542  // RP-188 Source
2545 
2546  // DMA Control
2551 
2552  // Color Correction Control
2562 
2563  // kRegCanDoStatus
2571 
2572  // kRegLUTV2Control
2599 
2600  // RS422 Control
2615 
2616 
2617  // FS1 ProcAmp Control
2624 
2627 
2628  // FS1 Audio Delay
2630 
2631  // Borg Audio Delay
2634 
2635  // kRegOutputTimingControl
2638 
2639  // FS1 I2C
2648 
2653 
2654  //kRegFS1ReferenceSelect
2664 
2665  // FS1 AFD Mode
2675 
2676  // FS1 AFD Inserter
2681 
2682  // FS1 Audio Channel Mapping
2687 
2688  // FS1 Output Timing Fine Phase Adjust
2690 
2691  //kRegAnalogInputStatus
2696 
2697  //kRegAnalogInputControl
2699 
2700  //kRegHDMIOut3DControl
2703 
2704  //kRegHDMIOutControl
2723 
2724  //kRegHDMIInputStatus
2740 
2741  //kRegHDMIInputControl
2761 
2762  //kRegHDMIInputControl / kRegHDMIOutControl ???
2765 
2766  //kK2RegAnalogOutControl,
2771  kLHIRegShiftVideoDACMode = 21, // 4 bit enum equivalent of bit 21-24
2777 
2778  //kK2RegSDIOut1Control + kRegK2SDIOut2Control + kK2RegAnalogOutControl
2794 
2795  //kK2RegConversionControl,
2808 
2809  //kK2RegFrameSync1Control and kK2RegFrameSync2Control
2814 
2815  //kK2RegXptSelectGroup1
2820 
2821  //kK2RegXptSelectGroup2
2826 
2827  //kK2RegXptSelectGroup3
2832 
2833  //kK2RegXptSelectGroup4
2838 
2839  //kK2RegXptSelectGroup5
2844 
2845  //kK2RegXptSelectGroup6
2850 
2851  //kK2RegXptSelectGroup7
2855 
2856  //kK2RegXptSelectGroup8
2860 
2861  //kRegCh1ControlExtended
2862  //kRegCh2ControlExtended
2864 
2865  //kK2RegXptSelectGroup9
2870 
2871  //kK2RegXptSelectGroup10
2874 
2875  //kK2RegXptSelectGroup11
2880 
2881  //kK2RegXptSelectGroup12
2886 
2887  //kK2RegXptSelectGroup13
2890 
2891  //kK2RegXptSelectGroup14
2895 
2896  //kRegXptSelectGroup15
2901 
2902  //kRegXptSelectGroup16
2906 
2907  //kK2RegXptSelectGroup17
2912 
2913  //kRegXptSelectGroup18
2916 
2917  //kRegXptSelectGroup19
2922 
2923  //kRegXptSelectGroup20
2928 
2929  //kK2RegXptSelectGroup21
2934 
2935  //kK2RegXptSelectGroup22
2940 
2941  //kK2RegXptSelectGroup30
2946 
2947  //kK2RegXptSelectGroup23
2952 
2953  //kK2RegXptSelectGroup24
2957 
2958  //kK2RegXptSelectGroup25
2963 
2964  //kK2RegXptSelectGroup26
2969 
2970  //kK2RegXptSelectGroup27
2974 
2975  //kK2RegXptSelectGroup28
2980 
2981  //kK2RegXptSelectGroup29
2986 
2987  //kRegXptSelectGroup31
2992 
2993  //kRegXptSelectGroup32
2998 
2999  //kRegXptSelectGroup33
3004 
3005  //kRegXptSelectGroup36
3008 
3009  //kRegXptSelectGroup34
3014 
3015  //kK2RegCSCoefficients1_2
3020  //kK2RegCSCoefficients3_4
3022 
3023  //kK2RegCSCoefficients5_6,
3025 
3026  //kK2RegCSCoefficients5_6,
3028 
3031 
3032  // Enhanced Color Space Converter contol
3039 
3042 
3043  // Xena2K and Konax Video Processing.
3049 
3050  // the newer 13(12) bit coefficients end on bit 14 unlike the
3051  // 11(10) bit ones on 16 - jac
3054 
3055  //kRegLTCStatusControl
3060 
3061  // kRegAudioOutputSourceMap
3064 
3065  // kRegSDIInput3GStatus
3081 
3082  // kRegSDIInput3GStatus2
3097 
3098  // kRegSDI5678Input3GStatus
3127 
3128  // kRegVPID
3146 
3147  // Borg Test Pattern Generator
3156 
3157  // Audio Channel Control 2 or 8 channel playback shift
3159 
3160  // Stereo Compressor control shift
3170 
3171  // SDI Direction Control Shift
3180 
3181  // SDI watchdog control
3189 
3191 
3192  // 4K Down Convert
3197 
3198  // Quadrant Rasterizer Control
3203 
3204  // kRegRXSDI1Status, kRegRXSDI2Status, etc
3212 
3215 
3224 
3233 
3242 
3251 
3260 
3269 
3278 
3287 
3290 
3291  //kRegHDMIHDR.... 330-336
3304 
3310 
3360 
3363 
3366 
3372 
3377 
3380 
3383 
3387 
3392 
3397 
3402 
3406 
3410 } RegisterShift;
3411 
3412 
3413 // NWL Registers
3414 
3415 // For the Mac we define an offset. This is done so that read/write register can easily identify an NWL register from a VP register.
3416 // This is necessary since the NWL registers lives in another PCI BAR and these offsets conflict with normal VP registers. With this
3417 // offset the driver knows which mapped BAR to use. Windows maps individual registers at start so this isn't necessary for Windows.
3418 #ifdef AJAMac
3419  #define NWL_REG_START 18000
3420 #else
3421  #define NWL_REG_START 0
3422 #endif
3423 
3424 typedef enum
3425 {
3432 
3439 
3446 
3453 
3458 
3459 } NwlRegisterNum;
3460 
3461 // This is an aid for utility routines that maintain tables indexed by a register number, like spinlocks
3462 typedef enum
3463 {
3470 
3477 
3484 
3491 
3496 
3499 
3500 typedef enum
3501 {
3505  kRegMaskNwlCapabilitiesEngineNumber = (BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15)),
3506  kRegMaskNwlCapabilitiesAddressSize = (BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)),
3507 
3519 
3544 
3545 } NwlRegisterMask;
3546 
3547 typedef enum
3548 {
3554 
3566 
3591 
3593 
3594 // XLNX Registers
3595 #define XLNX_MAX_CHANNELS 4
3596 #define XLNX_REG_TARGET_SIZE 0x400
3597 #define XLNX_REG_CHANNEL_SIZE 0x40
3598 #define XLNX_SUBSYSTEM_ID 0x1fc
3599 
3600 typedef enum
3601 {
3611 
3612 typedef enum
3613 {
3633 
3645 
3651 
3652 } XlnxRegisterNum;
3653 
3654 typedef enum
3655 {
3657  kRegMaskXlnxTarget = 0x000f0000,
3659  kRegMaskXlnxIdTarget = 0x00000f00,
3660  kRegMaskXlnxVersion = 0x000000ff,
3661 
3665  kRegMaskXlnxRun = 0x00000001,
3666 
3670 
3680 
3681  kRegMaskXlnxPerfRun = 0x00000004,
3683  kRegMaskXlnxPerfAuto = 0x00000001,
3684 
3687 
3690 
3693 
3695 
3696 typedef enum
3697 {
3703 
3708 
3712 
3722 
3726 
3729 
3732 
3735 
3737 
3738 // P2P Registers
3739 
3740 typedef enum
3741 {
3763 
3764 
3765 typedef enum
3766 {
3780 
3781 
3782 #define kTransferFlagVideoDMA1 (BIT(0)) // use dma channel 1 for video transfer
3783 #define kTransferFlagVideoDMA2 (BIT(1)) // use dma channel 2 for video transfer
3784 #define kTransferFlagVideoDMA3 (BIT(2)) // use dma channel 3 for video tranfer
3785 #define kTransferFlagVideoDMA4 (BIT(3)) // use dma channel 4 for video transfer
3786 #define kTransferFlagVideoDMAAny (BIT(0)+BIT(1)+BIT(2)+BIT(3))
3787 #define kTransferFlagAudioDMA1 (BIT(4)) // use dma channel 1 for audio transfer
3788 #define kTransferFlagAudioDMA2 (BIT(5)) // use dma channel 2 for audio transfer
3789 #define kTransferFlagAudioDMA3 (BIT(6)) // use dma channel 3 for audio transfer
3790 #define kTransferFlagAudioDMA4 (BIT(7)) // use dma channel 4 for audio transfer
3791 #define kTransferFlagAudioDMAAny (BIT(4)+BIT(5)+BIT(6)+BIT(7))
3792 #define kTransferFlagDMAAny (BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7))
3793 #define kTransferFlagQuadFrame (BIT(8)) // transfer a quad hd or 4k frame
3794 #define kTransferFlagP2PPrepare (BIT(9)) // prepare p2p target for synchronous transfer (no message)
3795 #define kTransferFlagP2PComplete (BIT(10)) // complete synchronous p2p transfer
3796 #define kTransferFlagP2PTarget (BIT(11)) // prepare p2p target for asynchronous transfer (with message)
3797 #define kTransferFlagP2PTransfer (BIT(12)) // transfer to p2p sync or async target
3798 
3799 #define MAX_FRAMEBUFFERS 512 // Max for Corvid88
3800 
3801 #define KONAIP_REGS_START 0x40000
3802 
3804 
3805 //----------------------- AJA XENA2 ---------------------------------
3806 
3807  // Offset in Base Address 1 Space to Channel 2 Frame Buffer
3808 #define XENA2_CHANNEL2_OFFSET (0x2000000) // 32 MBytes..not applicable
3809 
3810  // Size of each frame buffer
3811 #define XENA2_FRAMEBUFFER_SIZE (0x800000) // 8 MBytes
3812 
3813  // the event name shared among all Windows NT
3814  // This name to be appended to the actual Win32Name
3815 #define XENA2_NUM_FRAMEBUFFERS (16)
3816 #define XENA2_NTV2_VERTICALINTERRUPT_GLOBAL_EVENT_NAME "_Xena2VerticalInterruptSignalEvent"
3817 
3818  // the event name shared among all Windows NT
3819  // This name to be appended to the actual Win32Name
3820 #define KHD_NTV2_CHANGE_GLOBAL_EVENT_NAME "_HDChangeSignalEvent"
3821 
3822 
3823 //
3824 // Special defines
3825 //
3826 #define NTV2_MIN_FRAMEBUFFERSIZE KSD_FRAMEBUFFER_SIZE
3827 #define NTV2_MAX_FRAMEBUFFERSIZE KHD_FRAMEBUFFER_SIZE
3828 #define NTV2_MIN_FRAMEBUFFERS HDNTV_NUM_FRAMEBUFFERS
3829 #if defined(XENA2)
3830 #define NTV2_MAX_FRAMEBUFFERS MAX_FRAMEBUFFERS
3831 #else
3832 #define NTV2_MAX_FRAMEBUFFERS BONES_NUM_FRAMEBUFFERS
3833 #endif
3834 
3835 #define NTV2_UART_FIFO_SIZE (127)
3836 
3837 #define NTV2_PROGRAM_READY_BIT ( BIT_8 )
3838 #define NTV2_PROGRAM_DONE_BIT ( BIT_9 )
3839 #define NTV2_PROGRAM_RESET_BIT ( BIT_10 )
3840 
3841 /* PORT C(7) is output (default) */
3842 #define NTV2_FS1_FALLBACK_MODE_BIT ( BIT_11 )
3843 
3844 /* PORT C(7) is input/3-state */
3845 #define NTV2_FS1_CPLD_ENH_MODE_BIT ( BIT_12 )
3846 
3848 // Enums used to specify Property actions with interrupts
3850 
3851 typedef enum _INTERRUPT_ENUMS_
3852 {
3856  eInput1, // 2
3857  eInput2, // 3
3858  eAudio, // 4
3861  eDMA1, // 7
3862  eDMA2, // 8
3863  eDMA3, // 9
3864  eDMA4, // 10
3867  eWrapRate, // 13
3868  eUartTx, // 14
3870  eUartRx, // 15
3874  eLowPower, // 18
3877  eTemp1High, // 21
3878  eTemp2High, // 22
3880  eInput3, // 24
3881  eInput4, // 25
3882  eUartTx2, // 26
3884  eUartRx2, // 27
3887  eInput5, // 29
3888  eInput6, // 30
3889  eInput7, // 31
3890  eInput8, // 32
3892  eOutput2, // 34
3893  eOutput3, // 35
3894  eOutput4, // 36
3895  eOutput5, // 37
3896  eOutput6, // 38
3897  eOutput7, // 39
3898  eOutput8, // 40
3899  eNumInterruptTypes // This must be last // 41
3900 } INTERRUPT_ENUMS;
3901 
3902 
3903 #define MAX_NUM_EVENT_CODES (eNumInterruptTypes)
3904 #define NTV2_IS_VALID_INTERRUPT_ENUM(__e__) ((__e__) >= eOutput1 && (__e__) < eNumInterruptTypes)
3905 #define NTV2_IS_INPUT_INTERRUPT(__e__) ( (__e__) == eInput1 \
3906  || (__e__) == eInput2 \
3907  || (__e__) == eInput3 \
3908  || (__e__) == eInput4 \
3909  || (__e__) == eInput5 \
3910  || (__e__) == eInput6 \
3911  || (__e__) == eInput7 \
3912  || (__e__) == eInput8 )
3913 
3914 #define NTV2_IS_OUTPUT_INTERRUPT(__e__) ( (__e__) == eOutput1 \
3915  || (__e__) == eOutput2 \
3916  || (__e__) == eOutput3 \
3917  || (__e__) == eOutput4 \
3918  || (__e__) == eOutput5 \
3919  || (__e__) == eOutput6 \
3920  || (__e__) == eOutput7 \
3921  || (__e__) == eOutput8 )
3922 
3923 
3924 // Some Mac only ENUMS that had to be moved over to get Win/Linux code to compile,
3925 // so these are only used by the Mac.
3926 typedef enum
3927 {
3931 } ReferenceSelect;
3932 
3933 
3934 #if !defined (NTV2_BUILDING_DRIVER)
3935  typedef std::vector <ULWord> NTV2ULWordVector;
3936 
3943  AJAExport std::ostream & NTV2PrintULWordVector (const NTV2ULWordVector & inObj, std::ostream & inOutStream = std::cout); // New in SDK 16.0
3944 
3945  typedef std::vector <NTV2Channel> NTV2ChannelList;
3946  typedef NTV2ChannelList::const_iterator NTV2ChannelListConstIter;
3947 
3955  AJAExport std::ostream & NTV2PrintChannelList (const NTV2ChannelList & inObj, const bool inCompact = true, std::ostream & inOutStream = std::cout); // New in SDK 16.0
3956 
3962  AJAExport std::string NTV2ChannelListToStr (const NTV2ChannelList & inObj, const bool inCompact = true); // New in SDK 16.0
3963 
3964  typedef std::set <NTV2Channel> NTV2ChannelSet;
3965  typedef NTV2ChannelSet::const_iterator NTV2ChannelSetConstIter;
3966 
3974  AJAExport std::ostream & NTV2PrintChannelSet (const NTV2ChannelSet & inObj, const bool inCompact = true, std::ostream & inOutStream = std::cout); // New in SDK 16.0
3975 
3981  AJAExport std::string NTV2ChannelSetToStr (const NTV2ChannelSet & inObj, const bool inCompact = true); // New in SDK 16.0
3982 
3988  AJAExport NTV2ChannelSet NTV2MakeChannelSet (const NTV2Channel inFirstChannel, const UWord inNumChannels = 1); // New in SDK 16.0
3989 
3994  AJAExport NTV2ChannelSet NTV2MakeChannelSet (const NTV2ChannelList inChannels); // New in SDK 16.0
3995 
4001  AJAExport NTV2ChannelList NTV2MakeChannelList (const NTV2Channel inFirstChannel, const UWord inNumChannels = 1); // New in SDK 16.0
4002 
4007  AJAExport NTV2ChannelList NTV2MakeChannelList (const NTV2ChannelSet inChannels); // New in SDK 16.0
4008 
4009 
4010  typedef std::set <NTV2AudioSystem> NTV2AudioSystemSet;
4011  typedef NTV2AudioSystemSet::const_iterator NTV2AudioSystemSetConstIter;
4012 
4020  AJAExport std::ostream & NTV2PrintAudioSystemSet (const NTV2AudioSystemSet & inObj, const bool inCompact = true, std::ostream & inOutStream = std::cout); // New in SDK 16.2
4021 
4027  AJAExport std::string NTV2AudioSystemSetToStr (const NTV2AudioSystemSet & inObj, const bool inCompact = true); // New in SDK 16.2
4028 
4034  AJAExport NTV2AudioSystemSet NTV2MakeAudioSystemSet (const NTV2AudioSystem inFirstAudioSystem, const UWord inCount = 1); // New in SDK 16.2
4035 
4036 
4043  #define NTV2_STRUCT_BEGIN(__struct_name__) class AJAExport __struct_name__ {public:
4044  #define NTV2_STRUCT_END(__struct_name__) };
4045  #define NTV2_BEGIN_PRIVATE private:
4046  #define NTV2_END_PRIVATE public:
4047  #define NTV2_BEGIN_PROTECTED protected:
4048  #define NTV2_END_PROTECTED public:
4049 
4050  #if defined (_DEBUG)
4051  #define NTV2_IS_STRUCT_VALID_IMPL(__hr__,__tr__) bool NTV2_IS_STRUCT_VALID (void) const {return __hr__.IsValid() && __tr__.IsValid();}
4052  #define NTV2_ASSERT_STRUCT_VALID do {NTV2_ASSERT (NTV2_IS_STRUCT_VALID ());} while (false)
4053  #else
4054  #define NTV2_IS_STRUCT_VALID_IMPL(__hr__,__tr__)
4055  #define NTV2_ASSERT_STRUCT_VALID
4056  #endif
4057 #else // defined (NTV2_BUILDING_DRIVER)
4058  #define NTV2_STRUCT_BEGIN(__struct_name__) typedef struct __struct_name__ {
4059  #define NTV2_STRUCT_END(__struct_name__) } __struct_name__;
4060  #define NTV2_BEGIN_PRIVATE
4061  #define NTV2_END_PRIVATE
4062  #define NTV2_BEGIN_PROTECTED
4063  #define NTV2_END_PROTECTED
4064  #define NTV2_IS_STRUCT_VALID_IMPL(__hr__,__tr__)
4065  #define NTV2_ASSERT_STRUCT_VALID
4066 #endif // !defined (NTV2_BUILDING_DRIVER)
4067 
4068 
4073  ULWord registerNumber;
4074  ULWord registerValue;
4075  ULWord registerMask;
4076  ULWord registerShift;
4077 
4078  #if !defined(NTV2_BUILDING_DRIVER)
4079 
4086  NTV2RegInfo (const ULWord inRegNum = 0, const ULWord inValue = 0, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0)
4087  : registerNumber (inRegNum),
4088  registerValue (inValue),
4089  registerMask (inMask),
4090  registerShift (inShift)
4091  {
4092  }
4093 
4101  inline void Set (const ULWord inRegNum, const ULWord inValue,
4102  const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0)
4103  {setRegNum(inRegNum).setValue(inValue).setMask(inMask).setShift(inShift);}
4107  inline void MakeInvalid (void)
4108  {registerNumber = registerValue = registerMask = registerShift = 0xFFFFFFFF;}
4109 
4114  inline bool IsValid (void) const {return !(regNum() == 0xFFFFFFFF && value() == 0xFFFFFFFF && mask() == 0xFFFFFFFF && shift() == 0xFFFFFFFF)
4115  && mask() && shift() < 32;}
4116 
4123  inline bool operator == (const NTV2RegInfo & inRHS) const {return regNum() == inRHS.regNum() && value() == inRHS.value()
4124  && mask() == inRHS.mask() && shift() == inRHS.shift();}
4130  bool operator < (const NTV2RegInfo & inRHS) const;
4131 
4139  std::ostream & Print (std::ostream & outputStream, const bool inAsCode = false) const;
4140 
4149  std::ostream & PrintCode (std::ostream & outputStream, const int inRadix = 16, const NTV2DeviceID inDeviceID = DEVICE_ID_INVALID, const std::string & sCard = "card") const; // New in SDK 16.0, added inDeviceID in 16.2
4150 
4157  std::ostream & PrintLog (std::ostream & outputStream, const NTV2DeviceID inDeviceID = DEVICE_ID_INVALID) const; // New in SDK 18.1
4158 
4166  bool ImportFromLog (const NTV2StringList & inLogLines); // New in SDK 18.1
4167 
4168  inline ULWord regNum (void) const {return registerNumber;} // New in SDK 17.5
4169  inline ULWord value (void) const {return registerValue;} // New in SDK 17.5
4170  inline ULWord mask (void) const {return registerMask;} // New in SDK 17.5
4171  inline ULWord shift (void) const {return registerShift;} // New in SDK 17.5
4172  inline ULWord offset (void) const {return registerNumber == 0xFFFFFFFF ? 0xFFFFFFFF : registerNumber * 4;} // New in SDK 18.1
4173  inline NTV2RegInfo & setRegNum (const ULWord val){registerNumber = val; return *this;} // New in SDK 17.5
4174  inline NTV2RegInfo & setValue (const ULWord val) {registerValue = val; return *this;} // New in SDK 17.5
4175  inline NTV2RegInfo & setMask (const ULWord val) {registerMask = val; return *this;} // New in SDK 17.5
4176  inline NTV2RegInfo & setShift (const ULWord val) {if (val < 32) registerShift = val; return *this;} // New in SDK 17.5
4177  #endif // !defined(NTV2_BUILDING_DRIVER)
4179 
4181 
4182 #if !defined (NTV2_BUILDING_DRIVER)
4183  typedef std::vector <NTV2RegInfo> NTV2RegisterWrites, NTV2RegWrites;
4184  typedef NTV2RegWrites::const_iterator NTV2RegisterWritesConstIter, NTV2RegWritesConstIter;
4185  typedef NTV2RegWrites::iterator NTV2RegisterWritesIter, NTV2RegWritesIter;
4189 
4196  AJAExport NTV2RegReadsConstIter FindFirstMatchingRegisterNumber (const uint32_t inRegNum, const NTV2RegReads & inRegInfos);
4197 
4204  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2RegInfo & inObj);
4205 
4212  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2RegisterWrites & inObj);
4213 #endif // !defined (NTV2_BUILDING_DRIVER)
4214 
4215 
4216 typedef struct NTV2RoutingEntry
4217 {
4222  #if !defined (NTV2_BUILDING_DRIVER)
4223  NTV2RoutingEntry & operator = (const NTV2RegInfo & inRHS);
4224  #endif // !defined (NTV2_BUILDING_DRIVER)
4225 } NTV2RoutingEntry;
4226 
4227 #define MAX_ROUTING_ENTRIES 32
4228 
4229 typedef struct
4230 {
4233 } NTV2RoutingTable;
4234 
4235 
4236 // Color Space Convert Custom Coefficients
4237 typedef struct
4238 {
4250 
4252 // RP188 data structure used in AutoCirculate
4254 
4255 typedef struct RP188_STRUCT {
4257  ULWord Low; // | BG 4 | Secs10 | BG 3 | Secs 1 | BG 2 | Frms10 | BG 1 | Frms 1 |
4258  ULWord High; // | BG 8 | Hrs 10 | BG 7 | Hrs 1 | BG 6 | Mins10 | BG 5 | Mins 1 |
4259 
4261 } RP188_STRUCT;
4262 
4263 
4264 #define RP188_STRUCT_SET(_struct_,_dbb_,_lo_,_hi_) do \
4265  { \
4266  (_struct_).DBB = (_dbb_); \
4267  (_struct_).Low = (_lo_); \
4268  (_struct_).High = (_hi_); \
4269  } while (false)
4270 
4271 #define RP188_PSTRUCT_SET(_pStruct_,_dbb_,_lo_,_hi_) do \
4272  { \
4273  (_pStruct_)->DBB = (_dbb_); \
4274  (_pStruct_)->Low = (_lo_); \
4275  (_pStruct_)->High = (_hi_); \
4276  } while (false)
4277 
4278  // convenience masks to extract fields in .Low and .High words
4279 #define RP188_FRAMEUNITS_MASK 0x0000000F // Frames (units digit) in bits 3- 0 of .Low word
4280 #define RP188_FRAMETENS_MASK 0x00000300 // Frames (tens digit) in bits 9- 8 of .Low word
4281 #define RP188_SECONDUNITS_MASK 0x000F0000 // Seconds (units digit) in bits 19-16 of .Low word
4282 #define RP188_SECONDTENS_MASK 0x07000000 // Seconds (tens digit) in bits 26-24 of .Low word
4283 #define RP188_LOW_TIME_MASK (RP188_FRAMEUNITS_MASK | RP188_FRAMETENS_MASK | RP188_SECONDUNITS_MASK | RP188_SECONDTENS_MASK)
4284 
4285 #define RP188_MINUTESUNITS_MASK 0x0000000F // Minutes (units digit) in bits 3- 0 of .High word
4286 #define RP188_MINUTESTENS_MASK 0x00000700 // Minutes (tens digit) in bits 10- 8 of .High word
4287 #define RP188_HOURUNITS_MASK 0x000F0000 // Hours (units digit) in bits 19-16 of .High word
4288 #define RP188_HOURTENS_MASK 0x03000000 // Hours (tens digit) in bits 25-24 of .High word
4289 #define RP188_HIGH_TIME_MASK (RP188_MINUTESUNITS_MASK | RP188_MINUTESTENS_MASK | RP188_HOURUNITS_MASK | RP188_HOURTENS_MASK)
4290 
4291  // private bit flags added to the RP188 DBB word
4292 #define NEW_RP188_RCVD 0x00010000 // new RP188 data was received on ANY of the channels (LTC, VITC, etc.) (capture only)
4293 #define NEW_SELECT_RP188_RCVD 0x00020000 // new RP188 data was received on the selected channel (capture only)
4294 #define RP188_720P_FRAMEID 0x00400000 // 720p FrameID (capture only - set by driver software)
4295 #define RP188_CHANGED_FLAG 0x00800000 // RP188 data changed compared to last frame (capture only - set by driver software)
4296 
4297 
4299 // Color Correction data structure used in AutoCirculate
4301 // Color Corrector has 3 tables(usually R, G and B). Each table has 1024 entries
4302 // with 2 entries per 32 bit word....therefore 512 32 bit words per table.
4303 #define NTV2_COLORCORRECTOR_WORDSPERTABLE (512) // number of ULONG words in EACH color table
4304 #define NTV2_COLORCORRECTOR_TOTALWORDS (NTV2_COLORCORRECTOR_WORDSPERTABLE * 3) // total number of ULONG words in all 3 tables
4305 #define NTV2_COLORCORRECTOR_TABLESIZE (NTV2_COLORCORRECTOR_TOTALWORDS * 4) // total length in bytes of all 3 tables: numWords * numColors * bytes/word
4306 
4307 // 12 bit Color Corrector has 3 tables(usually R, G and B). Each table has 4096 entries
4308 // with 2 entries per 32 bit word....therefore 2048 32 bit words per table.
4309 #define NTV2_12BIT_COLORCORRECTOR_WORDSPERTABLE (2048) // number of ULONG words in EACH color table
4310 #define NTV2_12BIT_COLORCORRECTOR_TOTALWORDS (NTV2_12BIT_COLORCORRECTOR_WORDSPERTABLE * 3) // total number of ULONG words in all 3 tables
4311 #define NTV2_12BIT_COLORCORRECTOR_TABLESIZE (NTV2_12BIT_COLORCORRECTOR_TOTALWORDS * 4) // total length in bytes of all 3 tables: numWords * numColors * bytes/word
4312 
4313 
4320 
4321 
4322 typedef struct {
4328 
4329 typedef struct {
4335 
4336 // within each 32-bit LUT word, bits <31:22> = LUT[2i+1], bits <15:6> = LUT[2i]
4337 #define kRegColorCorrectionLUTOddShift 22
4338 #define kRegColorCorrectionLUTEvenShift 6
4339 
4340 // the base BYTE offsets (from PCI Config Base Address 0) of the three Color Correction LUTs
4341 // Note: if using these with GetRegisterBaseAddress() be sure to divide by 4 to get WORD offset!
4342 #define kColorCorrectionLUTOffset_Red (0x0800)
4343 #define kColorCorrectionLUTOffset_Green (0x1000)
4344 #define kColorCorrectionLUTOffset_Blue (0x1800)
4345 
4346 // within each 32-bit LUT word, bits <31:22> = LUT[2i+1], bits <15:6> = LUT[2i]
4347 #define kRegColorCorrection12BitLUTOddShift 16
4348 #define kRegColorCorrection12BitLUTEvenShift 0
4349 
4350 #define kRegColorCorrection10To12BitLUTOddShift 18
4351 #define kRegColorCorrection10To12BitLUTEvenShift 2
4352 
4353 // Note: there is code that assumes that the three LUTs are contiguous. So if this relationship
4354 // changes (i.e. there are "gaps" between tables) then code will need to change!
4355 #define kColorCorrectionLUTOffset_Base (0x0800) // BYTE offset
4356 #define kColorCorrection12BitLUTOffset_Base (0xe000) // BYTE offset
4357 
4358 // cc lut v3 locations
4359 
4360 #define kColorCorrectionLUTV3WidgetOffset (0xd800) // byte offset
4361 #define kColorCorrectionLUTV3WidgetSize (16) // byte size
4362 #define kColorCorrectionLUTV3DataOffset (0xe000) // byte offset
4363 
4364 // cc lut v3 registers
4365 typedef enum
4366 {
4368  regCCLUTV3Capabilities = regCCLUTV3_FIRST, // Reg 0 - read only
4369  regCCLUTV3DmaLoad, // Reg 1 - dma load address and trigger
4370  regCCLUTV3HostLoad, // Reg 2 - host load enable and bank/plain selects
4373 
4374 typedef enum
4375 {
4376  // regCCLUTV3Capabilities
4377  maskCCLUTV3Depth12 = BIT(0), // lut supports 12/10 bits
4379  maskCCLUTV3DmaLoad = BIT(4), // lut supports dma loading
4381  maskCCLUTV3Banks2 = BIT(8), // lut supports 2 banks
4383  maskCCLUTV3HostLoad = BIT(12), // lut supports host loading
4385  // regCCLUTV3DmaLoad
4387  BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) +
4388  BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15) + \
4389  BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) +
4390  BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29),
4394  // regCCLUTV3HostLoad
4404 
4405 
4407 // VidProc data structure used in AutoCirculate
4409 
4410 typedef enum
4411 {
4418 
4419 #define NTV2_IS_VALID_AUTOCIRCVIDPROCMODE(__m__) ((__m__) >= AUTOCIRCVIDPROCMODE_MIX && (__m__) < AUTOCIRCVIDPROCMODE_INVALID)
4420 
4421 
4422 
4423 typedef struct AutoCircVidProcInfo
4424 {
4432 
4433  #if !defined (NTV2_BUILDING_DRIVER)
4434  public:
4435  AJAExport explicit AutoCircVidProcInfo ();
4437  #endif // user-space clients only
4439 
4440 
4442 // CustomAncData data structure used in AutoCirculate
4444 typedef struct
4445 {
4451 
4452 #define OBSOLETE_ANC_STRUCT CUSTOM_ANC_STRUCT
4453 
4454 
4456 // Control
4458 
4459 typedef enum _AutoCircCommand_
4460 {
4480 
4481 #define NTV2_IS_AUTO_CIRC_XFER_CMD(__m__) ((__m__) == eTransferAutoCirculate && (__m__) == eTransferAutoCirculateEx && (__m__) == eTransferAutoCirculateEx2)
4482 
4483 
4487 typedef enum
4488 {
4498 
4499 #define NTV2_IS_VALID_AUTO_CIRC_STATE(__m__) ((__m__) >= NTV2_AUTOCIRCULATE_DISABLED && (__m__) < NTV2_AUTOCIRCULATE_INVALID)
4500 
4501 
4505 typedef enum
4506 {
4511 } NTV2TaskMode;
4512 
4513 #if !defined(NTV2_DEPRECATE_18_0)
4515 #endif // !defined(NTV2_DEPRECATE_18_0)
4516 
4517 #define NTV2_IS_VALID_TASK_MODE(__m__) ((__m__) == NTV2_DISABLE_TASKS || (__m__) == NTV2_STANDARD_TASKS || (__m__) == NTV2_OEM_TASKS)
4518 #define NTV2_IS_STANDARD_TASKS(__m__) ((__m__) == NTV2_STANDARD_TASKS)
4519 #define NTV2_IS_DRIVER_ACTIVE_TASKS(__m__) ((__m__) == NTV2_STANDARD_TASKS || (__m__) == NTV2_OEM_TASKS)
4520 
4521 
4522 typedef enum
4523 {
4526 } NTV2DebugReg;
4527 
4528 
4529 #ifdef AJAMac
4530  #pragma pack(4) // removes 64 bit alignment on non-64 bit fields
4531 #endif
4532 
4533 // Structure used for GetAutoCirculate
4535 {
4536  NTV2Crosspoint channelSpec; // Not used by Windows.
4540  LWord activeFrame; // Current Frame# actually being output (or input), -1, if not active
4541  ULWord64 rdtscStartTime; // Performance Counter at start
4542  ULWord64 audioClockStartTime; // Register 28 with Wrap Logic
4543  ULWord64 rdtscCurrentTime; // Performance Counter at time of call
4544  ULWord64 audioClockCurrentTime; // Register 28 with Wrap Logic
4547  ULWord bufferLevel; // how many buffers ready to record or playback in driver
4555 
4558 
4559 
4560 typedef struct
4561 {
4564 
4571 
4580 
4585 
4587 
4588 
4589 typedef struct AUTOCIRCULATE_DATA
4590 {
4593 
4600 
4609 
4610  void* pvVal1;
4611  void* pvVal2;
4612  void* pvVal3;
4613  void* pvVal4;
4614 
4615  #if !defined (NTV2_BUILDING_DRIVER)
4616  public:
4618  AJAExport std::ostream & Print (std::ostream & oss) const;
4620  #endif // user-space clients only
4622 
4623 
4624 typedef struct
4625 {
4628 
4635 
4644 
4649 
4651 
4652 
4654 // GetFrameStamp
4656 
4657 typedef struct FRAME_STAMP_STRUCT
4658 {
4659  NTV2Crosspoint channelSpec; // Ignored in Windows
4660 
4661  //
4662  // Information from the requested frame (#FRAMESTAMP_CONTROL_STRUCT:frameNum
4663  //
4664 
4665  // Clock (System PerformanceCounter under Windows) at time of play or record.
4666  // audioClockTimeStamp is preferred, but not available on all boards. (See comments below at 'currentTime' member.)
4668 
4671 
4673  ULWord64 audioClockTimeStamp; // Register 28 with Wrap Logic
4674 
4677 
4679  ULWord audioInStartAddress; // AudioInAddress at the time this Frame was stamped.
4680 
4682  ULWord audioInStopAddress; // AudioInAddress at the Frame AFTER this Frame was stamped.
4683 
4685  ULWord audioOutStopAddress; // AudioOutAddress at the time this Frame was stamped.
4686 
4688  ULWord audioOutStartAddress; // AudioOutAddress at the Frame AFTER this Frame was stamped.
4689 
4692 
4702 
4703  //
4704  // Information from the current (active) frame
4705  //
4706 
4708  // This is the finest-grained counter available from the OS.
4709  // The granularity of this counter can vary depending on the PC's HAL.
4710  // audioClockCurrentTime is the recommended time-stamp to use instead of this (but is not available on all boards)!
4713 
4715  RP188_STRUCT currentRP188; // ignored if withRP188 is false
4716 
4719 
4721  ULWord64 audioClockCurrentTime; // Register 28 with Wrap Logic
4722  // audioClockCurrentTime (from 48 kHz on-board clock) is consistent and accurate!
4723  // but is not available on the XenaSD-22.
4724 
4727 
4730 
4736 
4739 
4740 
4741 typedef struct
4742 {
4743  NTV2Crosspoint channelSpec; // specify Input or Output channel for desired Frame
4744  NTV2AutoCirculateState state; // current state
4745  LWord transferFrame; // framebuffer number the frame transferred to, -1 on error
4746  ULWord bufferLevel; // how many buffers ready to record or playback
4749  FRAME_STAMP_STRUCT frameStamp; // record. framestramp for that frame,playback
4753 
4754 
4755 typedef struct
4756 {
4757  NTV2Crosspoint channelSpec; // Specify Input or Output channel for desired Frame
4758  Pointer64 videoBuffer; // Keep 64 bit aligned for performance reasons
4760  ULWord videoDmaOffset; // Must be initialized, 64 bit aligned
4761  Pointer64 audioBuffer; // Keep 64 bit aligned for performance reasons
4763  ULWord audioStartSample; // To ensure correct alignment in audio buffer .. NOT USED in Windows... audio now always starts at sample zero.
4764  ULWord audioNumChannels; // 1-6 NOTE!!! only 6 supported at this time
4765  ULWord frameRepeatCount; // NOTE!!! not supported yet.
4766  RP188_STRUCT rp188; // Ignored if withRP188 is false
4767  LWord desiredFrame; // -1 if you want driver to find next available
4768  ULWord hUser; // A user cookie returned by frame stamp
4769  ULWord transferFlags; // disableAudioDMA is no longer used
4770  BOOL_ bDisableExtraAudioInfo; // No 24 byte 0 at front or size info in buffer
4771  NTV2FrameBufferFormat frameBufferFormat; // Should be initialized, but can be overridden
4776  // The following params are for cases when you need to DMA multiple discontiguous "segments" of a video frame. One example
4777  // would be when a frame in Host memory is not "packed", i.e. there are extra "padding" bytes at the end of each row.
4778  // In this case you would set videoBufferSize to the number of active bytes per row, videoNumSegments to the number of rows,
4779  // and videoSegmentHostPitch to the number of bytes from the beginning of one row to the next. In this example,
4780  // videoSegmentCardPitch would be equal to videoBufferSize (i.e. the frame is packed in board memory).
4781  // Another example would be DMAing a sub-section of a frame. In this case set videoBufferSize to the number of bytes in
4782  // one row of the subsection, videoNumSegments to the number of rows in the subsection, videoSegmentHostPitch to the rowBytes
4783  // of the entire frame in Host Memory, and videoSegmentCardPitch to the rowBytes of the entire frame in board memory.
4784  // Note: setting videoNumSegments to 0 or 1 defaults to original behavior (i.e. DMA one complete packed frame)
4785  ULWord videoNumSegments; // Number of segments of size videoBufferSize to DMA (i.e. numLines)
4786  ULWord videoSegmentHostPitch; // Offset (in bytes) between the beginning of one host segment and the beginning of the next host segment (i.e. host rowBytes)
4787  ULWord videoSegmentCardPitch; // Offset (in bytes) between the beginning of one board segment and the beginning of the next board segment (i.e. board memory rowBytes)
4788  NTV2QuarterSizeExpandMode videoQuarterSizeExpand; // Turns on the "quarter-size expand" (2x H + 2x V) hardware
4790 
4791 
4793 {
4794  NTV2Crosspoint channelSpec; // specify Input or Output channel for desired Frame
4795  ULWord * videoBuffer; // Keep 64 bit aligned for performance reasons
4797  ULWord videoDmaOffset; // must be initialized, 64 bit aligned
4798  ULWord * audioBuffer; // Keep 64 bit aligned for performance reasons
4800  ULWord audioStartSample; // To ensure correct alignment in audio buffer .. NOT USED in Windows... audio now always starts at sample zero.
4801  ULWord audioNumChannels; // 1-6 NOTE!!! only 6 supported at this time
4802  ULWord frameRepeatCount; // NOTE!!! not supported yet.
4803  RP188_STRUCT rp188; // Ignored if withRP188 is false
4804  LWord desiredFrame; // -1 if you want driver to find next available
4805  ULWord hUser; // A user cookie returned by frame stamp
4806  ULWord transferFlags; // disableAudioDMA is no longer used
4807  BOOL_ bDisableExtraAudioInfo; // No 24 byte 0 at front or size info in buffer
4808  NTV2FrameBufferFormat frameBufferFormat; // Should be initialized, but can be overridden
4813  // The following params are for cases when you need to DMA multiple discontiguous "segments" of a video frame. One example
4814  // would be when a frame in Host memory is not "packed", i.e. there are extra "padding" bytes at the end of each row.
4815  // In this case you would set videoBufferSize to the number of active bytes per row, videoNumSegments to the number of rows,
4816  // and videoSegmentHostPitch to the number of bytes from the beginning of one row to the next. In this example,
4817  // videoSegmentCardPitch would be equal to videoBufferSize (i.e. the frame is packed in board memory).
4818  // Another example would be DMAing a sub-section of a frame. In this case set videoBufferSize to the number of bytes in
4819  // one row of the subsection, videoNumSegments to the number of rows in the subsection, videoSegmentHostPitch to the rowBytes
4820  // of the entire frame in Host Memory, and videoSegmentCardPitch to the rowBytes of the entire frame in board memory.
4821  // Note: setting videoNumSegments to 0 or 1 defaults to original behavior (i.e. DMA one complete packed frame)
4822  ULWord videoNumSegments; // Number of segments of size videoBufferSize to DMA (i.e. numLines)
4823  ULWord videoSegmentHostPitch; // Offset (in bytes) between the beginning of one host segment and the beginning of the next host segment (i.e. host rowBytes)
4824  ULWord videoSegmentCardPitch; // Offset (in bytes) between the beginning of one board segment and the beginning of the next board segment (i.e. board memory rowBytes)
4825  NTV2QuarterSizeExpandMode videoQuarterSizeExpand; // Turns on the "quarter-size expand" (2x H + 2x V) hardware
4826 
4829 
4830 
4831 typedef struct
4832 {
4833  NTV2Crosspoint channelSpec; // Specify Input or Output channel for desired Frame
4834  ULWord * POINTER_32 videoBuffer; // Keep 64 bit aligned for performance reasons
4836  ULWord videoDmaOffset; // Must be initialized, 64 bit aligned
4837  ULWord * POINTER_32 audioBuffer; // Keep 64 bit aligned for performance reasons
4839  ULWord audioStartSample; // To ensure correct alignment in audio buffer .. NOT USED in Windows... audio now always starts at sample zero.
4840  ULWord audioNumChannels; // 1-6 NOTE!!! only 6 supported at this time
4841  ULWord frameRepeatCount; // NOTE!!! not supported yet.
4842  RP188_STRUCT rp188; // Ignored if withRP188 is false
4843  LWord desiredFrame; // -1 if you want driver to find next available
4844  ULWord hUser; // A user cookie returned by frame stamp
4845  ULWord transferFlags; // disableAudioDMA is no longer used
4846  BOOL_ bDisableExtraAudioInfo; // No 24 byte 0 at front or size info in buffer .. NOT USED in Windows, extra audio no longer supported
4847  NTV2FrameBufferFormat frameBufferFormat; // Should be initialized, but can be overridden
4852  // The following params are for cases when you need to DMA multiple discontiguous "segments" of a video frame. One example
4853  // would be when a frame in Host memory is not "packed", i.e. there are extra "padding" bytes at the end of each row.
4854  // In this case you would set videoBufferSize to the number of active bytes per row, videoNumSegments to the number of rows,
4855  // and videoSegmentHostPitch to the number of bytes from the beginning of one row to the next. In this example,
4856  // videoSegmentCardPitch would be equal to videoBufferSize (i.e. the frame is packed in board memory).
4857  // Another example would be DMAing a sub-section of a frame. In this case set videoBufferSize to the number of bytes in
4858  // one row of the subsection, videoNumSegments to the number of rows in the subsection, videoSegmentHostPitch to the rowBytes
4859  // of the entire frame in Host Memory, and videoSegmentCardPitch to the rowBytes of the entire frame in board memory.
4860  // Note: setting videoNumSegments to 0 or 1 defaults to original behavior (i.e. DMA one complete packed frame)
4861  ULWord videoNumSegments; // Number of segments of size videoBufferSize to DMA (i.e. numLines)
4862  ULWord videoSegmentHostPitch; // Offset (in bytes) between the beginning of one host segment and the beginning of the next host segment (i.e. host rowBytes)
4863  ULWord videoSegmentCardPitch; // Offset (in bytes) between the beginning of one board segment and the beginning of the next board segment (i.e. board memory rowBytes)
4864  NTV2QuarterSizeExpandMode videoQuarterSizeExpand; // Turns on the "quarter-size expand" (2x H + 2x V) hardware
4866 
4867 
4868 // Structure for autocirculate peer to peer transfers. For p2p target specify kTransferFlagP2PPrepare
4869 // for completion using kTransferFlagP2PComplete or kTransferFlagP2PTarget for completion with message transfer.
4870 // Autocirculate will write an AUTOCIRCULATE_P2P_STRUCT to the video buffer specified to the target. Pass this
4871 // buffer as the video buffer to the autocirculate p2p source (kTransferFlagP2PTransfer) to do the p2p transfer.
4872 // For completion with kTransferFlagP2PComplete specify the transferFrame from the kTransferFlagP2PPrepare.
4873 typedef struct
4874 {
4875  ULWord p2pSize; // size of p2p structure
4876  ULWord p2pflags; // p2p transfer flags
4877  ULWord64 videoBusAddress; // frame buffer bus address
4878  ULWord64 messageBusAddress; // message register bus address (0 if not required)
4879  ULWord videoBusSize; // size of the video aperture (bytes)
4880  ULWord messageData; // message data (write to message bus address to complete video transfer)
4882 
4883 
4884 #define AUTOCIRCULATE_TASK_VERSION 0x00000001
4885 #define AUTOCIRCULATE_TASK_MAX_TASKS 128
4886 
4890 typedef enum
4891 {
4893  eAutoCircTaskRegisterWrite, // AutoCircRegisterTask
4894  eAutoCircTaskRegisterRead, // AutoCircRegisterTask
4895  eAutoCircTaskTimeCodeWrite, // AutoCircTimeCodeTask
4896  eAutoCircTaskTimeCodeRead, // AutoCircTimeCodeTask
4899 
4900 
4901 #define NTV2_IS_VALID_TASK_TYPE(_x_) ((_x_) > eAutoCircTaskNone && (_x_) < MAX_NUM_AutoCircTaskTypes)
4902 
4903 #define NTV2_IS_REGISTER_READ_TASK(_x_) ((_x_) == eAutoCircTaskRegisterRead)
4904 #define NTV2_IS_REGISTER_WRITE_TASK(_x_) ((_x_) == eAutoCircTaskRegisterWrite)
4905 #define NTV2_IS_REGISTER_TASK(_x_) (NTV2_IS_REGISTER_WRITE_TASK (_x_) || NTV2_IS_REGISTER_READ_TASK (_x_))
4906 
4907 #define NTV2_IS_TIMECODE_READ_TASK(_x_) ((_x_) == eAutoCircTaskTimeCodeRead)
4908 #define NTV2_IS_TIMECODE_WRITE_TASK(_x_) ((_x_) == eAutoCircTaskTimeCodeWrite)
4909 #define NTV2_IS_TIMECODE_TASK(_x_) (NTV2_IS_TIMECODE_WRITE_TASK (_x_) || NTV2_IS_TIMECODE_READ_TASK (_x_))
4910 
4911 
4912 typedef struct
4913 {
4919 
4920 typedef struct
4921 {
4941 
4942 typedef struct AutoCircGenericTask
4943 {
4945  union
4946  {
4949  } u;
4950 
4951  #if !defined (NTV2_BUILDING_DRIVER)
4952  public:
4953  AJAExport explicit AutoCircGenericTask () {u.registerTask.regNum = u.registerTask.mask = u.registerTask.shift = u.registerTask.value = 0;}
4955  #endif // user-space clients only
4957 
4958 typedef struct
4959 {
4970 
4972 {
4982 
4985 
4986 typedef struct
4987 {
4998 
4999 
5000 // Information about the currently programmed Xilinx .bit file
5001 #define NTV2_BITFILE_DATETIME_STRINGLENGTH (16)
5002 #define NTV2_BITFILE_DESIGNNAME_STRINGLENGTH (100)
5003 #define NTV2_BITFILE_PARTNAME_STRINGLENGTH (16)
5004 // Increment this when you change the bitfile information structure
5005 // And be sure to update the driver so it can handle the new version.
5006 #define NTV2_BITFILE_STRUCT_VERSION (4)
5007 
5008 // There is room for up to 4kbytes after the audio in the last frame,
5009 // but a 4KB data struct overflows the stack in the ioctl routine in
5010 // the driver under Linux.
5011 //#define NTV2_BITFILE_RESERVED_ULWORDS (244)
5012 //#define NTV2_BITFILE_RESERVED_ULWORDS (243) // added bitFileType
5013 //#define NTV2_BITFILE_RESERVED_ULWORDS (239) // added designName
5014 //#define NTV2_BITFILE_RESERVED_ULWORDS (235) // added partName
5015 #define NTV2_BITFILE_RESERVED_ULWORDS (234) // added whichFPGA
5016 
5017 typedef struct {
5018  ULWord checksum; // Platform-dependent. Deprecated on Linux.
5019  ULWord structVersion; // Version of this structure
5020  ULWord structSize; // Total size of this structure
5021 
5022  ULWord numBytes; // Xilinx bitfile bytecount
5023  char dateStr[NTV2_BITFILE_DATETIME_STRINGLENGTH]; // Date Xilinx bitfile compiled
5024  char timeStr[NTV2_BITFILE_DATETIME_STRINGLENGTH]; // Time Xilinx bitfile compiled
5026 
5027  ULWord bitFileType; // NTV2BitfileType
5028 
5029  char partNameStr[NTV2_BITFILE_PARTNAME_STRINGLENGTH]; // Part name (v4)
5031 
5033 
5035 
5036 
5037 typedef struct {
5039  ULWord dmaFlags; // flags passed into DMA currently bit 1 is set for to indicate weird 4096 10bit YUV 4K frame
5040 
5041  Pointer64 dmaHostBuffer; // vitrual address of host buffer
5042  ULWord dmaSize; // number of bytes to DMA
5043  ULWord dmaCardFrameNumber; // card frame number
5044  ULWord dmaCardFrameOffset; // offset (in bytes) into card frame to begin DMA
5045  ULWord dmaNumberOfSegments; // number of segments of size videoBufferSize to DMA
5046  ULWord dmaSegmentSize; // size of each segment (if videoNumSegments > 1)
5047  ULWord dmaSegmentHostPitch; // offset (in bytes) between the beginning of one host-memory segment and the beginning of the next host-memory segment
5048  ULWord dmaSegmentCardPitch; // offset (in bytes) between the beginning of one Kona-memory segment and the beginning of the next Kona-memory segment
5049 
5050  BOOL_ dmaToCard; // direction of DMA transfer
5051 
5053 
5054 
5055 // NOTE: Max bitfilestruct size was NTV2_AUDIO_READBUFFEROFFSET - NTV2_AUDIO_WRAPADDRESS
5056 // but is now practically unlimited.
5057 
5058 // The following structure is used to retrieve the timestamp values of the last video
5059 // interrupts. Use GetInterruptTimeStamps(&
5060 typedef struct {
5065 
5066 // System status calls and structs associated with specific opcodes
5067 
5068 typedef enum
5069 {
5070  SSC_GetFirmwareProgress, // return firmware progress informaiton
5071  SSC_End // end of list
5073 
5074 typedef enum
5075 {
5092 } ProgramState;
5093 
5094 typedef enum {
5104 } ProgramCommand;
5105 
5106 typedef struct {
5111 
5112 // System control calls and structs associated with specific opcodes
5113 
5114 typedef enum
5115 {
5116  SCC_Test, // just a test for now
5117  SCC_End // end of list
5119 
5120 typedef struct {
5121  ULWord param1; // test parameter 1
5122  ULWord param2; // test parameter 2
5123 } SCC_TEST_STRUCT;
5124 
5125 
5126 // Build information
5127 #define NTV2_BUILD_STRINGLENGTH (1024)
5128 #define NTV2_BUILD_STRUCT_VERSION (0)
5129 
5130 #define NTV2_BUILD_RESERVED_BYTES (1016)
5131 
5132 typedef struct {
5133  ULWord structVersion; // Version of this structure
5134  ULWord structSize; // Total size of this structure
5135 
5136  char buildStr[NTV2_BUILD_STRINGLENGTH]; // User-defined build string
5137  unsigned char reserved[NTV2_BUILD_RESERVED_BYTES];
5138 
5140 
5141 
5142 #ifdef AJAMac
5143 #pragma options align=reset
5144 #endif
5145 
5146  // used to filter the vout menu display
5147 typedef enum
5148 {
5149  kUndefinedFilterFormats = 0, // Undefined
5150  kDropFrameFormats = BIT(0), // 23.98 / 29.97 / 59.94
5151  kNonDropFrameFormats = BIT(1), // 24 / 30 / 60
5152  kEuropeanFormats = BIT(2), // 25 / 50
5153  k1080ProgressiveFormats = BIT(3), // 1080p 23.98/24/29.97/30 (exclude 1080psf)
5154  kREDFormats = BIT(4), // RED's odd geometries
5155  k2KFormats = BIT(5), // 2K formats
5156  k4KFormats = BIT(6) // 4K formats
5157 
5159 
5160 // STUFF moved from ntv2macinterface.h that is now common
5162 {
5163  kDesktopFBIniting = 0, // waiting for Finder? Window Mgr? to discover us
5164  kDesktopFBOff = 1, // Running - not in use
5165  kDesktopFBOn = 2 // Running - in-use as Mac Desktop
5166 
5168 
5169 
5171 {
5174 
5176 
5177 
5178 #if !defined(R2_DEPRECATED)
5179 
5180 typedef enum TimelapseUnits
5181 {
5182  kTimelapseFrames = 0, // frames
5183  kTimelapseSeconds = 1, // seconds
5184  kTimelapseMinutes = 2, // minutes
5185  kTimelapseHours = 3 // hours
5186 
5187 } TimelapseUnits;
5188 
5189 typedef enum
5190 {
5191  kDefaultModeDesktop, // deprecated
5193  kDefaultModeBlack, // deprecated
5198 
5199 typedef enum
5200 {
5206  kHDMIOutCSCYCbCr8bit, // deprecated
5209 
5210 typedef enum
5211 {
5217 
5218 typedef enum
5219 {
5225 
5227 
5229 {
5236 };
5237 
5238 // deprecated - NTV2TestPatternSelect
5239 // note: this order mimics (somewhat) that of NTV2TestPatternSelect in "ntv2testpatterngen.h"
5240 typedef enum
5241 {
5245  kTestPatternMultiburst, // Mulitburst
5246  kTestPatternLinesweep, // Line Sweep
5247  kTestPatternPathological, // Pathological
5248  kTestPatternFlatField, // Flat Field (50%)
5249  kTestPatternMultiPattern, // a swath of everything
5252  kTestPatternCustom // Custom ("Load File...")
5253 
5255 
5256 
5257 #endif //R2_DEPRECATED
5258 
5259 
5260 
5261 typedef enum
5262 {
5263  kRP188SourceEmbeddedLTC = 0x0, // NOTE these values are same as RP188 DBB channel select
5268 
5269 
5270 // Masks
5271 enum
5272 {
5273  // kRegUserState1
5274  kMaskInputFormatSelect = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7),
5275  kMaskPrimaryFormatSelect = BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
5276  kMaskSecondaryFormatSelect = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23),
5278  kMaskAnalogInputType = BIT(28) + BIT(29) + BIT(30) + BIT(31),
5279 
5280  //kRegIoHDGlobalStatus
5282 
5283  // kRegIoHDGlobalControl
5284  kMaskStandAloneMode = BIT(0) + BIT(1) + BIT(2),
5285  kMaskDisplayMode = BIT(4) + BIT(5) + BIT(6) + BIT(7),
5286  kMaskDisplayModeTCType = BIT(8) + BIT(9) + BIT(10) + BIT(11), // TimecodeFormat - when set to zero, Timecode type follows primary format
5287 
5288  // kVRegStartupStatusFlags
5292 };
5293 
5294 // isoch streams (channels)
5296 {
5297  kStartPhase1 = 1, // These start out at 1 because they become a bit setting
5299 };
5300 
5301 typedef enum
5302 {
5305 } IoHDDisplayMode;
5306 
5307 #define KONA_DEBUGFILTER_STRINGLENGTH 128
5308 typedef struct
5309 {
5310  char includeString[KONA_DEBUGFILTER_STRINGLENGTH];
5311  char excludeString[KONA_DEBUGFILTER_STRINGLENGTH];
5313 
5314 
5315 typedef enum
5316 {
5327  maskSyncro = BIT(24) + BIT(25),
5335  maskField1CutoffLine = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10),
5337  maskField2CutoffLine = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26),
5339  maskTotalBytesIn = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) +
5340  BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15) +
5341  BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23),
5345  maskField1BytesIn = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) +
5346  BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15) +
5347  BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23),
5351  maskField2BytesIn = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) +
5352  BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15) +
5353  BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23),
5357  maskField1StartLine = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10),
5359  maskField2StartLine = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26),
5361  maskTotalFrameLines = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10),
5363  maskFIDHi = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10),
5365  maskFIDLow = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26),
5367  maskPktIgnore_1_5_9_13_17 = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7),
5369  maskPktIgnore_2_6_10_14_18 = BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
5371  maskPktIgnore_3_7_11_15_19 = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23),
5373  maskPktIgnore_4_8_12_16_20 = BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
5375  maskField1AnalogStartLine = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10),
5377  maskField2AnalogStartLine = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26),
5379 } ANCExtMaskShift;
5380 
5381 typedef enum
5382 {
5384  regAncExtControl = regAncExt_FIRST, // Reg 0 - Control register
5385  regAncExtField1StartAddress, // Reg 1 - f1_start_address[31:0]
5386  regAncExtField1EndAddress, // Reg 2 - f1_end_address[31:0]
5387  regAncExtField2StartAddress, // Reg 3 - f2_start_addr[31:0]
5388  regAncExtField2EndAddress, // Reg 4 - f2_end_address[31:0]
5389  regAncExtFieldCutoffLine, // Reg 5 - f2_cutoff_line[10:0], f1_cutoff_line[10:0]
5390  regAncExtTotalStatus, // Reg 6 - mem_sz_overrun, total_bytes[15:0]
5391  regAncExtField1Status, // Reg 7 - mem_sz_overrun_f1, total_bytes_f1[15:0]
5392  regAncExtField2Status, // Reg 8 - mem_sz_overrun_f2, total_bytes_f2[15:0]
5393  regAncExtFieldVBLStartLine, // Reg 9 - f2_vbl_start[10:0], f1_vbl_start[10:0]
5394  regAncExtTotalFrameLines, // Reg 10 - total_lines[10:0]
5395  regAncExtFID, // Reg 11 - fid_low[10:0], fid_hi[10:0]
5396  regAncExtIgnorePacketReg_1_2_3_4, // Reg 12 - Packet Ignore bytes
5398  regAncExtIgnorePacketReg_5_6_7_8, // Reg 13 - Packet Ignore bytes
5399  regAncExtIgnorePacketReg_9_10_11_12, // Reg 14 - Packet Ignore bytes
5400  regAncExtIgnorePacketReg_13_14_15_16, // Reg 15 - Packet Ignore bytes
5401  regAncExtIgnorePacketReg_17_18_19_20, // Reg 16 - Packet Ignore bytes
5403  regAncExtAnalogStartLine, // Reg 17 - analog_start_line[10:0]
5404  regAncExtField1AnalogYFilter, // Reg 18 - analog_line_y_f1[31:0] - one bit per F1 line past analog_start_line, 1=captureAnalogY, 0=normal
5405  regAncExtField2AnalogYFilter, // Reg 19 - analog_line_y_f2[31:0] - one bit per F2 line past analog_start_line, 1=captureAnalogY, 0=normal
5406  regAncExtField1AnalogCFilter, // Reg 20 - analog_line_c_f1[31:0] - one bit per F1 line past analog_start_line, 1=captureAnalogC, 0=normal
5407  regAncExtField2AnalogCFilter, // Reg 21 - analog_line_c_f2[31:0] - one bit per F2 line past analog_start_line, 1=captureAnalogC, 0=normal
5408  regAncExtTwoFrameCadenceDetect, // Reg 22 - not used in NTV2
5409  regAncExtRP188Type, // Reg 23 - not used in NTV2
5410  regAncExtTimecodeStatus0_31, // Reg 24 - not used in NTV2
5411  regAncExtTimecodeStatus32_63, // Reg 25 - not used in NTV2
5412  regAncExtTimecodeStatusDBB, // Reg 26 - not used in NTV2
5413  regAncExtAnalogActiveLineLength, // Reg 27 - analog active line length
5415 } ANCExtRegisters;
5416 
5417 typedef enum
5418 {
5440 } ANCInsRegisters;
5441 
5442 typedef enum
5443 {
5444  maskInsField1Bytes = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
5446  maskInsField2Bytes = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + +BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
5464  maskInsHancDelay = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9),
5466  maskInsVancDelay = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26),
5468  maskInsField1FirstActive = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10),
5470  maskInsField2FirstActive = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26),
5472  maskInsActivePixelsInLine = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10),
5474  maskInsTotalPixelsInLine = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27),
5476  maskInsTotalLinesPerFrame = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10),
5478  maskInsFieldIDHigh = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10),
5480  maskInsFieldIDLow = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26),
5482 
5483 } ANCInsMaskShift;
5484 
5485 // HDMI AUX extractor registers
5486 typedef enum
5487 {
5489  regAuxExtControl = regAuxExt_FIRST, // Reg 0 - filter_inv[29], dis_mem_wr[28], syncro[25:24], prog[16]
5490  regAuxExtField1StartAddress, // Reg 1 - f1_start_address[31:0]
5491  regAuxExtField1EndAddress, // Reg 2 - f1_end_address[31:0]
5492  regAuxExtField2StartAddress, // Reg 3 - f2_start_addr[31:0]
5493  regAuxExt4, // Reg 4
5494  regAuxExt5, // Reg 5
5495  regAuxExtTotalStatus, // Reg 6 - mem_sz_overrun[28], total_bytes[23:0]
5496  regAuxExtField1Status, // Reg 7 - mem_sz_overrun_f1[28], total_bytes_f1[23:0]
5497  regAuxExtField2Status, // Reg 8 - mem_sz_overrun_f2[28], total_bytes_f2[23:0]
5498  regAuxExtFieldVBLStartLine, // Reg 9 - f2_vbl_start[27:16], f1_vbl_start[11:0]
5499  regAuxExtTotalFrameLines, // Reg 10 - total_lines[11:0]
5500  regAuxExtFID, // Reg 11 - fid_low[27:16], fid_hi[11:0]
5501  regAuxExtPacketMask0, // Reg 12 - Packet Ignore bytes
5503  regAuxExtPacketMask1, // Reg 13 - Packet Ignore bytes
5504  regAuxExtPacketMask2, // Reg 14 - Packet Ignore bytes
5505  regAuxExtPacketMask3, // Reg 15 - Packet Ignore bytes
5507  regAuxExtFillData, // Reg 16 - Buffer fill data
5509 } AUXExtRegisters;
5510 
5511 typedef enum
5512 {
5513  // regAuxExtControl
5516  maskAuxSyncro = BIT(24) + BIT(25),
5522  // regAuxExtField1StartAddress, regAuxExtField1EndAddress, regAuxExtField2StartAddress
5523  maskAuxTotalBytesIn = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) +
5524  BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15) +
5525  BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23),
5527  // regAuxExtTotalStatus
5530  // regAuxExtField1Status, regAuxExtField2Status
5531  maskAuxFieldBytesIn = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) +
5532  BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15) +
5533  BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23),
5537  // regAuxExtFieldVBLStartLine
5538  maskAuxField1StartLine = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11),
5540  maskAuxField2StartLine = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27),
5542  // regAuxExtTotalFrameLines
5543  maskAuxTotalFrameLines = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11),
5545  // regAuxExtFID
5546  maskAuxFIDHi = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11),
5548  maskAuxFIDLow = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27),
5550  // regAuxExtPacketMask0, regAuxExtPacketMask1, regAuxExtPacketMask2, regAuxExtPacketMask3
5551  maskAuxPacket0 = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7),
5553  maskAuxPacket1 = BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15),
5555  maskAuxPacket2 = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23),
5557  maskAuxPacket3 = BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31),
5559 } AUXExtMaskShift;
5560 
5561 
5562 // Driver Version ULWord encode/decode macros
5563 // Introduced in SDK 15.0
5564 // Common ULWord format on all platforms:
5565 //
5566 // 3 2 1
5567 // 10987654321098765432109876543210
5568 // TTXMMMMMMMmmmmmmPPPPPPbbbbbbbbbb
5569 //
5570 // MMMMMMM: [28:22] major version number (7 bits, 0-127)
5571 // mmmmmm: [21:16] minor version number (6 bits, 0-63)
5572 // PPPPPP: [15:10] point release number (6 bits, 0-63)
5573 // bbbbbbbbbb: [9:0] build number (10 bits, 0-1023)
5574 // TT: [31:30] build type (0=release, 1=beta, 2=alpha, 3=dev)
5575 #if defined(__CPLUSPLUS__) || defined(__cplusplus)
5576  #define NTV2DriverVersionEncode(__maj__, __min__, __pt__, __bld__) ((ULWord(__maj__) & 0x0000007F) << 22) \
5577  | ((ULWord(__min__) & 0x0000003F) << 16) \
5578  | ((ULWord(__pt__ ) & 0x0000003F) << 10) \
5579  | ((ULWord(__bld__) & 0x000003FF) << 0)
5580  #define NTV2DriverVersionDecode_Major(__vers__) ((ULWord(__vers__) >> 22) & 0x0000007F)
5581  #define NTV2DriverVersionDecode_Minor(__vers__) ((ULWord(__vers__) >> 16) & 0x0000003F)
5582  #define NTV2DriverVersionDecode_Point(__vers__) ((ULWord(__vers__) >> 10) & 0x0000003F)
5583  #define NTV2DriverVersionDecode_Build(__vers__) ((ULWord(__vers__) >> 0) & 0x000003FF)
5584 #else
5585  #define NTV2DriverVersionEncode(__maj__, __min__, __pt__, __bld__) (((ULWord)(__maj__) & 0x0000007F) << 22) \
5586  | (((ULWord)(__min__) & 0x0000003F) << 16) \
5587  | (((ULWord)(__pt__ ) & 0x0000003F) << 10) \
5588  | (((ULWord)(__bld__) & 0x000003FF) << 0)
5589  #define NTV2DriverVersionDecode_Major(__vers__) (((ULWord)(__vers__) >> 22) & 0x0000007F)
5590  #define NTV2DriverVersionDecode_Minor(__vers__) (((ULWord)(__vers__) >> 16) & 0x0000003F)
5591  #define NTV2DriverVersionDecode_Point(__vers__) (((ULWord)(__vers__) >> 10) & 0x0000003F)
5592  #define NTV2DriverVersionDecode_Build(__vers__) (((ULWord)(__vers__) >> 0) & 0x000003FF)
5593 #endif
5594 #define NTV2DriverVersionBuildTypeToOrdinal(__ch__) ((__ch__) == 'd' ? 3UL : ((__ch__) == 'a' ? 2UL : ((__ch__) == 'b' ? 1UL : 0UL)))
5595 #define NTV2DriverVersionEncodedBuildType (NTV2DriverVersionBuildTypeToOrdinal(AJA_NTV2_SDK_BUILD_TYPE[0]) << 30)
5596 
5597 // Pack/Unpack SDK version in & out of ULWord:
5598 #define NTV2SDKVersionEncode NTV2DriverVersionEncode
5599 #define NTV2SDKVersionDecode_Major NTV2DriverVersionDecode_Major
5600 #define NTV2SDKVersionDecode_Minor NTV2DriverVersionDecode_Minor
5601 #define NTV2SDKVersionDecode_Point NTV2DriverVersionDecode_Point
5602 #define NTV2SDKVersionDecode_Build NTV2DriverVersionDecode_Build
5603 
5604 
5606 
5607  #if AJATargetBigEndian
5608  #if defined(__CPLUSPLUS__) || defined(__cplusplus)
5609  #define NTV2_4CC(_str_) ( (uint32_t((UByte*(_str_))[0]) << 0) | \
5610  (uint32_t((UByte*(_str_))[1]) << 8) | \
5611  (uint32_t((UByte*(_str_))[2]) << 16) | \
5612  (uint32_t((UByte*(_str_))[3]) << 24))
5613 
5614  #define NTV2_FOURCC(_a_,_b_,_c_,_d_) ( ((uint32_t(_a_)) << 0) | \
5615  ((uint32_t(_b_)) << 8) | \
5616  ((uint32_t(_c_)) << 16) | \
5617  ((uint32_t(_d_)) << 24))
5618  #if !defined (NTV2_BUILDING_DRIVER)
5619  #define NTV2_4CC_AS_STRING(_x_) std::string (1, ((_x_) & 0x000000FF) >> 0) + \
5620  std::string (1, ((_x_) & 0x0000FF00) >> 8) + \
5621  std::string (1, ((_x_) & 0x00FF0000) >> 16) + \
5622  std::string (1, ((_x_) & 0xFF000000) >> 24)
5623  #endif // !defined (NTV2_BUILDING_DRIVER)
5624  #else
5625  #define NTV2_4CC(_str_) ( ((uint32_t)(((UByte *)(_str_))[0]) << 0) | \
5626  ((uint32_t)(((UByte *)(_str_))[1]) << 8) | \
5627  ((uint32_t)(((UByte *)(_str_))[2]) << 16) | \
5628  ((uint32_t)(((UByte *)(_str_))[3]) << 24))
5629 
5630  #define NTV2_FOURCC(_a_,_b_,_c_,_d_) ( (((uint32_t)(_a_)) << 0) | \
5631  (((uint32_t)(_b_)) << 8) | \
5632  (((uint32_t)(_c_)) << 16) | \
5633  (((uint32_t)(_d_)) << 24))
5634  #endif // C
5635  #else
5636  #if defined(__CPLUSPLUS__) || defined(__cplusplus)
5637  #define NTV2_4CC(_str_) ( (uint32_t((UByte*(_str_))[3]) << 0) | \
5638  (uint32_t((UByte*(_str_))[2]) << 8) | \
5639  (uint32_t((UByte*(_str_))[1]) << 16) | \
5640  (uint32_t((UByte*(_str_))[0]) << 24))
5641 
5642  #define NTV2_FOURCC(_a_,_b_,_c_,_d_) ( ((uint32_t(_a_)) << 24) | \
5643  ((uint32_t(_b_)) << 16) | \
5644  ((uint32_t(_c_)) << 8) | \
5645  ((uint32_t(_d_)) << 0) )
5646  #if !defined (NTV2_BUILDING_DRIVER)
5647  #define NTV2_4CC_AS_STRING(_x_) std::string(1, char((uint32_t(_x_) & 0xFF000000) >> 24)) + \
5648  std::string(1, char((uint32_t(_x_) & 0x00FF0000) >> 16)) + \
5649  std::string(1, char((uint32_t(_x_) & 0x0000FF00) >> 8)) + \
5650  std::string(1, char((uint32_t(_x_) & 0x000000FF) >> 0))
5651  #endif // !defined (NTV2_BUILDING_DRIVER)
5652  #else
5653  #define NTV2_4CC(_str_) ( ((uint32_t)(((UByte *)(_str_))[3]) << 0) | \
5654  ((uint32_t)(((UByte *)(_str_))[2]) << 8) | \
5655  ((uint32_t)(((UByte *)(_str_))[1]) << 16) | \
5656  ((uint32_t)(((UByte *)(_str_))[0]) << 24))
5657 
5658  #define NTV2_FOURCC(_a_,_b_,_c_,_d_) ( (((uint32_t)(_a_)) << 24) | \
5659  (((uint32_t)(_b_)) << 16) | \
5660  (((uint32_t)(_c_)) << 8) | \
5661  (((uint32_t)(_d_)) << 0) )
5662  #endif // C
5663  #endif // else Little-Endian
5664 
5665 
5666  #define NTV2_CURRENT_HEADER_VERSION 0
5667  #define NTV2_CURRENT_TRAILER_VERSION 0
5668 
5669  #define AUTOCIRCULATE_STRUCT_VERSION 0
5670 
5671  #define NTV2_HEADER_TAG NTV2_FOURCC ('N', 'T', 'V', '2')
5672  #define NTV2_TRAILER_TAG NTV2_FOURCC ('n', 't', 'v', '2')
5673 
5674  #define NTV2_IS_VALID_HEADER_TAG(_x_) ((_x_) == NTV2_HEADER_TAG)
5675  #define NTV2_IS_VALID_TRAILER_TAG(_x_) ((_x_) == NTV2_TRAILER_TAG)
5676 
5677  #define NTV2_TYPE_VIRTUAL_DATA_RW NTV2_FOURCC ('v', 'd', 'a', 't')
5678  #define NTV2_TYPE_MESSAGE_DATA NTV2_FOURCC ('m', 'd', 'a', 't')
5679  #define NTV2_TYPE_BANKGETSET NTV2_FOURCC ('b', 'n', 'k', 'S')
5680  #define NTV2_TYPE_ACCONTROL NTV2_FOURCC ('c', 'o', 'n', 't')
5681  #define NTV2_TYPE_ACSTATUS NTV2_FOURCC ('s', 't', 'a', 't')
5682  #define NTV2_TYPE_ACXFER NTV2_FOURCC ('x', 'f', 'e', 'r')
5683  #define NTV2_TYPE_ACXFERSTATUS NTV2_FOURCC ('x', 'f', 's', 't')
5684  #define NTV2_TYPE_ACTASK NTV2_FOURCC ('t', 'a', 's', 'k')
5685  #define NTV2_TYPE_ACFRAMESTAMP NTV2_FOURCC ('s', 't', 'm', 'p')
5686  #define NTV2_TYPE_GETREGS NTV2_FOURCC ('r', 'e', 'g', 'R')
5687  #define NTV2_TYPE_SETREGS NTV2_FOURCC ('r', 'e', 'g', 'W')
5688  #define NTV2_TYPE_SDISTATS NTV2_FOURCC ('s', 'd', 'i', 'S')
5689  #define NTV2_TYPE_AJADEBUGLOGGING NTV2_FOURCC ('d', 'b', 'l', 'g')
5690  #define NTV2_TYPE_AJABUFFERLOCK NTV2_FOURCC ('b', 'f', 'l', 'k')
5691  #define NTV2_TYPE_AJABITSTREAM NTV2_FOURCC ('b', 't', 's', 't')
5692  #define NTV2_TYPE_AJASTREAMCHANNEL NTV2_FOURCC ('s', 't', 'c', 'h')
5693  #define NTV2_TYPE_AJASTREAMBUFFER NTV2_FOURCC ('s', 't', 'b', 'u')
5694  #define NTV2_TYPE_AJAMAILBUFFER NTV2_FOURCC ('m', 'a', 'i', 'l')
5695  #define NTV2_TYPE_CONFIGINTERRUPT NTV2_FOURCC ('c', 'i', 'n', 't')
5696  #if defined(NTV2_DEPRECATE_16_3)
5697  #define AUTOCIRCULATE_TYPE_STATUS NTV2_TYPE_ACSTATUS
5698  #define AUTOCIRCULATE_TYPE_XFER NTV2_TYPE_ACXFER
5699  #define AUTOCIRCULATE_TYPE_XFERSTATUS NTV2_TYPE_ACXFERSTATUS
5700  #define AUTOCIRCULATE_TYPE_TASK NTV2_TYPE_ACTASK
5701  #define AUTOCIRCULATE_TYPE_FRAMESTAMP NTV2_TYPE_ACFRAMESTAMP
5702  #define AUTOCIRCULATE_TYPE_GETREGS NTV2_TYPE_GETREGS
5703  #define AUTOCIRCULATE_TYPE_SETREGS NTV2_TYPE_SETREGS
5704  #define AUTOCIRCULATE_TYPE_SDISTATS NTV2_TYPE_SDISTATS
5705  #endif // defined(NTV2_DEPRECATE_16_3)
5706 
5707  #define NTV2_IS_VALID_STRUCT_TYPE(_x_) ( (_x_) == NTV2_TYPE_ACSTATUS || \
5708  (_x_) == NTV2_TYPE_ACXFER || \
5709  (_x_) == NTV2_TYPE_ACXFERSTATUS || \
5710  (_x_) == NTV2_TYPE_ACTASK || \
5711  (_x_) == NTV2_TYPE_ACFRAMESTAMP || \
5712  (_x_) == NTV2_TYPE_GETREGS || \
5713  (_x_) == NTV2_TYPE_SETREGS || \
5714  (_x_) == NTV2_TYPE_SDISTATS || \
5715  (_x_) == NTV2_TYPE_BANKGETSET || \
5716  (_x_) == NTV2_TYPE_VIRTUAL_DATA_RW || \
5717  (_x_) == NTV2_TYPE_MESSAGE_DATA || \
5718  (_x_) == NTV2_TYPE_AJADEBUGLOGGING || \
5719  (_x_) == NTV2_TYPE_AJABUFFERLOCK || \
5720  (_x_) == NTV2_TYPE_AJABITSTREAM || \
5721  (_x_) == NTV2_TYPE_AJASTREAMCHANNEL || \
5722  (_x_) == NTV2_TYPE_AJASTREAMBUFFER || \
5723  (_x_) == NTV2_TYPE_AJAMAILBUFFER || \
5724  (_x_) == NTV2_TYPE_CONFIGINTERRUPT)
5725 
5726  // NTV2Buffer FLAGS
5727  #define NTV2Buffer_ALLOCATED BIT(0)
5728  #define NTV2Buffer_PAGE_ALIGNED BIT(1)
5729  #define NTV2Buffer_SHARED BIT(2)
5730  #define NTV2Buffer_SHARED_GLOBAL BIT(4)
5731 
5733  #define NTV2Buffer_TO_ULWORD64(__p__) ((sizeof(int*) == 4) ? (ULWord64(ULWord64(__p__) << 32) | 0x00000000BAADF00D) : ULWord64(__p__))
5734  #if !defined(NTV2_DEPRECATE_17_0)
5735  #define NTV2_POINTER_ALLOCATED NTV2Buffer_ALLOCATED
5736  #define NTV2_POINTER_PAGE_ALIGNED NTV2Buffer_PAGE_ALIGNED
5737  #define NTV2_POINTER_TO_ULWORD64(_p_) NTV2Buffer_TO_ULWORD64(_p_)
5738  #endif // defined(NTV2_DEPRECATE_17_0)
5739 
5740 
5741  // AUTOCIRCULATE OPTION FLAGS
5742  #define AUTOCIRCULATE_WITH_RP188 BIT(0)
5743  #define AUTOCIRCULATE_WITH_LTC BIT(1)
5744  #define AUTOCIRCULATE_WITH_FBFCHANGE BIT(2)
5745  #define AUTOCIRCULATE_WITH_FBOCHANGE BIT(3)
5746  #define AUTOCIRCULATE_WITH_COLORCORRECT BIT(4)
5747  #define AUTOCIRCULATE_WITH_VIDPROC BIT(5)
5748  #define AUTOCIRCULATE_WITH_ANC BIT(6)
5749  #define AUTOCIRCULATE_WITH_AUDIO_CONTROL BIT(7)
5750  #define AUTOCIRCULATE_WITH_FIELDS BIT(8)
5751  #define AUTOCIRCULATE_WITH_HDMIAUX BIT(9)
5752  #define AUTOCIRCULATE_WITH_MULTILINK_AUDIO1 BIT(10)
5753  #define AUTOCIRCULATE_WITH_MULTILINK_AUDIO2 BIT(11)
5754  #define AUTOCIRCULATE_WITH_MULTILINK_AUDIO3 BIT(12)
5755 
5756  #define AUTOCIRCULATE_FRAME_FULL BIT(20)
5757  #define AUTOCIRCULATE_FRAME_FIELD0 BIT(21)
5758  #define AUTOCIRCULATE_FRAME_FIELD1 BIT(22)
5759 
5760  #define AUTOCIRCULATE_P2P_PREPARE BIT(28)
5761  #define AUTOCIRCULATE_P2P_COMPLETE BIT(29)
5762  #define AUTOCIRCULATE_P2P_TARGET BIT(30)
5763  #define AUTOCIRCULATE_P2P_TRANSFER BIT(31)
5764 
5765  #define DMABUFFERLOCK_LOCK BIT(0)
5766  #define DMABUFFERLOCK_UNLOCK_ALL BIT(1)
5767  #define DMABUFFERLOCK_MAP BIT(2)
5768  #define DMABUFFERLOCK_UNLOCK BIT(3)
5769  #define DMABUFFERLOCK_AUTO BIT(4)
5770  #define DMABUFFERLOCK_MANUAL BIT(5)
5771  #define DMABUFFERLOCK_MAX_SIZE BIT(6)
5772  #define DMABUFFERLOCK_RDMA BIT(7)
5773 
5774  // Bitstream flags
5775  #define BITSTREAM_WRITE BIT(0)
5776  #define BITSTREAM_FRAGMENT BIT(1)
5777  #define BITSTREAM_SWAP BIT(2)
5778  #define BITSTREAM_RESET_CONFIG BIT(3)
5779  #define BITSTREAM_RESET_MODULE BIT(4)
5780  #define BITSTREAM_READ_REGISTERS BIT(5)
5781  #define BITSTREAM_SUSPEND BIT(6)
5782  #define BITSTREAM_RESUME BIT(7)
5783 
5784  // Bitstream registers
5785  #define BITSTREAM_EXT_CAP 0
5786  #define BITSTREAM_VENDOR_HEADER 1
5787  #define BITSTREAM_JTAG_ID 2
5788  #define BITSTREAM_VERSION 3
5789  #define BITSTREAM_MCAP_STATUS 4
5790  #define BITSTREAM_MCAP_CONTROL 5
5791  #define BITSTREAM_MCAP_DATA 6
5792  #define BITSTREAM_NUM_REGISTERS 7
5793 
5794  #if !defined (NTV2_BUILDING_DRIVER)
5795  // Convenience macros for compactly formatting ostream output...
5796  #define Hex(__x__) std::hex << (__x__) << std::dec
5797  #define xHex(__x__) "0x" << Hex(__x__)
5798  #define HexN(__x__,__n__) std::hex << std::setw(int(__n__)) << (__x__) << std::dec
5799  #define xHexN(__x__,__n__) "0x" << HexN((__x__),(__n__))
5800  #define Hex0N(__x__,__n__) std::hex << std::setw(int(__n__)) << std::setfill('0') << (__x__) << std::dec << std::setfill(' ')
5801  #define xHex0N(__x__,__n__) "0x" << Hex0N((__x__),(__n__))
5802  #define HEX(__x__) std::hex << std::uppercase << (__x__) << std::dec << std::nouppercase
5803  #define xHEX(__x__) "0x" << HEX(__x__)
5804  #define HEXN(__x__,__n__) std::hex << std::uppercase << std::setw(int(__n__)) << (__x__) << std::dec << std::nouppercase
5805  #define xHEXN(__x__,__n__) "0x" << HEXN((__x__),(__n__))
5806  #define HEX0N(__x__,__n__) std::hex << std::uppercase << std::setw(int(__n__)) << std::setfill('0') << (__x__) << std::dec << std::setfill(' ') << std::nouppercase
5807  #define xHEX0N(__x__,__n__) "0x" << HEX0N((__x__),(__n__))
5808  #define DEC(__x__) std::dec << std::right << (int(__x__))
5809  #define DECN(__x__,__n__) std::dec << std::setw(int(__n__)) << std::right << (__x__)
5810  #define DEC0N(__x__,__n__) std::dec << std::setw(int(__n__)) << std::setfill('0') << std::right << (__x__) << std::dec << std::setfill(' ')
5811  #define OCT(__x__) std::oct << (__x__) << std::dec
5812  #define OCT0N(__x__,__n__) std::oct << std::setw(int(__n__)) << std::setfill('0') << (__x__) << std::dec << std::setfill(' ')
5813  #define oOCT(__x__) "o" << std::oct << (__x__) << std::dec
5814  #define oOCT0N(__x__,__n__) "o" << std::oct << std::setw(int(__n__)) << std::setfill('0') << (__x__) << std::dec << std::setfill(' ')
5815  #define BIN064(__x__) std::bitset<8>((uint64_t(__x__)&0xFF00000000000000)>>56) << "." \
5816  << std::bitset<8>((uint64_t(__x__)&0x00FF000000000000)>>48) << "." \
5817  << std::bitset<8>((uint64_t(__x__)&0x0000FF0000000000)>>40) << "." \
5818  << std::bitset<8>((uint64_t(__x__)&0x000000FF00000000)>>32) << "." \
5819  << std::bitset<8>((uint64_t(__x__)&0x00000000FF000000)>>24) << "." \
5820  << std::bitset<8>((uint64_t(__x__)&0x0000000000FF0000)>>16) << "." \
5821  << std::bitset<8>((uint64_t(__x__)&0x000000000000FF00)>>8) << "." \
5822  << std::bitset<8>( uint64_t(__x__)&0x00000000000000FF)
5823  #define BIN032(__x__) std::bitset<8>((uint32_t(__x__)&0xFF000000)>>24) << "." \
5824  << std::bitset<8>((uint32_t(__x__)&0x00FF0000)>>16) << "." \
5825  << std::bitset<8>((uint32_t(__x__)&0x0000FF00)>>8) << "." \
5826  << std::bitset<8>( uint32_t(__x__)&0x000000FF)
5827  #define BIN016(__x__) std::bitset<8>((uint16_t(__x__)&0xFF00)>>8) << "." \
5828  << std::bitset<8>( uint16_t(__x__)&0x00FF)
5829  #define BIN012(__x__) std::bitset<12>((uint16_t(__x__)&0x0FFF))
5830  #define BIN010(__x__) std::bitset<10>((uint16_t(__x__)&0x03FF))
5831  #define BIN08(__x__) std::bitset<8>(uint8_t(__x__))
5832  #define BIN04(__x__) std::bitset<4>(uint8_t(__x__))
5833  #define BIN0N(__x__,__n__) std::bitset<__n__>(uint8_t(__x__))
5834  #define bBIN064(__x__) "b" << BIN064(__x__)
5835  #define bBIN032(__x__) "b" << BIN032(__x__)
5836  #define bBIN016(__x__) "b" << BIN016(__x__)
5837  #define bBIN012(__x__) "b" << BIN012(__x__)
5838  #define bBIN010(__x__) "b" << BIN010(__x__)
5839  #define bBIN08(__x__) "b" << BIN08(__x__)
5840  #define bBIN04(__x__) "b" << BIN04(__x__)
5841  #define bBIN0N(__x__,__n__) "b" << BIN0N(__x__,__n__)
5842  #define fDEC(__x__,__w__,__p__) std::dec << std::fixed << std::setw(__w__) << std::setprecision(__p__) << (__x__)
5843  #endif // !defined (NTV2_BUILDING_DRIVER)
5844 
5845 
5846  #if defined (AJAMac)
5847  #pragma pack (push, 4)
5848  #endif // defined (AJAMac)
5849 
5850 
5856  #if !defined (NTV2_BUILDING_DRIVER)
5857  // Member Functions
5858 
5864  explicit inline NTV2FrameSize (const ULWord inWidth = 0, const ULWord inHeight = 0) {set (inWidth, inHeight);}
5865  explicit inline NTV2FrameSize (const NTV2FrameGeometry inFG) {set(FGWidth(inFG), FGHeight(inFG));}
5866  inline ULWord width (void) const {return mWidth;}
5867  inline ULWord height (void) const {return mHeight;}
5868  inline bool isValid (void) const {return magnitude() > 0;}
5869  inline bool operator == (const NTV2FrameSize & rhs) const {return magnitude() == rhs.magnitude();}
5870  inline bool operator < (const NTV2FrameSize & rhs) const {return magnitude() < rhs.magnitude();}
5871  inline operator bool() const {return isValid();}
5872  operator NTV2FrameGeometry() const;
5873 
5879  inline NTV2FrameSize & setWidth (const ULWord inValue) {mWidth = inValue; return *this;}
5880 
5886  inline NTV2FrameSize & setHeight (const ULWord inValue) {mHeight = inValue; return *this;}
5887 
5894  inline NTV2FrameSize & set (const ULWord inWidth, const ULWord inHeight) {return setWidth(inWidth).setHeight(inHeight);}
5895 
5901  inline NTV2FrameSize & operator = (const NTV2FrameGeometry & rhs) {return set(FGWidth(rhs), FGHeight(rhs));}
5902 
5907  inline NTV2FrameSize & reset (void) {return set (0, 0);}
5908 
5913  inline NTV2FrameSize & swap (void) {return set (height(), width());}
5914 
5915  #if !defined(NTV2_DEPRECATE_17_5)
5916  inline ULWord NTV2_DEPRECATED_17_5(GetWidth (void) const) {return width();}
5917  inline ULWord NTV2_DEPRECATED_17_5(GetHeight (void) const) {return height();}
5918  inline ULWord NTV2_DEPRECATED_17_5(Width (void) const) {return width();}
5919  inline ULWord NTV2_DEPRECATED_17_5(Height (void) const) {return height();}
5920  inline bool NTV2_DEPRECATED_17_5(IsValid (void) const) {return isValid();}
5921  inline NTV2FrameSize & NTV2_DEPRECATED_17_5(SetWidth (const ULWord v)) {return setWidth(v);}
5922  inline NTV2FrameSize & NTV2_DEPRECATED_17_5(SetHeight (const ULWord v)) {return setHeight(v);}
5923  inline NTV2FrameSize & NTV2_DEPRECATED_17_5(Set (const ULWord w, const ULWord h)) {return set(w,h);}
5924  inline NTV2FrameSize & NTV2_DEPRECATED_17_5(Reset (void)) {return reset();}
5925  #endif // !defined(NTV2_DEPRECATE_17_5)
5926 
5927  static ULWord FGWidth (const NTV2FrameGeometry fg);
5928  static ULWord FGHeight (const NTV2FrameGeometry fg);
5929 
5931  inline uint64_t magnitude(void) const {return (uint64_t(width()) << 32) | uint64_t(height());}
5932  typedef std::map<NTV2FrameGeometry, ULWord> FGSizesMap;
5933  typedef FGSizesMap::const_iterator FGSizesMapCI;
5935  #endif // !defined (NTV2_BUILDING_DRIVER)
5936 
5938  ULWord mWidth;
5939  ULWord mHeight;
5942  #if !defined(NTV2_DEPRECATE_17_5)
5944  #endif // !defined(NTV2_DEPRECATE_17_5)
5945 
5966  #if !defined (NTV2_BUILDING_DRIVER)
5967 
5971  : mFlags (0),
5972  mNumSegments (0),
5973  mElementsPerSegment (0),
5974  mInitialSrcOffset (0),
5975  mInitialDstOffset (0),
5976  mSrcElementsPerRow (0),
5977  mDstElementsPerRow (0) {setElementLength(1);}
5978 
5982  inline bool isValid (void) const {return getSegmentCount() && getSegmentLength() ? true : false;}
5984  inline ULWord getSegmentCount (void) const {return mNumSegments;}
5985  inline ULWord getSegmentLength (void) const {return mElementsPerSegment;}
5986  inline ULWord getSourceOffset (void) const {return mInitialSrcOffset;}
5987  inline ULWord getDestOffset (void) const {return mInitialDstOffset;}
5988  inline ULWord getSourcePitch (void) const {return mSrcElementsPerRow;}
5989  inline ULWord getDestPitch (void) const {return mDstElementsPerRow;}
5990 
5995  inline ULWord getElementLength (void) const {return ULWord(1 << (mFlags & 3));}
5997  inline bool isSourceBottomUp (void) const {return mFlags & BIT(8) ? true : false;}
5998  inline bool isSourceTopDown (void) const {return mFlags & BIT(8) ? false : true;}
5999  inline bool isDestBottomUp (void) const {return mFlags & BIT(9) ? true : false;}
6000  inline bool isDestTopDown (void) const {return mFlags & BIT(9) ? false : true;}
6001  inline ULWord getTotalElements (void) const {return getSegmentCount() * getSegmentLength();}
6002  inline ULWord getTotalBytes (void) const {return getTotalElements() * getElementLength();}
6003 
6007  inline ULWord getSourceEndOffset (void) const // New in SDK 16.0
6008  {return getSourceOffset() + getSourcePitch() * getSegmentCount() + getSegmentLength();}
6009 
6013  inline ULWord getDestEndOffset (void) const // New in SDK 16.0
6014  {return getDestOffset() + getDestPitch() * getSegmentCount() + getSegmentLength();}
6015 
6022  std::ostream & Print (std::ostream & inStrm, const bool inDumpSegments = false) const;
6023 
6029  std::string getSourceCode (const bool inInclDecl = true) const; // New in SDK 16.0
6030 
6035  bool containsElementAtOffset (const ULWord inElementOffset) const; // New in SDK 16.0
6036 
6042  bool operator != (const NTV2SegmentedXferInfo & inRHS) const; // New in SDK 16.0
6043 
6049  inline bool operator == (const NTV2SegmentedXferInfo & inRHS) const {return !(*this != inRHS);} // New in SDK 16.0
6051 
6055 
6057  NTV2SegmentedXferInfo & reset (void);
6058 
6065  inline NTV2SegmentedXferInfo & setSegmentInfo (const ULWord inNumSegs, const ULWord inSegLength)
6066  {return setSegmentCount(inNumSegs).setSegmentLength(inSegLength);}
6067 
6073  inline NTV2SegmentedXferInfo & setSegmentCount (const ULWord inNumSegments)
6074  {mNumSegments = inNumSegments; return *this;}
6075 
6081  inline NTV2SegmentedXferInfo & setSegmentLength (const ULWord inNumElements)
6082  {mElementsPerSegment = inNumElements; return *this;}
6083 
6090  inline NTV2SegmentedXferInfo & setSourceInfo (const ULWord inOffset, const ULWord inPitch)
6091  {return setSourceOffset(inOffset).setSourcePitch(inPitch);}
6092 
6099  {mInitialSrcOffset = inOffset; return *this;}
6100 
6107  {mSrcElementsPerRow = inPitch; return *this;}
6108 
6115  inline NTV2SegmentedXferInfo & setSourceDirection (const bool inTopDown)
6116  { mFlags &= ~(BIT(8)); // set top-down
6117  if (!inTopDown)
6118  mFlags |= BIT(8); // set bottom-up
6119  return *this;
6120  }
6127  inline NTV2SegmentedXferInfo & setSourceFlipped (const bool inFlipped = Direction_Flipped) {return setSourceDirection(inFlipped);}
6128 
6135  inline NTV2SegmentedXferInfo & setDestInfo (const ULWord inOffset, const ULWord inPitch)
6136  {return setDestOffset(inOffset).setDestPitch(inPitch);}
6137 
6143  inline NTV2SegmentedXferInfo & setDestOffset (const ULWord inOffset) {mInitialDstOffset = inOffset; return *this;}
6144 
6150  inline NTV2SegmentedXferInfo & setDestPitch (const ULWord inPitch) {mDstElementsPerRow = inPitch; return *this;}
6151 
6158  inline NTV2SegmentedXferInfo & setDestDirection (const bool inTopDown)
6159  { mFlags &= ~(BIT(9)); // set top-down
6160  if (!inTopDown)
6161  mFlags |= BIT(9); // set bottom-up
6162  return *this;
6163  }
6170  inline NTV2SegmentedXferInfo & setDestFlipped (const bool inFlipped = Direction_Flipped) {return setDestDirection(inFlipped);}
6171 
6178  inline NTV2SegmentedXferInfo & setElementLength (const ULWord inBytesPerElement)
6179  {
6180  if (inBytesPerElement && inBytesPerElement < 9)
6181  if (!(inBytesPerElement & (inBytesPerElement - 1))) // Power of 2?
6182  {
6183  ULWord num(inBytesPerElement), lengthBits(0);
6184  while (num >>= 1)
6185  lengthBits++;
6186  mFlags = (mFlags & ~3UL) | (lengthBits & 3UL);
6187  }
6188  return *this;
6189  }
6194  NTV2SegmentedXferInfo & swapSourceAndDestination (void); // New in SDK 16.0
6196 
6200  static const bool Direction_TopToBottom = true;
6202  static const bool Direction_TopDown = true;
6203  static const bool Direction_Normal = true;
6204  static const bool Direction_BottomToTop = false;
6205  static const bool Direction_BottomUp = false;
6206  static const bool Direction_Flipped = false;
6207  #endif // !defined (NTV2_BUILDING_DRIVER)
6209 
6211  ULWord mFlags;
6212  ULWord mNumSegments;
6213  ULWord mElementsPerSegment;
6214  ULWord mInitialSrcOffset;
6215  ULWord mInitialDstOffset;
6216  ULWord mSrcElementsPerRow;
6217  ULWord mDstElementsPerRow;
6220 
6221 
6259  ULWord64 fUserSpacePtr;
6260  ULWord fByteCount;
6261  ULWord fFlags;
6263  #if defined (AJAMac)
6264  ULWord64 fKernelSpacePtr;
6265  ULWord64 fIOMemoryDesc;
6266  ULWord64 fIOMemoryMap;
6267  #else
6268  //ULWord64 fKernelSpacePtr; ///< @brief Reserved -- New in SDK 17.5
6269  ULWord64 fKernelHandle;
6270  #endif
6272 
6273  #if !defined (NTV2_BUILDING_DRIVER)
6274 
6277 
6284  explicit NTV2Buffer (const void * pInUserPointer, const size_t inByteCount);
6285 
6293  NTV2Buffer (const size_t inByteCount = 0);
6294 
6299  explicit NTV2Buffer (const NTV2Buffer & inObj);
6300 
6304  ~NTV2Buffer ();
6306 
6310 
6314  inline void * GetHostPointer (void) const
6315  {
6316  if (sizeof(int*) == 4)
6317  return reinterpret_cast <void*>((fUserSpacePtr & 0xFFFFFFFF00000000) >> 32);
6318  else
6319  return reinterpret_cast <void*>(fUserSpacePtr);
6320  }
6321 
6326  inline ULWord64 GetRawHostPointer (void) const {return fUserSpacePtr;}
6327 
6331  inline ULWord GetByteCount (void) const {return fByteCount;}
6332 
6337  inline bool IsAllocatedBySDK (void) const {return flags() & NTV2Buffer_ALLOCATED ? true : false;}
6338 
6343  inline bool IsProvidedByClient (void) const {return flags() & NTV2Buffer_ALLOCATED ? false : true;}
6344 
6348  inline bool IsPageAligned (void) const {return flags() & NTV2Buffer_PAGE_ALIGNED ? true : false;} // New in SDK 17.0
6349 
6353  inline bool IsNULL (void) const {return GetHostPointer() == AJA_NULL || GetByteCount() == 0;}
6354 
6358  inline operator bool() const {return !IsNULL();}
6359 
6363  inline operator size_t() const {return GetByteCount();} // New in SDK 16.0
6364 
6372  void * GetHostAddress (const ULWord inByteOffset, const bool inFromEnd = false) const;
6373 
6383  template<typename T> bool Find (const T & inValue, int & inOutIndex) const // New in SDK 16.0
6384  {
6385  const bool isAscending(inOutIndex >= 0);
6386  const int maxNdx(int(GetByteCount()) / sizeof(T));
6387  if (isAscending && inOutIndex >= maxNdx)
6388  return false; // Past end
6389  if (!isAscending && (1 - inOutIndex) >= maxNdx)
6390  return false; // Before start
6391  const T * pValues(*this);
6392  if (isAscending)
6393  {
6394  for (int ndx(inOutIndex); ndx < maxNdx; ndx++)
6395  if (pValues[ndx] == inValue)
6396  {inOutIndex = ndx; return true;}
6397  }
6398  else
6399  {
6400  const int minNdx(0 - maxNdx);
6401  for (int ndx(inOutIndex); ndx >= minNdx; ndx++)
6402  if (pValues[maxNdx + ndx] == inValue)
6403  {inOutIndex = ndx; return true;}
6404  }
6405  inOutIndex = 0;
6406  return false; // Not found
6407  }
6408 
6418  ULWordSet & Find (ULWordSet & outOffsets, const NTV2Buffer & inValue, const size_t inLimit = 0) const; // Originally FindAll before SDK 18.1
6419 
6426  bool IsContentEqual (const NTV2Buffer & inBuffer, const ULWord inByteOffset = 0, const ULWord inByteCount = 0xFFFFFFFF) const;
6427 
6436  bool NextDifference (const NTV2Buffer & inBuffer, ULWord & byteOffset) const;
6437 
6457  bool GetRingChangedByteRange (const NTV2Buffer & inBuffer, ULWord & outByteOffsetFirst, ULWord & outByteOffsetLast) const;
6459 
6463 
6474  bool Allocate (const size_t inByteCount, const bool inPageAligned = false);
6475 
6480  bool Deallocate (void);
6481 
6487  template<typename T> bool Fill (const T & inValue)
6488  {
6489  T* pT = reinterpret_cast<T*>(GetHostPointer());
6490  if (!pT)
6491  return false;
6492 
6493  const size_t bufferSize (GetByteCount() / sizeof(T));
6494  if (!bufferSize)
6495  return false;
6496 
6497  for (size_t i(0); i < bufferSize; i++)
6498  pT[i] = inValue;
6499  return true;
6500  }
6501 
6509  template<typename T> bool Fill (const T & inValue, const NTV2SegmentedXferInfo & inXferInfo)
6510  {
6511  if (!inXferInfo.isValid())
6512  return false;
6513  // Fill a temporary buffer to hold all the segment data...
6514  NTV2Buffer segData(inXferInfo.getElementLength() * inXferInfo.getSegmentCount() * inXferInfo.getSegmentLength());
6515  if (!segData.Fill(inValue))
6516  return false; // Fill failed
6517 
6518  // Copy the segment data into me...
6519  ULWord srcOffset (0);
6520  ULWord dstOffset (inXferInfo.getDestOffset() * inXferInfo.getElementLength());
6521  const ULWord dstPitch (inXferInfo.getDestPitch() * inXferInfo.getElementLength());
6522  const ULWord bytesPerSeg (inXferInfo.getSegmentLength() * inXferInfo.getElementLength());
6523  for (ULWord segNdx(0); segNdx < inXferInfo.getSegmentCount(); segNdx++)
6524  {
6525  const void * pSrc (segData.GetHostAddress(srcOffset));
6526  void * pDst (GetHostAddress(dstOffset));
6527  if (!pSrc) return false;
6528  if (!pDst) return false;
6529  if (dstOffset + bytesPerSeg > GetByteCount())
6530  return false; // memcpy will write past end
6531  ::memcpy (pDst, pSrc, bytesPerSeg);
6532  srcOffset += bytesPerSeg; // Bump src offset
6533  dstOffset += dstPitch; // Bump dst offset
6534  } // for each segment
6535  return true;
6536  }
6537 
6544  bool Truncate (const size_t inByteCount);
6545 
6550  NTV2Buffer & operator = (const NTV2Buffer & inRHS);
6551 
6562  bool Set (const void * pInUserPointer, const size_t inByteCount);
6563 
6575  bool SetAndFill (const void * pInUserPointer, const size_t inByteCount, const UByte inValue);
6576 
6584  bool SetFrom (const NTV2Buffer & inBuffer);
6585 
6595  bool SetFromHexString (const std::string & inStr);
6596 
6603  bool CopyFrom (const void * pInSrcBuffer, const ULWord inByteCount);
6604 
6615  bool CopyFrom (const NTV2Buffer & inSrcBuffer, const ULWord inSrcByteOffset, const ULWord inDstByteOffset, const ULWord inByteCount);
6616 
6624  bool CopyFrom (const NTV2Buffer & inSrcBuffer, const NTV2SegmentedXferInfo & inXferInfo);
6625 
6635  bool SwapWith (NTV2Buffer & inBuffer);
6636 
6642  bool ByteSwap64 (void); // New in SDK 16.0
6643 
6649  bool ByteSwap32 (void); // New in SDK 16.0
6650 
6656  bool ByteSwap16 (void); // New in SDK 16.0
6658 
6662 
6668  std::ostream & Print (std::ostream & inOutStream) const;
6669 
6674  std::string AsString (UWord inDumpMaxBytes = 0) const;
6675 
6683  std::string AsCode (const size_t inBytesPerWord = 4, const std::string & inVarName = "", const bool inUseSTL = false, const bool inByteSwap = false) const;
6684 
6693  bool toHexString (std::string & outStr, const size_t inLineBreakInterval = 0) const;
6694 
6715  std::ostream & Dump ( std::ostream & inOutputStream = std::cout,
6716  const size_t inStartByteOffset = 0,
6717  const size_t inByteCount = 0,
6718  const size_t inRadix = 16,
6719  const size_t inBytesPerGroup = 4,
6720  const size_t inGroupsPerLine = 8,
6721  const size_t inAddressRadix = 0,
6722  const bool inShowAscii = false,
6723  const size_t inAddrOffset = 0) const;
6724 
6746  std::string & Dump ( std::string & inOutputString,
6747  const size_t inStartByteOffset = 0,
6748  const size_t inByteCount = 0,
6749  const size_t inRadix = 16,
6750  const size_t inBytesPerGroup = 4,
6751  const size_t inGroupsPerLine = 8,
6752  const size_t inAddressRadix = 0,
6753  const bool inShowAscii = false,
6754  const size_t inAddrOffset = 0) const;
6756 
6760 
6764  template<typename T> operator const T*() const {return reinterpret_cast<const T*>(GetHostPointer());} // New in SDK 16.0
6765 
6769  template<typename T> operator T*() const {return reinterpret_cast<T*>(GetHostPointer());} // New in SDK 16.0
6770 
6781  NTV2Buffer & Segment (NTV2Buffer & outPtr, const ULWord inByteOffset, const ULWord inByteCount) const;
6782 
6789  inline uint8_t U8 (const int inIndex) const {const uint8_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()) + inIndex : inIndex];} // New in SDK 16.0
6790 
6797  inline uint8_t & U8 (const int inIndex) {uint8_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()) + inIndex : inIndex];} // New in SDK 16.0
6798 
6799  inline int8_t I8 (const int inIndex) const {const int8_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()) + inIndex : inIndex];} // New in SDK 16.0
6800  inline int8_t & I8 (const int inIndex) {int8_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()) + inIndex : inIndex];} // New in SDK 16.0
6801  inline uint16_t U16 (const int inIndex) const {const uint16_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/2) + inIndex : inIndex];} // New in SDK 16.0
6802  inline uint16_t & U16 (const int inIndex) {uint16_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/2) + inIndex : inIndex];} // New in SDK 16.0
6803  inline int16_t I16 (const int inIndex) const {const int16_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/2) + inIndex : inIndex];} // New in SDK 16.0
6804  inline int16_t & I16 (const int inIndex) {int16_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/2) + inIndex : inIndex];} // New in SDK 16.0
6805  inline uint32_t U32 (const int inIndex) const {const uint32_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/4) + inIndex : inIndex];} // New in SDK 16.0
6806  inline uint32_t & U32 (const int inIndex) {uint32_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/4) + inIndex : inIndex];} // New in SDK 16.0
6807  inline int32_t I32 (const int inIndex) const {const int32_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/4) + inIndex : inIndex];} // New in SDK 16.0
6808  inline int32_t & I32 (const int inIndex) {int32_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/4) + inIndex : inIndex];} // New in SDK 16.0
6809  inline uint64_t U64 (const int inIndex) const {const uint64_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/8) + inIndex : inIndex];} // New in SDK 16.0
6810  inline uint64_t & U64 (const int inIndex) {uint64_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/8) + inIndex : inIndex];} // New in SDK 16.0
6811  inline int64_t I64 (const int inIndex) const {const int64_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/8) + inIndex : inIndex];} // New in SDK 16.0
6812  inline int64_t & I64 (const int inIndex) {int64_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/8) + inIndex : inIndex];} // New in SDK 16.0
6813  inline float FL (const int inIndex) const {const float* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/sizeof(float)) + inIndex : inIndex];} // New in SDK 16.0
6814  inline float & FL (const int inIndex) {float* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/sizeof(float)) + inIndex : inIndex];} // New in SDK 16.0
6815  inline double DBL (const int inIndex) const {const double* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/sizeof(double)) + inIndex : inIndex];} // New in SDK 16.0
6816  inline double & DBL (const int inIndex) {double* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/sizeof(double)) + inIndex : inIndex];} // New in SDK 16.0
6818 
6822 
6837  bool GetU64s (ULWord64Sequence & outU64s, const size_t inU64Offset = 0, const size_t inMaxSize = 16, const bool inByteSwap = false) const;
6838 
6851  inline ULWord64Sequence GetU64s (const size_t inU64Offset = 0, const size_t inMaxSize = 16, const bool inByteSwap = false) const {ULWord64Sequence result; GetU64s(result, inU64Offset, inMaxSize, inByteSwap); return result;}
6852 
6867  bool GetU32s (ULWordSequence & outU32s, const size_t inU32Offset = 0, const size_t inMaxSize = 32, const bool inByteSwap = false) const;
6868 
6881  inline ULWordSequence GetU32s (const size_t inU32Offset = 0, const size_t inMaxSize = 32, const bool inByteSwap = false) const {ULWordSequence result; GetU32s(result, inU32Offset, inMaxSize, inByteSwap); return result;}
6882 
6897  bool GetU16s (UWordSequence & outU16s, const size_t inU16Offset = 0, const size_t inMaxSize = 64, const bool inByteSwap = false) const;
6898 
6911  inline UWordSequence GetU16s (const size_t inU16Offset = 0, const size_t inMaxSize = 64, const bool inByteSwap = false) const {UWordSequence result; GetU16s(result, inU16Offset, inMaxSize, inByteSwap); return result;}
6912 
6923  bool GetU8s (UByteSequence & outU8s, const size_t inU8Offset = 0, const size_t inMaxSize = 128) const;
6924 
6933  inline UByteSequence GetU8s (const size_t inU8Offset = 0, const size_t inMaxSize = 128) const {UByteSequence result; GetU8s(result, inU8Offset, inMaxSize); return result;}
6934 
6940  bool AppendU8s (UByteSequence & outU8s) const;
6941 
6953  bool GetString (std::string & outString, const size_t inU8Offset = 0, const size_t inMaxSize = 128) const;
6954 
6964  inline std::string GetString (const size_t inU8Offset = 0, const size_t inMaxSize = 128) const {std::string result; GetString(result, inU8Offset, inMaxSize); return result;}
6965 
6975  bool PutU64s (const ULWord64Sequence & inU64s, const size_t inU64Offset = 0, const bool inByteSwap = false);
6976 
6986  bool PutU32s (const ULWordSequence & inU32s, const size_t inU32Offset = 0, const bool inByteSwap = false);
6987 
6997  bool PutU16s (const UWordSequence & inU16s, const size_t inU16Offset = 0, const bool inByteSwap = false);
6998 
7006  bool PutU8s (const UByteSequence & inU8s, const size_t inU8Offset = 0);
7008 
7009  inline NTV2_DEPRECATED_18_1(ULWordSet & FindAll (ULWordSet & outOffsets, const NTV2Buffer & inValue) const) {return Find(outOffsets,inValue);} // New in SDK 16.3, renamed in SDK 18.1
7010 
7011  private:
7012  inline uint8_t flags (void) const {return uint8_t(fFlags);}
7013 
7014  public:
7018 
7022  static size_t DefaultPageSize (void);
7023 
7029  static bool SetDefaultPageSize (const size_t inNewSize);
7030 
7034  static size_t HostPageSize (void); // New in SDK 16.3
7036 
7038  #endif // user-space clients only
7040 
7041  #if !defined(NTV2_DEPRECATE_17_0)
7042  typedef NTV2Buffer NTV2_POINTER; // Renamed in SDK 17.0
7043  #endif // !defined(NTV2_DEPRECATE_17_0
7044 
7045 
7050  ULWord fDBB;
7051  ULWord fLo;
7052  ULWord fHi;
7053 
7054  #if defined (NTV2_BUILDING_DRIVER)
7055  #define NTV2_RP188_from_RP188_STRUCT(_n_,_r_) { (_n_).fDBB = (_r_).DBB; \
7056  (_n_).fLo = (_r_).Low; \
7057  (_n_).fHi = (_r_).High; }
7058 
7059  #define NTV2_RP188P_from_RP188_STRUCT(_np_,_r_) { (_np_)->fDBB = (_r_).DBB; \
7060  (_np_)->fLo = (_r_).Low; \
7061  (_np_)->fHi = (_r_).High; }
7062 
7063  #define RP188_STRUCT_from_NTV2_RP188(_r_,_n_) { (_r_).DBB = (_n_).fDBB; \
7064  (_r_).Low = (_n_).fLo; \
7065  (_r_).High = (_n_).fHi; }
7066 
7067  #define RP188_STRUCT_from_NTV2_RP188P(_r_,_np_) { (_r_).DBB = (_np_)->fDBB; \
7068  (_r_).Low = (_np_)->fLo; \
7069  (_r_).High = (_np_)->fHi; }
7070 
7071  #define NTV2_RP188_IS_VALID(_n_) ((_n_).fDBB != 0xFFFFFFFF || (_n_).fLo != 0xFFFFFFFF || (_n_).fHi != 0xFFFFFFFF)
7072  #else
7073 
7080  inline explicit NTV2_RP188 (const ULWord inDBB = 0xFFFFFFFF, const ULWord inLow = 0xFFFFFFFF, const ULWord inHigh = 0xFFFFFFFF) : fDBB (inDBB), fLo (inLow), fHi (inHigh) {}
7081 
7086  inline explicit NTV2_RP188 (const RP188_STRUCT & inOldRP188) : fDBB (inOldRP188.DBB), fLo (inOldRP188.Low), fHi (inOldRP188.High) {}
7087 
7091  inline bool IsValid (void) const {return fDBB != 0xFFFFFFFF || fLo != 0xFFFFFFFF || fHi != 0xFFFFFFFF;}
7092 
7098  inline NTV2_RP188 & operator = (const RP188_STRUCT & inRHS) {fDBB = inRHS.DBB; fLo = inRHS.Low; fHi = inRHS.High; return *this;}
7099 
7104  inline bool operator != (const RP188_STRUCT & inRHS) const {return fDBB != inRHS.DBB || fLo != inRHS.Low || fHi != inRHS.High;}
7105 
7112  inline void Set (const ULWord inDBB = 0xFFFFFFFF, const ULWord inLow = 0xFFFFFFFF, const ULWord inHigh = 0xFFFFFFFF) {fDBB = inDBB; fLo = inLow; fHi = inHigh;}
7113 
7118  inline operator RP188_STRUCT () const {RP188_STRUCT result; result.DBB = fDBB; result.Low = fLo; result.High = fHi; return result;}
7119 
7123  inline operator bool () const {return IsValid();}
7124 
7126  #endif // user-space clients only
7128 
7129  #if !defined (NTV2_BUILDING_DRIVER)
7130  typedef std::vector <NTV2_RP188> NTV2TimeCodeList;
7131  typedef NTV2TimeCodeList::const_iterator NTV2TimeCodeListConstIter;
7134  //typedef NTV2TimeCodeList::iterator NTV2TimeCodeListIter;
7135  typedef std::map <NTV2TCIndex, NTV2_RP188> NTV2TimeCodes;
7136  typedef NTV2TimeCodes::const_iterator NTV2TimeCodesConstIter;
7137 
7138  typedef std::set <NTV2TCIndex> NTV2TCIndexes, NTV2TCIndexSet;
7139  typedef NTV2TCIndexes::const_iterator NTV2TCIndexesConstIter, NTV2TCIndexSetConstIter;
7140 
7147  NTV2TimeCodeList & operator << (NTV2TimeCodeList & inOutList, const NTV2_RP188 & inRP188);
7148  #endif // !defined (NTV2_BUILDING_DRIVER)
7149 
7150 
7156  UWord mCRCTallyA;
7157  UWord mCRCTallyB;
7159  ULWord mUnlockTally;
7161  ULWord64 mFrameRefClockCount;
7162  ULWord64 mGlobalClockCount;
7163  bool mFrameTRSError;
7164  bool mLocked;
7166  bool mVPIDValidA;
7168  bool mVPIDValidB;
7169  #if !defined (NTV2_BUILDING_DRIVER)
7170  explicit NTV2SDIInputStatus ();
7171  void Clear (void);
7172  inline bool isLocked (void) const {return mLocked;}
7173  inline ULWord unlockTally (void) const {return mUnlockTally;}
7175 
7179  inline UWord CRCLines (const UWord ndx = 0) const {return ndx ? mCRCTallyB : mCRCTallyA;}
7180  inline bool hasFrameTRSError (void) const {return mFrameTRSError;}
7181 
7186  inline bool hasValidVPID (const UWord ndx = 0) const {return ndx ? mVPIDValidB : mVPIDValidA;}
7192  std::ostream & Print (std::ostream & oStream) const;
7193  #endif // !defined (NTV2_BUILDING_DRIVER)
7195 
7196 
7197 
7203  bool mEnabled;
7204  bool mPixel420;
7205  NTV2HDMIColorSpace mColorSpace;
7206  NTV2HDMIRange mRGBRange;
7207  NTV2HDMIProtocol mProtocol;
7208  NTV2Standard mVideoStandard;
7209  NTV2FrameRate mVideoRate;
7210  NTV2HDMIBitDepth mVideoBitDepth;
7211  NTV2AudioFormat mAudioFormat;
7212  NTV2AudioRate mAudioRate;
7213  NTV2HDMIAudioChannels mAudioChannels;
7214  #if !defined (NTV2_BUILDING_DRIVER)
7215 
7218  explicit NTV2HDMIOutputStatus () {Clear();}
7219 
7224  explicit NTV2HDMIOutputStatus (const ULWord inData) {Clear(); SetFromRegValue(inData);}
7225 
7226  void Clear (void);
7227 
7233  bool SetFromRegValue (const ULWord inData);
7234 
7240  std::ostream & Print (std::ostream & inOutStream) const;
7241  #endif // !defined (NTV2_BUILDING_DRIVER)
7242  NTV2_STRUCT_END (NTV2HMDIOutputStatus)
7243 
7244 
7245 
7251  ULWord fHeaderTag;
7252  ULWord fType;
7253  ULWord fHeaderVersion;
7254  ULWord fVersion;
7255  ULWord fSizeInBytes;
7256  ULWord fPointerSize;
7257  ULWord fOperation;
7258  ULWord fResultStatus;
7260 
7261  #if !defined (NTV2_BUILDING_DRIVER)
7262 
7267  explicit NTV2_HEADER (const ULWord inStructureType, const ULWord inSizeInBytes);
7268 
7269  inline ULWord GetSizeInBytes (void) const {return fSizeInBytes;}
7270  inline ULWord GetTag (void) const {return fHeaderTag;} // New in SDK 16.3
7271  inline ULWord GetType (void) const {return fType;} // New in SDK 16.3
7272  inline ULWord GetHeaderVersion (void) const {return fHeaderVersion;} // New in SDK 16.3
7273  inline ULWord GetVersion (void) const {return fVersion;} // New in SDK 16.3
7274  inline ULWord GetPointerSize (void) const {return fPointerSize;} // New in SDK 16.3
7275  inline ULWord GetConnectionID (void) const {return fOperation;} // New in SDK 16.3
7276  inline void SetConnectionID (const ULWord inValue) {fOperation = inValue;} // New in SDK 16.3
7277  inline ULWord GetResultStatus (void) const {return fResultStatus;} // New in SDK 17.5
7278 
7284  std::ostream & Print (std::ostream & inOutStream) const;
7285 
7289  inline bool IsValid (void) const {return NTV2_IS_VALID_HEADER_TAG(fHeaderTag) && NTV2_IS_VALID_STRUCT_TYPE(fType);}
7290 
7291  inline void ClearResultStatus (void) {fResultStatus = 0;} // New in SDK 17.5
7292 
7293  static std::string FourCCToString (const ULWord in4CC, const char nonPrintable = '?');
7294 
7296  #endif // user-space clients only
7298 
7299 
7300 
7305  ULWord fTrailerVersion;
7306  ULWord fTrailerTag;
7307 
7308  #if !defined (NTV2_BUILDING_DRIVER)
7309  explicit NTV2_TRAILER ();
7310 
7314  inline bool IsValid (void) const {return NTV2_IS_VALID_TRAILER_TAG (fTrailerTag);}
7315 
7317  #endif // user-space clients only
7319 
7320 
7321 
7345  ULWord acNumSegments;
7346  ULWord acNumActiveBytesPerRow;
7348  ULWord acSegmentHostPitch;
7349  ULWord acSegmentDevicePitch;
7351 
7353  #if !defined (NTV2_BUILDING_DRIVER)
7354 
7357  explicit NTV2SegmentedDMAInfo ();
7358 
7366  explicit NTV2SegmentedDMAInfo (const ULWord inNumSegments, const ULWord inNumActiveBytesPerRow, const ULWord inHostBytesPerRow, const ULWord inDeviceBytesPerRow);
7367 
7376  void Set (const ULWord inNumSegments, const ULWord inNumActiveBytesPerRow, const ULWord inHostBytesPerRow, const ULWord inDeviceBytesPerRow);
7377 
7381  void Reset (void);
7382 
7386  inline ULWord GetSegmentCount (void) const {return acNumSegments;}
7387 
7391  inline bool IsSegmented (void) const {return GetSegmentCount() > 1;}
7392 
7394  #endif // user-space clients only
7396 
7397 
7398 
7404  ULWord ccSaturationValue;
7405 
7411  NTV2Buffer ccLookupTables;
7412 
7413  #if !defined (NTV2_BUILDING_DRIVER)
7414 
7417  explicit NTV2ColorCorrectionData ();
7418 
7423 
7427  void Clear (void);
7428 
7432  inline bool IsActive (void) const {return NTV2_IS_ACTIVE_COLOR_CORRECTION_MODE (ccMode) && ccLookupTables.GetHostPointer ();}
7433 
7442  bool Set (const NTV2ColorCorrectionMode inMode, const ULWord inSaturation, const void * pInTableData);
7443 
7445 
7447  inline explicit NTV2ColorCorrectionData (const NTV2ColorCorrectionData & inObj) : ccLookupTables (0) {(void) inObj;}
7448  inline NTV2ColorCorrectionData & operator = (const NTV2ColorCorrectionData & inRHS) {(void) inRHS; return *this;}
7450  #endif // user-space clients only
7452 
7453 
7454 
7459  NTV2_HEADER acHeader;
7460  NTV2Crosspoint acCrosspoint;
7462  LWord acStartFrame;
7463  LWord acEndFrame;
7464  LWord acActiveFrame;
7465  ULWord64 acRDTSCStartTime;
7466  ULWord64 acAudioClockStartTime;
7467  ULWord64 acRDTSCCurrentTime;
7468  ULWord64 acAudioClockCurrentTime;
7469  ULWord acFramesProcessed;
7470  ULWord acFramesDropped;
7471  ULWord acBufferLevel;
7472  ULWord acOptionFlags;
7473  NTV2AudioSystem acAudioSystem;
7474  NTV2_TRAILER acTrailer;
7475 
7476  #if !defined (NTV2_BUILDING_DRIVER)
7477 
7480  explicit AUTOCIRCULATE_STATUS (const NTV2Crosspoint inCrosspoint = NTV2CROSSPOINT_CHANNEL1);
7481 
7487  bool CopyTo (AUTOCIRCULATE_STATUS_STRUCT & outOldStruct);
7488 
7494  bool CopyFrom (const AUTOCIRCULATE_STATUS_STRUCT & inOldStruct);
7495 
7499  void Clear (void);
7500 
7504  inline ULWord GetFrameCount (void) const {return IsStopped() ? 0 : ULWord (acEndFrame - acStartFrame + 1);}
7505 
7509  inline ULWord GetDroppedFrameCount (void) const {return acFramesDropped;}
7510 
7514  inline ULWord GetProcessedFrameCount (void) const {return acFramesProcessed;}
7515 
7519  inline ULWord GetBufferLevel (void) const {return acBufferLevel;}
7520 
7524  inline ULWord GetNumAvailableOutputFrames (void) const {return GetFrameCount () > GetBufferLevel() ? GetFrameCount () - GetBufferLevel() : 0;}
7525 
7529  inline bool CanAcceptMoreOutputFrames (void) const {return GetNumAvailableOutputFrames () > 1;}
7530 
7568  inline bool HasAvailableInputFrame (void) const {return GetBufferLevel() > 1;}
7569 
7573  inline LWord GetActiveFrame (void) const {return acActiveFrame;}
7574 
7578  inline uint16_t GetStartFrame (void) const {return uint16_t(acStartFrame);}
7579 
7583  inline uint16_t GetEndFrame (void) const {return uint16_t(acEndFrame);}
7584 
7588  inline NTV2AutoCirculateState GetState (void) const {return acState;}
7589 
7593  inline NTV2AudioSystem GetAudioSystem (void) const {return acAudioSystem;}
7594 
7598  inline bool IsRunning (void) const {return GetState () == NTV2_AUTOCIRCULATE_RUNNING;}
7599 
7603  inline bool IsStarting (void) const {return GetState () == NTV2_AUTOCIRCULATE_STARTING || GetState () == NTV2_AUTOCIRCULATE_STARTING_AT_TIME;}
7604 
7608  inline bool IsStopped (void) const {return GetState () == NTV2_AUTOCIRCULATE_DISABLED;}
7609 
7613  inline bool IsStopping (void) const {return GetState () == NTV2_AUTOCIRCULATE_STOPPING;}
7614 
7618  inline bool IsPaused (void) const {return GetState () == NTV2_AUTOCIRCULATE_PAUSED;}
7619 
7623  inline bool WithAudio (void) const {return NTV2_IS_VALID_AUDIO_SYSTEM (GetAudioSystem ());}
7624 
7628  inline ULWord OptionFlags (void) const {return acOptionFlags;} // New in SDK 16.0
7629 
7633  inline bool WithCustomAnc (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_ANC;} // New in SDK 16.0
7634 
7638  inline bool WithRP188 (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_RP188;} // New in SDK 16.0
7639 
7643  inline bool WithLTC (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_LTC;} // New in SDK 16.0
7644 
7648  inline bool WithFBFChange (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_FBFCHANGE;} // New in SDK 16.0
7649 
7653  inline bool WithFBOChange (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_FBOCHANGE;} // New in SDK 16.0
7654 
7658  inline bool WithColorCorrect (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_COLORCORRECT;} // New in SDK 16.0
7659 
7663  inline bool WithVidProc (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_VIDPROC;} // New in SDK 16.0
7664 
7668  inline bool IsFieldMode (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_FIELDS;} // New in SDK 16.0
7669 
7673  inline bool WithHDMIAuxData (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_HDMIAUX;} // New in SDK 16.0
7674 
7678  inline bool IsInput (void) const {return NTV2_IS_INPUT_CROSSPOINT(acCrosspoint);}
7679 
7683  inline bool IsOutput (void) const {return NTV2_IS_OUTPUT_CROSSPOINT(acCrosspoint);}
7684 
7688  inline NTV2Mode GetMode (void) const {return IsStopped() ? NTV2_MODE_INVALID : (IsInput() ? NTV2_MODE_INPUT : NTV2_MODE_OUTPUT);} // New in SDK 15.5
7689 
7693  NTV2Channel GetChannel (void) const;
7694 
7699  std::string operator [] (const unsigned inIndexNum) const;
7700 
7704  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
7705 
7707  NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer)
7708  #endif // user-space clients only
7710 
7711 
7712  #if !defined (NTV2_BUILDING_DRIVER)
7717 
7723 
7730  NTV2RegisterNumberSet & operator << (NTV2RegisterNumberSet & inOutSet, const ULWord inRegisterNumber);
7731 
7732  typedef std::map <ULWord, ULWord> NTV2RegisterValueMap;
7733  typedef NTV2RegisterValueMap::const_iterator NTV2RegValueMapConstIter;
7734  typedef NTV2RegisterValueMap::iterator NTV2RegValueMapIter;
7735  #endif // !defined (NTV2_BUILDING_DRIVER)
7736 
7737 
7743  NTV2_STRUCT_BEGIN (NTV2GetRegisters) // NTV2_TYPE_GETREGS
7745  NTV2_HEADER mHeader;
7746  ULWord mInNumRegisters;
7747  NTV2Buffer mInRegisters;
7748  ULWord mOutNumRegisters;
7749  NTV2Buffer mOutGoodRegisters;
7750  NTV2Buffer mOutValues;
7751  NTV2_TRAILER mTrailer;
7753 
7754  #if !defined (NTV2_BUILDING_DRIVER)
7755 
7760  explicit NTV2GetRegisters (const NTV2RegNumSet & inRegisterNumbers = NTV2RegNumSet());
7761 
7766  explicit NTV2GetRegisters (NTV2RegisterReads & inRegReads);
7767 
7772  bool ResetUsing (const NTV2RegNumSet & inRegisterNumbers);
7773 
7779  inline bool ResetUsing (const NTV2RegisterReads & inRegReads) {return ResetUsing(::GetRegisterNumbers(inRegReads));}
7780 
7786  bool GetGoodRegisters (NTV2RegNumSet & outGoodRegNums) const;
7787 
7793  bool GetRegisterValues (NTV2RegisterValueMap & outValues) const;
7794 
7802  bool GetRegisterValues (NTV2RegisterReads & inOutValues) const;
7803 
7809  bool GetRequestedRegisterNumbers (NTV2RegNumSet & outRegNums) const; // New in SDK 16.3
7810 
7816  bool GetBadRegisters (NTV2RegNumSet & outBadRegNums) const; // New in SDK 16.3
7817 
7824  bool PatchRegister (const ULWord inRegNum, const ULWord inValue); // New in SDK 17.0
7825 
7831  std::ostream & Print (std::ostream & inOutStream) const;
7832 
7836  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
7837 
7838  inline ULWord numRegisters (void) const {return mInNumRegisters;} // New in SDK 18.0
7839  inline const NTV2Buffer & requestedRegisterNumbers (void) const {return mInRegisters;} // New in SDK 18.0
7840  inline ULWord & outNumRegisters (void) {return mOutNumRegisters;} // New in SDK 18.0
7841  inline NTV2Buffer & outGoodRegisterNumbers (void) {return mOutGoodRegisters;} // New in SDK 18.0
7842  inline NTV2Buffer & outRegisterValues (void) {return mOutValues;} // New in SDK 18.0
7843 
7845  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
7846 
7848  inline explicit NTV2GetRegisters (const NTV2GetRegisters & inObj) : mHeader(0xFEFEFEFE, 0), mInRegisters(0), mOutGoodRegisters(0), mOutValues(0)
7849  {(void) inObj;}
7850  inline NTV2GetRegisters & operator = (const NTV2GetRegisters & inRHS) {(void) inRHS; return *this;}
7852 
7853  #endif // !defined (NTV2_BUILDING_DRIVER)
7855 
7856 
7857 
7862  NTV2_STRUCT_BEGIN (NTV2SetRegisters) // NTV2_TYPE_SETREGS
7863  NTV2_HEADER mHeader;
7864  ULWord mInNumRegisters;
7865  NTV2Buffer mInRegInfos;
7866  ULWord mOutNumFailures;
7867  NTV2Buffer mOutBadRegIndexes;
7868  NTV2_TRAILER mTrailer;
7869 
7870  #if !defined (NTV2_BUILDING_DRIVER)
7871 
7876  NTV2SetRegisters (const NTV2RegWrites & inRegWrites = NTV2RegWrites());
7877 
7883  bool ResetUsing (const NTV2RegWrites & inRegWrites);
7884 
7890  bool GetFailedRegisterWrites (NTV2RegWrites & outFailedRegWrites) const;
7891 
7895  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
7896 
7897  inline ULWord GetRequestedRegisterCount (void) const {return mInNumRegisters;} // New in SDK 16.3
7898  bool GetRequestedRegisterWrites (NTV2RegWrites & outRegWrites) const; // New in SDK 16.3
7899  inline ULWord GetNumFailedWrites (void) const {return mOutNumFailures;} // New in SDK 16.3
7900 
7906  std::ostream & Print (std::ostream & inOutStream) const;
7907 
7908  inline const NTV2Buffer & regInfos (void) const {return mInRegInfos;} // New in SDK 18.0
7909  inline ULWord & outNumFailures (void) {return mOutNumFailures;} // New in SDK 18.0
7910  inline NTV2Buffer & outBadRegIndexes (void) {return mOutBadRegIndexes;} // New in SDK 18.0
7911 
7913  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
7914 
7916  inline explicit NTV2SetRegisters (const NTV2SetRegisters & inObj) : mHeader(0xFEFEFEFE, 0), mInNumRegisters(0), mInRegInfos(0), mOutNumFailures(0), mOutBadRegIndexes(0)
7917  {(void) inObj;}
7918  inline NTV2SetRegisters & operator = (const NTV2SetRegisters & inRHS) {(void) inRHS; return *this;}
7920 
7921  #endif // !defined (NTV2_BUILDING_DRIVER)
7923 
7924 
7925 
7929  NTV2_STRUCT_BEGIN (NTV2BankSelGetSetRegs) // NTV2_TYPE_BANKGETSET
7930  NTV2_HEADER mHeader;
7931  ULWord mIsWriting;
7932  NTV2Buffer mInBankInfos;
7933  NTV2Buffer mInRegInfos;
7934  NTV2_TRAILER mTrailer;
7935 
7936  #if !defined (NTV2_BUILDING_DRIVER)
7937 
7943  explicit NTV2BankSelGetSetRegs (const NTV2RegInfo & inBankSelect, const NTV2RegInfo & inRegInfo, const bool inDoWrite = false);
7944 
7949  NTV2RegInfo GetRegInfo (const UWord inIndex0 = 0) const;
7950 
7956  std::ostream & Print (std::ostream & inOutStream) const;
7957 
7961  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
7962 
7964  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
7965 
7967  inline explicit NTV2BankSelGetSetRegs (const NTV2BankSelGetSetRegs & inObj) : mHeader(0xFEFEFEFE, 0), mIsWriting(false), mInBankInfos(0), mInRegInfos(0)
7968  {(void) inObj;}
7969  inline NTV2BankSelGetSetRegs & operator = (const NTV2BankSelGetSetRegs & inRHS) {(void) inRHS; return *this;}
7971  #endif // !defined (NTV2_BUILDING_DRIVER)
7973 
7974 
7979  NTV2_HEADER mHeader;
7980  ULWord mOperation;
7981  ULWord mFlags;
7982  ULWord mInterruptID;
7983  ULWord mResult;
7984  ULWord64 mInterruptIDs;
7985  ULWord64 mEventHandle;
7986  ULWord64 mClientID;
7987  ULWord64 mClientPID;
7988  ULWord64 mClientTID;
7989  ULWord mCount;
7990  NTV2Buffer mHandles;
7991  ULWord mSpares[32];
7992  NTV2_TRAILER mTrailer;
7993 
7994  #if !defined (NTV2_BUILDING_DRIVER)
7995  explicit NTV2ConfigInterrupt(const void * pClient = nullptr);
7997 
7998  // SUPPORTED OPERATIONS
7999  static const ULWord kOpINVALID = 0x00000000;
8000  static const ULWord kOpFIRST = 0x00000001;
8001  static const ULWord kOpSubscribe = kOpFIRST;
8002  static const ULWord kOpUnsubscribe = 0x00000002;
8003  static const ULWord kOpEnable = 0x00000003;
8004  static const ULWord kOpDisable = 0x00000004;
8005  static const ULWord kOpGetSubscribed = 0x00000005;
8006  static const ULWord kOpGetEnabledIDs = 0x00000006;
8007  static const ULWord kOpGetIntCount = 0x00000007;
8008  static const ULWord kOpSetIntCount = 0x00000008;
8009  static const ULWord kOpLAST = kOpSetIntCount;
8010 
8011  // OPTION FLAGS
8012  static const ULWord kFlagMaskCreateHandle = 0x00000001;
8013  static const ULWord kFlagMaskIncludeGlobals = 0x00000002;
8014 
8015  // Inquiry
8016  inline ULWord operation (void) const {return mOperation;}
8017  inline ULWord flags (void) const {return mFlags;}
8018  inline INTERRUPT_ENUMS interruptID (void) const {return INTERRUPT_ENUMS(mInterruptID);}
8019  inline uint64_t interruptIDs (void) const {return mInterruptIDs;}
8020  inline bool isValid (void) const {return mHeader.IsValid() && mTrailer.IsValid() && mHeader.GetType() == NTV2_TYPE_CONFIGINTERRUPT && NTV2_IS_VALID_INTERRUPT_ENUM(interruptID()) && (operation() >= kOpFIRST && operation() <= kOpLAST);}
8021  inline operator bool() const {return isValid();}
8022  inline bool isSuccess (void) const {return mResult ? true : false;}
8023  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);}
8024  std::ostream & print (std::ostream & oss) const;
8025  inline uint64_t clientID (void) const {return mClientID;}
8026  inline uint64_t clientPID (void) const {return mClientPID;}
8027  inline uint64_t clientTID (void) const {return mClientTID;}
8028  inline ULWord count (void) const {return mCount;}
8029  inline size_t maxHandleCapacity (void) const {return mHandles.GetByteCount() / sizeof(uint64_t);}
8030  inline HANDLE eventHandle (const INTERRUPT_ENUMS id) const {return isValid() && mHandles && size_t(id) < maxHandleCapacity() ? HANDLE(mHandles.U64(int(id))) : HANDLE(0);}
8031  inline bool setEventHandle (const INTERRUPT_ENUMS id, HANDLE h) {if (!isValid() || !mHandles || size_t(id) >= maxHandleCapacity()) return false; mHandles.U64(int(id)) = uint64_t(h); return true;}
8032 
8033  inline bool hasCreateHandleFlag (void) const {return flags() & kFlagMaskCreateHandle;}
8034  inline bool hasIncludeGlobalsFlag (void) const {return flags() & kFlagMaskIncludeGlobals;}
8035 
8036  // Changing/Configuring
8037  inline NTV2ConfigInterrupt & doSubscribe (const INTERRUPT_ENUMS id) {return doSubscribeEvent(id,HANDLE(0)).setCreateEvent();}
8038  inline NTV2ConfigInterrupt & doSubscribeEvent (const INTERRUPT_ENUMS id, const HANDLE & hdl) {return setOperation(kOpSubscribe).setInterruptID(id).setEventHandle(hdl);}
8039  inline NTV2ConfigInterrupt & doUnsubscribe (const INTERRUPT_ENUMS id) {return setOperation(kOpUnsubscribe).setInterruptID(id);}
8040  inline NTV2ConfigInterrupt & doEnable (const INTERRUPT_ENUMS id) {return setOperation(kOpEnable).setInterruptID(id);}
8041  inline NTV2ConfigInterrupt & doDisable (const INTERRUPT_ENUMS id) {return setOperation(kOpDisable).setInterruptID(id);}
8042  inline NTV2ConfigInterrupt & doGetCount (const INTERRUPT_ENUMS id) {return setOperation(kOpGetIntCount).setInterruptID(id);}
8043  inline NTV2ConfigInterrupt & doSetCount (const INTERRUPT_ENUMS id, const ULWord cnt=0) {return setOperation(kOpSetIntCount).setInterruptID(id).setCount(cnt);}
8044  inline NTV2ConfigInterrupt & doGetSubscribed (const bool includeHdls = false)
8045  { if (includeHdls)
8046  mHandles.Allocate(size_t(eNumInterruptTypes));
8047  else
8048  mHandles.Set(nullptr, 0);
8049  return setOperation(kOpGetSubscribed);
8050  }
8051 
8052  inline NTV2ConfigInterrupt & setResult (const ULWord val) {mResult = val; return *this;}
8053  inline NTV2ConfigInterrupt & setFail (void) {return setResult(0);}
8054  inline NTV2ConfigInterrupt & setSuccess (void) {return setResult(1);}
8055  inline NTV2ConfigInterrupt & setClientID (const uint64_t id) {mClientID = id; return *this;}
8056  inline NTV2ConfigInterrupt & setCount (const ULWord val) {mCount = val; return *this;}
8057  NTV2ConfigInterrupt & setOperation (const ULWord op);
8058  inline NTV2ConfigInterrupt & setInterruptID (const INTERRUPT_ENUMS id) {mInterruptID = ULWord(id); return *this;}
8059  inline NTV2ConfigInterrupt & setEventHandle (const HANDLE & h) {mEventHandle = ULWord64(h); mCount = 0; mHandles.Set(nullptr,0); return *this;}
8060  inline NTV2ConfigInterrupt & setCreateEvent (void) {mFlags |= kFlagMaskCreateHandle; return *this;}
8061 
8062  static std::string OpName (const ULWord op);
8063  static NTV2StringList IntNames (const uint64_t mask);
8064  static std::string IntName (const INTERRUPT_ENUMS id);
8065 
8067  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
8068 
8070  inline explicit NTV2ConfigInterrupt (const NTV2ConfigInterrupt & inObj) : mHeader(0xFEFEFEFE, 0) {(void)inObj;}
8071  inline NTV2ConfigInterrupt & operator = (const NTV2ConfigInterrupt & inRHS) {(void)inRHS; return *this;}
8073  #endif // user-space clients only
8075 
8077 
8078  #define AsNTV2ConfigInterrupt(_p_) (reinterpret_cast<NTV2ConfigInterrupt*>(_p_))
8079  #define AsNTV2CfgInterrupt(_p_) (reinterpret_cast<NTV2ConfigInterrupt*>(_p_))
8080  #if !defined (NTV2_BUILDING_DRIVER)
8081  AJAExport std::ostream & operator << (std::ostream & oss, const NTV2ConfigInterrupt & msg);
8082  #endif// !defined (NTV2_BUILDING_DRIVER)
8083 
8084 
8089  NTV2_STRUCT_BEGIN (NTV2VirtualData) // NTV2_TYPE_VIRTUAL_DATA_RW
8090  NTV2_HEADER mHeader;
8091  ULWord mTag;
8092  ULWord mIsWriting;
8093  NTV2Buffer mVirtualData;
8094  NTV2_TRAILER mTrailer;
8095 
8096  #if !defined (NTV2_BUILDING_DRIVER)
8097 
8104  explicit NTV2VirtualData (const ULWord inTag, const void* inVirtualData, const size_t inVirtualDataSize, const bool inDoWrite = false);
8105 
8111  std::ostream & Print (std::ostream & inOutStream) const;
8112 
8116  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
8117 
8119  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
8120 
8121  #endif // !defined (NTV2_BUILDING_DRIVER)
8123 
8124 
8125 
8130  #define NTV2_MESSAGE_DATA_RW BIT(0)
8131 
8132  NTV2_STRUCT_BEGIN (NTV2MessageData) // NTV2_TYPE_MESSAGE_DATA
8133  NTV2_HEADER mHeader;
8134  NTV2Buffer mMessage;
8135  ULWord mFlags;
8136  ULWord mStatus;
8137  NTV2_TRAILER mTrailer;
8138 
8139  #if !defined (NTV2_BUILDING_DRIVER)
8140 
8146  explicit NTV2MessageData (const void* inMessage, const size_t inMessageSize, const ULWord inFlags);
8147 
8151  ULWord GetStatus (void) { return mStatus; }
8152 
8158  std::ostream & Print (std::ostream & inOutStream) const;
8159 
8163  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
8164 
8166  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
8167 
8168  #endif // !defined (NTV2_BUILDING_DRIVER)
8170 
8171 
8172 
8177  NTV2_STRUCT_BEGIN (NTV2SDIInStatistics) // NTV2_TYPE_SDISTATS
8179  NTV2_HEADER mHeader;
8180  NTV2Buffer mInStatistics;
8181  NTV2_TRAILER mTrailer;
8183 
8184  #if !defined (NTV2_BUILDING_DRIVER)
8185 
8189 
8193  void Clear (void);
8194 
8201  bool GetSDIInputStatus (NTV2SDIInputStatus & outStatus, const UWord inSDIInputIndex0 = 0);
8202 
8207  NTV2SDIInputStatus & operator [] (const size_t inSDIInputIndex0); // New in SDK 16.0
8208 
8214  std::ostream & Print (std::ostream & inOutStream) const;
8215 
8219  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 18.1
8220 
8222  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
8223  #endif // !defined (NTV2_BUILDING_DRIVER)
8225 
8226 
8227 
8240  NTV2_STRUCT_BEGIN (FRAME_STAMP) // NTV2_TYPE_ACFRAMESTAMP
8241  NTV2_HEADER acHeader;
8242 
8245  LWord64 acFrameTime;
8247  ULWord acRequestedFrame;
8251  ULWord64 acAudioClockTimeStamp;
8254  ULWord acAudioExpectedAddress;
8260  ULWord acAudioInStartAddress;
8261  ULWord acAudioInStopAddress;
8263  ULWord acAudioOutStopAddress;
8265  ULWord acAudioOutStartAddress;
8267  ULWord acTotalBytesTransferred;
8269  ULWord acStartSample;
8270 
8282  NTV2Buffer acTimeCodes;
8284  LWord64 acCurrentTime;
8294  ULWord acCurrentFrame;
8299  LWord64 acCurrentFrameTime;
8300  ULWord64 acAudioClockCurrentTime;
8304  ULWord acCurrentAudioExpectedAddress; // FIXFIXFIX Document What is this?!
8311  ULWord acCurrentAudioStartAddress;
8312  ULWord acCurrentFieldCount;
8313  ULWord acCurrentLineCount;
8314  ULWord acCurrentReps;
8315  ULWord64 acCurrentUserCookie;
8316  ULWord acFrame;
8321  NTV2_TRAILER acTrailer;
8323 
8324  #if !defined (NTV2_BUILDING_DRIVER)
8325 
8328  explicit FRAME_STAMP ();
8329 
8334  FRAME_STAMP (const FRAME_STAMP & inObj);
8335 
8339  ~FRAME_STAMP ();
8340 
8345  bool SetFrom (const FRAME_STAMP_STRUCT & inOldStruct);
8346 
8351  bool CopyTo (FRAME_STAMP_STRUCT & outOldStruct) const;
8352 
8359  bool GetInputTimeCodes (NTV2TimeCodeList & outValues) const;
8360 
8370  bool GetInputTimeCodes (NTV2TimeCodes & outTimeCodes, const NTV2Channel inSDIInput, const bool inValidOnly = true) const;
8371 
8380  bool GetInputTimeCode (NTV2_RP188 & outTimeCode, const NTV2TCIndex inTCIndex = NTV2_TCINDEX_SDI1) const;
8381 
8388  bool GetSDIInputStatus (NTV2SDIInputStatus & outStatus, const UWord inSDIInputIndex0 = 0) const;
8389 
8397  bool SetInputTimecode (const NTV2TCIndex inTCNdx, const NTV2_RP188 & inTimecode);
8398 
8403  FRAME_STAMP & operator = (const FRAME_STAMP & inRHS);
8404 
8409  std::string operator [] (const unsigned inIndexNum) const;
8410 
8414  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
8415 
8417  NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer)
8418 
8419  #endif // !defined (NTV2_BUILDING_DRIVER)
8421 
8422 
8423 
8429  NTV2_HEADER acHeader;
8431  LWord acTransferFrame;
8432  ULWord acBufferLevel;
8433  ULWord acFramesProcessed;
8434  ULWord acFramesDropped;
8435  FRAME_STAMP acFrameStamp;
8436  ULWord acAudioTransferSize;
8437  ULWord acAudioStartSample;
8438  ULWord acAncTransferSize;
8439  ULWord acAncField2TransferSize;
8440  NTV2_TRAILER acTrailer;
8441 
8442  #if !defined (NTV2_BUILDING_DRIVER)
8443 
8446  explicit AUTOCIRCULATE_TRANSFER_STATUS ();
8447 
8451  inline const FRAME_STAMP & GetFrameStamp (void) const {return acFrameStamp;}
8452 
8456  inline LWord GetTransferFrame (void) const {return acTransferFrame;}
8457 
8461  inline NTV2AutoCirculateState GetState (void) const {return acState;}
8462 
8466  inline ULWord GetBufferLevel (void) const {return acBufferLevel;}
8467 
8471  inline ULWord GetProcessedFrameCount (void) const {return acFramesProcessed;}
8472 
8476  inline ULWord GetDroppedFrameCount (void) const {return acFramesDropped;}
8477 
8483  inline ULWord GetCapturedAudioByteCount (void) const {return acAudioTransferSize;}
8484 
8491  inline ULWord GetCapturedAncByteCount (const bool inField2 = false) const {return inField2 ? acAncField2TransferSize : acAncTransferSize;}
8492 
8499  inline ULWord GetCapturedAuxByteCount (const bool inField2 = false) const {return GetCapturedAncByteCount(inField2);}
8500 
8502  NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer)
8503 
8505  inline explicit AUTOCIRCULATE_TRANSFER_STATUS (const AUTOCIRCULATE_TRANSFER_STATUS & inObj) : acHeader(0xFEFEFEFE, 0) {(void) inObj;}
8506  inline AUTOCIRCULATE_TRANSFER_STATUS & operator = (const AUTOCIRCULATE_TRANSFER_STATUS & inRHS) {(void) inRHS; return *this;}
8508  #endif // !defined (NTV2_BUILDING_DRIVER)
8510 
8511 
8512 
8518  NTV2_HEADER acHeader;
8519 
8525  NTV2Buffer acVideoBuffer;
8526 
8532  NTV2Buffer acAudioBuffer;
8533 
8543  NTV2Buffer acANCBuffer;
8544 
8554  NTV2Buffer acANCField2Buffer;
8555 
8562  NTV2Buffer acOutputTimeCodes;
8563 
8570 
8576  ULWord64 acInUserCookie;
8577 
8584  ULWord acInVideoDMAOffset;
8585 
8586  NTV2SegmentedDMAInfo acInSegmentedDMAInfo;
8587  NTV2ColorCorrectionData acColorCorrection;
8588  NTV2FrameBufferFormat acFrameBufferFormat;
8589  NTV2FBOrientation acFrameBufferOrientation;
8590  AutoCircVidProcInfo acVidProcInfo;
8591  NTV2QuarterSizeExpandMode acVideoQuarterSizeExpand;
8592 
8593  NTV2Buffer acHDMIAuxData;
8594 
8598  ULWord acPeerToPeerFlags;
8600  ULWord acFrameRepeatCount;
8601  LWord acDesiredFrame;
8604  NTV2_TRAILER acTrailer;
8606 
8607  #if !defined (NTV2_BUILDING_DRIVER)
8608 
8611  explicit AUTOCIRCULATE_TRANSFER ();
8614 
8638  explicit AUTOCIRCULATE_TRANSFER (ULWord * pInVideoBuffer, const ULWord inVideoByteCount, ULWord * pInAudioBuffer = AJA_NULL,
8639  const ULWord inAudioByteCount = 0, ULWord * pInANCBuffer = AJA_NULL, const ULWord inANCByteCount = 0,
8640  ULWord * pInANCF2Buffer = AJA_NULL, const ULWord inANCF2ByteCount = 0);
8645  void Clear (void);
8646 
8648  inline explicit AUTOCIRCULATE_TRANSFER (const AUTOCIRCULATE_TRANSFER & inObj)
8649  : acHeader(0xFEFEFEFE, 0), acVideoBuffer(0), acAudioBuffer(0),
8650  acANCBuffer(0), acANCField2Buffer(0), acOutputTimeCodes(0), acHDMIAuxData(0)
8651  {(void) inObj;}
8652  inline AUTOCIRCULATE_TRANSFER & operator = (const AUTOCIRCULATE_TRANSFER & inRHS) {(void) inRHS; return *this;}
8655 
8659 
8685  bool SetBuffers (ULWord * pInVideoBuffer, const ULWord inVideoByteCount,
8686  ULWord * pInAudioBuffer, const ULWord inAudioByteCount,
8687  ULWord * pInANCBuffer, const ULWord inANCByteCount,
8688  ULWord * pInANCF2Buffer = AJA_NULL, const ULWord inANCF2ByteCount = 0);
8689 
8701  bool SetVideoBuffer (ULWord * pInVideoBuffer, const ULWord inVideoByteCount);
8702 
8713  bool SetAudioBuffer (ULWord * pInAudioBuffer, const ULWord inAudioByteCount);
8714 
8736  bool SetAncBuffers (ULWord * pInANCBuffer, const ULWord inANCByteCount,
8737  ULWord * pInANCF2Buffer = AJA_NULL, const ULWord inANCF2ByteCount = 0);
8741  inline const NTV2Buffer & GetVideoBuffer (void) const {return acVideoBuffer;}
8742 
8746  inline const NTV2Buffer & GetAudioBuffer (void) const {return acAudioBuffer;}
8747 
8752  inline const NTV2Buffer & GetAncBuffer (const bool inField2 = false) const {return inField2 ? acANCField2Buffer : acANCBuffer;}
8754 
8758 
8768  bool SetOutputTimeCodes (const NTV2TimeCodes & inValues);
8769 
8780  bool SetOutputTimeCode (const NTV2_RP188 & inTimecode, const NTV2TCIndex inTCIndex = NTV2_TCINDEX_SDI1);
8781 
8790  bool SetAllOutputTimeCodes (const NTV2_RP188 & inTimecode, const bool inIncludeF2 = true);
8791 
8799  bool GetInputTimeCodes (NTV2TimeCodeList & outValues) const;
8800 
8811  bool GetInputTimeCode (NTV2_RP188 & outTimeCode, const NTV2TCIndex inTCIndex = NTV2_TCINDEX_SDI1) const;
8812 
8825  bool GetInputTimeCodes (NTV2TimeCodes & outTimeCodes, const NTV2Channel inSDIInput = NTV2_CHANNEL1, const bool inValidOnly = true) const;
8827 
8831 
8842  inline bool SetFrameUserCookie (const ULWord64 & inUserCookie) {acInUserCookie = inUserCookie; return true;}
8843 
8851  bool SetFrameBufferFormat (const NTV2FrameBufferFormat inNewFormat);
8852 
8856  inline void EnableQuarterSizeExpandMode (void) {acVideoQuarterSizeExpand = NTV2_QuarterSizeExpandOn;}
8857 
8861  inline void DisableQuarterSizeExpandMode (void) {acVideoQuarterSizeExpand = NTV2_QuarterSizeExpandOff;}
8862 
8866  inline bool IsQuarterSizeExpandModeEnabled (void) const {return acVideoQuarterSizeExpand == NTV2_QuarterSizeExpandOn;}
8867 
8872  inline const AUTOCIRCULATE_TRANSFER_STATUS & GetTransferStatus (void) const {return acTransferStatus;}
8873 
8878  inline const FRAME_STAMP & GetFrameInfo (void) const {return acTransferStatus.acFrameStamp;}
8879 
8884  inline ULWord GetCapturedAudioByteCount (void) const {return acTransferStatus.GetCapturedAudioByteCount();}
8885 
8886  inline NTV2_DEPRECATED_f(ULWord GetAudioByteCount (void) const) {return GetCapturedAudioByteCount ();}
8887 
8894  inline ULWord GetCapturedAncByteCount (const bool inField2 = false) const {return acTransferStatus.GetCapturedAncByteCount(inField2);}
8895  inline NTV2_SHOULD_BE_DEPRECATED(ULWord GetAncByteCount (const bool inField2 = false) const) {return GetCapturedAncByteCount(inField2);}
8896 
8900  inline NTV2FrameBufferFormat GetFrameBufferFormat (void) const {return acFrameBufferFormat;}
8901 
8905  inline LWord GetTransferFrameNumber (void) const {return acTransferStatus.GetTransferFrame();}
8907 
8911 
8925  bool EnableSegmentedDMAs (const ULWord inNumSegments, const ULWord inNumActiveBytesPerLine,
8926  const ULWord inHostBytesPerLine, const ULWord inDeviceBytesPerLine);
8931  bool DisableSegmentedDMAs (void);
8932 
8936  bool SegmentedDMAsEnabled (void) const;
8938 
8942  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
8943 
8945  NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer)
8946  #endif // user-space clients only
8948 
8949 
8950 
8955  NTV2_HEADER mHeader;
8956  NTV2Buffer mSharedMemory;
8957  // and its length. The AJADebug logging facility owns and manages this memory.
8958  // If NULL or zero length, debug logging will be disabled in the driver.
8959  // If non-NULL and zero length, debug logging will be enabled in the driver.
8960  ULWord mReserved[32];
8961  NTV2_TRAILER mTrailer;
8962 
8963  #if !defined (NTV2_BUILDING_DRIVER)
8964 
8968  explicit NTV2DebugLogging (const bool inEnable = false);
8969 
8975  std::ostream & Print (std::ostream & inOutStream) const;
8976 
8977  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
8978 
8979  #endif // !defined (NTV2_BUILDING_DRIVER)
8981 
8982 
8983 
8991  NTV2_HEADER mHeader;
8992  NTV2Buffer mBuffer;
8993  // A NULL buffer (or zero length) releases all locked buffers.
8994  ULWord mFlags;
8995  ULWord64 mMaxLockSize;
8996  ULWord mReserved[30];
8997  NTV2_TRAILER mTrailer;
8998 
8999  #if !defined (NTV2_BUILDING_DRIVER)
9000 
9003  explicit NTV2BufferLock ();
9005  inline ~NTV2BufferLock () {}
9006 
9012  explicit NTV2BufferLock (const NTV2Buffer & inBuffer, const ULWord inFlags);
9013 
9020  explicit NTV2BufferLock (const ULWord * pInBuffer, const ULWord inByteCount, const ULWord inFlags);
9021 
9027  explicit NTV2BufferLock (const ULWord64 inMaxLockSize, const ULWord inFlags); // New in SDK 16.0
9029 
9033 
9039  bool SetBuffer (const NTV2Buffer & inBuffer);
9040 
9047  inline bool SetBuffer (const ULWord * pInBuffer, const ULWord inByteCount)
9048  {
9049  return SetBuffer(NTV2Buffer(pInBuffer, inByteCount));
9050  }
9051 
9056  inline void SetFlags (const ULWord inFlags) {NTV2_ASSERT_STRUCT_VALID; mFlags = inFlags;}
9057 
9062  inline void SetMaxLockSize (const ULWord64 inNumBytes) {NTV2_ASSERT_STRUCT_VALID; mMaxLockSize = inNumBytes;} // New in SDK 16.0
9063 
9068  inline void Clear (void)
9069  {
9070  SetBuffer(NTV2Buffer());
9071  SetFlags(0);
9072  SetMaxLockSize(0);
9073  }
9075 
9081  std::ostream & Print (std::ostream & inOutStream) const;
9082 
9083  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
9084 
9085  #endif // !defined (NTV2_BUILDING_DRIVER)
9087 
9088 
9089 
9095  NTV2_HEADER mHeader;
9096  NTV2Buffer mBuffer;
9097  ULWord mFlags;
9098  ULWord mStatus;
9099  ULWord mRegisters[16];
9100  ULWord mReserved[32];
9101  NTV2_TRAILER mTrailer;
9102 
9103  #if !defined (NTV2_BUILDING_DRIVER)
9104 
9107  explicit NTV2Bitstream ();
9109  inline ~NTV2Bitstream () {}
9110 
9116  explicit NTV2Bitstream (const NTV2Buffer & inBuffer, const ULWord inFlags);
9117 
9124  explicit NTV2Bitstream (const ULWord * pInBuffer, const ULWord inByteCount, const ULWord inFlags);
9126 
9130 
9136  bool SetBuffer (const NTV2Buffer & inBuffer);
9137 
9144  inline bool SetBuffer (const ULWord * pInBuffer, const ULWord inByteCount) {return SetBuffer(NTV2Buffer(pInBuffer, inByteCount));}
9145 
9150  inline void SetFlags (const ULWord inFlags) {NTV2_ASSERT_STRUCT_VALID; mFlags = inFlags;}
9151 
9155  inline void Clear (void) {SetBuffer(NTV2Buffer());}
9157 
9163  std::ostream & Print (std::ostream & inOutStream) const;
9164 
9168  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
9169 
9171  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
9172 
9173  #endif // !defined (NTV2_BUILDING_DRIVER)
9175 
9176 
9177  // Stream channel action flags
9178  #define NTV2_STREAM_CHANNEL_INITIALIZE BIT(0)
9179  #define NTV2_STREAM_CHANNEL_RELEASE BIT(1)
9180  #define NTV2_STREAM_CHANNEL_START BIT(2)
9181  #define NTV2_STREAM_CHANNEL_STOP BIT(3)
9182  #define NTV2_STREAM_CHANNEL_FLUSH BIT(4)
9183  #define NTV2_STREAM_CHANNEL_STATUS BIT(5)
9184  #define NTV2_STREAM_CHANNEL_WAIT BIT(6)
9185 
9186  // Stream channel state flags
9187  #define NTV2_STREAM_CHANNEL_STATE_DISABLED BIT(0)
9188  #define NTV2_STREAM_CHANNEL_STATE_INITIALIZED BIT(1)
9189  #define NTV2_STREAM_CHANNEL_STATE_RELEASED BIT(2)
9190  #define NTV2_STREAM_CHANNEL_STATE_IDLE BIT(3)
9191  #define NTV2_STREAM_CHANNEL_STATE_ACTIVE BIT(4)
9192  #define NTV2_STREAM_CHANNEL_STATE_ERROR BIT(5)
9193 
9194  // Stream buffer action flags
9195  #define NTV2_STREAM_BUFFER_QUEUE BIT(1)
9196  #define NTV2_STREAM_BUFFER_RELEASE BIT(2)
9197  #define NTV2_STREAM_BUFFER_STATUS BIT(3)
9198 
9199  // Stream buffer state flags
9200  #define NTV2_STREAM_BUFFER_STATE_QUEUED BIT(0)
9201  #define NTV2_STREAM_BUFFER_STATE_LINKED BIT(1)
9202  #define NTV2_STREAM_BUFFER_STATE_COMPLETED BIT(2)
9203  #define NTV2_STREAM_BUFFER_STATE_FLUSHED BIT(3)
9204  #define NTV2_STREAM_BUFFER_STATE_RELEASED BIT(4)
9205  #define NTV2_STREAM_BUFFER_STATE_ERROR BIT(5)
9206 
9207  // Stream action status flags
9208  #define NTV2_STREAM_STATUS_SUCCESS BIT(0)
9209  #define NTV2_STREAM_STATUS_FAIL BIT(1)
9210  #define NTV2_STREAM_STATUS_STATE BIT(2)
9211  #define NTV2_STREAM_STATUS_MESSAGE BIT(3)
9212  #define NTV2_STREAM_STATUS_INVALID BIT(4)
9213  #define NTV2_STREAM_STATUS_TIMEOUT BIT(5)
9214  #define NTV2_STREAM_STATUS_RESOURCE BIT(6)
9215  #define NTV2_STREAM_STATUS_OWNER BIT(7)
9216 
9218  NTV2_HEADER mHeader;
9219  NTV2Channel mChannel;
9220  ULWord mFlags;
9221  ULWord mStatus;
9222  ULWord mStreamState;
9223  ULWord64 mBufferCookie;
9224  LWord64 mStartTime;
9225  LWord64 mStopTime;
9226  ULWord64 mQueueCount;
9227  ULWord64 mReleaseCount;
9228  ULWord64 mActiveCount;
9229  ULWord64 mRepeatCount;
9230  ULWord64 mIdleCount;
9231  ULWord mReserved[32];
9232  NTV2_TRAILER mTrailer;
9233 
9234  #if !defined (NTV2_BUILDING_DRIVER)
9235 
9238  explicit NTV2StreamChannel ();
9240  inline ~NTV2StreamChannel () {}
9241 
9243  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
9244 
9249  inline ULWord GetQueueDepth (void) {return (ULWord)(mQueueCount - mReleaseCount);}
9250 
9255  inline bool IsIdle (void) {return ((mStreamState & NTV2_STREAM_CHANNEL_STATE_IDLE) != 0);}
9256 
9261  inline bool IsActive (void) {return ((mStreamState & NTV2_STREAM_CHANNEL_STATE_ACTIVE) != 0);}
9262 
9267  inline bool HasError (void) {return ((mStreamState & NTV2_STREAM_CHANNEL_STATE_ERROR) != 0);}
9268 
9269  std::ostream & Print (std::ostream & inOutStream) const;
9270 
9271  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
9272 
9273  #endif // !defined (NTV2_BUILDING_DRIVER)
9274 
9276 
9278  NTV2_HEADER mHeader;
9279  NTV2Channel mChannel;
9280  ULWord mFlags;
9281  ULWord mStatus;
9282  NTV2Buffer mBuffer;
9283  ULWord mSegmentSize;
9284  LWord mSegmentPitch;
9285  ULWord mNumSegments;
9286  ULWord64 mBufferCookie;
9287  ULWord mBufferState;
9288  LWord64 mQueueTime;
9289  LWord64 mActiveTime;
9290  LWord64 mCompleteTime;
9291  LWord64 mFlushTime;
9292  ULWord64 mTransferCount;
9293  ULWord mReserved[32];
9294  NTV2_TRAILER mTrailer;
9295 
9296  #if !defined (NTV2_BUILDING_DRIVER)
9297 
9300  explicit NTV2StreamBuffer ();
9302  inline ~NTV2StreamBuffer () {}
9303 
9305  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
9306 
9307  std::ostream & Print (std::ostream & inOutStream) const;
9308 
9309  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
9310 
9311  #endif // !defined (NTV2_BUILDING_DRIVER)
9312 
9314 
9315  // Mail buffer action flags
9316  #define NTV2_MAIL_BUFFER_SEND BIT(0)
9317  #define NTV2_MAIL_BUFFER_RECEIVE BIT(1)
9318 
9319  // Mail buffer status flags
9320  #define NTV2_MAIL_BUFFER_SUCCESS BIT(0)
9321  #define NTV2_MAIL_BUFFER_FAIL BIT(1)
9322  #define NTV2_MAIL_BUFFER_OVERFLOW BIT(2)
9323  #define NTV2_MAIL_BUFFER_TIMEOUT BIT(3)
9324  #define NTV2_MAIL_BUFFER_TRYAGAIN BIT(4)
9325 
9326  // Mail buffer maximum size
9327  #define NTV2_MAIL_BUFFER_MAX 4096
9328 
9330  NTV2_HEADER mHeader;
9331  NTV2Channel mChannel;
9332  NTV2Buffer mBuffer;
9333  ULWord mDataSize;
9334  ULWord mFlags;
9335  ULWord mDelay;
9336  ULWord mTimeout;
9337  ULWord mStatus;
9338  ULWord mReserved[32];
9339  NTV2_TRAILER mTrailer;
9340 
9341  #if !defined (NTV2_BUILDING_DRIVER)
9342 
9345  explicit NTV2MailBuffer ();
9347  inline ~NTV2MailBuffer () {}
9348 
9350  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
9351 
9352  std::ostream & Print (std::ostream & inOutStream) const;
9353 
9354  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
9355 
9356  #endif // !defined (NTV2_BUILDING_DRIVER)
9357 
9359 
9360  #if !defined (NTV2_BUILDING_DRIVER)
9361  typedef std::set <NTV2VideoFormat> NTV2VideoFormatSet;
9362  typedef NTV2VideoFormatSet::const_iterator NTV2VideoFormatSetConstIter;
9363 
9364  typedef std::set <NTV2FrameBufferFormat> NTV2FrameBufferFormatSet;
9365  typedef NTV2FrameBufferFormatSet::const_iterator NTV2FrameBufferFormatSetConstIter;
9366  typedef NTV2FrameBufferFormatSet NTV2PixelFormats; // New in SDK 17.0
9368 
9369  typedef std::set <NTV2FrameGeometry> NTV2GeometrySet;
9370  typedef NTV2GeometrySet::const_iterator NTV2GeometrySetConstIter;
9371 
9372  typedef std::set <NTV2Standard> NTV2StandardSet;
9373  typedef NTV2StandardSet::const_iterator NTV2StandardSetConstIter;
9374 
9375  typedef std::set <NTV2InputSource> NTV2InputSourceSet;
9376  typedef NTV2InputSourceSet::const_iterator NTV2InputSourceSetConstIter;
9377 
9378  typedef std::set <NTV2OutputDestination> NTV2OutputDestinations;
9379  typedef NTV2OutputDestinations::const_iterator NTV2OutputDestinationsConstIter;
9380 
9381  typedef std::set <NTV2FrameRate> NTV2FrameRateSet;
9382  typedef NTV2FrameRateSet::const_iterator NTV2FrameRateSetConstIter;
9383 
9384  typedef std::set <NTV2AudioRate> NTV2AudioRateSet;
9385  typedef NTV2AudioRateSet::const_iterator NTV2AudioRateSetConstIter;
9386 
9393  AJAExport std::ostream & operator << (std::ostream & inOutStream, const UWordSequence & inData);
9394 
9401  AJAExport std::ostream & operator << (std::ostream & inOutStream, const ULWordSequence & inData);
9402 
9409  AJAExport std::ostream & operator << (std::ostream & inOutStream, const ULWord64Sequence & inData);
9410 
9416 
9425  AJAExport bool NTV2DeviceGetSupportedVideoFormats (const NTV2DeviceID inDeviceID, NTV2VideoFormatSet & outFormats);
9426 
9434 
9441  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2VideoFormatSet & inFormats);
9442 
9450  AJAExport bool NTV2DeviceGetSupportedPixelFormats (const NTV2DeviceID inDeviceID, NTV2PixelFormats & outFormats);
9451 
9457  AJAExport bool NTV2GetSupportedPixelFormats (NTV2PixelFormats & outFormats); // New in SDK 17.0
9458 
9464  AJAExport bool NTV2GetUnsupportedPixelFormats (NTV2PixelFormats & outFormats); // New in SDK 17.0
9465 
9471  AJAExport bool NTV2GetSupportedStandards (NTV2StandardSet & outStandards); // New in SDK 17.0
9472 
9478  AJAExport bool NTV2GetUnsupportedStandards (NTV2StandardSet & outStandards); // New in SDK 17.0
9479 
9486  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2PixelFormats & inFormats);
9487 
9495 
9503  AJAExport bool NTV2DeviceGetSupportedStandards (const NTV2DeviceID inDeviceID, NTV2StandardSet & outStandards);
9504 
9511  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2StandardSet & inStandards);
9512 
9520 
9528  AJAExport bool NTV2DeviceGetSupportedGeometries (const NTV2DeviceID inDeviceID, NTV2GeometrySet & outGeometries);
9529 
9536  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2GeometrySet & inGeometries);
9537 
9545 
9552  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2InputSourceSet & inSet);
9553 
9561 
9571  AJAExport bool NTV2DeviceGetSupportedInputSources (const NTV2DeviceID inDeviceID, NTV2InputSourceSet & outInputSources, const NTV2IOKinds inKinds = NTV2_IOKINDS_ALL); // New in SDK 16.3
9572 
9579  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2OutputDestinations & inSet); // New in SDK 16.0
9580 
9587  AJAExport NTV2OutputDestinations & operator += (NTV2OutputDestinations & inOutSet, const NTV2OutputDestinations & inSet); // New in SDK 16.0
9588 
9598  AJAExport bool NTV2DeviceGetSupportedOutputDests (const NTV2DeviceID inDeviceID, NTV2OutputDestinations & outOutputDests, const NTV2IOKinds inKinds = NTV2_IOKINDS_ALL); // New in SDK 16.3
9599 
9606  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2FrameRateSet & inSet); // New in SDK 17.0
9607 
9614  AJAExport NTV2FrameRateSet & operator += (NTV2FrameRateSet & inOutSet, const NTV2FrameRateSet & inSet); // New in SDK 17.0
9615 
9624  AJAExport bool NTV2DeviceGetSupportedFrameRates (const NTV2DeviceID inDeviceID, NTV2FrameRateSet & outRates); // New in SDK 17.0
9625 
9626 
9633  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2_HEADER & inObj);
9634 
9641  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2_TRAILER & inObj);
9642 
9649  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2Buffer & inObj);
9650 
9657  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2_RP188 & inObj);
9658 
9665  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2TimeCodeList & inObj);
9666 
9673  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2TimeCodes & inObj);
9674 
9681  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2TCIndexes & inObj);
9682 
9689  AJAExport NTV2TCIndexes & operator += (NTV2TCIndexes & inOutSet, const NTV2TCIndexes & inSet);
9690 
9697  AJAExport std::ostream & operator << (std::ostream & inOutStream, const FRAME_STAMP & inObj);
9698 
9705  AJAExport std::ostream & operator << (std::ostream & inOutStream, const AUTOCIRCULATE_STATUS & inObj);
9706 
9713  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2SegmentedDMAInfo & inObj);
9714 
9721  AJAExport std::ostream & operator << (std::ostream & inOutStream, const AUTOCIRCULATE_TRANSFER & inObj);
9722 
9729  AJAExport std::ostream & operator << (std::ostream & inOutStream, const FRAME_STAMP & inObj);
9730 
9737  AJAExport std::ostream & operator << (std::ostream & inOutStream, const AUTOCIRCULATE_TRANSFER_STATUS & inObj);
9738 
9745  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2RegisterNumberSet & inObj);
9746 
9753  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2RegisterValueMap & inObj);
9754 
9761  AJAExport std::ostream & operator << (std::ostream & inOutStream, const AutoCircVidProcInfo & inObj);
9762 
9769  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2ColorCorrectionData & inObj);
9770 
9777  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2GetRegisters & inObj) {return inObj.Print (inOutStream);}
9778 
9785  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2SetRegisters & inObj) {return inObj.Print (inOutStream);}
9786 
9793  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2BankSelGetSetRegs & inObj) {return inObj.Print (inOutStream);}
9794 
9801  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2SDIInStatistics & inObj) {return inObj.Print (inOutStream);}
9802 
9809  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2SDIInputStatus & inObj) {return inObj.Print (inOutStream);}
9810 
9817  AJAExport std::ostream & operator << (std::ostream & inOutStrm, const NTV2SegmentedXferInfo & inXferInfo);
9818 
9825  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2DebugLogging & inObj) {return inObj.Print (inOutStream);}
9826 
9833  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2BufferLock & inObj) {return inObj.Print (inOutStream);}
9834  #endif // !defined (NTV2_BUILDING_DRIVER)
9835 
9836  #if defined (AJAMac)
9837  #pragma pack (pop)
9838  #endif // defined (AJAMac)
9839 
9841 #if !defined(NTV2_DEPRECATE_17_6)
9842 
9844  // maximum number of hevc streams
9845  #define HEVC_STREAM_MAX 4
9846 
9847  // maximum number of gpio ports
9848  #define HEVC_GPIO_MAX 64
9849 
9850  // version string maximum size (bytes)
9851  #define HEVC_VERSION_STRING_SIZE 64
9852 
9853  // picture and encoded information additional data size (bytes)
9854  #define HEVC_ADDITIONAL_DATA_SIZE ((4 + 4 + 256) * 16)
9855 
9856  // codec state flags
9857  #define HEVC_STATE_FLAG_VIDEO_STARTED 0x00000001U // codec video input capture started
9858 
9859  // transfer flags
9860  #define HEVC_TRANSFER_FLAG_IS_LAST_FRAME 0x00000001U // last stream frame
9861 
9862  // driver io status codes
9863  #define HEVC_STATUS_SUCCESS 0x00000001U
9864 
9865  // fatal error registers
9866  #define HEVC_FATAL_ERROR_INFO_REG 0x08000100U // codec error register base
9867  #define HEVC_FATAL_ERROR_INFO_COUNT 64 // number of codec error registers
9868 
9869  // driver debug register output enable bits
9870  #define HEVC_DEBUG_DRIVER_REGISTER 0x080000FCU // register address of debug bits
9871  #define HEVC_DEBUG_MASK_INFO 0x00000001 // general probe and cleanup
9872  #define HEVC_DEBUG_MASK_WARNING 0x00000002 // general warinings
9873  #define HEVC_DEBUG_MASK_ERROR 0x00000004 // general erros
9874  #define HEVC_DEBUG_MASK_INT_PRIMARY 0x00000008 // primary interrupt info
9875  #define HEVC_DEBUG_MASK_INT_COMMAND 0x00000010 // command tasklet info
9876  #define HEVC_DEBUG_MASK_INT_VEI 0x00000020 // raw stream tasklet info
9877  #define HEVC_DEBUG_MASK_INT_SEO 0x00000040 // encoded stream tasklet info
9878  #define HEVC_DEBUG_MASK_INT_ERROR 0x00000080 // interrupt errors
9879  #define HEVC_DEBUG_MASK_REGISTER_INFO 0x00000100 // register read/write info
9880  #define HEVC_DEBUG_MASK_REGISTER_STATE 0x00000200 // detailed register access info
9881  #define HEVC_DEBUG_MASK_REGISTER_ERROR 0x00000400 // register access errors
9882  #define HEVC_DEBUG_MASK_COMMAND_INFO 0x00000800 // command queue info
9883  #define HEVC_DEBUG_MASK_COMMAND_STATE 0x00001000 // detailed command processing info
9884  #define HEVC_DEBUG_MASK_COMMAND_ERROR 0x00002000 // command queue errors
9885  #define HEVC_DEBUG_MASK_STREAM_INFO 0x00004000 // stream (dma) queue info
9886  #define HEVC_DEBUG_MASK_STREAM_STATE 0x00008000 // detailed stream processing info
9887  #define HEVC_DEBUG_MASK_STREAM_COPY 0x00010000 // stream data copy info
9888  #define HEVC_DEBUG_MASK_STREAM_SEGMENT 0x00020000 // stream data segment info
9889  #define HEVC_DEBUG_MASK_STREAM_FRAME 0x00040000 // stream vif frame info
9890  #define HEVC_DEBUG_MASK_STREAM_ERROR 0x00080000 // stream queue errors
9891  #define HEVC_DEBUG_MASK_MEMORY_ALLOC 0x00100000 // buffer memory allocation info
9892  #define HEVC_DEBUG_MASK_MEMORY_ERROR 0x00200000 // buffer memory allocation errors
9893  #define HEVC_DEBUG_MASK_DMA_INFO 0x00400000 // dma send info
9894  #define HEVC_DEBUG_MASK_DMA_DESCRIPTOR 0x00800000 // dma descriptor dump
9895  #define HEVC_DEBUG_MASK_DMA_ERROR 0x01000000 // dma errors
9896  #define HEVC_DEBUG_MASK_STATUS_INFO 0x02000000 // status info requests
9897  #define HEVC_DEBUG_MASK_RESERVED_0 0x04000000
9898  #define HEVC_DEBUG_MASK_RESERVED_1 0x08000000
9899  #define HEVC_DEBUG_MASK_RESERVED_2 0x10000000
9900  #define HEVC_DEBUG_MASK_RESERVED_3 0x20000000
9901  #define HEVC_DEBUG_MASK_RESERVED_4 0x40000000
9902  #define HEVC_DEBUG_MASK_RESERVED_5 0x80000000
9903 
9904  // ntv2 gpio input registers
9905  #define HEVC_NTV2_GPIO_REGISTER_LOW 510
9906  #define HEVC_NTV2_GPIO_REGISTER_HIGH 511
9907 
9908 
9909  // hevc version information
9910  typedef struct HevcVersion
9911  {
9916  } HevcVersion;
9917 
9918  // pci id information
9919  typedef struct HevcPciId
9920  {
9925  } HevcPciId;
9926 
9927  // hevc device mode
9928  typedef enum HevcDeviceMode
9929  {
9931  Hevc_DeviceMode_Codec, // codec mode
9932  Hevc_DeviceMode_Maintenance, // maintenance mode
9934  } HevcDeviceMode;
9935 
9936  // hevc device information message
9937  typedef struct HevcDeviceInfo
9938  {
9939  HevcVersion driverVersion; // driver version
9940  HevcVersion mcpuVersion; // firmware versions
9946  HevcPciId pciId; // pci ids
9947  HevcDeviceMode deviceMode; // hardware device mode
9948  bool mcpuVersionCheck; // mcpu version supported
9949  bool systemVersionCheck; // system version supported
9950  bool standardSingleCheck; // standard firmware single version supported
9951  bool standardMultipleCheck; // standard fimwrare multiple version supported
9952  bool pciIdCheck; // pci id supported
9953  } HevcDeviceInfo;
9954 
9955  // hevc register
9956  typedef struct HevcDeviceRegister
9957  {
9958  ULWord address; // register address
9959  ULWord writeValue; // register write value
9960  ULWord readValue; // register read value
9961  ULWord mask; // register value mask
9962  ULWord shift; // register value shift
9963  bool write; // write flag
9964  bool read; // read flag
9965  bool forceBar4; // force bar4 access
9967 
9968  // hevc main state
9969  typedef enum HevcMainState
9970  {
9972  Hevc_MainState_Boot, // codec has booted
9973  Hevc_MainState_Init, // initialize codec
9974  Hevc_MainState_Encode, // configure encoding (load firmware?)
9975  Hevc_MainState_Error, // codec must be reset
9977  } HevcMainState;
9978 
9979  // encoder mode
9980  typedef enum HevcEncodeMode
9981  {
9983  Hevc_EncodeMode_Single, // encode a sigle stream
9984  Hevc_EncodeMode_Multiple, // encode multiple streams
9986  } HevcEncodeMode;
9987 
9988  // encoder firmware type
9989  typedef enum HevcFirmwareType
9990  {
9992  Hevc_FirmwareType_Standard, // encode firmware standard
9993  Hevc_FirmwareType_User, // encode firmware user
9995  } HevcFirmwareType;
9996 
9997  // hevc video interface state
9998  typedef enum HevcVifState
9999  {
10001  Hevc_VifState_Stop, // video interface stop
10002  Hevc_VifState_Start, // video interface start
10004  } HevcVifState;
10005 
10006  // hevc video input state
10007  typedef enum HevcVinState
10008  {
10010  Hevc_VinState_Stop, // video input stop
10011  Hevc_VinState_Start, // video input start
10013  } HevcVinState;
10014 
10015  // hevc encoder state
10016  typedef enum HevcEhState
10017  {
10019  Hevc_EhState_Stop, // encoder stop
10020  Hevc_EhState_Start, // encoder start
10021  Hevc_EhState_ReadyToStop, // encoder ready to stop
10023  } HevcEhState;
10024 
10025  // hevc gpio control
10026  typedef enum HevcGpioControl
10027  {
10029  Hevc_GpioControl_Function, // configure gpio port function
10030  Hevc_GpioControl_Direction, // configure gpio port direction
10031  Hevc_GpioControl_Set, // set gpio port value
10032  Hevc_GpioControl_Get, // get pgio port value
10034  } HevcGpioControl;
10035 
10036  // hevc gpio function
10037  typedef enum HevcGpioFunction
10038  {
10040  Hevc_GpioFunction_Gpio, // gpio function is gpio
10041  Hevc_GpioFunction_Peripheral, // gpio function is peripheral
10043  } HevcGpioFunction;
10044 
10045  // hevc gpio direction
10046  typedef enum HevcGpioDirection
10047  {
10049  Hevc_GpioDirection_Input, // gpio direction is input
10050  Hevc_GpioDirection_Output, // gpio direction is output
10053 
10054  // hevc gpio value
10055  typedef enum HevcGpioValue
10056  {
10058  Hevc_GpioValue_Low, // gpio direction is input
10059  Hevc_GpioValue_High, // gpio direction is output
10061  } HevcGpioValue;
10062 
10063  typedef enum HevcChangeSequence
10064  {
10070 
10071  // hevc change param target
10072  #define Hevc_ParamTarget_None 0x00000000
10073  #define Hevc_ParamTarget_Vbr 0x00000001 // change variable bitrate
10074  #define Hevc_ParamTarget_Cbr 0x00000002 // change constant bitrate
10075  #define Hevc_ParamTarget_Resolution 0x00000004 // change size, crop, pan, etc.
10076  #define Hevc_ParamTarget_Frame_Rate 0x00000008 // change frame rate
10077  #define Hevc_ParamTarget_All 0x0000000f
10078 
10079  // hevc commands
10080  typedef enum HevcCommand
10081  {
10083  Hevc_Command_MainState, // set main state
10084  Hevc_Command_VinState, // set video input state
10085  Hevc_Command_EhState, // set encoder state
10086  Hevc_Command_Gpio, // control gpio
10087  Hevc_Command_Reset, // reset codec
10088  Hevc_Command_ChangeParam, // change dynamic params during encode
10089  Hevc_Command_ChangePicture, // change picture type
10091  } HevcCommand;
10092 
10093  // hevc command information
10094  typedef struct HevcDeviceCommand
10095  {
10096  HevcCommand command; // command type
10097  // main state command info
10098  HevcMainState mainState; // set main state
10099  HevcEncodeMode encodeMode; // set encoder mode
10100  HevcFirmwareType firmwareType; // set encode firmware type
10101  // vin/eh state command info
10102  HevcVinState vinState; // set video input state
10103  HevcEhState ehState; // set encoder state
10104  ULWord streamBits; // command applies to each stream bit
10105  // gpio command info
10106  HevcGpioControl gpioControl; // gpio control type
10107  ULWord gpioNumber; // gpio port number (function, direction, set, get)
10108  HevcGpioFunction gpioFunction; // gpio port function (function)
10109  HevcGpioDirection gpioDirection; // gpio port direction (direction)
10110  HevcGpioValue gpioValue; // gpio port value (set, get)
10111  // change encode params
10112  ULWord paramTarget; // parameters to change
10113  ULWord paramStreamId; // stream id
10114  HevcChangeSequence changeSequence; // start new sequence (vbr)
10115  ULWord maxBitRate; // maximum bitrate (vbr)
10116  ULWord aveBitRate; // average bitrate (vbr and cbr)
10117  ULWord minBitRate; // minimum bitrate (vbr)
10118  ULWord seqEndPicNumber; // last picture number of sequence (resolution and frame rate)
10119  ULWord hSizeEh; // resolution parameters
10139  ULWord frameRateCode; // frame rate parameter
10140  // change picture type
10141  ULWord picType; // picture type
10142  ULWord picStreamId; // stream id
10143  ULWord gopEndPicNumber; // last picture number of gop
10144  // general command flags
10145  ULWord flags; // command flags
10147 
10148  // hevc stream types
10149  typedef enum HevcStream
10150  {
10152  Hevc_Stream_VideoRaw, // raw data stream
10153  Hevc_Stream_VideoEnc, // encoded data stream
10155  } HevcStream;
10156 
10157  // hevc picture data (raw streams)
10158  typedef struct HevcPictureData
10159  {
10160  ULWord serialNumber; // serial number (application data)
10161  ULWord ptsValueLow; // presentation time stamp (90kHz)
10162  ULWord ptsValueHigh; // pts high bit only (33 bit roll over)
10163  ULWord pictureNumber; // start with 1 and increment for each picture
10164  ULWord numAdditionalData; // number of additional data entries
10165  } HevcPictureData;
10166 
10167  // hevc picture information (raw streams)
10168  typedef struct HevcPictureInfo
10169  {
10170  HevcPictureData pictureData; // raw stream picture data
10171  //
10172  // additional data format
10173  // u32 additional_data_type
10174  // u32 additional_data_size (256 bytes max)
10175  // u8... additional_data_payload
10176  // ... more additional data
10177  //
10178  // additional data types
10179  // 1 = sei data
10180  // 2 = passthrough data (to encoded additional data of encoded frame)
10181  // 4 = cancel sei on every gop (set additional size to 0)
10182  //
10183  // sei data format
10184  // u8 user_sei_location
10185  // u8 user_sei_type
10186  // u8 user_sei_length
10187  // u8... user_sei_payload
10188  //
10189  // user sei location
10190  // 2 = every gop head picture
10191  // 3 = this picture only
10192  //
10193  // passthrough data format
10194  // u8... passthrough_data_payload
10195  //
10197  } HevcPictureInfo;
10198 
10199  // hevc encoded stream data (encoded streams)
10200  typedef struct HevcEncodedData
10201  {
10202  ULWord serialNumber; // serial number (from picture information)
10203  ULWord esOffsetLow; // encoded stream frame location (?)
10204  ULWord esOffsetHigh; // es frame location high 32 bits
10205  ULWord esSize; // encoded stream frame size (?)
10206  ULWord ptsValueLow; // presentation time stamp (picture information)
10207  ULWord ptsValueHigh; // pts high bit (33 bit roll over)
10208  ULWord dtsValueLow; // decoding time stamp (90 kHz)
10209  ULWord dtsValueHigh; // dts high bit (33 bit roll over)
10210  ULWord itcValueLow; // internal time clock (90 kHz)
10211  ULWord itcValueHigh; // itc high bit (33 bit roll over)
10212  ULWord itcExtension; // internal time extension (27 MHz)
10213  ULWord temporalId; // temporal ID
10214  ULWord esIdrType; // 0 = not IDR, 1 = IDR, 3 = IDR command
10215  ULWord pictureType; // 0 = I-frame, 1 = P-frame, 2 = B-frame
10216  ULWord nalOffset; // offset to the nal top of the idr/i picture
10217  ULWord cpbValue; // codec picture buffer occupancy value
10218  ULWord esHSize; // horizontal resolution
10219  ULWord esVSize; // vertical resolution
10220  ULWord esUnitsInTick; // frame duration (2x eh param value for half rate)
10221  ULWord esBitRate; // bit rate (Kbps)
10222  ULWord esEndFlag; // 0 = not end of sequence, 1 = end of sequence
10223  ULWord esLastFrame; // 0xffffffff = last frame
10232  ULWord numAdditionalData; // number of additional data entries
10233  } HevcEncodedData;
10234 
10235  // hevc encode stream information (encoded streams)
10236  typedef struct HevcEncodedInfo
10237  {
10238  HevcEncodedData encodedData; // encoded stream data
10240  } HevcEncodedInfo;
10241 
10242  // hevc stream transfer information
10243  typedef struct HevcDeviceTransfer
10244  {
10245  HevcStream streamType; // transfer stream type
10246  ULWord streamId; // transfer stream id
10247 
10248  UByte* pVideoBuffer; // video buffer
10249  ULWord videoBufferSize; // total video buffer size
10250  ULWord videoDataSize; // video data size in buffer
10251 
10252  ULWord segVideoPitch; // video segment pitch
10253  ULWord segCodecPitch; // codec segment pitch
10254  ULWord segSize; // segment size
10255  ULWord segCount; // number of segments
10256 
10257  UByte* pInfoBuffer; // information buffer (picture or encoded)
10258  ULWord infoBufferSize; // total information buffer size
10259  ULWord infoDataSize; // information size in buffer
10260 
10261  LWord64 encodeTime; // frame encode time (100ns host system clock)
10262  ULWord flags; // transfer flags (see above for last frame flag)
10264 
10265  // hevc gpio port status
10266  typedef struct hevc_gpio_state
10267  {
10268  HevcGpioFunction function; // gpio last set port function
10269  HevcGpioDirection direction; // gpio last set port direction
10270  HevcGpioValue setValue; // gpio last set value
10271  HevcGpioValue getValue; // gpio last get value
10272  } HevcGpioState;
10273 
10274  // hevc stream statistics (nsec, bytes)
10275  typedef struct hevc_stream_statistics
10276  {
10277  LWord64 transferCount; // number of transfers queued
10278  LWord64 minTransferTime; // minimum time between transfers
10279  LWord64 avrTransferTime; // average time between transfers
10280  LWord64 maxTransferTime; // maximum time between transfers
10281  LWord64 minTransferSize; // minimum transfer size
10282  LWord64 maxTransferSize; // maximum transfer size
10283  LWord64 avrTransferSize; // average transfer size
10284  LWord64 minCopyDuration; // time for io thread to copy frames
10285  LWord64 maxCopyDuration; // to/from bounce buffer
10287  LWord64 minEnqueueDuration; // time from io thread enqueue
10288  LWord64 maxEnqueueDuration; // to send to codec
10290  LWord64 minSendDuration; // time from send to codec
10291  LWord64 maxSendDuration; // to codec acknowledge
10293  LWord64 minDmaDuration; // time from codec acknowledge
10294  LWord64 maxDmaDuration; // to codec dma completion
10296  LWord64 minDequeueDuration; // time from io thread enqueue
10297  LWord64 maxDequeueDuration; // to io thread dequeue
10300 
10301  // hevc status information
10302  typedef struct HevcDeviceStatus
10303  {
10304  HevcMainState mainState; // codec main state
10305  HevcEncodeMode encodeMode; // codec encode mode
10306  HevcFirmwareType firmwareType; // codec firmware type
10307 
10308  HevcVifState vifState[HEVC_STREAM_MAX]; // video interface state
10309  HevcVinState vinState[HEVC_STREAM_MAX]; // video input state
10312 
10313  LWord64 commandCount; // number of commands processed
10314  LWord64 rawTransferCount; // number of raw transfers processed
10315  LWord64 encTransferCount; // number of encoded transfers processed
10316 
10317  ULWord commandQueueLevel; // number of commands in command queue
10318  ULWord rawTransferQueueLevel; // number of transfers in raw transfer queue
10319  ULWord encTransferQueueLevel; // number of transfers in encoded transfer queue
10320  } HevcDeviceStatus;
10321 
10322  // hevc debug information
10323  typedef struct HevcDeviceDebug
10324  {
10325  HevcDeviceStatus deviceStatus; // device status structure
10326 
10327  HevcStreamStatistics rawStats[HEVC_STREAM_MAX]; // raw stream statistics
10328  HevcStreamStatistics encStats[HEVC_STREAM_MAX]; // encoded stream statistics
10329  ULWord queueLevel[HEVC_STREAM_MAX]; // stream queue level
10330  ULWord clearRawStatsBits; // stream bits to clear raw stream statistics
10331  ULWord clearEncStatsBits; // stream bits to clear encodec stream statistics
10332 
10333  ULWord cmdContCount; // codec command continuity count
10334  ULWord cmdAckContCount; // codec command acknowledge count
10335  ULWord cmdMsgContCount; // codec command message count
10336  ULWord rawContCount; // raw dma continuity count
10337  ULWord rawAckContCount; // raw dma acknowledge count
10338  ULWord rawMsgContCount; // raw dma message count
10339  ULWord encContCount; // encoded dma continuity count
10340  ULWord encAckContCount; // encoded dma acnowledge count
10341  ULWord encMsgContCount; // encoded dma message count
10342  } HevcDeviceDebug;
10343 
10344  // hevc driver ioctl message types
10345  typedef enum HevcMessageId
10346  {
10348  Hevc_MessageId_Info, // get device information
10349  Hevc_MessageId_Register, // write/read codec register
10350  Hevc_MessageId_Command, // send a codec command
10351  Hevc_MessageId_Transfer, // transfer codec stream data
10352  Hevc_MessageId_Status, // get codec status
10353  Hevc_MessageId_Debug, // get debug information
10355  } HevcMessageId;
10356 
10357  // hevc common driver ioctl message header
10358  typedef struct hevcMessageHeader
10359  {
10367 
10368  // hevc stream transfer data
10369  typedef struct HevcTransferData
10370  {
10385  } HevcTransferData;
10386 
10387  // hevc driver device information message
10388  typedef struct HevcMessageInfo
10389  {
10392  } HevcMessageInfo;
10393 
10394  // hevc driver register message
10395  typedef struct HevcMessageRegister
10396  {
10400 
10401  // hevc driver command message
10402  typedef struct HevcMessageCommand
10403  {
10407 
10408  // hevc driver transfer message
10409  typedef struct HevcMessageTransfer
10410  {
10414 
10415  // hevc driver status message
10416  typedef struct HevcMessageStatus
10417  {
10421 
10422  // hevc driver debug message
10423  typedef struct HevcMessageDebug
10424  {
10427  } HevcMessageDebug;
10428 #endif
10429 
10430 typedef struct HDRRegValues
10431 {
10432  uint16_t greenPrimaryX;
10433  uint16_t greenPrimaryY;
10434  uint16_t bluePrimaryX;
10435  uint16_t bluePrimaryY;
10436  uint16_t redPrimaryX;
10437  uint16_t redPrimaryY;
10438  uint16_t whitePointX;
10439  uint16_t whitePointY;
10446 
10447  #if !defined(NTV2_BUILDING_DRIVER)
10451  inline bool validPrimariesAndWhitePoint (void) const { const uint16_t kMax(0xC350);
10452  return greenPrimaryX <= kMax || greenPrimaryY <= kMax ||
10453  bluePrimaryX <= kMax || bluePrimaryY <= kMax ||
10454  redPrimaryX <= kMax || redPrimaryY <= kMax ||
10455  whitePointX <= kMax || whitePointY <= kMax; }
10456  inline HDRRegValues & setBT2020 (void) { greenPrimaryX = 0x2134; greenPrimaryY = 0x9BAA; bluePrimaryX = 0x1996; bluePrimaryY = 0x08FC;
10457  redPrimaryX = 0x8A48; redPrimaryY = 0x3908; whitePointX = 0x3D13; whitePointY = 0x4042;
10458  maxMasteringLuminance = 0x2710; minMasteringLuminance = 0x0032;
10460  electroOpticalTransferFunction = 0x02; staticMetadataDescriptorID = 0x00; return *this; }
10461  inline HDRRegValues & setDCIP3 (void) { greenPrimaryX = 0x33C2; greenPrimaryY = 0x86C4; bluePrimaryX = 0x1D4C; bluePrimaryY = 0x0BB8;
10462  redPrimaryX = 0x84D0; redPrimaryY = 0x3E80; whitePointX = 0x3D13; whitePointY = 0x4042;
10463  maxMasteringLuminance = 0x02E8; minMasteringLuminance = 0x0032;
10465  electroOpticalTransferFunction = 0x02; staticMetadataDescriptorID = 0x00; return *this; }
10466  #endif // !defined(NTV2_BUILDING_DRIVER)
10467 } HDRRegValues;
10468 
10469 typedef struct HDRFloatValues
10470 {
10485 
10486  #if !defined(NTV2_BUILDING_DRIVER)
10490 
10491  inline bool validPrimariesAndWhitePoint (void) const { return greenPrimaryX >= 0.0f || greenPrimaryX <= float(1.0f) ||
10492  greenPrimaryY >= 0.0f || greenPrimaryY <= float(1.0f) ||
10493  bluePrimaryX >= 0.0f || bluePrimaryX <= float(1.0f) ||
10494  bluePrimaryY >= 0.0f || bluePrimaryY <= float(1.0f) ||
10495  redPrimaryX >= 0.0f || redPrimaryX <= float(1.0f) ||
10496  redPrimaryY >= 0.0f || redPrimaryY <= float(1.0f) ||
10497  whitePointX >= 0.0f || whitePointX <= float(1.0f) ||
10498  whitePointY >= 0.0f || whitePointY <= float(1.0f) ||
10499  minMasteringLuminance >= 0 || minMasteringLuminance <= float(6.5535f); }
10500 
10501  inline bool setFromRegValues (const HDRRegValues & inRegValues) { if (!inRegValues.validPrimariesAndWhitePoint())
10502  return false;
10503  const float kMult(0.00002f), kMultLum(0.0001f);
10504  greenPrimaryX = float(inRegValues.greenPrimaryX * kMult);
10505  greenPrimaryY = float(inRegValues.greenPrimaryY * kMult);
10506  bluePrimaryX = float(inRegValues.bluePrimaryX * kMult);
10507  bluePrimaryY = float(inRegValues.bluePrimaryY * kMult);
10508  redPrimaryX = float(inRegValues.redPrimaryX * kMult);
10509  redPrimaryY = float(inRegValues.redPrimaryY * kMult);
10510  whitePointX = float(inRegValues.whitePointX * kMult);
10511  whitePointY = float(inRegValues.whitePointY * kMult);
10512  minMasteringLuminance = float(inRegValues.minMasteringLuminance * kMultLum);
10518  return true; }
10519 
10520  inline bool toRegValues (HDRRegValues & outVals) const { if (!validPrimariesAndWhitePoint())
10521  return false;
10522  outVals.greenPrimaryX = uint16_t(greenPrimaryX / float(0.00002f));
10523  outVals.greenPrimaryY = uint16_t(greenPrimaryY / float(0.00002f));
10524  outVals.bluePrimaryX = uint16_t(bluePrimaryX / float(0.00002f));
10525  outVals.bluePrimaryY = uint16_t(bluePrimaryY / float(0.00002f));
10526  outVals.redPrimaryX = uint16_t(redPrimaryX / float(0.00002f));
10527  outVals.redPrimaryY = uint16_t(redPrimaryY / float(0.00002f));
10528  outVals.whitePointX = uint16_t(whitePointX / float(0.00002f));
10529  outVals.whitePointY = uint16_t(whitePointY / float(0.00002f));
10530  outVals.minMasteringLuminance = uint16_t(minMasteringLuminance / float(0.0001f));
10536  return true; }
10537  #endif // !defined(NTV2_BUILDING_DRIVER)
10538 } HDRFloatValues;
10539 
10540 typedef struct HDRDriverValues{
10541  uint16_t greenPrimaryX;
10542  uint16_t greenPrimaryY;
10543  uint16_t bluePrimaryX;
10544  uint16_t bluePrimaryY;
10545  uint16_t redPrimaryX;
10546  uint16_t redPrimaryY;
10547  uint16_t whitePointX;
10548  uint16_t whitePointY;
10555  uint8_t luminance;
10557 
10558 #define NTV2_IS_VALID_HDR_PRIMARY(__val__) ((__val__) <= 0x0000C350)
10559 #define NTV2_IS_VALID_HDR_MASTERING_LUMINENCE(__val__) (true)
10560 #define NTV2_IS_VALID_HDR_LIGHT_LEVEL(__val__) (true)
10561 
10562 #if 0 && defined(_DEBUG)
10563  // One-stop-shop for pretend/fake device swap (AJA internal use only)
10564  #define NTV2_PRETEND_DEVICE
10565  #define NTV2_PRETEND_DEVICE_FROM DEVICE_ID_IOX3
10566  #define NTV2_PRETEND_DEVICE_TO DEVICE_ID_KONAHDMI
10567 #endif // _DEBUG
10568 #endif // NTV2PUBLICINTERFACE_H
NTV2LUTControlRegisters
NTV2_RP188(const ULWord inDBB=0xFFFFFFFF, const ULWord inLow=0xFFFFFFFF, const ULWord inHigh=0xFFFFFFFF)
Constructs an NTV2_RP188 from each of its DBB, low and high ULWord components.
std::set< NTV2VideoFormat > NTV2VideoFormatSet
A set of distinct NTV2VideoFormat values.
NTV2SegmentedXferInfo & setSourceDirection(const bool inTopDown)
Sets the scan direction for the source.
NTV2AutoCirculateState state
UWordSequence::iterator UWordSequenceIter
A handy non-const iterator for iterating over a UWordSequence.
NTV2VideoFrameBufferOrientation frameBufferOrientation
#define NTV2_STRUCT_END(__struct_name__)
HevcGpioControl gpioControl
ADV7189BRegisterNum
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
struct HDRDriverValues HDRDriverValues
const FRAME_STAMP & GetFrameInfo(void) const
Returns a constant reference to my FRAME_STAMP.
NTV2StandardSet::const_iterator NTV2StandardSetConstIter
A handy const iterator for iterating over an NTV2StandardSet.
ULWord GetCapturedAudioByteCount(void) const
ULWord audioInStopAddress
For record - end position (exclusive) in buffer of audio (includes base offset)
std::set< NTV2FrameBufferFormat > NTV2FrameBufferFormatSet
A set of distinct NTV2FrameBufferFormat values.
UByteSequence::iterator UByteSequenceIter
A handy non-const iterator for iterating over a UByteSequence.
struct AUTOCIRCULATE_TASK_STRUCT_64 * PAUTOCIRCULATE_TASK_STRUCT_64
struct AUTOCIRCULATE_P2P_STRUCT * PAUTOCIRCULATE_P2P_STRUCT
ULWord frame
The frame requested or -1 if not available.
#define HEVC_STREAM_MAX
NTV2HDMIOutAudioRegisters
HevcFirmwareType firmwareType
const NTV2AudioChannelsMuted16 NTV2AudioChannelsEnableAll
All 16 audio channels unmuted/enabled.
bool NTV2DeviceGetSupportedStandards(const NTV2DeviceID inDeviceID, NTV2StandardSet &outStandards)
Returns a set of distinct NTV2Standard values supported on the given device.
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
NTV2RegWrites::const_iterator NTV2RegWritesConstIter
A handy const (read-only) iterator for iterating over the contents of an NTV2RegisterWrites instance...
NTV2TCIndexes::const_iterator NTV2TCIndexSetConstIter
A handy const interator for iterating over an NTV2TCIndexes set.
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
Definition: ntv2enums.h:3901
MessageRegisterMask
std::set< NTV2TCIndex > NTV2TCIndexSet
A set of distinct NTV2TCIndex values.
NTV2OutputDestinations::const_iterator NTV2OutputDestinationsConstIter
A handy const iterator for iterating over an NTV2OutputDestinations.
struct AUTOCIRCULATE_STATUS_STRUCT AUTOCIRCULATE_STATUS_STRUCT
For devices that support it (see NTV2DeviceCanDoSDIErrorChecks ), this struct reports SDI input error...
NTV2VideoFrameBufferOrientation
Determines the order that raster lines are written into, or read out of, frame buffer memory on the d...
Definition: ntv2enums.h:2045
std::set< NTV2TCIndex > NTV2TCIndexes
The AutoCirculate channel is running.
ULWord currentAudioStartAddress
As found by isr.
std::string NTV2ChannelSetToStr(const NTV2ChannelSet &inObj, const bool inCompact=true)
bool Allocate(const size_t inByteCount, const bool inPageAligned=false)
Allocates (or re-allocates) my user-space storage using the given byte count. I assume full responsib...
struct HevcPciId HevcPciId
void SetFlags(const ULWord inFlags)
Sets the action flags for use in a subsequent call to CNTV2Card::LoadBitstream.
char standardFirmwareSingle[64]
#define NTV2_IS_STRUCT_VALID_IMPL(__hr__, __tr__)
LWord64 currentTime
Current processor time ... on Windows, this is derived from KeQueryPerformanceCounter.
uint16_t & U16(const int inIndex)
int8_t I8(const int inIndex) const
std::set< NTV2FrameRate > NTV2FrameRateSet
A set of distinct NTV2FrameRate values. New in SDK 17.0.
NTV2Crosspoint
Logically, these are an NTV2Channel combined with an NTV2Mode.
Definition: ntv2enums.h:1705
mVideoBuffer Allocate(mFormatDesc.GetTotalRasterBytes())
NTV2TaskMode NTV2EveryFrameTaskMode
ULWord GetVersion(void) const
ADV7402AHDProcAmpRegisters HD
CUSTOM_ANC_STRUCT customAncInfo
This field is obsolete. Do not use.
enum _NTV2OERegisters NTV2OERegisters
NTV2RegWritesConstIter NTV2RegReadsConstIter
A handy const (read-only) iterator for iterating over the contents of an NTV2RegisterReads instance...
std::vector< double > NTV2DoubleArray
An array of double-precision floating-point values.
struct BUILD_INFO_STRUCT * PBUILD_INFO_STRUCT
HevcMessageHeader header
NTV2HDMIColorSpace
Indicates or specifies HDMI Color Space.
Definition: ntv2enums.h:3611
ULWordSet NTV2RegisterNumberSet
A set of distinct ULWord values.
bool WithCustomAnc(void) const
bool IsNULL(void) const
ULWord audioOutStartAddress
For play - end position (exclusive) in buffer of audio.
NTV2RegInfo(const ULWord inRegNum=0, const ULWord inValue=0, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Constructs a valid NTV2RegInfo from the given optional parameters.
ULWord shift(void) const
~NTV2StreamBuffer()
My default destructor, which frees all allocatable fields that I own.
ULWord getElementLength(void) const
int16_t & I16(const int inIndex)
CUSTOM_ANC_STRUCT customAncInfo
This field is obsolete. Do not use.
NTV2RegInfo & setMask(const ULWord val)
struct hevc_stream_statistics HevcStreamStatistics
The AutoCirculate channel is starting, waiting for the first VBI and/or call to CNTV2Card::AutoCircul...
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
Definition: ntv2enums.h:223
~NTV2ConfigInterrupt()
Destructor.
#define BIT(_x_)
Definition: ajatypes.h:496
MessageRegisterShift
defined(NTV2_DEPRECATE_17_6)
NTV2ChannelSet::const_iterator NTV2ChannelSetConstIter
A handy const iterator into an NTV2ChannelSet.
NTV2TaskMode
Describes the task mode state. See also: NTV2 Device Sharing.
ULWord getTotalBytes(void) const
ULWord OptionFlags(void) const
NTV2ConfigInterrupt & doGetSubscribed(const bool includeHdls=false)
Retrieve subscribed interrupt IDs + count of them (+ optional event HANDLEs)
DefaultVideoOutMode
CCLUTV3Registers
#define NTV2_IS_VALID_TRAILER_TAG(_x_)
NTV2StringSet::const_iterator NTV2StringSetConstIter
UByte NTV2DID
An ancillary Data IDentifier.
struct HevcDeviceStatus HevcDeviceStatus
int64_t I64(const int inIndex) const
HANDLE eventHandle(const INTERRUPT_ENUMS id) const
bool isSuccess(void) const
ULWord GetCapturedAudioByteCount(void) const
std::set< NTV2InputSource > NTV2InputSourceSet
A set of distinct NTV2InputSource values.
float & FL(const int inIndex)
ULWord GetType(void) const
NTV2ConfigInterrupt & setCount(const ULWord val)
Sets my mCount.
int Fixed_
Definition: ajatypes.h:302
uint16_t minMasteringLuminance
struct HevcMessageRegister HevcMessageRegister
ULWord width(void) const
unsigned int BOOL_
Definition: ajatypes.h:300
ULWord GetBufferLevel(void) const
#define KONA_DEBUGFILTER_STRINGLENGTH
NTV2IDSwitchRegister
NTV2StringList::const_iterator NTV2StringListConstIter
enum NTV2VideoFrameBufferOrientation NTV2FBOrientation
bool WithFBOChange(void) const
std::ostream & NTV2PrintChannelList(const NTV2ChannelList &inObj, const bool inCompact=true, std::ostream &inOutStream=std::cout)
Streams a human-readable dump of the given NTV2ChannelList into the specified output stream...
The AutoCirculate channel is initializing, waiting for CNTV2Card::AutoCirculateStart to be called...
ULWord GetNumAvailableOutputFrames(void) const
#define NTV2_IS_VALID_INTERRUPT_ENUM(__e__)
NTV2DoubleArray::iterator NTV2DoubleArrayIter
Handy non-const iterator to iterate over an NTV2DoubleArray.
bool isSourceTopDown(void) const
std::ostream & NTV2PrintChannelSet(const NTV2ChannelSet &inObj, const bool inCompact=true, std::ostream &inOutStream=std::cout)
Streams a human-readable dump of the given NTV2ChannelSet into the specified output stream...
void SetMaxLockSize(const ULWord64 inNumBytes)
Sets the maximum lock size for use in a subsequent call to CNTV2Card::DMABufferLock.
NTV2TimeCodeList::const_iterator NTV2TimeCodeListConstIter
A handy const interator for iterating over an NTV2TimeCodeList.
NTV2SegmentedXferInfo & setSourceOffset(const ULWord inOffset)
Sets my source offset.
int16_t I16(const int inIndex) const
AutoCircTaskType
These are the available AutoCirculate task types.
uint32_t U32(const int inIndex) const
AutoCircVidProcMode
ULWordSet::iterator ULWordSetIter
ULWordSequence::const_iterator ULWordSequenceConstIter
A handy const iterator for iterating over a ULWordSequence.
void SetConnectionID(const ULWord inValue)
uint64_t & U64(const int inIndex)
ULWord bytesRead
Total audio and video bytes transfered.
bool SetFrameUserCookie(const ULWord64 &inUserCookie)
Intended for playout, replaces my current acUserCookie value with the new value.
#define NTV2_STREAM_CHANNEL_STATE_ERROR
Used in NTV2StreamChannel stream error.
ULWord GetTag(void) const
bool IsValid(void) const
Answers true if I&#39;m valid, or false if I&#39;m not valid.
NTV2ConfigInterrupt & doSubscribeEvent(const INTERRUPT_ENUMS id, const HANDLE &hdl)
Subscribe given HANDLE for interruptID.
ULWord GetByteCount(void) const
ULWord registerNum
NTV2ConfigInterrupt & setEventHandle(const HANDLE &h)
Sets my event handle.
ULWord audioExpectedAddress
The address that was used to transfer.
Configure interrupt (subscribe/unsubscribe, enable/disable, query subscribed interrupts, query enabled interrupts, etc.).
NTV2RegWrites::const_iterator NTV2RegisterWritesConstIter
std::ostream & NTV2PrintULWordVector(const NTV2ULWordVector &inObj, std::ostream &inOutStream=std::cout)
Streams a human-readable dump of the given NTV2ULWordVector into the specified output stream...
std::map< ULWord, ULWord > NTV2RegisterValueMap
A mapping of distinct NTV2RegisterNumbers to their corresponding ULWord values.
ULWord getDestPitch(void) const
ULWord offset(void) const
bool WithAudio(void) const
HevcDeviceRegister data
ULWordSetConstIter NTV2RegNumSetConstIter
A const iterator that iterates over a set of distinct NTV2RegisterNumbers.
struct RP188_STRUCT RP188_STRUCT
int32_t LWord
Definition: ajatypes.h:235
struct HevcEncodedInfo HevcEncodedInfo
NTV2AudioSystemSet NTV2MakeAudioSystemSet(const NTV2AudioSystem inFirstAudioSystem, const UWord inCount=1)
NTV2HDMIOutputStatus(const ULWord inData)
Constructs a NTV2HDMIOutputStatus from a register data value.
NTV2VideoFrameBufferOrientation frameBufferOrientation
VirtualProcAmpRegisters_base HD
#define AUTOCIRCULATE_WITH_FBFCHANGE
Use this to AutoCirculate with the possibility of frame buffer format changes.
HevcFirmwareType firmwareType
NTV2ClockMonitorWidgetRegisters
std::bitset< 16 > NTV2AudioChannelsMuted16
Per-audio-channel mute state for up to 16 audio channels.
FRAME_STAMP acFrameStamp
Frame stamp for the transferred frame.
AUTOCIRCULATE_DATA(const AUTO_CIRC_COMMAND inCommand=AUTO_CIRC_COMMAND_INVALID, const NTV2Crosspoint inCrosspoint=NTV2CROSSPOINT_INVALID)
UByteSequence::const_iterator UByteSequenceConstIter
A handy const iterator for iterating over a UByteSequence.
NTV2FrameSize(const ULWord inWidth=0, const ULWord inHeight=0)
My constructor.
HevcGpioDirection gpioDirection
NTV2AudioChannelQuads::const_iterator NTV2AudioChannelQuadsConstIter
Handy const iterator to iterate over a set of distinct NTV2AudioChannelQuad values.
Specifies any/all input/output kinds.
Definition: ntv2enums.h:1299
bool CanAcceptMoreOutputFrames(void) const
bool validPrimariesAndWhitePoint(void) const
ULWord value(void) const
HevcDeviceStatus deviceStatus
UByteSequence NTV2_RPC_BLOB_TYPE
void MakeInvalid(void)
Invalidates me, setting my register number, value, mask and shift values to 0xFFFFFFFF.
NTV2FrameBufferFormatSet NTV2PixelFormats
struct AUTOCIRCULATE_TASK_STRUCT * PAUTOCIRCULATE_TASK_STRUCT
AUTO_CIRC_COMMAND eCommand
UByteSequence GetU8s(const size_t inU8Offset=0, const size_t inMaxSize=128) const
ULWord currentFrame
Last vertical blank frame for this channel&#39;s auto-circulate. (at the time of the IOCTL_NTV2_GET_FRAME...
FGSizesMap::const_iterator FGSizesMapCI
HevcGpioDirection direction
NTV2HDMIAudioChannels
Indicates or specifies the HDMI audio channel count.
Definition: ntv2enums.h:3673
NTV2FrameSize NTV2FrameDimensions
bool IsIdle(void)
Is the stream idle.
int32_t & I32(const int inIndex)
const NTV2AudioChannelsMuted16 NTV2AudioChannelsMuteAll
All 16 audio channels muted/disabled.
uint16_t maxFrameAverageLightLevel
NTV2AutoCirculateState GetState(void) const
std::set< NTV2OutputDestination > NTV2OutputDestinations
A set of distinct NTV2OutputDestination values.
ULWord count(void) const
_NTV2MultiRasterRegisters
const NTV2Buffer & requestedRegisterNumbers(void) const
bool isSourceBottomUp(void) const
ULWord GetNumFailedWrites(void) const
bool operator!=(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition: json.hpp:14762
HevcVersion driverVersion
struct DMA_TRANSFER_STRUCT_64 * PDMA_TRANSFER_STRUCT_64
#define false
NTV2HDMIRange
Indicates or specifies the HDMI RGB range.
Definition: ntv2enums.h:3641
uint32_t ULWord
Definition: ajatypes.h:236
NTV2SegmentedXferInfo & setElementLength(const ULWord inBytesPerElement)
Sets my element length.
NTV2AudioFormat
Definition: ntv2enums.h:1956
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1361
short HANDLE
Definition: ajatypes.h:298
Describes a segmented data transfer (copy or move) from a source memory location to a destination loc...
#define NTV2_BEGIN_PRIVATE
NTV2SegmentedXferInfo & setSegmentInfo(const ULWord inNumSegs, const ULWord inSegLength)
Sets both my segment count and length.
std::vector< NTV2RegInfo > NTV2RegWrites
An ordered sequence of zero or more NTV2RegInfo structs intended for WriteRegister.
uint32_t & U32(const int inIndex)
HevcEncodeMode encodeMode
NTV2FrameRateSet::const_iterator NTV2FrameRateSetConstIter
A handy const iterator for iterating over an NTV2FrameRateSet.
struct AutoCircGenericTask AutoCircGenericTask
std::set< NTV2AudioChannelPair > NTV2AudioChannelPairs
A set of distinct NTV2AudioChannelPair values.
NTV2AudioRateSet::const_iterator NTV2AudioRateSetConstIter
A handy const iterator for iterating over an NTV2AudioRateSet.
std::set< NTV2AudioChannelQuad > NTV2AudioChannelQuads
A set of distinct NTV2AudioChannelQuad values.
uint8_t electroOpticalTransferFunction
std::set< NTV2Standard > NTV2StandardSet
A set of distinct NTV2Standard values.
uint64_t Pointer64
Definition: ajatypes.h:240
std::string NTV2AudioSystemSetToStr(const NTV2AudioSystemSet &inObj, const bool inCompact=true)
ULWord GetProcessedFrameCount(void) const
const NTV2Buffer & GetAudioBuffer(void) const
NTV2ConfigInterrupt & doEnable(const INTERRUPT_ENUMS id)
Enable given interruptID.
Output (playout, display) mode, which reads from device SDRAM.
Definition: ntv2enums.h:1246
HevcChangeSequence changeSequence
NTV2SegmentedXferInfo & setDestFlipped(const bool inFlipped=Direction_Flipped)
Sets the scan direction for the destination.
NTV2_RP188(const RP188_STRUCT &inOldRP188)
Constructs an NTV2_RP188 from the given RP188_STRUCT.
bool NTV2GetSupportedStandards(NTV2StandardSet &outStandards)
Returns a set of all NTV2Standard values supported (used) by any/all supported NTV2 devices...
NTV2LocalProcBlockRegisters
std::vector< uint8_t > UByteSequence
An ordered sequence of UByte (uint8_t) values.
ULWord64Sequence GetU64s(const size_t inU64Offset=0, const size_t inMaxSize=16, const bool inByteSwap=false) const
ULWordSet::const_iterator ULWordSetConstIter
struct AutoCircVidProcInfo AutoCircVidProcInfo
AUTO_CIRC_COMMAND eCommand
This struct replaces the old RP188_STRUCT.
NTV2RegWritesConstIter NTV2RegisterReadsConstIter
NTV2GeometrySet::const_iterator NTV2GeometrySetConstIter
A handy const iterator for iterating over an NTV2GeometrySet.
NTV2ConfigInterrupt & doGetCount(const INTERRUPT_ENUMS id)
Get interruptID count.
AutoCircGenericTask * taskArray
bool isValid(void) const
NTV2LocalProcRegisterShift
ULWord height(void) const
ULWord regNum(void) const
NTV2ConfigInterrupt & setFail(void)
Zeroes my mResult (indicating failure)
NTV2ChannelList NTV2MakeChannelList(const NTV2Channel inFirstChannel, const UWord inNumChannels=1)
struct HevcDeviceTransfer HevcDeviceTransfer
NTV2RegInfo & setRegNum(const ULWord val)
ULWord value
NTV2TCIndex
These enum values are indexes into the capture/playout AutoCirculate timecode arrays.
Definition: ntv2enums.h:3957
NTV2XilinxFPGA
Definition: ntv2enums.h:3852
bool Fill(const T &inValue)
Fills me with the given scalar value.
bool Find(const T &inValue, int &inOutIndex) const
Searches me for the given scalar value of type T starting at a given index position.
struct INTERRUPT_TIMESTAMP_STRUCT * PINTERRUPT_TIMESTAMP_STRUCT
SharedPrefsPermissions
bool IsProvidedByClient(void) const
NTV2PWMFanRegisters
ULWord currentReps
At Call Line# currently being OUTPUT (at the time of the IOCTL_NTV2_GET_FRAMESTAMP) ...
ULWord GetSegmentCount(void) const
bool IsValid(void) const
NTV2Buffer & outRegisterValues(void)
enum _NTV2MultiRasterRegisters NTV2MultiRasterRegisters
struct AUTOCIRCULATE_TRANSFER_STATUS_STRUCT * PAUTOCIRCULATE_TRANSFER_STATUS_STRUCT
ULWord operation(void) const
#define NTV2_RPC_BUFFER_CODEC_DECLS
AutoCircVidProcMode mode
NTV2FrameRate
Identifies a particular video frame rate.
Definition: ntv2enums.h:416
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
double & DBL(const int inIndex)
HevcPictureData pictureData
#define true
ULWordSetIter NTV2RegNumSetIter
A non-constant iterator that iterates over a set of distinct NTV2RegisterNumbers. ...
NTV2Standard
Identifies a particular video standard.
Definition: ntv2enums.h:169
0: Disabled (never recommended): device configured exclusively by client application(s).
bool IsStarting(void) const
AutoCircTimeCodeTask timeCodeTask
struct HevcPictureData HevcPictureData
bool IsAllocatedBySDK(void) const
uint8_t electroOpticalTransferFunction
ULWord GetSizeInBytes(void) const
My total size, in bytes, including header, body and trailer (but excluding embedded NTV2Buffer data) ...
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
bool hasCreateHandleFlag(void) const
HDMIOutColorSpaceMode
Enumerations for controlling NTV2 devices.
~NTV2MailBuffer()
My default destructor, which frees all allocatable fields that I own.
NTV2RegisterValueMap::iterator NTV2RegValueMapIter
A non-constant iterator that iterates over NTV2RegisterValueMap entries.
ULWord getDestEndOffset(void) const
void Set(const ULWord inRegNum, const ULWord inValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Sets me from the given parameters.
This is used to perform virtual data reads or writes.
bool IsQuarterSizeExpandModeEnabled(void) const
ULWord UWord_
Definition: ajatypes.h:301
struct HevcEncodedData HevcEncodedData
bool hasValidVPID(const UWord ndx=0) const
The invalid mode.
Definition: ntv2enums.h:1249
struct hevc_gpio_state HevcGpioState
#define NTV2_TYPE_CONFIGINTERRUPT
Identifies NTV2ConfigInterrupt struct.
#define NTV2_IS_ACTIVE_COLOR_CORRECTION_MODE(__x__)
Definition: ntv2enums.h:2095
bool WithHDMIAuxData(void) const
std::set< std::string > NTV2StringSet
NTV2FrameSize & swap(void)
Swaps my width and height.
NTV2HDMIOutputStatus()
Constructs a default NTV2HDMIOutputStatus.
NTV2ColorCorrectionInfo_32 colorCorrectionInfo
int64_t & I64(const int inIndex)
const AUTOCIRCULATE_TRANSFER_STATUS & GetTransferStatus(void) const
Returns a constant reference to my AUTOCIRCULATE_TRANSFER_STATUS.
bool NTV2GetSupportedPixelFormats(NTV2PixelFormats &outFormats)
Returns a set of all NTV2PixelFormat values supported (used) by any/all supported NTV2 devices...
NTV2VideoFormatSet::const_iterator NTV2VideoFormatSetConstIter
A handy const iterator for iterating over an NTV2VideoFormatSet.
Defines the import/export macros for producing DLLs or LIBs.
The AutoCirculate channel is stopping.
ULWord GetProcessedFrameCount(void) const
void SetFlags(const ULWord inFlags)
Sets the action flags for use in a subsequent call to CNTV2Card::DMABufferLock.
_INTERRUPT_ENUMS_
NTV2DMAEngine
Definition: ntv2enums.h:1861
#define AJA_NULL
Definition: ajatypes.h:180
struct HDRFloatValues HDRFloatValues
#define NWL_REG_START
#define POINTER_32
Definition: ajatypes.h:321
NTV2TimeCodes::const_iterator NTV2TimeCodesConstIter
A handy const interator for iterating over NTV2TCIndex/NTV2TimeCodeList pairs.
struct AUTOCIRCULATE_TASK_STRUCT AUTOCIRCULATE_TASK_STRUCT
NTV2ColorCorrectionMode mode
enum _AutoCircCommand_ NTV2AutoCirculateCommand
Reports HDMI output status information.
HevcMessageHeader header
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
HDMIOutProtocolMode
NTV2RegWritesIter NTV2RegReadsIter
A handy non-const iterator for iterating over the contents of an NTV2RegisterReads instance...
TestPatternSelect
struct hevcMessageHeader HevcMessageHeader
ULWord GetResultStatus(void) const
std::vector< ULWord > NTV2ULWordVector
An ordered sequence of ULWords.
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
enum _INTERRUPT_ENUMS_ INTERRUPT_ENUMS
struct HevcDeviceCommand HevcDeviceCommand
#define NTV2_END_PRIVATE
ULWord GetRequestedRegisterCount(void) const
ULWord flags(void) const
NTV2ColorCorrectionMode
Definition: ntv2enums.h:2084
bool IsStopped(void) const
bool IsValid(void) const
2: OEM (recommended): device configured by client application(s) with some driver involvement...
NTV2SegmentedXferInfo()
Constructs me as empty/invalid.
std::ostream & operator<<(std::ostream &inOutStream, const NTV2StringList &inData)
NTV2QuarterSizeExpandMode
Definition: ntv2enums.h:2491
HevcMessageHeader header
NTV2ColorCorrectionInfo colorCorrectionInfo
NTV2RegisterNumberSet NTV2RegNumSet
A set of distinct NTV2RegisterNumbers.
This is used to atomically perform bank-selected register reads or writes.
std::set< ULWord > ULWordSet
A collection of unique ULWord (uint32_t) values.
ULWord64Sequence::iterator ULWord64SequenceIter
A handy non-const iterator for iterating over a ULWord64Sequence.
NTV2StringList::iterator NTV2StringListIter
struct AUTOCIRCULATE_TRANSFER_STRUCT AUTOCIRCULATE_TRANSFER_STRUCT
HDMIOutStereoSelect
ULWord GetHeaderVersion(void) const
NTV2SegmentedXferInfo & setDestPitch(const ULWord inPitch)
Sets my destination pitch.
enum _NTV2XptValidROMRegisters NTV2XptValidROMRegisters
struct AUTOCIRCULATE_DATA AUTOCIRCULATE_DATA
NTV2ColorCorrectionInfo_64 colorCorrectionInfo
int64_t LWord64
Definition: ajatypes.h:238
All new NTV2 structs start with this common header.
NTV2RegWrites NTV2RegisterReads
XlnxRegisterShift
std::vector< uint16_t > UWordSequence
An ordered sequence of UWord (uint16_t) values.
bool NTV2DeviceGetSupportedFrameRates(const NTV2DeviceID inDeviceID, NTV2FrameRateSet &outRates)
Returns a set of distinct NTV2FrameRate values supported on the given device.
#define NTV2_IS_INPUT_CROSSPOINT(__x__)
Definition: ntv2enums.h:1729
std::set< NTV2FrameGeometry > NTV2GeometrySet
A set of distinct NTV2FrameGeometry values.
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
UWordSequence::const_iterator UWordSequenceConstIter
A handy const iterator for iterating over a UWordSequence.
std::set< NTV2AudioSystem > NTV2AudioSystemSet
A set of distinct NTV2AudioSystem values. New in SDK 16.2.
uint16_t maxMasteringLuminance
ULWord GetPointerSize(void) const
#define NTV2_RPC_CODEC_DECLS
NTV2HDMIProtocol
Indicates or specifies the HDMI protocol.
Definition: ntv2enums.h:3627
struct HevcMessageStatus HevcMessageStatus
The AutoCirculate channel is starting, waiting for the start time specified in the call to CNTV2Card:...
ULWord shift
size_t maxHandleCapacity(void) const
ULWord GetDroppedFrameCount(void) const
bool NTV2DeviceGetSupportedVideoFormats(const NTV2DeviceID inDeviceID, NTV2VideoFormatSet &outFormats)
Returns a set of distinct NTV2VideoFormat values supported on the given device.
enum _NTV2HDMIRegisters NTV2HDMIRegisters
#define NTV2_DEPRECATED_f(__f__)
bool isValid(void) const
ULWord64 audioClockCurrentTime
48kHz clock in reg 28 extended to 64 bits
uint16_t maxFrameAverageLightLevel
struct HevcPictureInfo HevcPictureInfo
double DBL(const int inIndex) const
std::string GetString(const size_t inU8Offset=0, const size_t inMaxSize=128) const
std::ostream & NTV2PrintAudioSystemSet(const NTV2AudioSystemSet &inObj, const bool inCompact=true, std::ostream &inOutStream=std::cout)
Streams a human-readable dump of the given NTV2AudioSystemSet into the specified output stream...
The AutoCirculate channel is stopped.
NTV2RegWrites::iterator NTV2RegisterWritesIter
bool WithRP188(void) const
#define AUTOCIRCULATE_WITH_ANC
Use this to AutoCirculate with ancillary data.
NTV2FrameBufferFormat frameBufferFormat
#define NTV2_END_PROTECTED
void Clear(void)
Resets the struct to its initialized state.
enum _AutoCircCommand_ NTV2AutoCircCmd
uint64_t ULWord64
Definition: ajatypes.h:239
NTV2QuarterSizeExpandMode videoQuarterSizeExpand
NTV2DIDSet::const_iterator NTV2DIDSetConstIter
Handy const iterator to iterate over an NTV2DIDSet.
std::set< NTV2AudioRate > NTV2AudioRateSet
A set of distinct NTV2AudioRate values. New in SDK 18.0.
LWord GetActiveFrame(void) const
ULWord getDestOffset(void) const
NTV2RoutingEntry & operator=(const NTV2RegInfo &inRHS)
Assigns an NTV2RegInfo to me.
HevcChangeSequence
int8_t & I8(const int inIndex)
HDRRegValues & setDCIP3(void)
#define NTV2_DEPRECATED_18_1(__f__)
#define NTV2_IS_VALID_STRUCT_TYPE(_x_)
uint8_t UByte
Definition: ajatypes.h:231
DriverStartPhase
The AutoCirculate channel is paused.
NTV2Crosspoint channelSpec
bool IsPageAligned(void) const
This is used by the CNTV2Card::ReadRegisters function.
NTV2ColorCorrectionMode mode
uint16_t maxContentLightLevel
NTV2LEDWidgetRegisters
NTV2Crosspoint backgroundVideoCrosspoint
bool hasFrameTRSError(void) const
NTV2ConfigInterrupt & doUnsubscribe(const INTERRUPT_ENUMS id)
Unsubscribe local HANDLE from given interruptID.
NTV2AudioMixerRegisters
NwlRegisterShift
#define NTV2_BUILD_STRINGLENGTH
NTV2FrameSize & reset(void)
Sets both my width and height to zero (an invalid state).
#define NTV2_SHOULD_BE_DEPRECATED(__f__)
Definition: ntv2deprecate.h:77
const NTV2Buffer & GetVideoBuffer(void) const
bool validPrimariesAndWhitePoint(void) const
This is used to prelock a video/audio/anc buffer used as the source or target of DMA transfers...
NTV2AutoCirculateState
Describes the state of an AutoCirculate channel. See AUTOCIRCULATE_STATUS.
bool NTV2DeviceGetSupportedPixelFormats(const NTV2DeviceID inDeviceID, NTV2PixelFormats &outFormats)
Returns a set of distinct NTV2FrameBufferFormat values supported on the given device.
struct FRAME_STAMP_STRUCT FRAME_STAMP_STRUCT
ULWord getTotalElements(void) const
NTV2ConfigInterrupt & setSuccess(void)
Sets my mResult to 1 (non-zero indicates success)
ActiveVideoOutSelect
std::ostream & Print(std::ostream &oss) const
AutoCircRegisterTask registerTask
HevcGpioFunction gpioFunction
NTV2SegmentedXferInfo & setDestOffset(const ULWord inOffset)
Sets my destination offset.
ULWord getSourceEndOffset(void) const
This is used for bitstream maintainance. (New in SDK 16.0)
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.).
ULWord audioInStartAddress
For record - first position in buffer of audio (includes base offset)
NTV2ConfigInterrupt & setCreateEvent(void)
Sets the kFlagMaskCreateHandle option.
std::map< NTV2TCIndex, NTV2_RP188 > NTV2TimeCodes
A mapping of NTV2TCIndex enum values to NTV2_RP188 structures.
bool IsValid(void) const
NTV2Mode
Used to identify the mode of a widget_framestore, or the direction of an AutoCirculate stream: either...
Definition: ntv2enums.h:1243
bool NTV2DeviceGetSupportedOutputDests(const NTV2DeviceID inDeviceID, NTV2OutputDestinations &outOutputDests, const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL)
Returns a set of distinct NTV2OutputDest values supported on the given device.
uint16_t GetEndFrame(void) const
HevcMessageHeader header
NTV2DIDSet::iterator NTV2DIDSetIter
Handy non-const iterator to iterate over an NTV2DIDSet.
ULWord GetCapturedAuxByteCount(const bool inField2=false) const
const ULWord LUTTablePartitionSize
#define NTV2_STREAM_CHANNEL_STATE_ACTIVE
Used in NTV2StreamChannel stream active.
struct NTV2RoutingEntry NTV2RoutingEntry
HevcStreamStatistics encStats[4]
NTV2InputSourceSet::const_iterator NTV2InputSourceSetConstIter
A handy const iterator for iterating over an NTV2InputSourceSet.
std::string NTV2AutoCirculateStateToString(const NTV2AutoCirculateState inState)
#define AUTOCIRCULATE_WITH_FBOCHANGE
Use this to AutoCirculate with the possibility of frame buffer orientation changes.
#define NTV2_IS_VALID_HEADER_TAG(_x_)
void ClearResultStatus(void)
NTV2RegisterNumber RegisterNum
struct AUTOCIRCULATE_P2P_STRUCT CHANNEL_P2P_STRUCT
This object specifies the information that will be transferred to or from the AJA device in the CNTV2...
_NTV2XptValidROMRegisters
#define NTV2_DEPRECATED_17_5(__f__)
struct HevcMessageDebug HevcMessageDebug
#define HEVC_VERSION_STRING_SIZE
uint8_t staticMetadataDescriptorID
NTV2Buffer & outBadRegIndexes(void)
HevcVifState vifState[4]
bool operator==(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition: json.hpp:14737
bool IsActive(void)
Is the stream active.
const FRAME_STAMP & GetFrameStamp(void) const
NTV2RegisterNumber
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
bool HasError(void)
Has the stream encountered an error.
#define AJAExport
Definition: export.h:33
LWord GetTransferFrameNumber(void) const
NTV2SegmentedXferInfo & setSourcePitch(const ULWord inPitch)
Sets my source pitch.
NTV2FrameGeometry
Identifies a particular video frame geometry.
Definition: ntv2enums.h:352
uint64_t clientPID(void) const
std::set< NTV2Channel > NTV2ChannelSet
A set of distinct NTV2Channel values.
NTV2AudioChannelOctets::const_iterator NTV2AudioChannelOctetsConstIter
Handy const iterator to iterate over a set of distinct NTV2AudioChannelOctet values.
uint16_t maxFrameAverageLightLevel
uint64_t interruptIDs(void) const
CCLUTV3MaskShift
SystemStatusCode
NTV2FrameSize & setWidth(const ULWord inValue)
Sets my width dimension.
uint64_t clientID(void) const
NTV2RegNumSet GetRegisterNumbers(const NTV2RegReads &inRegInfos)
void Set(const ULWord inDBB=0xFFFFFFFF, const ULWord inLow=0xFFFFFFFF, const ULWord inHigh=0xFFFFFFFF)
Sets my fields from the given DBB, low and high ULWord components.
bool IsStopping(void) const
ULWord GetCapturedAncByteCount(const bool inField2=false) const
SystemControlCode
NTV2ConfigInterrupt & doDisable(const INTERRUPT_ENUMS id)
Disable given interruptID.
HevcDeviceCommand data
NTV2Crosspoint foregroundKeyCrosspoint
ULWordSequence GetU32s(const size_t inU32Offset=0, const size_t inMaxSize=32, const bool inByteSwap=false) const
Describes the horizontal and vertical size dimensions of a raster, bitmap, frame or image...
bool Set(const void *pInUserPointer, const size_t inByteCount)
Sets (or resets) me from a client-supplied address and size.
NTV2SegmentedXferInfo & setSegmentLength(const ULWord inNumElements)
Sets my segment length.
union AutoCircGenericTask::@15 u
#define NTV2_BITFILE_RESERVED_ULWORDS
NTV2ConfigInterrupt & doSetCount(const INTERRUPT_ENUMS id, const ULWord cnt=0)
Set interruptID count.
std::vector< uint64_t > ULWord64Sequence
An ordered sequence of ULWord64 (uint64_t) values.
bool ResetUsing(const NTV2RegisterReads &inRegReads)
Resets me, starting over, using the given NTV2RegisterReads vector.
struct AUTOCIRCULATE_TRANSFER_STRUCT_64 * PAUTOCIRCULATE_TRANSFER_STRUCT_64
#define NTV2Buffer_PAGE_ALIGNED
Allocated page-aligned?
struct HevcMessageCommand HevcMessageCommand
Pointer64 ccLookupTables
only used in 3way color correction mode.
AUTO_CIRC_COMMAND eCommand
This struct is used to augment the default full-frame AutoCirculate DMA transfer to accommodate multi...
NTV2RotaryEncoderRegister
#define NTV2_STRUCT_BEGIN(__struct_name__)
NTV2ConfigInterrupt & doSubscribe(const INTERRUPT_ENUMS id)
Create event handle and subscribe it to given interruptID.
#define NTV2_BITFILE_PARTNAME_STRINGLENGTH
NTV2SegmentedXferInfo & setDestInfo(const ULWord inOffset, const ULWord inPitch)
A convenience function that sets both my destination offset and pitch.
NTV2ColorCorrectionMode mode
ULWord * ccLookupTables
only used in 3way color correction mode.
ULWord GetFrameCount(void) const
NTV2VideoFormatSet & operator+=(NTV2VideoFormatSet &inOutSet, const NTV2VideoFormatSet inSet)
Appends the given NTV2VideoFormatSet contents into the given set.
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
#define HEVC_ADDITIONAL_DATA_SIZE
#define AUTOCIRCULATE_WITH_COLORCORRECT
Use this to AutoCirculate with color correction.
std::vector< NTV2_RP188 > NTV2TimeCodeList
An ordered sequence of zero or more NTV2_RP188 structures. An NTV2TCIndex enum value can be used as a...
struct HevcMessageInfo HevcMessageInfo
HevcGpioState gpioState[64]
#define NTV2_IS_OUTPUT_CROSSPOINT(__x__)
Definition: ntv2enums.h:1738
NTV2RegisterValueMap::const_iterator NTV2RegValueMapConstIter
A const iterator that iterates over NTV2RegisterValueMap entries.
ULWord mask
uint16_t UWord
Definition: ajatypes.h:234
std::ostream & Print(std::ostream &oStream) const
Prints a human-readable representation of me into the given output stream.
uint16_t U16(const int inIndex) const
ULWord numRegisters(void) const
NTV2DoubleArray::const_iterator NTV2DoubleArrayConstIter
Handy const iterator to iterate over an NTV2DoubleArray.
1: Standard/Retail: device configured by AJA ControlPanel, service/daemon, and driver.
Specifies channel or FrameStore 1 (or the first item).
Definition: ntv2enums.h:1363
~NTV2Bitstream()
My default destructor, which frees all allocatable fields that I own.
NTV2Buffer NTV2_POINTER
UWordSequence GetU16s(const size_t inU16Offset=0, const size_t inMaxSize=64, const bool inByteSwap=false) const
NTV2SegmentedXferInfo & setSourceFlipped(const bool inFlipped=Direction_Flipped)
Sets the scan direction for the source.
bool NTV2DeviceGetSupportedInputSources(const NTV2DeviceID inDeviceID, NTV2InputSourceSet &outInputSources, const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL)
Returns a set of distinct NTV2InputSource values supported on the given device.
bool isLocked(void) const
enum _AutoCircCommand_ AUTO_CIRC_COMMAND
struct ColorSpaceConverterCustomCoefficients NTV2CSCCustomCoeffs
#define NTV2_ASSERT_STRUCT_VALID
NTV2FrameSize & setHeight(const ULWord inValue)
Sets my height dimension.
HevcMessageHeader header
HevcDeviceMode deviceMode
#define NTV2_IS_VALID_AUDIO_SYSTEM(__x__)
Definition: ntv2enums.h:3920
ULWord currenthUser
Contains validCount (Play - reps remaining, Record - drops on frame)
bool SetBuffer(const ULWord *pInBuffer, const ULWord inByteCount)
Sets the buffer to lock for use in a subsequent call to CNTV2Card::DMABufferLock. ...
uint64_t clientTID(void) const
bool NTV2GetUnsupportedPixelFormats(NTV2PixelFormats &outFormats)
Returns a set of NTV2PixelFormat values not suported by any NTV2 device.
ULWord getSourcePitch(void) const
NTV2RegWritesIter NTV2RegisterReadsIter
NTV2RegInfo & setValue(const ULWord val)
bool toRegValues(HDRRegValues &outVals) const
NTV2FrameBufferFormat GetFrameBufferFormat(void) const
NTV2AudioSystemSet::const_iterator NTV2AudioSystemSetConstIter
A handy const iterator into an NTV2AudioSystemSet. New in SDK 16.2.
ULWord * ccLookupTables
only used in 3way color correction mode.
HDRFloatValues & zero(void)
_NTV2OERegisters
bool operator<(const value_t lhs, const value_t rhs) noexcept
comparison operator for JSON types
Definition: json.hpp:2902
ULWord & outNumFailures(void)
bool setFromRegValues(const HDRRegValues &inRegValues)
This object is embedded in the AUTOCIRCULATE_TRANSFER struct that&#39;s returned from the CNTV2Card::Auto...
uint64_t magnitude(void) const
NTV2ConfigInterrupt & setResult(const ULWord val)
Sets my mResult.
ADV7189BProcAmpRegisters SD
_NTV2HDMIRegisters
bool HasAvailableInputFrame(void) const
Input (capture) mode, which writes into device SDRAM.
Definition: ntv2enums.h:1248
void EnableQuarterSizeExpandMode(void)
Enables quarter-size expansion mode.
bool NTV2DeviceGetSupportedGeometries(const NTV2DeviceID inDeviceID, NTV2GeometrySet &outGeometries)
Returns a set of distinct NTV2FrameGeometry values supported on the given device. ...
NTV2ChannelSet NTV2MakeChannelSet(const NTV2Channel inFirstChannel, const UWord inNumChannels=1)
ULWord getSegmentLength(void) const
float FL(const int inIndex) const
NTV2RXSDIStatusRegister
bool isDestBottomUp(void) const
NTV2SegmentedXferInfo & setSegmentCount(const ULWord inNumSegments)
Sets my segment count.
ULWord currentAudioExpectedAddress
As set by play.
RP188SourceFilterSelect
This class/object reports information about the current and/or requested AutoCirculate frame...
std::map< NTV2FrameGeometry, ULWord > FGSizesMap
ULWord getSourceOffset(void) const
NTV2ChannelList::const_iterator NTV2ChannelListConstIter
A handy const iterator into an NTV2ChannelList.
#define NTV2_BUILD_RESERVED_BYTES
bool SetBuffer(const ULWord *pInBuffer, const ULWord inByteCount)
Sets the buffer to lock for use in a subsequent call to CNTV2Card::LoadBitstream. ...
UWord CRCLines(const UWord ndx=0) const
NTV2AudioRate
Definition: ntv2enums.h:1933
std::vector< uint32_t > ULWordSequence
An ordered sequence of ULWord (uint32_t) values.
RP188_STRUCT currentRP188
Last vertical blank timecode (RP-188)
NTV2BOBWidgetRegisters
struct HevcDeviceInfo HevcDeviceInfo
HevcMessageHeader header
_AutoCircCommand_
ULWord GetConnectionID(void) const
std::vector< NTV2Channel > NTV2ChannelList
An ordered sequence of NTV2Channel values.
NTV2ConfigInterrupt & setClientID(const uint64_t id)
Sets my mClientID.
const NTV2Buffer & regInfos(void) const
bool IsRunning(void) const
struct AUTOCIRCULATE_TRANSFER_STRUCT_32 * PAUTOCIRCULATE_TRANSFER_STRUCT_32
bool setEventHandle(const INTERRUPT_ENUMS id, HANDLE h)
#define AUTOCIRCULATE_WITH_VIDPROC
Use this to AutoCirculate with video processing.
ULWord64Sequence::const_iterator ULWord64SequenceConstIter
A handy const iterator for iterating over a ULWord64Sequence.
NwlRegisterIndex
VirtualProcAmpRegisters_base SD
XlnxRegisterTarget
CUSTOM_ANC_STRUCT customAncInfo
This field is obsolete. Do not use.
uint64_t U64(const int inIndex) const
void * GetHostPointer(void) const
struct AUTOCIRCULATE_TRANSFER_STRUCT * PAUTOCIRCULATE_TRANSFER_STRUCT
uint8_t staticMetadataDescriptorID
_NTV2NonPCMAudioDetectRegisters
bool WithColorCorrect(void) const
NTV2SegmentedXferInfo & setDestDirection(const bool inTopDown)
Sets the scan direction for the destination.
This is used by the CNTV2Card::ReadSDIStatistics function.
NTV2RegWrites::iterator NTV2RegWritesIter
A handy non-const iterator for iterating over the contents of an NTV2RegisterWrites instance...
NTV2TCIndexes::const_iterator NTV2TCIndexesConstIter
Color correction data used with AUTOCIRCULATE_WITH_COLORCORRECT option.
uint8_t electroOpticalTransferFunction
ULWord GetCapturedAncByteCount(const bool inField2=false) const
ULWord & outNumRegisters(void)
std::vector< std::string > NTV2StringList
std::set< NTV2AudioChannelOctet > NTV2AudioChannelOctets
A set of distinct NTV2AudioChannelOctet values.
#define NTV2Buffer_ALLOCATED
Allocated using Allocate function?
uint8_t & U8(const int inIndex)
struct HevcTransferData HevcTransferData
NTV2SegmentedXferInfo & setSourceInfo(const ULWord inOffset, const ULWord inPitch)
A convenience function that sets both my source offset and pitch.
HevcFirmwareType
uint8_t U8(const int inIndex) const
ULWord audioOutStopAddress
For play - first position in buffer of audio.
UByte additionalData[((4+4+256) *16)]
std::vector< NTV2RegInfo > NTV2RegisterWrites
NTV2FrameSize(const NTV2FrameGeometry inFG)
enum NTV2RXSDIStatusRegister NTV2RXSDIStatusRegisters
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
struct HevcMessageTransfer HevcMessageTransfer
LWord64 currentFrameTime
Vertical blank start of current frame.
UByte additionalData[((4+4+256) *16)]
NTV2Buffer & outGoodRegisterNumbers(void)
bool Fill(const T &inValue, const NTV2SegmentedXferInfo &inXferInfo)
Fills a portion of me with the given scalar value.
XlnxRegisterMask
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
NTV2RegWrites NTV2RegReads
An ordered sequence of zero or more NTV2RegInfo structs intended for ReadRegister.
std::string NTV2ChannelListToStr(const NTV2ChannelList &inObj, const bool inCompact=true)
HDRRegValues & zero(void)
NTV2ConfigInterrupt & setInterruptID(const INTERRUPT_ENUMS id)
Sets my interruptID.
NTV2AudioChannelPairs::const_iterator NTV2AudioChannelPairsConstIter
Handy const iterator to iterate over a set of distinct NTV2AudioChannelPair values.
NTV2AudioSystem GetAudioSystem(void) const
NTV2EnhancedCSCRegisters
#define NTV2_BEGIN_PROTECTED
NTV2Crosspoint backgroundKeyCrosspoint
int32_t I32(const int inIndex) const
AutoCircTaskType taskType
NTV2QuarterSizeExpandMode videoQuarterSizeExpand
NTV2Crosspoint channelSpec
enum _NTV2NonPCMAudioDetectRegisters NTV2NonPCMAudioDetectRegisters
HevcVinState vinState[4]
#define AUTOCIRCULATE_WITH_FIELDS
Use this to AutoCirculate with fields as frames for interlaced formats.
#define HEVC_GPIO_MAX
~NTV2StreamChannel()
My default destructor, which frees all allocatable fields that I own.
ULWord mask(void) const
struct NTV2ColorCorrectionInfo_64 NTV2ColorCorrectionInfo_64
#define NTV2_BITFILE_DESIGNNAME_STRINGLENGTH
bool IsSegmented(void) const
ULWord GetQueueDepth(void)
Gets the queue depth.
#define AUTOCIRCULATE_WITH_HDMIAUX
Use this to AutoCirculate with HDMI auxiliary data.
bool IsFieldMode(void) const
NTV2Mode GetMode(void) const
DesktopFrameBuffStatus
bool WithFBFChange(void) const
bool NTV2GetUnsupportedStandards(NTV2StandardSet &outStandards)
Returns a set of NTV2Standard values not suported by any NTV2 device.
NTV2LocalProcRegisterMask
This is used to enable or disable AJADebug logging in the driver.
HevcEncodedData encodedData
struct BITFILE_INFO_STRUCT * PBITFILE_INFO_STRUCT
NTV2Crosspoint foregroundVideoCrosspoint
Declares enums for virtual registers used in all platform drivers and the SDK.
~NTV2BufferLock()
My default destructor, which frees all allocatable fields that I own.
#define NTV2_STREAM_CHANNEL_STATE_IDLE
Used in NTV2StreamChannel stream idle.
HevcStreamStatistics rawStats[4]
NTV2HDMIBitDepth
Indicates or specifies the HDMI video bit depth.
Definition: ntv2enums.h:3698
const NTV2Buffer & GetAncBuffer(const bool inField2=false) const
struct HevcVersion HevcVersion
NTV2RegInfo & setShift(const ULWord val)
struct HDRRegValues HDRRegValues
defined(NTV2_DEPRECATE_17_6)
uint16_t GetStartFrame(void) const
void DisableQuarterSizeExpandMode(void)
Enables quarter-size expansion mode.
SDI 1 embedded VITC.
Definition: ntv2enums.h:3960
HDRRegValues & setBT2020(void)
bool WithVidProc(void) const
#define AUTOCIRCULATE_WITH_LTC
Use this to AutoCirculate with analog LTC.
ULWord getSegmentCount(void) const
struct AUTOCIRCULATE_TASK_STRUCT_32 * PAUTOCIRCULATE_TASK_STRUCT_32
ULWord64 GetRawHostPointer(void) const
std::set< UByte > NTV2DIDSet
A set of distinct NTV2DID values.
This is used by the CNTV2Card::WriteRegisters function.
ULWord64 audioClockTimeStamp
48kHz clock (in reg 28, extended to 64 bits) at time of play or record.
struct HevcDeviceRegister HevcDeviceRegister
NTV2FrameBufferFormatSetConstIter NTV2PixelFormatsConstIter
NTV2VideoFrameBufferOrientation frameBufferOrientation
#define MAX_ROUTING_ENTRIES
char standardFirmwareMultiple[64]
ULWord NTV2IOKinds
Definition: ntv2enums.h:1314
INTERRUPT_ENUMS interruptID(void) const
void Clear(void)
Resets the struct to its initialized state.
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...
bool isDestTopDown(void) const
All new NTV2 structs end with this common trailer.
struct AUTOCIRCULATE_P2P_STRUCT * PCHANNEL_P2P_STRUCT
NTV2QuarterSizeExpandMode videoQuarterSizeExpand
bool hasIncludeGlobalsFlag(void) const
#define NTV2_BITFILE_DATETIME_STRINGLENGTH
ULWordSequence::iterator ULWordSequenceIter
A handy non-const iterator for iterating over a ULWordSequence.
ULWord currentFieldCount
At Call Field0 or Field1 currently being OUTPUT (at the time of the IOCTL_NTV2_GET_FRAMESTAMP) ...
TestPatternFormat
NTV2FrameBufferFormatSet::const_iterator NTV2FrameBufferFormatSetConstIter
A handy const iterator for iterating over an NTV2FrameBufferFormatSet.
NTV2AutoCirculateState GetState(void) const
struct HevcDeviceDebug HevcDeviceDebug