AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
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
uint32_t pcrPid
Specifies the PID for the PCR.
uint32_t audioChannels
Specifies the number of audio channels for J2K encode, a value of 0 indicates no audio.
uint32_t pmtPid
Specifies the PID for the PMT.
uint16_t sfp2Vlan
Specifies the VLAN TCI (if RX_MATCH_2022_VLAN set)
uint32_t ssrc
Specifies the SSRC identifier (if RX_MATCH_2022_SSRC set)
std::string sfp1RemoteIP
Specifies remote (destination) IP address.
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
J2KChromaSubSampling
Definition: ntv2tshelper.h:75
uint32_t playoutDelay
Specifies the wait time in milliseconds to SDI playout from incoming packet (0-150).
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
std::string sfp1SourceIP
Specifies the source (sender) IP address (if RX_MATCH_2022_SOURCE_IP set). If it&#39;s in the multiclass ...
uint32_t sfp2RemotePort
Specifies the remote (destination) port number.
uint32_t sfp1RemotePort
Specifies the remote (destination) port number.
uint16_t sfp1Vlan
Specifies the VLAN TCI (if RX_MATCH_2022_VLAN set)
bool GetBiDirectionalChannels()
uint32_t ullMode
Specifies the ull mode for J2K encode.
bool operator!=(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition: json.hpp:14762
uint32_t numAvailableAudios
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1357
uint32_t audio1Pid
Specifies the PID for audio 1.
Declares Transport Stream helper classes.
Configures a SMPTE 2022 Receive Channel.
Enumerations for controlling NTV2 devices.
NTV2VideoFormat videoFormat
Specifies the video format for J2K encode.
std::string sfp2RemoteIP
Specifies remote (destination) IP address.
eIGMPVersion_t
uint32_t sfp1LocalPort
Specifies the local (source) port number.
uint32_t sfp1DestPort
Specifies the destination (target) port number (if RX_MATCH_2022_DEST_PORT set)
The CNTV2ConfigTs2022 class is the interface to Kona-IP SMPTE 2022 J2K encoder and TS chips...
Defines the KonaIP/IoIP S2022 registers.
std::vector< uint32_t > availableProgramPIDs
uint32_t sfp2LocalPort
Specifies the local (source) port number.
Configures a SMPTE 2022 Transmit Channel.
std::vector< uint32_t > availableProgramNumbers
bool SetIGMPVersion(uint32_t version)
uint8_t sfp1RxMatch
Bitmap of rxMatch criteria used.
J2KChromaSubSampling chromaSubsamp
Specifies the chroma sub sampling for J2K encode.
uint32_t mbps
Specifies the mbits per-second for J2K encode.
bool operator==(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition: json.hpp:14737
The CNTV2Config2022 class is the interface to Kona-IP network I/O using SMPTE 2022.
#define AJAExport
Definition: export.h:33
eProgSelMode_t selectionMode
J2KStreamType
Definition: ntv2tshelper.h:69
uint8_t sfp2RxMatch
Bitmap of rxMatch criteria used.
uint32_t sfp2SourcePort
Specifies the source (sender) port number (if RX_MATCH_2022_SOURCE_PORT set)
uint32_t bitDepth
Specifies the bit depth for J2K encode.
void SetBiDirectionalChannels(bool bidirectional)
NTV2Stream
Identifies a specific IP-based data stream.
Definition: ntv2enums.h:1407
Declares the CNTV2Card class.
uint32_t sfp2DestPort
Specifies the destination (target) port number (if RX_MATCH_2022_DEST_PORT set)
std::string sfp2SourceIP
Specifies the source (sender) IP address (if RX_MATCH_2022_SOURCE_IP set). If it&#39;s in the multiclass ...
uint32_t programNumber
std::vector< uint32_t > availableAudioPIDs
uint32_t numAvailablePrograms
J2KStreamType streamType
Specifies the stream type for J2K encode.
uint32_t videoPid
Specifies the PID for the video.
uint32_t sfp1SourcePort
Specifies the source (sender) port number (if RX_MATCH_2022_SOURCE_PORT set)
bool DisableNetworkInterface(eSFP port)
NTV2IpError
Definition: ntv2enums.h:4313
Declares the CNTV2MBController class.