AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
ntv2config2022.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef NTV2_2022CONFIG_H
9 #define NTV2_2022CONFIG_H
10 
11 #include "ntv2card.h"
12 #include "ntv2enums.h"
13 #include "ntv2registers2022.h"
14 #include "ntv2mbcontroller.h"
15 #include "ntv2tshelper.h"
16 #include <string.h>
17 
23 {
24 public:
25  tx_2022_channel() { init(); }
26 
27  void init();
28 
29  bool operator != ( const tx_2022_channel &other );
30  bool operator == ( const tx_2022_channel &other );
31 
32 public:
33  bool sfp1Enable;
34  bool sfp2Enable;
35 
36  uint32_t sfp1LocalPort;
37  std::string sfp1RemoteIP;
38  uint32_t sfp1RemotePort;
39 
40  uint32_t sfp2LocalPort;
41  std::string sfp2RemoteIP;
42  uint32_t sfp2RemotePort;
43 
44  uint8_t tos; // type of service
45  uint8_t ttl; // time to live
46  uint32_t ssrc;
47 };
48 
54 {
55 public:
56  rx_2022_channel() { init(); }
57 
58  void init();
59 
60  bool operator != ( const rx_2022_channel &other );
61  bool operator == ( const rx_2022_channel &other );
62 
63 public:
64  bool sfp1Enable;
65  bool sfp2Enable;
66 
67  uint8_t sfp1RxMatch;
68  std::string sfp1SourceIP;
69  std::string sfp1DestIP;
71  uint32_t sfp1SourcePort;
72  uint32_t sfp1DestPort;
73  uint16_t sfp1Vlan;
74 
75  uint8_t sfp2RxMatch;
76  std::string sfp2SourceIP;
77  std::string sfp2DestIP;
79  uint32_t sfp2SourcePort;
80  uint32_t sfp2DestPort;
81  uint16_t sfp2Vlan;
82 
83  uint32_t ssrc;
84  uint32_t playoutDelay;
85 };
86 
88 {
89 public:
90  j2kEncoderConfig() { init(); }
91 
92  void init();
93 
94  bool operator == ( const j2kEncoderConfig &other );
95  bool operator != ( const j2kEncoderConfig &other );
96 
98  uint32_t ullMode;
99  uint32_t bitDepth;
101  uint32_t mbps;
103  uint32_t audioChannels;
104  uint32_t pmtPid;
105  uint32_t videoPid;
106  uint32_t pcrPid;
107  uint32_t audio1Pid;
108 };
109 
111 {
112 public:
113  typedef enum
114  {
120  eProgSel_Default = eProgSel_AutoFirstProg
121  } eProgSelMode_t;
122 
123  j2kDecoderConfig() {init();}
124  void init();
125 
126  bool operator == ( const j2kDecoderConfig &other );
127  bool operator != ( const j2kDecoderConfig &other );
128 
130  uint32_t programNumber;
131  uint32_t programPID;
132  uint32_t audioNumber;
133 };
134 
136 {
137 public:
138  j2kDecoderStatus() {init();}
139  void init();
140 
143  std::vector<uint32_t> availableProgramNumbers;
144  std::vector<uint32_t> availableProgramPIDs;
145  std::vector<uint32_t> availableAudioPIDs;
146 };
147 
149 {
150  uint32_t sfp1RxPackets;
152  uint32_t sfp2RxPackets;
154 };
155 
160 {
161 public:
162  CNTV2Config2022 (CNTV2Card & device);
163  ~CNTV2Config2022();
164 
165  bool SetNetworkConfiguration(const eSFP sfp, const IPVNetConfig & netConfig);
166  bool GetNetworkConfiguration(const eSFP sfp, IPVNetConfig & netConfig);
167  bool SetNetworkConfiguration(const eSFP sfp, const std::string localIPAddress, const std::string subnetMask, const std::string gateway);
168  bool GetNetworkConfiguration(const eSFP sfp, std::string & localIPAddress, std::string & subnetMask, std::string & gateway);
169  bool DisableNetworkInterface(const eSFP sfp);
170 
171  bool SetRxChannelConfiguration(const NTV2Channel channel, const rx_2022_channel & rxConfig);
172  bool GetRxChannelConfiguration(const NTV2Channel channel, rx_2022_channel & rxConfig);
173 
174  bool SetRxChannelEnable(const NTV2Channel channel, bool enable);
175  bool GetRxChannelEnable(const NTV2Channel channel, bool & enabled);
176 
177  bool SetTxChannelConfiguration(const NTV2Channel channel, const tx_2022_channel & txConfig);
178  bool GetTxChannelConfiguration(const NTV2Channel channel, tx_2022_channel & txConfig);
179 
180  bool SetTxChannelEnable(const NTV2Channel channel, bool enable);
181  bool GetTxChannelEnable(const NTV2Channel channel, bool & enabled);
182 
183  bool SetJ2KEncoderConfiguration(const NTV2Channel channel, const j2kEncoderConfig & j2kConfig);
184  bool GetJ2KEncoderConfiguration(const NTV2Channel channel, j2kEncoderConfig &j2kConfig);
185 
186  bool SetJ2KDecoderConfiguration(const j2kDecoderConfig & j2kConfig);
187  bool GetJ2KDecoderConfiguration(j2kDecoderConfig &j2kConfig);
188  bool GetJ2KDecoderStatus(j2kDecoderStatus & j2kStatus);
189 
190  bool Set2022_7_Mode(bool enable, uint32_t rx_networkPathDifferential);
191  bool Get2022_7_Mode(bool & enable, uint32_t & rx_networkPathDifferential);
192 
201  bool SetIGMPDisable(eSFP sfp, bool disable);
202  bool GetIGMPDisable(eSFP sfp, bool & disabled);
203 
204  bool SetIGMPVersion(eIGMPVersion_t version);
205  bool GetIGMPVersion(eIGMPVersion_t & version);
206 
207  void SetBiDirectionalChannels(bool bidirectional) { _biDirectionalChannels = bidirectional;}
208  bool GetBiDirectionalChannels() {return _biDirectionalChannels;}
209 
210  bool GetMACAddress(eSFP sfp, NTV2Stream stream, std::string remoteIP, uint32_t & hi, uint32_t & lo);
211 
212  bool GetSFPMSAData(eSFP sfp, SFPMSAData & data);
213  bool GetLinkStatus(eSFP sfp, SFPStatus & sfpStatus);
214  bool Get2022ChannelRxStatus(NTV2Channel channel, s2022RxChannelStatus & status);
215 
216  bool SetIPServicesControl(const bool enable, const bool forceReconfig);
217  bool GetIPServicesControl(bool & enable, bool & forceReconfig);
218 
219 
220  // If method returns false call this to get details
221  std::string getLastError();
222  NTV2IpError getLastErrorCode();
223 
224 private:
225  void ChannelSemaphoreSet(uint32_t controlReg, uint32_t baseaddr);
226  void ChannelSemaphoreClear(uint32_t controlReg, uint32_t baseaddr);
227 
228  bool SelectRxChannel(NTV2Channel channel, eSFP sfp, uint32_t & baseAddr);
229  bool SelectTxChannel(NTV2Channel channel, eSFP sfp, uint32_t & baseAddr);
230 
231  NTV2Stream VideoChannelToStream(const NTV2Channel channel);
232  NTV2Channel VideoStreamToChannel(const NTV2Stream stream);
233 
234  class CNTV2ConfigTs2022 * _tstreamConfig;
235 
236  eSFP GetTxLink(NTV2Channel chan);
237 
238  uint32_t _numRx0Chans;
239  uint32_t _numRx1Chans;
240  uint32_t _numTx0Chans;
241  uint32_t _numTx1Chans;
242  uint32_t _numRxChans;
243  uint32_t _numTxChans;
244  bool _is2022_6;
245  bool _is2022_2;
246  bool _is2022_7;
247  bool _biDirectionalChannels; // logically bi-directional channels
248  bool _is_txTop34;
249  bool _isIoIp;
250 }; // CNTV2Config2022
251 
252 #endif // NTV2_2022CONFIG_H
tx_2022_channel::tos
uint8_t tos
Definition: ntv2config2022.h:44
rx_2022_channel::sfp2Enable
bool sfp2Enable
Definition: ntv2config2022.h:65
eSFP
eSFP
Definition: ntv2mbcontroller.h:38
tx_2022_channel
Configures a SMPTE 2022 Transmit Channel.
Definition: ntv2config2022.h:22
tx_2022_channel::tx_2022_channel
tx_2022_channel()
Definition: ntv2config2022.h:25
j2kDecoderStatus::j2kDecoderStatus
j2kDecoderStatus()
Definition: ntv2config2022.h:138
j2kEncoderConfig
Definition: ntv2config2022.h:87
j2kDecoderConfig::eProgSel_SpecificProgNum
@ eProgSel_SpecificProgNum
Definition: ntv2config2022.h:118
s2022RxChannelStatus::sfp1ValidRxPackets
uint32_t sfp1ValidRxPackets
Definition: ntv2config2022.h:151
j2kDecoderStatus::availableProgramNumbers
std::vector< uint32_t > availableProgramNumbers
Definition: ntv2config2022.h:143
eIGMPVersion_t
eIGMPVersion_t
Definition: ntv2mbcontroller.h:56
j2kEncoderConfig::mbps
uint32_t mbps
Specifies the mbits per-second for J2K encode.
Definition: ntv2config2022.h:101
ntv2tshelper.h
Declares Transport Stream helper classes.
j2kDecoderStatus::numAvailablePrograms
uint32_t numAvailablePrograms
Definition: ntv2config2022.h:141
s2022RxChannelStatus::sfp2RxPackets
uint32_t sfp2RxPackets
Definition: ntv2config2022.h:152
CNTV2Config2022::GetBiDirectionalChannels
bool GetBiDirectionalChannels()
Definition: ntv2config2022.h:208
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific Frame Store. They're also commonly used to i...
Definition: ntv2enums.h:1305
tx_2022_channel::sfp1RemoteIP
std::string sfp1RemoteIP
Specifies remote (destination) IP address.
Definition: ntv2config2022.h:37
J2KChromaSubSampling
J2KChromaSubSampling
Definition: ntv2tshelper.h:75
j2kDecoderConfig::eProgSel_SpecificProgPID
@ eProgSel_SpecificProgPID
Definition: ntv2config2022.h:119
j2kEncoderConfig::videoPid
uint32_t videoPid
Specifies the PID for the video.
Definition: ntv2config2022.h:105
rx_2022_channel::playoutDelay
uint32_t playoutDelay
Specifies the wait time in milliseconds to SDI playout from incoming packet (0-150).
Definition: ntv2config2022.h:84
CNTV2Config2022
The CNTV2Config2022 class is the interface to Kona-IP network I/O using SMPTE 2022.
Definition: ntv2config2022.h:159
s2022RxChannelStatus::sfp1RxPackets
uint32_t sfp1RxPackets
Definition: ntv2config2022.h:150
tx_2022_channel::sfp2RemotePort
uint32_t sfp2RemotePort
Specifies the remote (destination) port number.
Definition: ntv2config2022.h:42
rx_2022_channel::ssrc
uint32_t ssrc
Specifies the SSRC identifier (if RX_MATCH_2022_SSRC set)
Definition: ntv2config2022.h:83
j2kDecoderConfig::eProgSel_AutoFirstProg
@ eProgSel_AutoFirstProg
Definition: ntv2config2022.h:116
j2kDecoderConfig::programPID
uint32_t programPID
Definition: ntv2config2022.h:131
tx_2022_channel::sfp1RemotePort
uint32_t sfp1RemotePort
Specifies the remote (destination) port number.
Definition: ntv2config2022.h:38
j2kDecoderConfig::eProgSel_LowestProgNum
@ eProgSel_LowestProgNum
Definition: ntv2config2022.h:117
rx_2022_channel::sfp1Vlan
uint16_t sfp1Vlan
Specifies the VLAN TCI (if RX_MATCH_2022_VLAN set)
Definition: ntv2config2022.h:73
tx_2022_channel::sfp2RemoteIP
std::string sfp2RemoteIP
Specifies remote (destination) IP address.
Definition: ntv2config2022.h:41
j2kEncoderConfig::streamType
J2KStreamType streamType
Specifies the stream type for J2K encode.
Definition: ntv2config2022.h:102
j2kEncoderConfig::audioChannels
uint32_t audioChannels
Specifies the number of audio channels for J2K encode, a value of 0 indicates no audio.
Definition: ntv2config2022.h:103
rx_2022_channel::sfp1SourceIP
std::string sfp1SourceIP
Specifies the source (sender) IP address (if RX_MATCH_2022_SOURCE_IP set). If it's in the multiclass ...
Definition: ntv2config2022.h:68
tx_2022_channel::sfp2LocalPort
uint32_t sfp2LocalPort
Specifies the local (source) port number.
Definition: ntv2config2022.h:40
SFPStatus
Definition: ntv2mbcontroller.h:73
tx_2022_channel::sfp1LocalPort
uint32_t sfp1LocalPort
Specifies the local (source) port number.
Definition: ntv2config2022.h:36
CNTV2MBController::DisableNetworkInterface
bool DisableNetworkInterface(eSFP port)
Definition: ntv2mbcontroller.cpp:99
j2kEncoderConfig::bitDepth
uint32_t bitDepth
Specifies the bit depth for J2K encode.
Definition: ntv2config2022.h:99
j2kDecoderStatus
Definition: ntv2config2022.h:135
CNTV2MBController::SetIGMPVersion
bool SetIGMPVersion(uint32_t version)
Definition: ntv2mbcontroller.cpp:149
ntv2registers2022.h
Defines the KonaIP/IoIP S2022 registers.
ntv2card.h
Declares the CNTV2Card class.
j2kDecoderStatus::numAvailableAudios
uint32_t numAvailableAudios
Definition: ntv2config2022.h:142
rx_2022_channel::sfp1RxMatch
uint8_t sfp1RxMatch
Bitmap of rxMatch criteria used.
Definition: ntv2config2022.h:67
ntv2enums.h
Enumerations for controlling NTV2 devices.
SFPMSAData
Definition: ntv2mbcontroller.h:68
tx_2022_channel::sfp2Enable
bool sfp2Enable
Definition: ntv2config2022.h:34
j2kEncoderConfig::ullMode
uint32_t ullMode
Specifies the ull mode for J2K encode.
Definition: ntv2config2022.h:98
j2kDecoderStatus::availableAudioPIDs
std::vector< uint32_t > availableAudioPIDs
Definition: ntv2config2022.h:145
CNTV2Card
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:262
j2kDecoderConfig::eProgSel_Off
@ eProgSel_Off
Definition: ntv2config2022.h:115
j2kDecoderConfig
Definition: ntv2config2022.h:110
NTV2Stream
NTV2Stream
Identifies a specific IP-based data stream.
Definition: ntv2enums.h:1352
J2KStreamType
J2KStreamType
Definition: ntv2tshelper.h:69
rx_2022_channel::sfp1DestPort
uint32_t sfp1DestPort
Specifies the destination (target) port number (if RX_MATCH_2022_DEST_PORT set)
Definition: ntv2config2022.h:72
rx_2022_channel::sfp2SourcePort
uint32_t sfp2SourcePort
Specifies the source (sender) port number (if RX_MATCH_2022_SOURCE_PORT set)
Definition: ntv2config2022.h:79
j2kDecoderConfig::audioNumber
uint32_t audioNumber
Definition: ntv2config2022.h:132
rx_2022_channel::rx_2022_channel
rx_2022_channel()
Definition: ntv2config2022.h:56
tx_2022_channel::sfp1Enable
bool sfp1Enable
Definition: ntv2config2022.h:33
CNTV2MBController
Definition: ntv2mbcontroller.h:128
j2kEncoderConfig::pmtPid
uint32_t pmtPid
Specifies the PID for the PMT.
Definition: ntv2config2022.h:104
j2kDecoderConfig::j2kDecoderConfig
j2kDecoderConfig()
Definition: ntv2config2022.h:123
s2022RxChannelStatus::sfp2ValidRxPackets
uint32_t sfp2ValidRxPackets
Definition: ntv2config2022.h:153
tx_2022_channel::ttl
uint8_t ttl
Definition: ntv2config2022.h:45
NTV2IpError
NTV2IpError
Definition: ntv2enums.h:4224
rx_2022_channel::sfp2SourceIP
std::string sfp2SourceIP
Specifies the source (sender) IP address (if RX_MATCH_2022_SOURCE_IP set). If it's in the multiclass ...
Definition: ntv2config2022.h:76
IPVNetConfig
Definition: ntv2mbcontroller.h:113
AJAExport
#define AJAExport
Definition: export.h:33
tx_2022_channel::ssrc
uint32_t ssrc
Definition: ntv2config2022.h:46
NTV2VideoFormat
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
s2022RxChannelStatus
Definition: ntv2config2022.h:148
j2kEncoderConfig::videoFormat
NTV2VideoFormat videoFormat
Specifies the video format for J2K encode.
Definition: ntv2config2022.h:97
ntv2mbcontroller.h
Declares the CNTV2MBController class.
rx_2022_channel::sfp1Enable
bool sfp1Enable
Definition: ntv2config2022.h:64
CNTV2Config2022::SetBiDirectionalChannels
void SetBiDirectionalChannels(bool bidirectional)
Definition: ntv2config2022.h:207
rx_2022_channel
Configures a SMPTE 2022 Receive Channel.
Definition: ntv2config2022.h:53
j2kEncoderConfig::chromaSubsamp
J2KChromaSubSampling chromaSubsamp
Specifies the chroma sub sampling for J2K encode.
Definition: ntv2config2022.h:100
rx_2022_channel::sfp2RxMatch
uint8_t sfp2RxMatch
Bitmap of rxMatch criteria used.
Definition: ntv2config2022.h:75
rx_2022_channel::sfp2DestPort
uint32_t sfp2DestPort
Specifies the destination (target) port number (if RX_MATCH_2022_DEST_PORT set)
Definition: ntv2config2022.h:80
j2kEncoderConfig::j2kEncoderConfig
j2kEncoderConfig()
Definition: ntv2config2022.h:90
j2kDecoderStatus::availableProgramPIDs
std::vector< uint32_t > availableProgramPIDs
Definition: ntv2config2022.h:144
j2kDecoderConfig::programNumber
uint32_t programNumber
Definition: ntv2config2022.h:130
j2kEncoderConfig::pcrPid
uint32_t pcrPid
Specifies the PID for the PCR.
Definition: ntv2config2022.h:106
j2kEncoderConfig::audio1Pid
uint32_t audio1Pid
Specifies the PID for audio 1.
Definition: ntv2config2022.h:107
rx_2022_channel::sfp1SourcePort
uint32_t sfp1SourcePort
Specifies the source (sender) port number (if RX_MATCH_2022_SOURCE_PORT set)
Definition: ntv2config2022.h:71
j2kDecoderConfig::eProgSelMode_t
eProgSelMode_t
Definition: ntv2config2022.h:113
j2kDecoderConfig::selectionMode
eProgSelMode_t selectionMode
Definition: ntv2config2022.h:129
CNTV2ConfigTs2022
The CNTV2ConfigTs2022 class is the interface to Kona-IP SMPTE 2022 J2K encoder and TS chips.
Definition: ntv2configts2022.h:60
rx_2022_channel::sfp2Vlan
uint16_t sfp2Vlan
Specifies the VLAN TCI (if RX_MATCH_2022_VLAN set)
Definition: ntv2config2022.h:81