AJA NTV2 SDK  18.1.0.2505
NTV2 SDK 18.1.0.2505
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);}
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 
7250  ULWord fTrailerVersion;
7251  ULWord fTrailerTag;
7252 
7253  #if !defined (NTV2_BUILDING_DRIVER)
7254  explicit NTV2_TRAILER ();
7255 
7259  inline bool IsValid (void) const {return NTV2_IS_VALID_TRAILER_TAG(fTrailerTag) && IsValidVersion();}
7260 
7266  std::ostream & Print (std::ostream & oss) const;
7267 
7271  inline ULWord SDKVersion (void) const {return fTrailerVersion;}
7272 
7276  bool MatchesThisSDK (void) const;
7277 
7281  bool IsValidVersion (void) const;
7282 
7286  std::string VersionString (void) const;
7287 
7294  bool VersionComponents (ULWord & outMajor, ULWord & outMinor, ULWord & outPoint, ULWord & outBuild) const;
7295 
7297  #endif // user-space clients only
7299 
7300 
7301 
7307  ULWord fHeaderTag;
7308  ULWord fType;
7309  ULWord fHeaderVersion;
7310  ULWord fVersion;
7311  ULWord fSizeInBytes;
7312  ULWord fPointerSize;
7313  ULWord fOperation;
7314  ULWord fResultStatus;
7316 
7317  #if !defined (NTV2_BUILDING_DRIVER)
7318 
7323  explicit NTV2_HEADER (const ULWord inStructureType, const ULWord inSizeInBytes);
7324 
7325  inline ULWord GetSizeInBytes (void) const {return fSizeInBytes;}
7326  inline ULWord GetTag (void) const {return fHeaderTag;} // New in SDK 16.3
7327  inline ULWord GetType (void) const {return fType;} // New in SDK 16.3
7328  inline ULWord GetHeaderVersion (void) const {return fHeaderVersion;} // New in SDK 16.3
7329  inline ULWord GetVersion (void) const {return fVersion;} // New in SDK 16.3
7330  inline ULWord GetPointerSize (void) const {return fPointerSize;} // New in SDK 16.3
7331  inline ULWord GetConnectionID (void) const {return fOperation;} // New in SDK 16.3
7332  inline void SetConnectionID (const ULWord inValue) {fOperation = inValue;} // New in SDK 16.3
7333  inline ULWord GetResultStatus (void) const {return fResultStatus;} // New in SDK 17.5
7334 
7344  const NTV2_TRAILER * GetTrailer (void) const; // New in SDK 18.1
7345 
7351  std::ostream & Print (std::ostream & inOutStream) const;
7352 
7361  inline bool IsValid (const bool chkTrailer = false) const
7362  { const size_t bytes (sizeof(NTV2_HEADER) + (chkTrailer ? sizeof(NTV2_TRAILER) : 0));
7363  bool ok = NTV2_IS_VALID_HEADER_TAG(fHeaderTag) // tag matches NTV2_HEADER_TAG
7364  && IsFourCC(fType) // fType is 4CC
7365  && GetSizeInBytes() > bytes; // total message size seems reasonable
7366  if (chkTrailer && ok)
7367  { const NTV2_TRAILER * pTrlr = GetTrailer();
7368  return pTrlr ? pTrlr->IsValid() : true;
7369  }
7370  return ok;
7371  }
7375  inline void ClearResultStatus (void) {fResultStatus = 0;} // New in SDK 17.5
7376 
7377  static std::string FourCCToString (const ULWord in4CC, const char nonPrintable = '?');
7378  static bool IsFourCC (const ULWord in4CC);
7379 
7381  #endif // user-space clients only
7383 
7384 
7385 
7409  ULWord acNumSegments;
7410  ULWord acNumActiveBytesPerRow;
7412  ULWord acSegmentHostPitch;
7413  ULWord acSegmentDevicePitch;
7415 
7417  #if !defined (NTV2_BUILDING_DRIVER)
7418 
7421  explicit NTV2SegmentedDMAInfo ();
7422 
7430  explicit NTV2SegmentedDMAInfo (const ULWord inNumSegments, const ULWord inNumActiveBytesPerRow, const ULWord inHostBytesPerRow, const ULWord inDeviceBytesPerRow);
7431 
7440  void Set (const ULWord inNumSegments, const ULWord inNumActiveBytesPerRow, const ULWord inHostBytesPerRow, const ULWord inDeviceBytesPerRow);
7441 
7445  void Reset (void);
7446 
7450  inline ULWord GetSegmentCount (void) const {return acNumSegments;}
7451 
7455  inline bool IsSegmented (void) const {return GetSegmentCount() > 1;}
7456 
7458  #endif // user-space clients only
7460 
7461 
7462 
7468  ULWord ccSaturationValue;
7469 
7475  NTV2Buffer ccLookupTables;
7476 
7477  #if !defined (NTV2_BUILDING_DRIVER)
7478 
7481  explicit NTV2ColorCorrectionData ();
7482 
7487 
7491  void Clear (void);
7492 
7496  inline bool IsActive (void) const {return NTV2_IS_ACTIVE_COLOR_CORRECTION_MODE (ccMode) && ccLookupTables.GetHostPointer ();}
7497 
7506  bool Set (const NTV2ColorCorrectionMode inMode, const ULWord inSaturation, const void * pInTableData);
7507 
7509 
7511  inline explicit NTV2ColorCorrectionData (const NTV2ColorCorrectionData & inObj) : ccLookupTables (0) {(void) inObj;}
7512  inline NTV2ColorCorrectionData & operator = (const NTV2ColorCorrectionData & inRHS) {(void) inRHS; return *this;}
7514  #endif // user-space clients only
7516 
7517 
7518 
7523  NTV2_HEADER acHeader;
7524  NTV2Crosspoint acCrosspoint;
7526  LWord acStartFrame;
7527  LWord acEndFrame;
7528  LWord acActiveFrame;
7529  ULWord64 acRDTSCStartTime;
7530  ULWord64 acAudioClockStartTime;
7531  ULWord64 acRDTSCCurrentTime;
7532  ULWord64 acAudioClockCurrentTime;
7533  ULWord acFramesProcessed;
7534  ULWord acFramesDropped;
7535  ULWord acBufferLevel;
7536  ULWord acOptionFlags;
7537  NTV2AudioSystem acAudioSystem;
7538  NTV2_TRAILER acTrailer;
7539 
7540  #if !defined (NTV2_BUILDING_DRIVER)
7541 
7544  explicit AUTOCIRCULATE_STATUS (const NTV2Crosspoint inCrosspoint = NTV2CROSSPOINT_CHANNEL1);
7545 
7551  bool CopyTo (AUTOCIRCULATE_STATUS_STRUCT & outOldStruct);
7552 
7558  bool CopyFrom (const AUTOCIRCULATE_STATUS_STRUCT & inOldStruct);
7559 
7563  void Clear (void);
7564 
7568  inline ULWord GetFrameCount (void) const {return IsStopped() ? 0 : ULWord (acEndFrame - acStartFrame + 1);}
7569 
7573  inline ULWord GetDroppedFrameCount (void) const {return acFramesDropped;}
7574 
7578  inline ULWord GetProcessedFrameCount (void) const {return acFramesProcessed;}
7579 
7583  inline ULWord GetBufferLevel (void) const {return acBufferLevel;}
7584 
7588  inline ULWord GetNumAvailableOutputFrames (void) const {return GetFrameCount () > GetBufferLevel() ? GetFrameCount () - GetBufferLevel() : 0;}
7589 
7593  inline bool CanAcceptMoreOutputFrames (void) const {return GetNumAvailableOutputFrames () > 1;}
7594 
7632  inline bool HasAvailableInputFrame (void) const {return GetBufferLevel() > 1;}
7633 
7637  inline LWord GetActiveFrame (void) const {return acActiveFrame;}
7638 
7642  inline uint16_t GetStartFrame (void) const {return uint16_t(acStartFrame);}
7643 
7647  inline uint16_t GetEndFrame (void) const {return uint16_t(acEndFrame);}
7648 
7652  inline NTV2AutoCirculateState GetState (void) const {return acState;}
7653 
7657  inline NTV2AudioSystem GetAudioSystem (void) const {return acAudioSystem;}
7658 
7662  inline bool IsRunning (void) const {return GetState () == NTV2_AUTOCIRCULATE_RUNNING;}
7663 
7667  inline bool IsStarting (void) const {return GetState () == NTV2_AUTOCIRCULATE_STARTING || GetState () == NTV2_AUTOCIRCULATE_STARTING_AT_TIME;}
7668 
7672  inline bool IsStopped (void) const {return GetState () == NTV2_AUTOCIRCULATE_DISABLED;}
7673 
7677  inline bool IsStopping (void) const {return GetState () == NTV2_AUTOCIRCULATE_STOPPING;}
7678 
7682  inline bool IsPaused (void) const {return GetState () == NTV2_AUTOCIRCULATE_PAUSED;}
7683 
7687  inline bool WithAudio (void) const {return NTV2_IS_VALID_AUDIO_SYSTEM (GetAudioSystem ());}
7688 
7692  inline ULWord OptionFlags (void) const {return acOptionFlags;} // New in SDK 16.0
7693 
7697  inline bool WithCustomAnc (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_ANC;} // New in SDK 16.0
7698 
7702  inline bool WithRP188 (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_RP188;} // New in SDK 16.0
7703 
7707  inline bool WithLTC (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_LTC;} // New in SDK 16.0
7708 
7712  inline bool WithFBFChange (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_FBFCHANGE;} // New in SDK 16.0
7713 
7717  inline bool WithFBOChange (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_FBOCHANGE;} // New in SDK 16.0
7718 
7722  inline bool WithColorCorrect (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_COLORCORRECT;} // New in SDK 16.0
7723 
7727  inline bool WithVidProc (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_VIDPROC;} // New in SDK 16.0
7728 
7732  inline bool IsFieldMode (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_FIELDS;} // New in SDK 16.0
7733 
7737  inline bool WithHDMIAuxData (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_HDMIAUX;} // New in SDK 16.0
7738 
7742  inline bool IsInput (void) const {return NTV2_IS_INPUT_CROSSPOINT(acCrosspoint);}
7743 
7747  inline bool IsOutput (void) const {return NTV2_IS_OUTPUT_CROSSPOINT(acCrosspoint);}
7748 
7752  inline NTV2Mode GetMode (void) const {return IsStopped() ? NTV2_MODE_INVALID : (IsInput() ? NTV2_MODE_INPUT : NTV2_MODE_OUTPUT);} // New in SDK 15.5
7753 
7757  NTV2Channel GetChannel (void) const;
7758 
7763  std::string operator [] (const unsigned inIndexNum) const;
7764 
7768  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
7769 
7771  NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer)
7772  #endif // user-space clients only
7774 
7775 
7776  #if !defined (NTV2_BUILDING_DRIVER)
7781 
7787 
7794  NTV2RegisterNumberSet & operator << (NTV2RegisterNumberSet & inOutSet, const ULWord inRegisterNumber);
7795 
7796  typedef std::map <ULWord, ULWord> NTV2RegisterValueMap;
7797  typedef NTV2RegisterValueMap::const_iterator NTV2RegValueMapConstIter;
7798  typedef NTV2RegisterValueMap::iterator NTV2RegValueMapIter;
7799  #endif // !defined (NTV2_BUILDING_DRIVER)
7800 
7801 
7807  NTV2_STRUCT_BEGIN (NTV2GetRegisters) // NTV2_TYPE_GETREGS
7809  NTV2_HEADER mHeader;
7810  ULWord mInNumRegisters;
7811  NTV2Buffer mInRegisters;
7812  ULWord mOutNumRegisters;
7813  NTV2Buffer mOutGoodRegisters;
7814  NTV2Buffer mOutValues;
7815  NTV2_TRAILER mTrailer;
7817 
7818  #if !defined (NTV2_BUILDING_DRIVER)
7819 
7824  explicit NTV2GetRegisters (const NTV2RegNumSet & inRegisterNumbers = NTV2RegNumSet());
7825 
7830  explicit NTV2GetRegisters (NTV2RegisterReads & inRegReads);
7831 
7836  bool ResetUsing (const NTV2RegNumSet & inRegisterNumbers);
7837 
7843  inline bool ResetUsing (const NTV2RegisterReads & inRegReads) {return ResetUsing(::GetRegisterNumbers(inRegReads));}
7844 
7850  bool GetGoodRegisters (NTV2RegNumSet & outGoodRegNums) const;
7851 
7857  bool GetRegisterValues (NTV2RegisterValueMap & outValues) const;
7858 
7866  bool GetRegisterValues (NTV2RegisterReads & inOutValues) const;
7867 
7873  bool GetRequestedRegisterNumbers (NTV2RegNumSet & outRegNums) const; // New in SDK 16.3
7874 
7880  bool GetBadRegisters (NTV2RegNumSet & outBadRegNums) const; // New in SDK 16.3
7881 
7888  bool PatchRegister (const ULWord inRegNum, const ULWord inValue); // New in SDK 17.0
7889 
7895  std::ostream & Print (std::ostream & inOutStream) const;
7896 
7900  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
7901 
7902  inline ULWord numRegisters (void) const {return mInNumRegisters;} // New in SDK 18.0
7903  inline const NTV2Buffer & requestedRegisterNumbers (void) const {return mInRegisters;} // New in SDK 18.0
7904  inline ULWord & outNumRegisters (void) {return mOutNumRegisters;} // New in SDK 18.0
7905  inline NTV2Buffer & outGoodRegisterNumbers (void) {return mOutGoodRegisters;} // New in SDK 18.0
7906  inline NTV2Buffer & outRegisterValues (void) {return mOutValues;} // New in SDK 18.0
7907 
7909  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
7910 
7912  inline explicit NTV2GetRegisters (const NTV2GetRegisters & inObj) : mHeader(0xFEFEFEFE, 0), mInRegisters(0), mOutGoodRegisters(0), mOutValues(0)
7913  {(void) inObj;}
7914  inline NTV2GetRegisters & operator = (const NTV2GetRegisters & inRHS) {(void) inRHS; return *this;}
7916 
7917  #endif // !defined (NTV2_BUILDING_DRIVER)
7919 
7920 
7921 
7926  NTV2_STRUCT_BEGIN (NTV2SetRegisters) // NTV2_TYPE_SETREGS
7927  NTV2_HEADER mHeader;
7928  ULWord mInNumRegisters;
7929  NTV2Buffer mInRegInfos;
7930  ULWord mOutNumFailures;
7931  NTV2Buffer mOutBadRegIndexes;
7932  NTV2_TRAILER mTrailer;
7933 
7934  #if !defined (NTV2_BUILDING_DRIVER)
7935 
7940  NTV2SetRegisters (const NTV2RegWrites & inRegWrites = NTV2RegWrites());
7941 
7947  bool ResetUsing (const NTV2RegWrites & inRegWrites);
7948 
7954  bool GetFailedRegisterWrites (NTV2RegWrites & outFailedRegWrites) const;
7955 
7959  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
7960 
7961  inline ULWord GetRequestedRegisterCount (void) const {return mInNumRegisters;} // New in SDK 16.3
7962  bool GetRequestedRegisterWrites (NTV2RegWrites & outRegWrites) const; // New in SDK 16.3
7963  inline ULWord GetNumFailedWrites (void) const {return mOutNumFailures;} // New in SDK 16.3
7964 
7970  std::ostream & Print (std::ostream & inOutStream) const;
7971 
7972  inline const NTV2Buffer & regInfos (void) const {return mInRegInfos;} // New in SDK 18.0
7973  inline ULWord & outNumFailures (void) {return mOutNumFailures;} // New in SDK 18.0
7974  inline NTV2Buffer & outBadRegIndexes (void) {return mOutBadRegIndexes;} // New in SDK 18.0
7975 
7977  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
7978 
7980  inline explicit NTV2SetRegisters (const NTV2SetRegisters & inObj) : mHeader(0xFEFEFEFE, 0), mInNumRegisters(0), mInRegInfos(0), mOutNumFailures(0), mOutBadRegIndexes(0)
7981  {(void) inObj;}
7982  inline NTV2SetRegisters & operator = (const NTV2SetRegisters & inRHS) {(void) inRHS; return *this;}
7984 
7985  #endif // !defined (NTV2_BUILDING_DRIVER)
7987 
7988 
7989 
7993  NTV2_STRUCT_BEGIN (NTV2BankSelGetSetRegs) // NTV2_TYPE_BANKGETSET
7994  NTV2_HEADER mHeader;
7995  ULWord mIsWriting;
7996  NTV2Buffer mInBankInfos;
7997  NTV2Buffer mInRegInfos;
7998  NTV2_TRAILER mTrailer;
7999 
8000  #if !defined (NTV2_BUILDING_DRIVER)
8001 
8007  explicit NTV2BankSelGetSetRegs (const NTV2RegInfo & inBankSelect, const NTV2RegInfo & inRegInfo, const bool inDoWrite = false);
8008 
8013  NTV2RegInfo GetRegInfo (const UWord inIndex0 = 0) const;
8014 
8020  std::ostream & Print (std::ostream & inOutStream) const;
8021 
8025  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
8026 
8028  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
8029 
8031  inline explicit NTV2BankSelGetSetRegs (const NTV2BankSelGetSetRegs & inObj) : mHeader(0xFEFEFEFE, 0), mIsWriting(false), mInBankInfos(0), mInRegInfos(0)
8032  {(void) inObj;}
8033  inline NTV2BankSelGetSetRegs & operator = (const NTV2BankSelGetSetRegs & inRHS) {(void) inRHS; return *this;}
8035  #endif // !defined (NTV2_BUILDING_DRIVER)
8037 
8038 
8043  NTV2_HEADER mHeader;
8044  ULWord mOperation;
8045  ULWord mFlags;
8046  ULWord mInterruptID;
8047  ULWord mResult;
8048  ULWord64 mInterruptIDs;
8049  ULWord64 mEventHandle;
8050  ULWord64 mClientID;
8051  ULWord64 mClientPID;
8052  ULWord64 mClientTID;
8053  ULWord mCount;
8054  NTV2Buffer mHandles;
8055  ULWord mSpares[32];
8056  NTV2_TRAILER mTrailer;
8057 
8058  #if !defined (NTV2_BUILDING_DRIVER)
8059  explicit NTV2ConfigInterrupt(const void * pClient = nullptr);
8061 
8062  // SUPPORTED OPERATIONS
8063  static const ULWord kOpINVALID = 0x00000000;
8064  static const ULWord kOpFIRST = 0x00000001;
8065  static const ULWord kOpSubscribe = kOpFIRST;
8066  static const ULWord kOpUnsubscribe = 0x00000002;
8067  static const ULWord kOpEnable = 0x00000003;
8068  static const ULWord kOpDisable = 0x00000004;
8069  static const ULWord kOpGetSubscribed = 0x00000005;
8070  static const ULWord kOpGetEnabledIDs = 0x00000006;
8071  static const ULWord kOpGetIntCount = 0x00000007;
8072  static const ULWord kOpSetIntCount = 0x00000008;
8073  static const ULWord kOpLAST = kOpSetIntCount;
8074 
8075  // OPTION FLAGS
8076  static const ULWord kFlagMaskCreateHandle = 0x00000001;
8077  static const ULWord kFlagMaskIncludeGlobals = 0x00000002;
8078 
8079  // Inquiry
8080  inline ULWord operation (void) const {return mOperation;}
8081  inline ULWord flags (void) const {return mFlags;}
8082  inline INTERRUPT_ENUMS interruptID (void) const {return INTERRUPT_ENUMS(mInterruptID);}
8083  inline uint64_t interruptIDs (void) const {return mInterruptIDs;}
8084  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);}
8085  inline operator bool() const {return isValid();}
8086  inline bool isSuccess (void) const {return mResult ? true : false;}
8087  inline bool isFail (void) const {return !isSuccess();}
8088  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);}
8089  std::ostream & print (std::ostream & oss) const;
8090  inline uint64_t clientID (void) const {return mClientID;}
8091  inline uint64_t clientPID (void) const {return mClientPID;}
8092  inline uint64_t clientTID (void) const {return mClientTID;}
8093  inline ULWord count (void) const {return mCount;}
8094  inline size_t maxHandleCapacity (void) const {return mHandles.GetByteCount() / sizeof(uint64_t);}
8095  inline HANDLE eventHandle (const INTERRUPT_ENUMS id) const {return isValid() && mHandles && size_t(id) < maxHandleCapacity() ? HANDLE(mHandles.U64(int(id))) : HANDLE(0);}
8096  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;}
8097 
8098  inline bool hasCreateHandleFlag (void) const {return flags() & kFlagMaskCreateHandle;}
8099  inline bool hasIncludeGlobalsFlag (void) const {return flags() & kFlagMaskIncludeGlobals;}
8100 
8101  // Changing/Configuring
8102  inline NTV2ConfigInterrupt & doSubscribe (const INTERRUPT_ENUMS id) {return doSubscribeEvent(id,HANDLE(0)).setCreateEvent();}
8103  inline NTV2ConfigInterrupt & doSubscribeEvent (const INTERRUPT_ENUMS id, const HANDLE & hdl) {return setOperation(kOpSubscribe).setInterruptID(id).setEventHandle(hdl);}
8104  inline NTV2ConfigInterrupt & doUnsubscribe (const INTERRUPT_ENUMS id) {return setOperation(kOpUnsubscribe).setInterruptID(id);}
8105  inline NTV2ConfigInterrupt & doEnable (const INTERRUPT_ENUMS id) {return setOperation(kOpEnable).setInterruptID(id);}
8106  inline NTV2ConfigInterrupt & doDisable (const INTERRUPT_ENUMS id) {return setOperation(kOpDisable).setInterruptID(id);}
8107  inline NTV2ConfigInterrupt & doGetCount (const INTERRUPT_ENUMS id) {return setOperation(kOpGetIntCount).setInterruptID(id);}
8108  inline NTV2ConfigInterrupt & doSetCount (const INTERRUPT_ENUMS id, const ULWord cnt=0) {return setOperation(kOpSetIntCount).setInterruptID(id).setCount(cnt);}
8109  inline NTV2ConfigInterrupt & doGetSubscribed (const bool includeHdls = false)
8110  { if (includeHdls)
8111  mHandles.Allocate(size_t(eNumInterruptTypes));
8112  else
8113  mHandles.Set(nullptr, 0);
8114  return setOperation(kOpGetSubscribed);
8115  }
8116 
8117  inline NTV2ConfigInterrupt & setResult (const ULWord val) {mResult = val; return *this;}
8118  inline NTV2ConfigInterrupt & setFail (void) {return setResult(0);}
8119  inline NTV2ConfigInterrupt & setSuccess (const bool b = true) {return setResult(b ? 1 : 0);}
8120  inline NTV2ConfigInterrupt & setClientID (const uint64_t id) {mClientID = id; return *this;}
8121  inline NTV2ConfigInterrupt & setCount (const ULWord val) {mCount = val; return *this;}
8122  NTV2ConfigInterrupt & setOperation (const ULWord op);
8123  inline NTV2ConfigInterrupt & setInterruptID (const INTERRUPT_ENUMS id) {mInterruptID = ULWord(id); return *this;}
8124  inline NTV2ConfigInterrupt & setEventHandle (const HANDLE & h) {mEventHandle = ULWord64(h); mCount = 0; mHandles.Set(nullptr,0); return *this;}
8125  inline NTV2ConfigInterrupt & setCreateEvent (void) {mFlags |= kFlagMaskCreateHandle; return *this;}
8126 
8127  static std::string OpName (const ULWord op);
8128  static NTV2StringList IntNames (const uint64_t mask);
8129  static std::string IntName (const INTERRUPT_ENUMS id);
8130 
8132  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
8133 
8135  inline explicit NTV2ConfigInterrupt (const NTV2ConfigInterrupt & inObj) : mHeader(0xFEFEFEFE, 0) {(void)inObj;}
8136  inline NTV2ConfigInterrupt & operator = (const NTV2ConfigInterrupt & inRHS) {(void)inRHS; return *this;}
8138  #endif // user-space clients only
8140 
8142 
8143  #define AsNTV2ConfigInterrupt(_p_) (reinterpret_cast<NTV2ConfigInterrupt*>(_p_))
8144  #define AsNTV2CfgInterrupt(_p_) (reinterpret_cast<NTV2ConfigInterrupt*>(_p_))
8145  #if !defined (NTV2_BUILDING_DRIVER)
8146  AJAExport std::ostream & operator << (std::ostream & oss, const NTV2ConfigInterrupt & msg);
8147  #endif// !defined (NTV2_BUILDING_DRIVER)
8148 
8149 
8154  NTV2_STRUCT_BEGIN (NTV2VirtualData) // NTV2_TYPE_VIRTUAL_DATA_RW
8155  NTV2_HEADER mHeader;
8156  ULWord mTag;
8157  ULWord mIsWriting;
8158  NTV2Buffer mVirtualData;
8159  NTV2_TRAILER mTrailer;
8160 
8161  #if !defined (NTV2_BUILDING_DRIVER)
8162 
8169  explicit NTV2VirtualData (const ULWord inTag, const void* inVirtualData, const size_t inVirtualDataSize, const bool inDoWrite = false);
8170 
8176  std::ostream & Print (std::ostream & inOutStream) const;
8177 
8181  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
8182 
8184  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
8185 
8186  #endif // !defined (NTV2_BUILDING_DRIVER)
8188 
8189 
8190 
8195  #define NTV2_MESSAGE_DATA_RW BIT(0)
8196 
8197  NTV2_STRUCT_BEGIN (NTV2MessageData) // NTV2_TYPE_MESSAGE_DATA
8198  NTV2_HEADER mHeader;
8199  NTV2Buffer mMessage;
8200  ULWord mFlags;
8201  ULWord mStatus;
8202  NTV2_TRAILER mTrailer;
8203 
8204  #if !defined (NTV2_BUILDING_DRIVER)
8205 
8211  explicit NTV2MessageData (const void* inMessage, const size_t inMessageSize, const ULWord inFlags);
8212 
8216  ULWord GetStatus (void) { return mStatus; }
8217 
8223  std::ostream & Print (std::ostream & inOutStream) const;
8224 
8228  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
8229 
8231  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
8232 
8233  #endif // !defined (NTV2_BUILDING_DRIVER)
8235 
8236 
8237 
8242  NTV2_STRUCT_BEGIN (NTV2SDIInStatistics) // NTV2_TYPE_SDISTATS
8244  NTV2_HEADER mHeader;
8245  NTV2Buffer mInStatistics;
8246  NTV2_TRAILER mTrailer;
8248 
8249  #if !defined (NTV2_BUILDING_DRIVER)
8250 
8254 
8258  void Clear (void);
8259 
8266  bool GetSDIInputStatus (NTV2SDIInputStatus & outStatus, const UWord inSDIInputIndex0 = 0);
8267 
8272  NTV2SDIInputStatus & operator [] (const size_t inSDIInputIndex0); // New in SDK 16.0
8273 
8279  std::ostream & Print (std::ostream & inOutStream) const;
8280 
8284  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 18.1
8285 
8287  NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer)
8288  #endif // !defined (NTV2_BUILDING_DRIVER)
8290 
8291 
8292 
8305  NTV2_STRUCT_BEGIN (FRAME_STAMP) // NTV2_TYPE_ACFRAMESTAMP
8306  NTV2_HEADER acHeader;
8307 
8310  LWord64 acFrameTime;
8312  ULWord acRequestedFrame;
8316  ULWord64 acAudioClockTimeStamp;
8319  ULWord acAudioExpectedAddress;
8325  ULWord acAudioInStartAddress;
8326  ULWord acAudioInStopAddress;
8328  ULWord acAudioOutStopAddress;
8330  ULWord acAudioOutStartAddress;
8332  ULWord acTotalBytesTransferred;
8334  ULWord acStartSample;
8335 
8347  NTV2Buffer acTimeCodes;
8349  LWord64 acCurrentTime;
8359  ULWord acCurrentFrame;
8364  LWord64 acCurrentFrameTime;
8365  ULWord64 acAudioClockCurrentTime;
8369  ULWord acCurrentAudioExpectedAddress; // FIXFIXFIX Document What is this?!
8376  ULWord acCurrentAudioStartAddress;
8377  ULWord acCurrentFieldCount;
8378  ULWord acCurrentLineCount;
8379  ULWord acCurrentReps;
8380  ULWord64 acCurrentUserCookie;
8381  ULWord acFrame;
8386  NTV2_TRAILER acTrailer;
8388 
8389  #if !defined (NTV2_BUILDING_DRIVER)
8390 
8393  explicit FRAME_STAMP ();
8394 
8399  FRAME_STAMP (const FRAME_STAMP & inObj);
8400 
8404  ~FRAME_STAMP ();
8405 
8410  bool SetFrom (const FRAME_STAMP_STRUCT & inOldStruct);
8411 
8416  bool CopyTo (FRAME_STAMP_STRUCT & outOldStruct) const;
8417 
8424  bool GetInputTimeCodes (NTV2TimeCodeList & outValues) const;
8425 
8435  bool GetInputTimeCodes (NTV2TimeCodes & outTimeCodes, const NTV2Channel inSDIInput, const bool inValidOnly = true) const;
8436 
8445  bool GetInputTimeCode (NTV2_RP188 & outTimeCode, const NTV2TCIndex inTCIndex = NTV2_TCINDEX_SDI1) const;
8446 
8453  bool GetSDIInputStatus (NTV2SDIInputStatus & outStatus, const UWord inSDIInputIndex0 = 0) const;
8454 
8462  bool SetInputTimecode (const NTV2TCIndex inTCNdx, const NTV2_RP188 & inTimecode);
8463 
8468  FRAME_STAMP & operator = (const FRAME_STAMP & inRHS);
8469 
8474  std::string operator [] (const unsigned inIndexNum) const;
8475 
8479  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
8480 
8482  NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer)
8483 
8484  #endif // !defined (NTV2_BUILDING_DRIVER)
8486 
8487 
8488 
8494  NTV2_HEADER acHeader;
8496  LWord acTransferFrame;
8497  ULWord acBufferLevel;
8498  ULWord acFramesProcessed;
8499  ULWord acFramesDropped;
8500  FRAME_STAMP acFrameStamp;
8501  ULWord acAudioTransferSize;
8502  ULWord acAudioStartSample;
8503  ULWord acAncTransferSize;
8504  ULWord acAncField2TransferSize;
8505  NTV2_TRAILER acTrailer;
8506 
8507  #if !defined (NTV2_BUILDING_DRIVER)
8508 
8511  explicit AUTOCIRCULATE_TRANSFER_STATUS ();
8512 
8516  inline const FRAME_STAMP & GetFrameStamp (void) const {return acFrameStamp;}
8517 
8521  inline LWord GetTransferFrame (void) const {return acTransferFrame;}
8522 
8526  inline NTV2AutoCirculateState GetState (void) const {return acState;}
8527 
8531  inline ULWord GetBufferLevel (void) const {return acBufferLevel;}
8532 
8536  inline ULWord GetProcessedFrameCount (void) const {return acFramesProcessed;}
8537 
8541  inline ULWord GetDroppedFrameCount (void) const {return acFramesDropped;}
8542 
8548  inline ULWord GetCapturedAudioByteCount (void) const {return acAudioTransferSize;}
8549 
8556  inline ULWord GetCapturedAncByteCount (const bool inField2 = false) const {return inField2 ? acAncField2TransferSize : acAncTransferSize;}
8557 
8564  inline ULWord GetCapturedAuxByteCount (const bool inField2 = false) const {return GetCapturedAncByteCount(inField2);}
8565 
8567  NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer)
8568 
8570  inline explicit AUTOCIRCULATE_TRANSFER_STATUS (const AUTOCIRCULATE_TRANSFER_STATUS & inObj) : acHeader(0xFEFEFEFE, 0) {(void) inObj;}
8571  inline AUTOCIRCULATE_TRANSFER_STATUS & operator = (const AUTOCIRCULATE_TRANSFER_STATUS & inRHS) {(void) inRHS; return *this;}
8573  #endif // !defined (NTV2_BUILDING_DRIVER)
8575 
8576 
8577 
8583  NTV2_HEADER acHeader;
8584 
8590  NTV2Buffer acVideoBuffer;
8591 
8597  NTV2Buffer acAudioBuffer;
8598 
8608  NTV2Buffer acANCBuffer;
8609 
8619  NTV2Buffer acANCField2Buffer;
8620 
8627  NTV2Buffer acOutputTimeCodes;
8628 
8635 
8641  ULWord64 acInUserCookie;
8642 
8649  ULWord acInVideoDMAOffset;
8650 
8651  NTV2SegmentedDMAInfo acInSegmentedDMAInfo;
8652  NTV2ColorCorrectionData acColorCorrection;
8653  NTV2FrameBufferFormat acFrameBufferFormat;
8654  NTV2FBOrientation acFrameBufferOrientation;
8655  AutoCircVidProcInfo acVidProcInfo;
8656  NTV2QuarterSizeExpandMode acVideoQuarterSizeExpand;
8657 
8658  NTV2Buffer acHDMIAuxData;
8659 
8663  ULWord acPeerToPeerFlags;
8665  ULWord acFrameRepeatCount;
8666  LWord acDesiredFrame;
8669  NTV2_TRAILER acTrailer;
8671 
8672  #if !defined (NTV2_BUILDING_DRIVER)
8673 
8676  explicit AUTOCIRCULATE_TRANSFER ();
8679 
8703  explicit AUTOCIRCULATE_TRANSFER (ULWord * pInVideoBuffer, const ULWord inVideoByteCount, ULWord * pInAudioBuffer = AJA_NULL,
8704  const ULWord inAudioByteCount = 0, ULWord * pInANCBuffer = AJA_NULL, const ULWord inANCByteCount = 0,
8705  ULWord * pInANCF2Buffer = AJA_NULL, const ULWord inANCF2ByteCount = 0);
8710  void Clear (void);
8711 
8713  inline explicit AUTOCIRCULATE_TRANSFER (const AUTOCIRCULATE_TRANSFER & inObj)
8714  : acHeader(0xFEFEFEFE, 0), acVideoBuffer(0), acAudioBuffer(0),
8715  acANCBuffer(0), acANCField2Buffer(0), acOutputTimeCodes(0), acHDMIAuxData(0)
8716  {(void) inObj;}
8717  inline AUTOCIRCULATE_TRANSFER & operator = (const AUTOCIRCULATE_TRANSFER & inRHS) {(void) inRHS; return *this;}
8720 
8724 
8750  bool SetBuffers (ULWord * pInVideoBuffer, const ULWord inVideoByteCount,
8751  ULWord * pInAudioBuffer, const ULWord inAudioByteCount,
8752  ULWord * pInANCBuffer, const ULWord inANCByteCount,
8753  ULWord * pInANCF2Buffer = AJA_NULL, const ULWord inANCF2ByteCount = 0);
8754 
8766  bool SetVideoBuffer (ULWord * pInVideoBuffer, const ULWord inVideoByteCount);
8767 
8778  bool SetAudioBuffer (ULWord * pInAudioBuffer, const ULWord inAudioByteCount);
8779 
8801  bool SetAncBuffers (ULWord * pInANCBuffer, const ULWord inANCByteCount,
8802  ULWord * pInANCF2Buffer = AJA_NULL, const ULWord inANCF2ByteCount = 0);
8806  inline const NTV2Buffer & GetVideoBuffer (void) const {return acVideoBuffer;}
8807 
8811  inline const NTV2Buffer & GetAudioBuffer (void) const {return acAudioBuffer;}
8812 
8817  inline const NTV2Buffer & GetAncBuffer (const bool inField2 = false) const {return inField2 ? acANCField2Buffer : acANCBuffer;}
8819 
8823 
8833  bool SetOutputTimeCodes (const NTV2TimeCodes & inValues);
8834 
8845  bool SetOutputTimeCode (const NTV2_RP188 & inTimecode, const NTV2TCIndex inTCIndex = NTV2_TCINDEX_SDI1);
8846 
8855  bool SetAllOutputTimeCodes (const NTV2_RP188 & inTimecode, const bool inIncludeF2 = true);
8856 
8864  bool GetInputTimeCodes (NTV2TimeCodeList & outValues) const;
8865 
8876  bool GetInputTimeCode (NTV2_RP188 & outTimeCode, const NTV2TCIndex inTCIndex = NTV2_TCINDEX_SDI1) const;
8877 
8890  bool GetInputTimeCodes (NTV2TimeCodes & outTimeCodes, const NTV2Channel inSDIInput = NTV2_CHANNEL1, const bool inValidOnly = true) const;
8892 
8896 
8907  inline bool SetFrameUserCookie (const ULWord64 & inUserCookie) {acInUserCookie = inUserCookie; return true;}
8908 
8916  bool SetFrameBufferFormat (const NTV2FrameBufferFormat inNewFormat);
8917 
8921  inline void EnableQuarterSizeExpandMode (void) {acVideoQuarterSizeExpand = NTV2_QuarterSizeExpandOn;}
8922 
8926  inline void DisableQuarterSizeExpandMode (void) {acVideoQuarterSizeExpand = NTV2_QuarterSizeExpandOff;}
8927 
8931  inline bool IsQuarterSizeExpandModeEnabled (void) const {return acVideoQuarterSizeExpand == NTV2_QuarterSizeExpandOn;}
8932 
8937  inline const AUTOCIRCULATE_TRANSFER_STATUS & GetTransferStatus (void) const {return acTransferStatus;}
8938 
8943  inline const FRAME_STAMP & GetFrameInfo (void) const {return acTransferStatus.acFrameStamp;}
8944 
8949  inline ULWord GetCapturedAudioByteCount (void) const {return acTransferStatus.GetCapturedAudioByteCount();}
8950 
8951  inline NTV2_DEPRECATED_f(ULWord GetAudioByteCount (void) const) {return GetCapturedAudioByteCount ();}
8952 
8959  inline ULWord GetCapturedAncByteCount (const bool inField2 = false) const {return acTransferStatus.GetCapturedAncByteCount(inField2);}
8960  inline NTV2_SHOULD_BE_DEPRECATED(ULWord GetAncByteCount (const bool inField2 = false) const) {return GetCapturedAncByteCount(inField2);}
8961 
8965  inline NTV2FrameBufferFormat GetFrameBufferFormat (void) const {return acFrameBufferFormat;}
8966 
8970  inline LWord GetTransferFrameNumber (void) const {return acTransferStatus.GetTransferFrame();}
8972 
8976 
8990  bool EnableSegmentedDMAs (const ULWord inNumSegments, const ULWord inNumActiveBytesPerLine,
8991  const ULWord inHostBytesPerLine, const ULWord inDeviceBytesPerLine);
8996  bool DisableSegmentedDMAs (void);
8997 
9001  bool SegmentedDMAsEnabled (void) const;
9003 
9007  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
9008 
9010  NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer)
9011  #endif // user-space clients only
9013 
9014 
9015 
9020  NTV2_HEADER mHeader;
9021  NTV2Buffer mSharedMemory;
9022  // and its length. The AJADebug logging facility owns and manages this memory.
9023  // If NULL or zero length, debug logging will be disabled in the driver.
9024  // If non-NULL and zero length, debug logging will be enabled in the driver.
9025  ULWord mReserved[32];
9026  NTV2_TRAILER mTrailer;
9027 
9028  #if !defined (NTV2_BUILDING_DRIVER)
9029 
9033  explicit NTV2DebugLogging (const bool inEnable = false);
9034 
9040  std::ostream & Print (std::ostream & inOutStream) const;
9041 
9042  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
9043 
9044  #endif // !defined (NTV2_BUILDING_DRIVER)
9046 
9047 
9048 
9056  NTV2_HEADER mHeader;
9057  NTV2Buffer mBuffer;
9058  // A NULL buffer (or zero length) releases all locked buffers.
9059  ULWord mFlags;
9060  ULWord64 mMaxLockSize;
9061  ULWord mReserved[30];
9062  NTV2_TRAILER mTrailer;
9063 
9064  #if !defined (NTV2_BUILDING_DRIVER)
9065 
9068  explicit NTV2BufferLock ();
9070  inline ~NTV2BufferLock () {}
9071 
9077  explicit NTV2BufferLock (const NTV2Buffer & inBuffer, const ULWord inFlags);
9078 
9085  explicit NTV2BufferLock (const ULWord * pInBuffer, const ULWord inByteCount, const ULWord inFlags);
9086 
9092  explicit NTV2BufferLock (const ULWord64 inMaxLockSize, const ULWord inFlags); // New in SDK 16.0
9094 
9098 
9104  bool SetBuffer (const NTV2Buffer & inBuffer);
9105 
9112  inline bool SetBuffer (const ULWord * pInBuffer, const ULWord inByteCount)
9113  {
9114  return SetBuffer(NTV2Buffer(pInBuffer, inByteCount));
9115  }
9116 
9121  inline void SetFlags (const ULWord inFlags) {NTV2_ASSERT_STRUCT_VALID; mFlags = inFlags;}
9122 
9127  inline void SetMaxLockSize (const ULWord64 inNumBytes) {NTV2_ASSERT_STRUCT_VALID; mMaxLockSize = inNumBytes;} // New in SDK 16.0
9128 
9133  inline void Clear (void)
9134  {
9135  SetBuffer(NTV2Buffer());
9136  SetFlags(0);
9137  SetMaxLockSize(0);
9138  }
9140 
9146  std::ostream & Print (std::ostream & inOutStream) const;
9147 
9148  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
9149 
9150  #endif // !defined (NTV2_BUILDING_DRIVER)
9152 
9153 
9154 
9160  NTV2_HEADER mHeader;
9161  NTV2Buffer mBuffer;
9162  ULWord mFlags;
9163  ULWord mStatus;
9164  ULWord mRegisters[16];
9165  ULWord mReserved[32];
9166  NTV2_TRAILER mTrailer;
9167 
9168  #if !defined (NTV2_BUILDING_DRIVER)
9169 
9172  explicit NTV2Bitstream ();
9174  inline ~NTV2Bitstream () {}
9175 
9181  explicit NTV2Bitstream (const NTV2Buffer & inBuffer, const ULWord inFlags);
9182 
9189  explicit NTV2Bitstream (const ULWord * pInBuffer, const ULWord inByteCount, const ULWord inFlags);
9191 
9195 
9201  bool SetBuffer (const NTV2Buffer & inBuffer);
9202 
9209  inline bool SetBuffer (const ULWord * pInBuffer, const ULWord inByteCount) {return SetBuffer(NTV2Buffer(pInBuffer, inByteCount));}
9210 
9215  inline void SetFlags (const ULWord inFlags) {NTV2_ASSERT_STRUCT_VALID; mFlags = inFlags;}
9216 
9220  inline void Clear (void) {SetBuffer(NTV2Buffer());}
9222 
9228  std::ostream & Print (std::ostream & inOutStream) const;
9229 
9233  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
9234 
9236  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
9237 
9238  #endif // !defined (NTV2_BUILDING_DRIVER)
9240 
9241 
9242  // Stream channel action flags
9243  #define NTV2_STREAM_CHANNEL_INITIALIZE BIT(0)
9244  #define NTV2_STREAM_CHANNEL_RELEASE BIT(1)
9245  #define NTV2_STREAM_CHANNEL_START BIT(2)
9246  #define NTV2_STREAM_CHANNEL_STOP BIT(3)
9247  #define NTV2_STREAM_CHANNEL_FLUSH BIT(4)
9248  #define NTV2_STREAM_CHANNEL_STATUS BIT(5)
9249  #define NTV2_STREAM_CHANNEL_WAIT BIT(6)
9250 
9251  // Stream channel state flags
9252  #define NTV2_STREAM_CHANNEL_STATE_DISABLED BIT(0)
9253  #define NTV2_STREAM_CHANNEL_STATE_INITIALIZED BIT(1)
9254  #define NTV2_STREAM_CHANNEL_STATE_RELEASED BIT(2)
9255  #define NTV2_STREAM_CHANNEL_STATE_IDLE BIT(3)
9256  #define NTV2_STREAM_CHANNEL_STATE_ACTIVE BIT(4)
9257  #define NTV2_STREAM_CHANNEL_STATE_ERROR BIT(5)
9258 
9259  // Stream buffer action flags
9260  #define NTV2_STREAM_BUFFER_QUEUE BIT(1)
9261  #define NTV2_STREAM_BUFFER_RELEASE BIT(2)
9262  #define NTV2_STREAM_BUFFER_STATUS BIT(3)
9263 
9264  // Stream buffer state flags
9265  #define NTV2_STREAM_BUFFER_STATE_QUEUED BIT(0)
9266  #define NTV2_STREAM_BUFFER_STATE_LINKED BIT(1)
9267  #define NTV2_STREAM_BUFFER_STATE_COMPLETED BIT(2)
9268  #define NTV2_STREAM_BUFFER_STATE_FLUSHED BIT(3)
9269  #define NTV2_STREAM_BUFFER_STATE_RELEASED BIT(4)
9270  #define NTV2_STREAM_BUFFER_STATE_ERROR BIT(5)
9271 
9272  // Stream action status flags
9273  #define NTV2_STREAM_STATUS_SUCCESS BIT(0)
9274  #define NTV2_STREAM_STATUS_FAIL BIT(1)
9275  #define NTV2_STREAM_STATUS_STATE BIT(2)
9276  #define NTV2_STREAM_STATUS_MESSAGE BIT(3)
9277  #define NTV2_STREAM_STATUS_INVALID BIT(4)
9278  #define NTV2_STREAM_STATUS_TIMEOUT BIT(5)
9279  #define NTV2_STREAM_STATUS_RESOURCE BIT(6)
9280  #define NTV2_STREAM_STATUS_OWNER BIT(7)
9281 
9283  NTV2_HEADER mHeader;
9284  NTV2Channel mChannel;
9285  ULWord mFlags;
9286  ULWord mStatus;
9287  ULWord mStreamState;
9288  ULWord64 mBufferCookie;
9289  LWord64 mStartTime;
9290  LWord64 mStopTime;
9291  ULWord64 mQueueCount;
9292  ULWord64 mReleaseCount;
9293  ULWord64 mActiveCount;
9294  ULWord64 mRepeatCount;
9295  ULWord64 mIdleCount;
9296  ULWord mReserved[32];
9297  NTV2_TRAILER mTrailer;
9298 
9299  #if !defined (NTV2_BUILDING_DRIVER)
9300 
9303  explicit NTV2StreamChannel ();
9305  inline ~NTV2StreamChannel () {}
9306 
9308  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
9309 
9314  inline ULWord GetQueueDepth (void) {return (ULWord)(mQueueCount - mReleaseCount);}
9315 
9320  inline bool IsIdle (void) {return ((mStreamState & NTV2_STREAM_CHANNEL_STATE_IDLE) != 0);}
9321 
9326  inline bool IsActive (void) {return ((mStreamState & NTV2_STREAM_CHANNEL_STATE_ACTIVE) != 0);}
9327 
9332  inline bool HasError (void) {return ((mStreamState & NTV2_STREAM_CHANNEL_STATE_ERROR) != 0);}
9333 
9334  std::ostream & Print (std::ostream & inOutStream) const;
9335 
9336  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
9337 
9338  #endif // !defined (NTV2_BUILDING_DRIVER)
9339 
9341 
9343  NTV2_HEADER mHeader;
9344  NTV2Channel mChannel;
9345  ULWord mFlags;
9346  ULWord mStatus;
9347  NTV2Buffer mBuffer;
9348  ULWord mSegmentSize;
9349  LWord mSegmentPitch;
9350  ULWord mNumSegments;
9351  ULWord64 mBufferCookie;
9352  ULWord mBufferState;
9353  LWord64 mQueueTime;
9354  LWord64 mActiveTime;
9355  LWord64 mCompleteTime;
9356  LWord64 mFlushTime;
9357  ULWord64 mTransferCount;
9358  ULWord mReserved[32];
9359  NTV2_TRAILER mTrailer;
9360 
9361  #if !defined (NTV2_BUILDING_DRIVER)
9362 
9365  explicit NTV2StreamBuffer ();
9367  inline ~NTV2StreamBuffer () {}
9368 
9370  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
9371 
9372  std::ostream & Print (std::ostream & inOutStream) const;
9373 
9374  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
9375 
9376  #endif // !defined (NTV2_BUILDING_DRIVER)
9377 
9379 
9380  // Mail buffer action flags
9381  #define NTV2_MAIL_BUFFER_SEND BIT(0)
9382  #define NTV2_MAIL_BUFFER_RECEIVE BIT(1)
9383 
9384  // Mail buffer status flags
9385  #define NTV2_MAIL_BUFFER_SUCCESS BIT(0)
9386  #define NTV2_MAIL_BUFFER_FAIL BIT(1)
9387  #define NTV2_MAIL_BUFFER_OVERFLOW BIT(2)
9388  #define NTV2_MAIL_BUFFER_TIMEOUT BIT(3)
9389  #define NTV2_MAIL_BUFFER_TRYAGAIN BIT(4)
9390 
9391  // Mail buffer maximum size
9392  #define NTV2_MAIL_BUFFER_MAX 4096
9393 
9395  NTV2_HEADER mHeader;
9396  NTV2Channel mChannel;
9397  NTV2Buffer mBuffer;
9398  ULWord mDataSize;
9399  ULWord mFlags;
9400  ULWord mDelay;
9401  ULWord mTimeout;
9402  ULWord mStatus;
9403  ULWord mReserved[32];
9404  NTV2_TRAILER mTrailer;
9405 
9406  #if !defined (NTV2_BUILDING_DRIVER)
9407 
9410  explicit NTV2MailBuffer ();
9412  inline ~NTV2MailBuffer () {}
9413 
9415  inline operator NTV2_HEADER*() {return reinterpret_cast<NTV2_HEADER*>(this);} // New in SDK 16.3
9416 
9417  std::ostream & Print (std::ostream & inOutStream) const;
9418 
9419  NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer)
9420 
9421  #endif // !defined (NTV2_BUILDING_DRIVER)
9422 
9424 
9425  #if !defined (NTV2_BUILDING_DRIVER)
9426  typedef std::set <NTV2VideoFormat> NTV2VideoFormatSet;
9427  typedef NTV2VideoFormatSet::const_iterator NTV2VideoFormatSetConstIter;
9428 
9429  typedef std::set <NTV2FrameBufferFormat> NTV2FrameBufferFormatSet;
9430  typedef NTV2FrameBufferFormatSet::const_iterator NTV2FrameBufferFormatSetConstIter;
9431  typedef NTV2FrameBufferFormatSet NTV2PixelFormats; // New in SDK 17.0
9433 
9434  typedef std::set <NTV2FrameGeometry> NTV2GeometrySet;
9435  typedef NTV2GeometrySet::const_iterator NTV2GeometrySetConstIter;
9436 
9437  typedef std::set <NTV2Standard> NTV2StandardSet;
9438  typedef NTV2StandardSet::const_iterator NTV2StandardSetConstIter;
9439 
9440  typedef std::set <NTV2InputSource> NTV2InputSourceSet;
9441  typedef NTV2InputSourceSet::const_iterator NTV2InputSourceSetConstIter;
9442 
9443  typedef std::set <NTV2OutputDestination> NTV2OutputDestinations;
9444  typedef NTV2OutputDestinations::const_iterator NTV2OutputDestinationsConstIter;
9445 
9446  typedef std::set <NTV2FrameRate> NTV2FrameRateSet;
9447  typedef NTV2FrameRateSet::const_iterator NTV2FrameRateSetConstIter;
9448 
9449  typedef std::set <NTV2AudioRate> NTV2AudioRateSet;
9450  typedef NTV2AudioRateSet::const_iterator NTV2AudioRateSetConstIter;
9451 
9458  AJAExport std::ostream & operator << (std::ostream & inOutStream, const UWordSequence & inData);
9459 
9466  AJAExport std::ostream & operator << (std::ostream & inOutStream, const ULWordSequence & inData);
9467 
9474  AJAExport std::ostream & operator << (std::ostream & inOutStream, const ULWord64Sequence & inData);
9475 
9481 
9490  AJAExport bool NTV2DeviceGetSupportedVideoFormats (const NTV2DeviceID inDeviceID, NTV2VideoFormatSet & outFormats);
9491 
9499 
9506  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2VideoFormatSet & inFormats);
9507 
9515  AJAExport bool NTV2DeviceGetSupportedPixelFormats (const NTV2DeviceID inDeviceID, NTV2PixelFormats & outFormats);
9516 
9522  AJAExport bool NTV2GetSupportedPixelFormats (NTV2PixelFormats & outFormats); // New in SDK 17.0
9523 
9529  AJAExport bool NTV2GetUnsupportedPixelFormats (NTV2PixelFormats & outFormats); // New in SDK 17.0
9530 
9536  AJAExport bool NTV2GetSupportedStandards (NTV2StandardSet & outStandards); // New in SDK 17.0
9537 
9543  AJAExport bool NTV2GetUnsupportedStandards (NTV2StandardSet & outStandards); // New in SDK 17.0
9544 
9551  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2PixelFormats & inFormats);
9552 
9560 
9568  AJAExport bool NTV2DeviceGetSupportedStandards (const NTV2DeviceID inDeviceID, NTV2StandardSet & outStandards);
9569 
9576  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2StandardSet & inStandards);
9577 
9585 
9593  AJAExport bool NTV2DeviceGetSupportedGeometries (const NTV2DeviceID inDeviceID, NTV2GeometrySet & outGeometries);
9594 
9601  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2GeometrySet & inGeometries);
9602 
9610 
9617  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2InputSourceSet & inSet);
9618 
9626 
9636  AJAExport bool NTV2DeviceGetSupportedInputSources (const NTV2DeviceID inDeviceID, NTV2InputSourceSet & outInputSources, const NTV2IOKinds inKinds = NTV2_IOKINDS_ALL); // New in SDK 16.3
9637 
9644  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2OutputDestinations & inSet); // New in SDK 16.0
9645 
9652  AJAExport NTV2OutputDestinations & operator += (NTV2OutputDestinations & inOutSet, const NTV2OutputDestinations & inSet); // New in SDK 16.0
9653 
9663  AJAExport bool NTV2DeviceGetSupportedOutputDests (const NTV2DeviceID inDeviceID, NTV2OutputDestinations & outOutputDests, const NTV2IOKinds inKinds = NTV2_IOKINDS_ALL); // New in SDK 16.3
9664 
9671  AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2FrameRateSet & inSet); // New in SDK 17.0
9672 
9679  AJAExport NTV2FrameRateSet & operator += (NTV2FrameRateSet & inOutSet, const NTV2FrameRateSet & inSet); // New in SDK 17.0
9680 
9689  AJAExport bool NTV2DeviceGetSupportedFrameRates (const NTV2DeviceID inDeviceID, NTV2FrameRateSet & outRates); // New in SDK 17.0
9690 
9691 
9698  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2_HEADER & inObj);
9699 
9706  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2_TRAILER & inObj);
9707 
9714  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2Buffer & inObj);
9715 
9722  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2_RP188 & inObj);
9723 
9730  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2TimeCodeList & inObj);
9731 
9738  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2TimeCodes & inObj);
9739 
9746  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2TCIndexes & inObj);
9747 
9754  AJAExport NTV2TCIndexes & operator += (NTV2TCIndexes & inOutSet, const NTV2TCIndexes & inSet);
9755 
9762  AJAExport std::ostream & operator << (std::ostream & inOutStream, const FRAME_STAMP & inObj);
9763 
9770  AJAExport std::ostream & operator << (std::ostream & inOutStream, const AUTOCIRCULATE_STATUS & inObj);
9771 
9778  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2SegmentedDMAInfo & inObj);
9779 
9786  AJAExport std::ostream & operator << (std::ostream & inOutStream, const AUTOCIRCULATE_TRANSFER & inObj);
9787 
9794  AJAExport std::ostream & operator << (std::ostream & inOutStream, const FRAME_STAMP & inObj);
9795 
9802  AJAExport std::ostream & operator << (std::ostream & inOutStream, const AUTOCIRCULATE_TRANSFER_STATUS & inObj);
9803 
9810  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2RegisterNumberSet & inObj);
9811 
9818  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2RegisterValueMap & inObj);
9819 
9826  AJAExport std::ostream & operator << (std::ostream & inOutStream, const AutoCircVidProcInfo & inObj);
9827 
9834  AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2ColorCorrectionData & inObj);
9835 
9842  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2GetRegisters & inObj) {return inObj.Print (inOutStream);}
9843 
9850  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2SetRegisters & inObj) {return inObj.Print (inOutStream);}
9851 
9858  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2BankSelGetSetRegs & inObj) {return inObj.Print (inOutStream);}
9859 
9866  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2SDIInStatistics & inObj) {return inObj.Print (inOutStream);}
9867 
9874  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2SDIInputStatus & inObj) {return inObj.Print (inOutStream);}
9875 
9882  AJAExport std::ostream & operator << (std::ostream & inOutStrm, const NTV2SegmentedXferInfo & inXferInfo);
9883 
9890  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2DebugLogging & inObj) {return inObj.Print (inOutStream);}
9891 
9898  AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2BufferLock & inObj) {return inObj.Print (inOutStream);}
9899  #endif // !defined (NTV2_BUILDING_DRIVER)
9900 
9901  #if defined (AJAMac)
9902  #pragma pack (pop)
9903  #endif // defined (AJAMac)
9904 
9906 #if !defined(NTV2_DEPRECATE_17_6)
9907 
9909  // maximum number of hevc streams
9910  #define HEVC_STREAM_MAX 4
9911 
9912  // maximum number of gpio ports
9913  #define HEVC_GPIO_MAX 64
9914 
9915  // version string maximum size (bytes)
9916  #define HEVC_VERSION_STRING_SIZE 64
9917 
9918  // picture and encoded information additional data size (bytes)
9919  #define HEVC_ADDITIONAL_DATA_SIZE ((4 + 4 + 256) * 16)
9920 
9921  // codec state flags
9922  #define HEVC_STATE_FLAG_VIDEO_STARTED 0x00000001U // codec video input capture started
9923 
9924  // transfer flags
9925  #define HEVC_TRANSFER_FLAG_IS_LAST_FRAME 0x00000001U // last stream frame
9926 
9927  // driver io status codes
9928  #define HEVC_STATUS_SUCCESS 0x00000001U
9929 
9930  // fatal error registers
9931  #define HEVC_FATAL_ERROR_INFO_REG 0x08000100U // codec error register base
9932  #define HEVC_FATAL_ERROR_INFO_COUNT 64 // number of codec error registers
9933 
9934  // driver debug register output enable bits
9935  #define HEVC_DEBUG_DRIVER_REGISTER 0x080000FCU // register address of debug bits
9936  #define HEVC_DEBUG_MASK_INFO 0x00000001 // general probe and cleanup
9937  #define HEVC_DEBUG_MASK_WARNING 0x00000002 // general warinings
9938  #define HEVC_DEBUG_MASK_ERROR 0x00000004 // general erros
9939  #define HEVC_DEBUG_MASK_INT_PRIMARY 0x00000008 // primary interrupt info
9940  #define HEVC_DEBUG_MASK_INT_COMMAND 0x00000010 // command tasklet info
9941  #define HEVC_DEBUG_MASK_INT_VEI 0x00000020 // raw stream tasklet info
9942  #define HEVC_DEBUG_MASK_INT_SEO 0x00000040 // encoded stream tasklet info
9943  #define HEVC_DEBUG_MASK_INT_ERROR 0x00000080 // interrupt errors
9944  #define HEVC_DEBUG_MASK_REGISTER_INFO 0x00000100 // register read/write info
9945  #define HEVC_DEBUG_MASK_REGISTER_STATE 0x00000200 // detailed register access info
9946  #define HEVC_DEBUG_MASK_REGISTER_ERROR 0x00000400 // register access errors
9947  #define HEVC_DEBUG_MASK_COMMAND_INFO 0x00000800 // command queue info
9948  #define HEVC_DEBUG_MASK_COMMAND_STATE 0x00001000 // detailed command processing info
9949  #define HEVC_DEBUG_MASK_COMMAND_ERROR 0x00002000 // command queue errors
9950  #define HEVC_DEBUG_MASK_STREAM_INFO 0x00004000 // stream (dma) queue info
9951  #define HEVC_DEBUG_MASK_STREAM_STATE 0x00008000 // detailed stream processing info
9952  #define HEVC_DEBUG_MASK_STREAM_COPY 0x00010000 // stream data copy info
9953  #define HEVC_DEBUG_MASK_STREAM_SEGMENT 0x00020000 // stream data segment info
9954  #define HEVC_DEBUG_MASK_STREAM_FRAME 0x00040000 // stream vif frame info
9955  #define HEVC_DEBUG_MASK_STREAM_ERROR 0x00080000 // stream queue errors
9956  #define HEVC_DEBUG_MASK_MEMORY_ALLOC 0x00100000 // buffer memory allocation info
9957  #define HEVC_DEBUG_MASK_MEMORY_ERROR 0x00200000 // buffer memory allocation errors
9958  #define HEVC_DEBUG_MASK_DMA_INFO 0x00400000 // dma send info
9959  #define HEVC_DEBUG_MASK_DMA_DESCRIPTOR 0x00800000 // dma descriptor dump
9960  #define HEVC_DEBUG_MASK_DMA_ERROR 0x01000000 // dma errors
9961  #define HEVC_DEBUG_MASK_STATUS_INFO 0x02000000 // status info requests
9962  #define HEVC_DEBUG_MASK_RESERVED_0 0x04000000
9963  #define HEVC_DEBUG_MASK_RESERVED_1 0x08000000
9964  #define HEVC_DEBUG_MASK_RESERVED_2 0x10000000
9965  #define HEVC_DEBUG_MASK_RESERVED_3 0x20000000
9966  #define HEVC_DEBUG_MASK_RESERVED_4 0x40000000
9967  #define HEVC_DEBUG_MASK_RESERVED_5 0x80000000
9968 
9969  // ntv2 gpio input registers
9970  #define HEVC_NTV2_GPIO_REGISTER_LOW 510
9971  #define HEVC_NTV2_GPIO_REGISTER_HIGH 511
9972 
9973 
9974  // hevc version information
9975  typedef struct HevcVersion
9976  {
9981  } HevcVersion;
9982 
9983  // pci id information
9984  typedef struct HevcPciId
9985  {
9990  } HevcPciId;
9991 
9992  // hevc device mode
9993  typedef enum HevcDeviceMode
9994  {
9996  Hevc_DeviceMode_Codec, // codec mode
9997  Hevc_DeviceMode_Maintenance, // maintenance mode
9999  } HevcDeviceMode;
10000 
10001  // hevc device information message
10002  typedef struct HevcDeviceInfo
10003  {
10004  HevcVersion driverVersion; // driver version
10005  HevcVersion mcpuVersion; // firmware versions
10011  HevcPciId pciId; // pci ids
10012  HevcDeviceMode deviceMode; // hardware device mode
10013  bool mcpuVersionCheck; // mcpu version supported
10014  bool systemVersionCheck; // system version supported
10015  bool standardSingleCheck; // standard firmware single version supported
10016  bool standardMultipleCheck; // standard fimwrare multiple version supported
10017  bool pciIdCheck; // pci id supported
10018  } HevcDeviceInfo;
10019 
10020  // hevc register
10021  typedef struct HevcDeviceRegister
10022  {
10023  ULWord address; // register address
10024  ULWord writeValue; // register write value
10025  ULWord readValue; // register read value
10026  ULWord mask; // register value mask
10027  ULWord shift; // register value shift
10028  bool write; // write flag
10029  bool read; // read flag
10030  bool forceBar4; // force bar4 access
10032 
10033  // hevc main state
10034  typedef enum HevcMainState
10035  {
10037  Hevc_MainState_Boot, // codec has booted
10038  Hevc_MainState_Init, // initialize codec
10039  Hevc_MainState_Encode, // configure encoding (load firmware?)
10040  Hevc_MainState_Error, // codec must be reset
10042  } HevcMainState;
10043 
10044  // encoder mode
10045  typedef enum HevcEncodeMode
10046  {
10048  Hevc_EncodeMode_Single, // encode a sigle stream
10049  Hevc_EncodeMode_Multiple, // encode multiple streams
10051  } HevcEncodeMode;
10052 
10053  // encoder firmware type
10054  typedef enum HevcFirmwareType
10055  {
10057  Hevc_FirmwareType_Standard, // encode firmware standard
10058  Hevc_FirmwareType_User, // encode firmware user
10060  } HevcFirmwareType;
10061 
10062  // hevc video interface state
10063  typedef enum HevcVifState
10064  {
10066  Hevc_VifState_Stop, // video interface stop
10067  Hevc_VifState_Start, // video interface start
10069  } HevcVifState;
10070 
10071  // hevc video input state
10072  typedef enum HevcVinState
10073  {
10075  Hevc_VinState_Stop, // video input stop
10076  Hevc_VinState_Start, // video input start
10078  } HevcVinState;
10079 
10080  // hevc encoder state
10081  typedef enum HevcEhState
10082  {
10084  Hevc_EhState_Stop, // encoder stop
10085  Hevc_EhState_Start, // encoder start
10086  Hevc_EhState_ReadyToStop, // encoder ready to stop
10088  } HevcEhState;
10089 
10090  // hevc gpio control
10091  typedef enum HevcGpioControl
10092  {
10094  Hevc_GpioControl_Function, // configure gpio port function
10095  Hevc_GpioControl_Direction, // configure gpio port direction
10096  Hevc_GpioControl_Set, // set gpio port value
10097  Hevc_GpioControl_Get, // get pgio port value
10099  } HevcGpioControl;
10100 
10101  // hevc gpio function
10102  typedef enum HevcGpioFunction
10103  {
10105  Hevc_GpioFunction_Gpio, // gpio function is gpio
10106  Hevc_GpioFunction_Peripheral, // gpio function is peripheral
10108  } HevcGpioFunction;
10109 
10110  // hevc gpio direction
10111  typedef enum HevcGpioDirection
10112  {
10114  Hevc_GpioDirection_Input, // gpio direction is input
10115  Hevc_GpioDirection_Output, // gpio direction is output
10118 
10119  // hevc gpio value
10120  typedef enum HevcGpioValue
10121  {
10123  Hevc_GpioValue_Low, // gpio direction is input
10124  Hevc_GpioValue_High, // gpio direction is output
10126  } HevcGpioValue;
10127 
10128  typedef enum HevcChangeSequence
10129  {
10135 
10136  // hevc change param target
10137  #define Hevc_ParamTarget_None 0x00000000
10138  #define Hevc_ParamTarget_Vbr 0x00000001 // change variable bitrate
10139  #define Hevc_ParamTarget_Cbr 0x00000002 // change constant bitrate
10140  #define Hevc_ParamTarget_Resolution 0x00000004 // change size, crop, pan, etc.
10141  #define Hevc_ParamTarget_Frame_Rate 0x00000008 // change frame rate
10142  #define Hevc_ParamTarget_All 0x0000000f
10143 
10144  // hevc commands
10145  typedef enum HevcCommand
10146  {
10148  Hevc_Command_MainState, // set main state
10149  Hevc_Command_VinState, // set video input state
10150  Hevc_Command_EhState, // set encoder state
10151  Hevc_Command_Gpio, // control gpio
10152  Hevc_Command_Reset, // reset codec
10153  Hevc_Command_ChangeParam, // change dynamic params during encode
10154  Hevc_Command_ChangePicture, // change picture type
10156  } HevcCommand;
10157 
10158  // hevc command information
10159  typedef struct HevcDeviceCommand
10160  {
10161  HevcCommand command; // command type
10162  // main state command info
10163  HevcMainState mainState; // set main state
10164  HevcEncodeMode encodeMode; // set encoder mode
10165  HevcFirmwareType firmwareType; // set encode firmware type
10166  // vin/eh state command info
10167  HevcVinState vinState; // set video input state
10168  HevcEhState ehState; // set encoder state
10169  ULWord streamBits; // command applies to each stream bit
10170  // gpio command info
10171  HevcGpioControl gpioControl; // gpio control type
10172  ULWord gpioNumber; // gpio port number (function, direction, set, get)
10173  HevcGpioFunction gpioFunction; // gpio port function (function)
10174  HevcGpioDirection gpioDirection; // gpio port direction (direction)
10175  HevcGpioValue gpioValue; // gpio port value (set, get)
10176  // change encode params
10177  ULWord paramTarget; // parameters to change
10178  ULWord paramStreamId; // stream id
10179  HevcChangeSequence changeSequence; // start new sequence (vbr)
10180  ULWord maxBitRate; // maximum bitrate (vbr)
10181  ULWord aveBitRate; // average bitrate (vbr and cbr)
10182  ULWord minBitRate; // minimum bitrate (vbr)
10183  ULWord seqEndPicNumber; // last picture number of sequence (resolution and frame rate)
10184  ULWord hSizeEh; // resolution parameters
10204  ULWord frameRateCode; // frame rate parameter
10205  // change picture type
10206  ULWord picType; // picture type
10207  ULWord picStreamId; // stream id
10208  ULWord gopEndPicNumber; // last picture number of gop
10209  // general command flags
10210  ULWord flags; // command flags
10212 
10213  // hevc stream types
10214  typedef enum HevcStream
10215  {
10217  Hevc_Stream_VideoRaw, // raw data stream
10218  Hevc_Stream_VideoEnc, // encoded data stream
10220  } HevcStream;
10221 
10222  // hevc picture data (raw streams)
10223  typedef struct HevcPictureData
10224  {
10225  ULWord serialNumber; // serial number (application data)
10226  ULWord ptsValueLow; // presentation time stamp (90kHz)
10227  ULWord ptsValueHigh; // pts high bit only (33 bit roll over)
10228  ULWord pictureNumber; // start with 1 and increment for each picture
10229  ULWord numAdditionalData; // number of additional data entries
10230  } HevcPictureData;
10231 
10232  // hevc picture information (raw streams)
10233  typedef struct HevcPictureInfo
10234  {
10235  HevcPictureData pictureData; // raw stream picture data
10236  //
10237  // additional data format
10238  // u32 additional_data_type
10239  // u32 additional_data_size (256 bytes max)
10240  // u8... additional_data_payload
10241  // ... more additional data
10242  //
10243  // additional data types
10244  // 1 = sei data
10245  // 2 = passthrough data (to encoded additional data of encoded frame)
10246  // 4 = cancel sei on every gop (set additional size to 0)
10247  //
10248  // sei data format
10249  // u8 user_sei_location
10250  // u8 user_sei_type
10251  // u8 user_sei_length
10252  // u8... user_sei_payload
10253  //
10254  // user sei location
10255  // 2 = every gop head picture
10256  // 3 = this picture only
10257  //
10258  // passthrough data format
10259  // u8... passthrough_data_payload
10260  //
10262  } HevcPictureInfo;
10263 
10264  // hevc encoded stream data (encoded streams)
10265  typedef struct HevcEncodedData
10266  {
10267  ULWord serialNumber; // serial number (from picture information)
10268  ULWord esOffsetLow; // encoded stream frame location (?)
10269  ULWord esOffsetHigh; // es frame location high 32 bits
10270  ULWord esSize; // encoded stream frame size (?)
10271  ULWord ptsValueLow; // presentation time stamp (picture information)
10272  ULWord ptsValueHigh; // pts high bit (33 bit roll over)
10273  ULWord dtsValueLow; // decoding time stamp (90 kHz)
10274  ULWord dtsValueHigh; // dts high bit (33 bit roll over)
10275  ULWord itcValueLow; // internal time clock (90 kHz)
10276  ULWord itcValueHigh; // itc high bit (33 bit roll over)
10277  ULWord itcExtension; // internal time extension (27 MHz)
10278  ULWord temporalId; // temporal ID
10279  ULWord esIdrType; // 0 = not IDR, 1 = IDR, 3 = IDR command
10280  ULWord pictureType; // 0 = I-frame, 1 = P-frame, 2 = B-frame
10281  ULWord nalOffset; // offset to the nal top of the idr/i picture
10282  ULWord cpbValue; // codec picture buffer occupancy value
10283  ULWord esHSize; // horizontal resolution
10284  ULWord esVSize; // vertical resolution
10285  ULWord esUnitsInTick; // frame duration (2x eh param value for half rate)
10286  ULWord esBitRate; // bit rate (Kbps)
10287  ULWord esEndFlag; // 0 = not end of sequence, 1 = end of sequence
10288  ULWord esLastFrame; // 0xffffffff = last frame
10297  ULWord numAdditionalData; // number of additional data entries
10298  } HevcEncodedData;
10299 
10300  // hevc encode stream information (encoded streams)
10301  typedef struct HevcEncodedInfo
10302  {
10303  HevcEncodedData encodedData; // encoded stream data
10305  } HevcEncodedInfo;
10306 
10307  // hevc stream transfer information
10308  typedef struct HevcDeviceTransfer
10309  {
10310  HevcStream streamType; // transfer stream type
10311  ULWord streamId; // transfer stream id
10312 
10313  UByte* pVideoBuffer; // video buffer
10314  ULWord videoBufferSize; // total video buffer size
10315  ULWord videoDataSize; // video data size in buffer
10316 
10317  ULWord segVideoPitch; // video segment pitch
10318  ULWord segCodecPitch; // codec segment pitch
10319  ULWord segSize; // segment size
10320  ULWord segCount; // number of segments
10321 
10322  UByte* pInfoBuffer; // information buffer (picture or encoded)
10323  ULWord infoBufferSize; // total information buffer size
10324  ULWord infoDataSize; // information size in buffer
10325 
10326  LWord64 encodeTime; // frame encode time (100ns host system clock)
10327  ULWord flags; // transfer flags (see above for last frame flag)
10329 
10330  // hevc gpio port status
10331  typedef struct hevc_gpio_state
10332  {
10333  HevcGpioFunction function; // gpio last set port function
10334  HevcGpioDirection direction; // gpio last set port direction
10335  HevcGpioValue setValue; // gpio last set value
10336  HevcGpioValue getValue; // gpio last get value
10337  } HevcGpioState;
10338 
10339  // hevc stream statistics (nsec, bytes)
10340  typedef struct hevc_stream_statistics
10341  {
10342  LWord64 transferCount; // number of transfers queued
10343  LWord64 minTransferTime; // minimum time between transfers
10344  LWord64 avrTransferTime; // average time between transfers
10345  LWord64 maxTransferTime; // maximum time between transfers
10346  LWord64 minTransferSize; // minimum transfer size
10347  LWord64 maxTransferSize; // maximum transfer size
10348  LWord64 avrTransferSize; // average transfer size
10349  LWord64 minCopyDuration; // time for io thread to copy frames
10350  LWord64 maxCopyDuration; // to/from bounce buffer
10352  LWord64 minEnqueueDuration; // time from io thread enqueue
10353  LWord64 maxEnqueueDuration; // to send to codec
10355  LWord64 minSendDuration; // time from send to codec
10356  LWord64 maxSendDuration; // to codec acknowledge
10358  LWord64 minDmaDuration; // time from codec acknowledge
10359  LWord64 maxDmaDuration; // to codec dma completion
10361  LWord64 minDequeueDuration; // time from io thread enqueue
10362  LWord64 maxDequeueDuration; // to io thread dequeue
10365 
10366  // hevc status information
10367  typedef struct HevcDeviceStatus
10368  {
10369  HevcMainState mainState; // codec main state
10370  HevcEncodeMode encodeMode; // codec encode mode
10371  HevcFirmwareType firmwareType; // codec firmware type
10372 
10373  HevcVifState vifState[HEVC_STREAM_MAX]; // video interface state
10374  HevcVinState vinState[HEVC_STREAM_MAX]; // video input state
10377 
10378  LWord64 commandCount; // number of commands processed
10379  LWord64 rawTransferCount; // number of raw transfers processed
10380  LWord64 encTransferCount; // number of encoded transfers processed
10381 
10382  ULWord commandQueueLevel; // number of commands in command queue
10383  ULWord rawTransferQueueLevel; // number of transfers in raw transfer queue
10384  ULWord encTransferQueueLevel; // number of transfers in encoded transfer queue
10385  } HevcDeviceStatus;
10386 
10387  // hevc debug information
10388  typedef struct HevcDeviceDebug
10389  {
10390  HevcDeviceStatus deviceStatus; // device status structure
10391 
10392  HevcStreamStatistics rawStats[HEVC_STREAM_MAX]; // raw stream statistics
10393  HevcStreamStatistics encStats[HEVC_STREAM_MAX]; // encoded stream statistics
10394  ULWord queueLevel[HEVC_STREAM_MAX]; // stream queue level
10395  ULWord clearRawStatsBits; // stream bits to clear raw stream statistics
10396  ULWord clearEncStatsBits; // stream bits to clear encodec stream statistics
10397 
10398  ULWord cmdContCount; // codec command continuity count
10399  ULWord cmdAckContCount; // codec command acknowledge count
10400  ULWord cmdMsgContCount; // codec command message count
10401  ULWord rawContCount; // raw dma continuity count
10402  ULWord rawAckContCount; // raw dma acknowledge count
10403  ULWord rawMsgContCount; // raw dma message count
10404  ULWord encContCount; // encoded dma continuity count
10405  ULWord encAckContCount; // encoded dma acnowledge count
10406  ULWord encMsgContCount; // encoded dma message count
10407  } HevcDeviceDebug;
10408 
10409  // hevc driver ioctl message types
10410  typedef enum HevcMessageId
10411  {
10413  Hevc_MessageId_Info, // get device information
10414  Hevc_MessageId_Register, // write/read codec register
10415  Hevc_MessageId_Command, // send a codec command
10416  Hevc_MessageId_Transfer, // transfer codec stream data
10417  Hevc_MessageId_Status, // get codec status
10418  Hevc_MessageId_Debug, // get debug information
10420  } HevcMessageId;
10421 
10422  // hevc common driver ioctl message header
10423  typedef struct hevcMessageHeader
10424  {
10432 
10433  // hevc stream transfer data
10434  typedef struct HevcTransferData
10435  {
10450  } HevcTransferData;
10451 
10452  // hevc driver device information message
10453  typedef struct HevcMessageInfo
10454  {
10457  } HevcMessageInfo;
10458 
10459  // hevc driver register message
10460  typedef struct HevcMessageRegister
10461  {
10465 
10466  // hevc driver command message
10467  typedef struct HevcMessageCommand
10468  {
10472 
10473  // hevc driver transfer message
10474  typedef struct HevcMessageTransfer
10475  {
10479 
10480  // hevc driver status message
10481  typedef struct HevcMessageStatus
10482  {
10486 
10487  // hevc driver debug message
10488  typedef struct HevcMessageDebug
10489  {
10492  } HevcMessageDebug;
10493 #endif
10494 
10495 typedef struct HDRRegValues
10496 {
10497  uint16_t greenPrimaryX;
10498  uint16_t greenPrimaryY;
10499  uint16_t bluePrimaryX;
10500  uint16_t bluePrimaryY;
10501  uint16_t redPrimaryX;
10502  uint16_t redPrimaryY;
10503  uint16_t whitePointX;
10504  uint16_t whitePointY;
10511 
10512  #if !defined(NTV2_BUILDING_DRIVER)
10516  inline bool validPrimariesAndWhitePoint (void) const { const uint16_t kMax(0xC350);
10517  return greenPrimaryX <= kMax || greenPrimaryY <= kMax ||
10518  bluePrimaryX <= kMax || bluePrimaryY <= kMax ||
10519  redPrimaryX <= kMax || redPrimaryY <= kMax ||
10520  whitePointX <= kMax || whitePointY <= kMax; }
10521  inline HDRRegValues & setBT2020 (void) { greenPrimaryX = 0x2134; greenPrimaryY = 0x9BAA; bluePrimaryX = 0x1996; bluePrimaryY = 0x08FC;
10522  redPrimaryX = 0x8A48; redPrimaryY = 0x3908; whitePointX = 0x3D13; whitePointY = 0x4042;
10523  maxMasteringLuminance = 0x2710; minMasteringLuminance = 0x0032;
10525  electroOpticalTransferFunction = 0x02; staticMetadataDescriptorID = 0x00; return *this; }
10526  inline HDRRegValues & setDCIP3 (void) { greenPrimaryX = 0x33C2; greenPrimaryY = 0x86C4; bluePrimaryX = 0x1D4C; bluePrimaryY = 0x0BB8;
10527  redPrimaryX = 0x84D0; redPrimaryY = 0x3E80; whitePointX = 0x3D13; whitePointY = 0x4042;
10528  maxMasteringLuminance = 0x02E8; minMasteringLuminance = 0x0032;
10530  electroOpticalTransferFunction = 0x02; staticMetadataDescriptorID = 0x00; return *this; }
10531  #endif // !defined(NTV2_BUILDING_DRIVER)
10532 } HDRRegValues;
10533 
10534 typedef struct HDRFloatValues
10535 {
10550 
10551  #if !defined(NTV2_BUILDING_DRIVER)
10555 
10556  inline bool validPrimariesAndWhitePoint (void) const { return greenPrimaryX >= 0.0f || greenPrimaryX <= float(1.0f) ||
10557  greenPrimaryY >= 0.0f || greenPrimaryY <= float(1.0f) ||
10558  bluePrimaryX >= 0.0f || bluePrimaryX <= float(1.0f) ||
10559  bluePrimaryY >= 0.0f || bluePrimaryY <= float(1.0f) ||
10560  redPrimaryX >= 0.0f || redPrimaryX <= float(1.0f) ||
10561  redPrimaryY >= 0.0f || redPrimaryY <= float(1.0f) ||
10562  whitePointX >= 0.0f || whitePointX <= float(1.0f) ||
10563  whitePointY >= 0.0f || whitePointY <= float(1.0f) ||
10564  minMasteringLuminance >= 0 || minMasteringLuminance <= float(6.5535f); }
10565 
10566  inline bool setFromRegValues (const HDRRegValues & inRegValues) { if (!inRegValues.validPrimariesAndWhitePoint())
10567  return false;
10568  const float kMult(0.00002f), kMultLum(0.0001f);
10569  greenPrimaryX = float(inRegValues.greenPrimaryX * kMult);
10570  greenPrimaryY = float(inRegValues.greenPrimaryY * kMult);
10571  bluePrimaryX = float(inRegValues.bluePrimaryX * kMult);
10572  bluePrimaryY = float(inRegValues.bluePrimaryY * kMult);
10573  redPrimaryX = float(inRegValues.redPrimaryX * kMult);
10574  redPrimaryY = float(inRegValues.redPrimaryY * kMult);
10575  whitePointX = float(inRegValues.whitePointX * kMult);
10576  whitePointY = float(inRegValues.whitePointY * kMult);
10577  minMasteringLuminance = float(inRegValues.minMasteringLuminance * kMultLum);
10583  return true; }
10584 
10585  inline bool toRegValues (HDRRegValues & outVals) const { if (!validPrimariesAndWhitePoint())
10586  return false;
10587  outVals.greenPrimaryX = uint16_t(greenPrimaryX / float(0.00002f));
10588  outVals.greenPrimaryY = uint16_t(greenPrimaryY / float(0.00002f));
10589  outVals.bluePrimaryX = uint16_t(bluePrimaryX / float(0.00002f));
10590  outVals.bluePrimaryY = uint16_t(bluePrimaryY / float(0.00002f));
10591  outVals.redPrimaryX = uint16_t(redPrimaryX / float(0.00002f));
10592  outVals.redPrimaryY = uint16_t(redPrimaryY / float(0.00002f));
10593  outVals.whitePointX = uint16_t(whitePointX / float(0.00002f));
10594  outVals.whitePointY = uint16_t(whitePointY / float(0.00002f));
10595  outVals.minMasteringLuminance = uint16_t(minMasteringLuminance / float(0.0001f));
10601  return true; }
10602  #endif // !defined(NTV2_BUILDING_DRIVER)
10603 } HDRFloatValues;
10604 
10605 typedef struct HDRDriverValues{
10606  uint16_t greenPrimaryX;
10607  uint16_t greenPrimaryY;
10608  uint16_t bluePrimaryX;
10609  uint16_t bluePrimaryY;
10610  uint16_t redPrimaryX;
10611  uint16_t redPrimaryY;
10612  uint16_t whitePointX;
10613  uint16_t whitePointY;
10620  uint8_t luminance;
10622 
10623 #define NTV2_IS_VALID_HDR_PRIMARY(__val__) ((__val__) <= 0x0000C350)
10624 #define NTV2_IS_VALID_HDR_MASTERING_LUMINENCE(__val__) (true)
10625 #define NTV2_IS_VALID_HDR_LIGHT_LEVEL(__val__) (true)
10626 
10627 #if 0 && defined(_DEBUG)
10628  // One-stop-shop for pretend/fake device swap (AJA internal use only)
10629  #define NTV2_PRETEND_DEVICE
10630  #define NTV2_PRETEND_DEVICE_FROM DEVICE_ID_IOX3
10631  #define NTV2_PRETEND_DEVICE_TO DEVICE_ID_KONAHDMI
10632 #endif // _DEBUG
10633 #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
bool IsValid(const bool chkTrailer=false) const
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.
#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
NTV2ConfigInterrupt & setSuccess(const bool b=true)
Sets my mResult to 1 (non-zero indicates success)
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
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 NTV2 messages 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__)
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...
ULWord SDKVersion(void) const
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
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.
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.
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 NTV2 messages 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