AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
ntv2config2022.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ntv2config2022.h"
9 #include "ntv2configts2022.h"
10 #include "ntv2endian.h"
11 #include "ntv2utils.h"
12 #include "ntv2card.h"
13 #include <ajabase/network/network.h>
14 #include <sstream>
15 
16 #if defined (AJALinux) || defined (AJAMac)
17  #include <stdlib.h>
18 #endif
19 
20 using namespace std;
22 {
23  sfp1Enable = true;
24  sfp2Enable = false;
25 
26  sfp1RemoteIP.erase();
27  sfp1LocalPort = 0;
28  sfp1RemotePort = 0;
29 
30  sfp2RemoteIP.erase();
31  sfp2LocalPort = 0;
32  sfp2RemotePort = 0;
33 
34  tos = 0x64;
35  ttl = 0x40;
36  ssrc = 0;
37 }
38 
40 {
41  return !(*this == other);
42 }
43 
45 {
46  if ((sfp1Enable == other.sfp1Enable) &&
47  (sfp2Enable == other.sfp2Enable) &&
48 
49  (sfp1LocalPort == other.sfp1LocalPort) &&
50  (sfp1RemoteIP == other.sfp1RemoteIP) &&
51  (sfp1RemotePort == other.sfp1RemotePort) &&
52 
53  (sfp2LocalPort == other.sfp2LocalPort) &&
54  (sfp2RemoteIP == other.sfp2RemoteIP) &&
55  (sfp2RemotePort == other.sfp2RemotePort))
56  {
57  return true;
58  }
59  else
60  {
61  return false;
62  }
63 }
64 
66 {
67  sfp1Enable = true;
68  sfp2Enable = false;
69 
70  sfp1RxMatch = 0;
71  sfp1SourceIP.erase();
72  sfp1DestIP.erase();
73  sfp1SourcePort = 0;
74  sfp1DestPort = 0;
75  sfp1Vlan = 0;
76 
77  sfp2RxMatch = 0;
78  sfp2SourceIP.erase();
79  sfp2DestIP.erase();
80  sfp2SourcePort = 0;
81  sfp2DestPort = 0;
82  sfp2Vlan = 0;
83 
84  ssrc = 0;
85  playoutDelay = 50;
86 }
87 
89 {
90  return !(*this == other);
91 }
92 
94 {
95  if ((sfp1Enable == other.sfp1Enable) &&
96  (sfp2Enable == other.sfp2Enable) &&
97 
98  (sfp1RxMatch == other.sfp1RxMatch) &&
99  (sfp1SourceIP == other.sfp1SourceIP) &&
100  (sfp1DestIP == other.sfp1DestIP) &&
101  (sfp1SourcePort == other.sfp1SourcePort) &&
102  (sfp1DestPort == other.sfp1DestPort) &&
103  (sfp1Vlan == other.sfp1Vlan) &&
104 
105  (sfp2RxMatch == other.sfp2RxMatch) &&
106  (sfp2SourceIP == other.sfp2SourceIP) &&
107  (sfp2DestIP == other.sfp2DestIP) &&
108  (sfp2SourcePort == other.sfp2SourcePort) &&
109  (sfp2DestPort == other.sfp2DestPort) &&
110  (sfp2Vlan == other.sfp2Vlan) &&
111 
112  (ssrc == other.ssrc) &&
113  (playoutDelay == other.playoutDelay))
114  {
115  return true;
116  }
117  else
118  {
119  return false;
120  }
121 }
122 
123 
125 {
126  videoFormat = NTV2_FORMAT_720p_5994;
127  ullMode = false;
128  bitDepth = 10;
129  chromaSubsamp = kJ2KChromaSubSamp_422_Standard;
130  mbps = 200;
131  streamType = kJ2KStreamTypeStandard;
132  audioChannels = 2;
133  pmtPid = 255;
134  videoPid = 256;
135  pcrPid = 257;
136  audio1Pid = 258;
137 }
138 
140 {
141  return (!(*this == other));
142 }
143 
145 {
146  if ((videoFormat == other.videoFormat) &&
147  (ullMode == other.ullMode) &&
148  (bitDepth == other.bitDepth) &&
149  (chromaSubsamp == other.chromaSubsamp) &&
150  (mbps == other.mbps) &&
151  (streamType == other.streamType) &&
152  (audioChannels == other.audioChannels) &&
153  (pmtPid == other.pmtPid) &&
154  (videoPid == other.videoPid) &&
155  (pcrPid == other.pcrPid) &&
156  (audio1Pid == other.audio1Pid))
157  {
158  return true;
159  }
160  else
161  {
162  return false;
163  }
164 }
165 
167 {
168  selectionMode = j2kDecoderConfig::eProgSel_Default;
169  programNumber = 1;
170  programPID = 0;
171  audioNumber = 1;
172 }
173 
175 {
176  return (!(*this == other));
177 }
178 
180 {
181  if ((selectionMode == other.selectionMode) &&
182  (programNumber == other.programNumber) &&
183  (programPID == other.programPID) &&
184  (audioNumber == other.audioNumber))
185  {
186  return true;
187  }
188  else
189  {
190  return false;
191  }
192 }
193 
195 {
196  numAvailablePrograms = 0;
197  numAvailableAudios = 0;
198  availableProgramNumbers.clear();
199  availableProgramPIDs.clear();
200  availableAudioPIDs.clear();
201 }
202 
204 //
205 // CNTV2Config2022
206 //
208 
210 {
211  uint32_t features = getFeatures();
212 
213  _numTx0Chans = (features & (SAREK_TX0_MASK)) >> 28;
214  _numRx0Chans = (features & (SAREK_RX0_MASK)) >> 24;
215  _numTx1Chans = (features & (SAREK_TX1_MASK)) >> 20;
216  _numRx1Chans = (features & (SAREK_RX1_MASK)) >> 16;
217 
218  _numRxChans = _numRx0Chans + _numRx1Chans;
219  _numTxChans = _numTx0Chans + _numTx1Chans;
220 
221  _is2022_6 = ((features & SAREK_2022_6) != 0);
222  _is2022_2 = ((features & SAREK_2022_2) != 0);
223  _is2022_7 = ((features & SAREK_2022_7) != 0);
224  _is_txTop34 = ((features & SAREK_TX_TOP34) != 0);
225 
226  _biDirectionalChannels = false;
227 
228  _tstreamConfig = NULL;
229  if (_is2022_2)
230  {
231  _tstreamConfig = new CNTV2ConfigTs2022(device);
232  }
233 
234  _isIoIp = (device.GetDeviceID() == DEVICE_ID_IOIP_2022);
235 }
236 
238 {
239  if (_is2022_2)
240  {
241  delete _tstreamConfig;
242  }
243 }
244 
246 {
247  string ip, subnet, gateway;
248  struct in_addr addr;
249  addr.s_addr = (uint32_t)netConfig.ipc_ip;
250  ip = AJANetwork::aja_inet_ntoa(addr);
251  addr.s_addr = (uint32_t)netConfig.ipc_subnet;
252  subnet = AJANetwork::aja_inet_ntoa(addr);
253  addr.s_addr = (uint32_t)netConfig.ipc_gateway;
254  gateway = AJANetwork::aja_inet_ntoa(addr);
255 
256  bool rv = SetNetworkConfiguration(sfp, ip, subnet, gateway);
257  return rv;
258 }
259 
261 {
262  string ip, subnet, gateway;
263  GetNetworkConfiguration(sfp, ip, subnet, gateway);
264 
265  netConfig.ipc_ip = NTV2EndianSwap32((uint32_t)AJANetwork::aja_inet_addr(ip.c_str()));
266  netConfig.ipc_subnet = NTV2EndianSwap32((uint32_t)AJANetwork::aja_inet_addr(subnet.c_str()));
267  netConfig.ipc_gateway = NTV2EndianSwap32((uint32_t)AJANetwork::aja_inet_addr(gateway.c_str()));
268 
269  return true;
270 }
271 
272 bool CNTV2Config2022::SetNetworkConfiguration(const eSFP sfp, const std::string localIPAddress, const std::string subnetMask, const std::string gateway)
273 {
274  if (!mDevice.IsMBSystemReady())
275  {
277  return false;
278  }
279 
280  if (!mDevice.IsMBSystemValid())
281  {
283  return false;
284  }
285 
286  uint32_t addr = AJANetwork::aja_inet_addr(localIPAddress.c_str());
287  addr = NTV2EndianSwap32(addr);
288 
289  uint32_t macLo;
290  uint32_t macHi;
291 
292  // get primaray mac address
293  uint32_t macAddressRegister = SAREK_REGS + kRegSarekMAC;
294  mDevice.ReadRegister(macAddressRegister, macHi);
295  macAddressRegister++;
296  mDevice.ReadRegister(macAddressRegister, macLo);
297 
298  uint32_t boardHi = (macHi & 0xffff0000) >>16;
299  uint32_t boardLo = ((macHi & 0x0000ffff) << 16) + ((macLo & 0xffff0000) >> 16);
300 
301  // get sfp2 mac address
302  macAddressRegister++;
303  mDevice.ReadRegister(macAddressRegister, macHi);
304  macAddressRegister++;
305  mDevice.ReadRegister(macAddressRegister, macLo);
306 
307  uint32_t boardHi2 = (macHi & 0xffff0000) >>16;
308  uint32_t boardLo2 = ((macHi & 0x0000ffff) << 16) + ((macLo & 0xffff0000) >> 16);
309 
310  uint32_t core6;
311  uint32_t core2;
312 
313  if (sfp == SFP_1)
314  {
315  core6 = (_is_txTop34) ? SAREK_2022_6_TX_CORE_1 : SAREK_2022_6_TX_CORE_0;
316  core2 = SAREK_2022_2_TX_CORE_0;
317  }
318  else
319  {
320  core6 = (_is_txTop34) ? SAREK_2022_6_TX_CORE_0 : SAREK_2022_6_TX_CORE_1;
321  core2 = SAREK_2022_2_TX_CORE_1;
322  }
323 
324  if (_is2022_6)
325  {
326  // initialise constants
327  if (_isIoIp)
328  mDevice.WriteRegister(kReg2022_6_tx_sys_mem_conf + core6, 0x10); // IoIP
329  else
330  mDevice.WriteRegister(kReg2022_6_tx_sys_mem_conf + core6, 0x04); // KonaIP
331  mDevice.WriteRegister(kReg2022_6_tx_hitless_config + core6, 0x01); // disable
332 
333  // source ip address
335 
338 
341  }
342  else
343  {
346 
349  }
350 
351  bool rv = SetMBNetworkConfiguration (sfp, localIPAddress, subnetMask, gateway);
352  return rv;
353 }
354 
355 bool CNTV2Config2022::GetNetworkConfiguration(const eSFP sfp, std::string & localIPAddress, std::string & subnetMask, std::string & gateway)
356 {
357  struct in_addr addr;
358 
359  if (sfp == SFP_1)
360  {
361  uint32_t val;
363  addr.s_addr = val;
364  localIPAddress = AJANetwork::aja_inet_ntoa(addr);
365 
367  addr.s_addr = val;
368  subnetMask = AJANetwork::aja_inet_ntoa(addr);
369 
371  addr.s_addr = val;
372  gateway = AJANetwork::aja_inet_ntoa(addr);
373  }
374  else
375  {
376  uint32_t val;
378  addr.s_addr = val;
379  localIPAddress = AJANetwork::aja_inet_ntoa(addr);
380 
382  addr.s_addr = val;
383  subnetMask = AJANetwork::aja_inet_ntoa(addr);
384 
386  addr.s_addr = val;
387  gateway = AJANetwork::aja_inet_ntoa(addr);
388  }
389  return true;
390 }
391 
393 {
395 }
396 
397 
399 {
400  uint32_t baseAddr;
401  bool rv;
402 
403  bool enabled_7 = false;
404  uint32_t unused = 0;
405  Get2022_7_Mode(enabled_7,unused);
406 
407  bool sfp1 = rxConfig.sfp1Enable;
408  bool sfp2 = rxConfig.sfp2Enable;
409  if (enabled_7)
410  {
411  sfp1 = true;
412  sfp2 = true;
413  }
414 
415  if (sfp1 && (GetSFPActive(SFP_1) == false))
416  {
418  return false;
419  }
420 
421  if (sfp2 && (GetSFPActive(SFP_2) == false))
422  {
424  return false;
425  }
426 
427  if (_is2022_7)
428  {
429  // select sfp2 channel
430  rv = SelectRxChannel(channel, SFP_2, baseAddr);
431  if (!rv) return false;
432 
433  // hold off access while we update channel regs
434  ChannelSemaphoreClear(kReg2022_6_rx_control, baseAddr);
435 
436  SetRxMatch(channel, SFP_2, 0); // disable while configuring
437 
438  // source ip address
439  uint32_t sourceIp = AJANetwork::aja_inet_addr(rxConfig.sfp2SourceIP.c_str());
440  sourceIp = NTV2EndianSwap32(sourceIp);
442 
443  // dest ip address
444  uint32_t destIp = AJANetwork::aja_inet_addr(rxConfig.sfp2DestIP.c_str());
445  destIp = NTV2EndianSwap32(destIp);
447 
448  // source port
450 
451  // dest port
453 
454  // vlan
456 
457  // matching
458  SetRxMatch(channel, SFP_2, rxConfig.sfp2RxMatch);
459 
460  // enable register updates
461  ChannelSemaphoreSet(kReg2022_6_rx_control, baseAddr);
462 
463  // update IGMP subscriptions
464  uint8_t ip0 = (destIp & 0xff000000)>> 24;
465  if ((ip0 >= 224 && ip0 <= 239) && sfp2)
466  {
467  // is multicast
468  bool enabled = false;
469  GetRxChannelEnable(channel,enabled);
470  if (rxConfig.sfp2RxMatch & RX_MATCH_2022_SOURCE_IP)
471  SetIGMPGroup(SFP_2, VideoChannelToStream(channel), destIp, sourceIp, enabled);
472  else
473  SetIGMPGroup(SFP_2, VideoChannelToStream(channel), destIp, 0, enabled);
474  }
475  else
476  {
477  UnsetIGMPGroup(SFP_2, VideoChannelToStream(channel));
478  }
479 
480  SetRxLinkState(channel, sfp1, sfp2);
481  }
482  else
483  {
484  SetRxLinkState(channel, true, false);
485  }
486 
487  // select sfp1 channel
488  rv = SelectRxChannel(channel, SFP_1, baseAddr);
489  if (!rv) return false;
490 
491  // hold off access while we update channel regs
492  ChannelSemaphoreClear(kReg2022_6_rx_control, baseAddr);
493 
494  SetRxMatch(channel, SFP_1, 0); // disable while configuring
495 
496  // source ip address
497  uint32_t sourceIp = AJANetwork::aja_inet_addr(rxConfig.sfp1SourceIP.c_str());
498  sourceIp = NTV2EndianSwap32(sourceIp);
500 
501  // dest ip address
502  uint32_t destIp = AJANetwork::aja_inet_addr(rxConfig.sfp1DestIP.c_str());
503  destIp = NTV2EndianSwap32(destIp);
505 
506  // source port
508 
509  // dest port
511 
512  // ssrc
513  WriteChannelRegister(kReg2022_6_rx_match_ssrc + baseAddr, rxConfig.ssrc);
514 
515  // vlan
517 
518  // matching
519  SetRxMatch(channel, SFP_1, rxConfig.sfp1RxMatch);
520 
521  // playout delay in 27MHz clocks or 90kHz clocks
522  uint32_t delay;
523  delay = (_is2022_2) ? (rxConfig.playoutDelay * 90) << 9 : rxConfig.playoutDelay * 27000;
525 
526  // network path differential
527  if (_is2022_2 || (enabled_7 == false))
528  {
530  }
531 
532  // some constants
533  WriteChannelRegister(kReg2022_6_rx_chan_timeout + baseAddr, 0x12ffffff);
535  if (_isIoIp)
536  WriteChannelRegister(kReg2022_6_rx_media_buf_base_addr + baseAddr, 0xC0000000 + (0x10000000 * channel)); // IoIp
537  else
538  WriteChannelRegister(kReg2022_6_rx_media_buf_base_addr + baseAddr, 0x10000000 * channel); // KonaIp
539 
540  // enable register updates
541  ChannelSemaphoreSet(kReg2022_6_rx_control, baseAddr);
542 
543  if (_is2022_2)
544  {
545  // setup PLL
551 
552  uint32_t rxMatch = rxConfig.sfp1RxMatch;
553  uint32_t pllMatch = 0;
554  if (rxMatch & RX_MATCH_2022_DEST_IP) pllMatch |= PLL_MATCH_DEST_IP;
555  if (rxMatch & RX_MATCH_2022_SOURCE_IP) pllMatch |= PLL_MATCH_SOURCE_IP;
556  if (rxMatch & RX_MATCH_2022_DEST_PORT) pllMatch |= PLL_MATCH_DEST_PORT;
557  if (rxMatch & RX_MATCH_2022_SOURCE_PORT) pllMatch |= PLL_MATCH_SOURCE_PORT;
558  pllMatch |= PLL_MATCH_ES_PID; // always set for TS PCR
560 
561  }
562 
563  // update IGMP subscriptions
564  uint8_t ip0 = (destIp & 0xff000000)>> 24;
565  if ((ip0 >= 224 && ip0 <= 239) && sfp1)
566  {
567  // is multicast
568  bool enabled = false;
569  GetRxChannelEnable(channel,enabled);
570  if (rxConfig.sfp1RxMatch & RX_MATCH_2022_SOURCE_IP)
571  SetIGMPGroup(SFP_1, VideoChannelToStream(channel), destIp, sourceIp, enabled);
572  else
573  SetIGMPGroup(SFP_1, VideoChannelToStream(channel), destIp, 0, enabled);
574  }
575  else
576  {
577  UnsetIGMPGroup(SFP_1, VideoChannelToStream(channel));
578  }
579 
580  return rv;
581 }
582 
584 {
585  uint32_t baseAddr;
586  uint32_t val;
587  bool rv;
588 
589  //get sfp enables
590  GetRxLinkState(channel,rxConfig.sfp1Enable, rxConfig.sfp2Enable);
591 
592  if (_is2022_7)
593  {
594  // Select sfp2 channel
595  rv = SelectRxChannel(channel, SFP_2, baseAddr);
596  if (!rv) return false;
597 
598  // source ip address
600  struct in_addr in;
601  in.s_addr = NTV2EndianSwap32(val);
602  char * ip = AJANetwork::aja_inet_ntoa(in);
603  rxConfig.sfp2SourceIP = ip;
604 
605  // dest ip address
607  in.s_addr = NTV2EndianSwap32(val);
608  ip = AJANetwork::aja_inet_ntoa(in);
609  rxConfig.sfp2DestIP = ip;
610 
611  // source port
613 
614  // dest port
616 
617  // vlan
619  rxConfig.sfp2Vlan = val & 0xffff;
620 
621  // matching
622  GetRxMatch(channel, SFP_2, rxConfig.sfp2RxMatch);
623  }
624  else
625  {
626  rxConfig.sfp1Enable = true;
627  rxConfig.sfp2Enable = false;
628  }
629 
630  // select sfp1 channel
631  rv = SelectRxChannel(channel, SFP_1, baseAddr);
632  if (!rv) return false;
633 
634  // source ip address
636  struct in_addr in;
637  in.s_addr = NTV2EndianSwap32(val);
638  char * ip = AJANetwork::aja_inet_ntoa(in);
639  rxConfig.sfp1SourceIP = ip;
640 
641  // dest ip address
643  in.s_addr = NTV2EndianSwap32(val);
644  ip = AJANetwork::aja_inet_ntoa(in);
645  rxConfig.sfp1DestIP = ip;
646 
647  // source port
649 
650  // dest port
652 
653  // ssrc
654  ReadChannelRegister(kReg2022_6_rx_match_ssrc + baseAddr, &rxConfig.ssrc);
655 
656  // vlan
658  rxConfig.sfp1Vlan = val & 0xffff;
659 
660  // matching
661  GetRxMatch(channel, SFP_1, rxConfig.sfp1RxMatch);
662 
663  // playout delay in ms
665  rxConfig.playoutDelay = (_is2022_2) ? (val >>9)/90 : val/27000;
666 
667  return true;
668 }
669 
670 bool CNTV2Config2022::SetRxChannelEnable(const NTV2Channel channel, bool enable)
671 {
672  uint32_t baseAddr;
673  bool rv;
674  bool disableIGMP;
675 
676  //get sfp enables
677  bool sfp1Enable;
678  bool sfp2Enable;
679  GetRxLinkState(channel,sfp1Enable, sfp2Enable);
680 
681  if (enable && sfp1Enable)
682  {
683  if (GetSFPActive(SFP_1) == false)
684  {
686  return false;
687  }
688  }
689 
690  if (enable && sfp2Enable)
691  {
692  if (GetSFPActive(SFP_2) == false)
693  {
695  return false;
696  }
697  }
698 
699  if (enable && _biDirectionalChannels)
700  {
701  bool txEnabled;
702  GetTxChannelEnable(channel, txEnabled);
703  if (txEnabled)
704  {
705  // disable tx channel
706  SetTxChannelEnable(channel,false);
707  }
708  mDevice.SetSDITransmitEnable(channel, false);
709  }
710 
711  if (sfp2Enable)
712  {
713  // IGMP subscription for sfp2 channel
714  GetIGMPDisable(SFP_2, disableIGMP);
715  if (!disableIGMP)
716  {
717  EnableIGMPGroup(SFP_2, VideoChannelToStream(channel), enable);
718  }
719  }
720  else
721  {
722  EnableIGMPGroup(SFP_2, VideoChannelToStream(channel), false);
723  }
724 
725  if (sfp1Enable)
726  {
727  // IGMP subscription for sfp1 channel
728  GetIGMPDisable(SFP_1, disableIGMP);
729  if (!disableIGMP)
730  {
731  EnableIGMPGroup(SFP_1, VideoChannelToStream(channel), enable);
732  }
733  }
734  else
735  {
736  EnableIGMPGroup(SFP_1, VideoChannelToStream(channel), false);
737  }
738 
739  rv = SelectRxChannel(channel, SFP_1, baseAddr);
740  if (!rv) return false;
741  if (enable & sfp1Enable)
742  {
743  uint8_t match;
744  GetRxMatch(channel, SFP_1, match);
745  WriteChannelRegister(kReg2022_6_rx_match_sel + baseAddr, (uint32_t)match);
746  }
747  else
748  {
749  // disables rx
751  }
752 
753  rv = SelectRxChannel(channel, SFP_2, baseAddr);
754  if (!rv) return false;
755  if (enable & sfp2Enable)
756  {
757  uint8_t match;
758  GetRxMatch(channel, SFP_2, match);
759  WriteChannelRegister(kReg2022_6_rx_match_sel + baseAddr, (uint32_t)match);
760  }
761  else
762  {
763  // disables rx
765  }
766 
767  // set channel enable
768  rv = SelectRxChannel(channel, SFP_1, baseAddr);
769  if (enable)
770  {
771  // Bit 0 = enable
772  // Bit 1 = ignore RTP timestamp
773  // Bit 1 is set because otherwise, we sometimes lock up on format
774  // change on incoming stream
776  }
777  else
778  {
780  }
781 
782  return rv;
783 }
784 
785 bool CNTV2Config2022::GetRxChannelEnable(const NTV2Channel channel, bool & enabled)
786 {
787  uint32_t baseAddr;
788 
789  enabled = false;
790 
791  // select sfp1 channel
792  bool rv = SelectRxChannel(channel, SFP_1, baseAddr);
793  if (!rv) return false;
794 
795  uint32_t val;
796  rv = ReadChannelRegister(kReg2022_6_rx_match_sel + baseAddr,&val);
797  if (!rv) return false;
798  if (val)
799  {
800  enabled = true;
801  return true;
802  }
803 
804  // select sfp2 channel
805  rv = SelectRxChannel(channel, SFP_2, baseAddr);
806  if (!rv) return false;
807 
808  rv = ReadChannelRegister(kReg2022_6_rx_match_sel + baseAddr,&val);
809  if (!rv) return false;
810  if (val)
811  {
812  enabled = true;
813  return true;
814  }
815 
816  return true;
817 }
818 
819 static bool MacAddressToRegisters(const MACAddr &macaddr, uint32_t & hi, uint32_t & lo)
820 {
821  hi = macaddr.mac[0] << 8;
822  hi += macaddr.mac[1];
823 
824  lo = macaddr.mac[2] << 24;
825  lo += macaddr.mac[3] << 16;
826  lo += macaddr.mac[4] << 8;
827  lo += macaddr.mac[5];
828  return true;
829 }
830 
832 {
833  uint32_t baseAddr;
834  uint32_t hi;
835  uint32_t lo;
836 
837 
838  uint32_t destIp;
839 
840  bool rv;
841 
842  if (txConfig.sfp1Enable && (GetSFPActive(SFP_1) == false))
843  {
845  return false;
846  }
847 
848  if (txConfig.sfp2Enable && (GetSFPActive(SFP_2) == false))
849  {
851  return false;
852  }
853 
854  if (_is2022_7)
855  {
856  // Select sfp2 channel
857  rv = SelectTxChannel(channel, SFP_2, baseAddr);
858  if (!rv) return false;
859 
860  // hold off access while we update channel regs
861  ChannelSemaphoreClear(kReg2022_6_tx_control, baseAddr);
862 
863  // initialise
864  uint32_t val = (txConfig.tos << 8) | txConfig.ttl;
866  WriteChannelRegister(kReg2022_6_tx_ssrc + baseAddr, txConfig.ssrc);
867 
868  if (_is2022_6)
869  {
870  WriteChannelRegister(kReg2022_6_tx_video_para_config + baseAddr, 0x01); // include video timestamp
871  }
872  else
873  {
875  }
876 
877  // dest ip address
878  destIp = AJANetwork::aja_inet_addr(txConfig.sfp2RemoteIP.c_str());
879  destIp = NTV2EndianSwap32(destIp);
881 
882  // source port
884 
885  // dest port
887 
888  // Get or generate a Mac address if we have 2022-7 enabled.
889  if (txConfig.sfp2Enable)
890  {
891  rv = GetMACAddress(SFP_2, VideoChannelToStream(channel), txConfig.sfp2RemoteIP,hi,lo);
892  if (!rv) return false;
895  }
896 
897  // enable register updates
898  ChannelSemaphoreSet(kReg2022_6_tx_control, baseAddr);
899 
900  SetTxLinkState(channel, txConfig.sfp1Enable,txConfig.sfp2Enable);
901  }
902  else
903  {
904  SetTxLinkState(channel, true, false);
905  }
906 
907  // select sfp1 channel
908  rv = SelectTxChannel(channel, SFP_1, baseAddr);
909  if (!rv) return false;
910 
911  // hold off access while we update channel regs
912  ChannelSemaphoreClear(kReg2022_6_tx_control, baseAddr);
913 
914  // initialise
915  uint32_t val = (txConfig.tos << 8) | txConfig.ttl;
917  WriteChannelRegister(kReg2022_6_tx_ssrc + baseAddr, txConfig.ssrc);
918  if (_is2022_6)
919  {
920  WriteChannelRegister(kReg2022_6_tx_video_para_config + baseAddr, 0x01); // include video timestamp
921  }
922  else
923  {
925  }
926 
927  // dest ip address
928  destIp = AJANetwork::aja_inet_addr(txConfig.sfp1RemoteIP.c_str());
929  destIp = NTV2EndianSwap32(destIp);
931 
932  // source port
934 
935  // dest port
937 
938  if (txConfig.sfp1Enable)
939  {
940  rv = GetMACAddress(SFP_1, VideoChannelToStream(channel), txConfig.sfp1RemoteIP,hi,lo);
941  if (!rv) return false;
944  }
945 
946  // enable register updates
947  ChannelSemaphoreSet(kReg2022_6_tx_control, baseAddr);
948 
949  return rv;
950 }
951 
953 {
954  uint32_t baseAddr;
955  uint32_t val;
956  bool rv;
957  if (_is2022_7)
958  {
959  // select sfp2 channel
960  rv = SelectTxChannel(channel, SFP_2, baseAddr);
961  if (!rv) return false;
962 
963  //get sfp enables
964  GetTxLinkState(channel,txConfig.sfp1Enable, txConfig.sfp2Enable);
965 
967  txConfig.ttl = val & 0xff;
968  txConfig.tos = (val & 0xff00) >> 8;
969  ReadChannelRegister(kReg2022_6_tx_ssrc + baseAddr,&txConfig.ssrc);
970 
971  // dest ip address
973  struct in_addr in;
974  in.s_addr = NTV2EndianSwap32(val);
975  char * ip = AJANetwork::aja_inet_ntoa(in);
976  txConfig.sfp2RemoteIP = ip;
977  // source port
979 
980  // dest port
982  }
983  else
984  {
985  txConfig.sfp1Enable = true;
986  txConfig.sfp2Enable = false;
987  }
988  // Select sfp1 channel
989  rv = SelectTxChannel(channel, SFP_1, baseAddr);
990  if (!rv) return false;
991 
992  // dest ip address
994  struct in_addr in;
995  in.s_addr = NTV2EndianSwap32(val);
996  char * ip = AJANetwork::aja_inet_ntoa(in);
997  txConfig.sfp1RemoteIP = ip;
998 
999  // source port
1001 
1002  // dest port
1004  return true;
1005 }
1006 
1007 bool CNTV2Config2022::SetTxChannelEnable(const NTV2Channel channel, bool enable)
1008 {
1009  uint32_t baseAddr;
1010  bool rv;
1011  uint32_t localIp;
1012 
1013  //get sfp enables
1014  bool sfp1Enable;
1015  bool sfp2Enable;
1016  GetTxLinkState(channel,sfp1Enable, sfp2Enable);
1017 
1018  if (enable && sfp1Enable)
1019  {
1020  if (GetSFPActive(SFP_1) == false)
1021  {
1023  return false;
1024  }
1025  }
1026 
1027  if (enable && sfp2Enable)
1028  {
1029  if (GetSFPActive(SFP_2) == false)
1030  {
1032  return false;
1033  }
1034  }
1035 
1036  if (_biDirectionalChannels)
1037  {
1038  bool rxEnabled;
1039  GetRxChannelEnable(channel,rxEnabled);
1040  if (rxEnabled)
1041  {
1042  // disable rx channel
1043  SetRxChannelEnable(channel,false);
1044  }
1045  mDevice.SetSDITransmitEnable(channel, true);
1046  }
1047 
1048  // select sfp1 channel
1049  rv = SelectTxChannel(channel, SFP_1, baseAddr);
1050  if (!rv) return false;
1051 
1052  if (!enable)
1053  {
1054  rv = SelectTxChannel(channel, SFP_1, baseAddr);
1055  if (!rv) return false;
1056 
1057  WriteChannelRegister(kReg2022_6_tx_chan_enable + baseAddr,0x0); // disables channel
1058  }
1059 
1060  // hold off access while we update channel regs
1061  ChannelSemaphoreClear(kReg2022_6_tx_control, baseAddr);
1062 
1063  WriteChannelRegister(kReg2022_6_tx_hitless_config + baseAddr,0x0); // 0 enables hitless mode
1064 
1065  if (enable && sfp1Enable)
1066  {
1067  if (GetTxLink(channel) == SFP_1)
1068  {
1070  }
1071  else
1072  {
1074  }
1076 
1077  WriteChannelRegister(kReg2022_6_tx_link_enable + baseAddr,0x01); // enables tx over mac1/mac2
1078  }
1079  else
1080  {
1081  WriteChannelRegister(kReg2022_6_tx_link_enable + baseAddr,0x00); // enables tx over mac1/mac2
1082  }
1083 
1084  // enable register updates
1085  ChannelSemaphoreSet(kReg2022_6_tx_control, baseAddr);
1086 
1087  if (_is2022_7)
1088  {
1089  // Select sfp2 channel
1090  rv = SelectTxChannel(channel, SFP_2, baseAddr);
1091  if (!rv) return false;
1092 
1093  // hold off access while we update channel regs
1094  ChannelSemaphoreClear(kReg2022_6_tx_control, baseAddr);
1095 
1096  WriteChannelRegister(kReg2022_6_tx_hitless_config + baseAddr,0x0); // 0 enables hitless mode
1097 
1098  if (enable && sfp2Enable)
1099  {
1102 
1103  // enable
1104  WriteChannelRegister(kReg2022_6_tx_link_enable + baseAddr,0x01); // enables tx over mac1/mac2
1105  }
1106  else
1107  {
1108  // disable
1109  WriteChannelRegister(kReg2022_6_tx_link_enable + baseAddr,0x0); // disables tx over mac1/mac2
1110  }
1111 
1112  // enable register updates
1113  ChannelSemaphoreSet(kReg2022_6_tx_control, baseAddr);
1114  }
1115 
1116  if (enable)
1117  {
1118  SelectTxChannel(channel, SFP_1, baseAddr);
1119  WriteChannelRegister(kReg2022_6_tx_chan_enable + baseAddr,0x01); // enables channel
1120  }
1121 
1122  return true;
1123 }
1124 
1125 bool CNTV2Config2022::GetTxChannelEnable(const NTV2Channel channel, bool & enabled)
1126 {
1127  uint32_t baseAddr;
1128  uint32_t val;
1129  bool rv;
1130 
1131  enabled = false;
1132 
1133  rv = SelectTxChannel(channel, SFP_1, baseAddr);
1134  if (!rv) return false;
1135 
1137  if (val == 0x01)
1138  {
1139  enabled = true;
1140  }
1141 
1142  return true;
1143 }
1144 
1145 bool CNTV2Config2022::Set2022_7_Mode(bool enable, uint32_t rx_networkPathDifferential)
1146 {
1147  if (!mDevice.IsMBSystemReady())
1148  {
1150  return false;
1151  }
1152 
1153  if (!_is2022_7)
1154  {
1156  return false;
1157  }
1158 
1159  bool old_enable = false;
1160  uint32_t unused = 0;
1161  Get2022_7_Mode(old_enable, unused);
1162 
1163  bool enableChange = (old_enable != enable);
1164 
1165  SetDualLinkMode(enable);
1166 
1167  if (_numRxChans)
1168  {
1169  uint32_t baseAddr;
1170  SelectRxChannel(NTV2_CHANNEL1, SFP_1, baseAddr);
1171  if (enableChange)
1172  {
1173  // reset
1174  WriteChannelRegister(kReg2022_6_rx_reset + baseAddr, 0x01);
1175  WriteChannelRegister(kReg2022_6_rx_reset + baseAddr, 0x00);
1176  }
1177  if (enable)
1178  {
1179  uint32_t delay = rx_networkPathDifferential * 27000;
1180  // network path differential in 27MHz clocks
1182  }
1183  else
1184  {
1186  }
1187  }
1188 
1189  if (_numTxChans && enableChange)
1190  {
1191  // save
1192  uint32_t addr;
1194 
1195  // reset the tx core
1196  uint32_t baseAddr;
1197  SelectTxChannel(NTV2_CHANNEL1, SFP_1, baseAddr);
1198  WriteChannelRegister(kReg2022_6_tx_reset + baseAddr, 0x01);
1199  WriteChannelRegister(kReg2022_6_tx_reset + baseAddr, 0x00);
1200 
1201  // restore everything
1202  uint32_t macLo;
1203  uint32_t macHi;
1204 
1205  // get primaray mac address
1206  uint32_t macAddressRegister = SAREK_REGS + kRegSarekMAC;
1207  mDevice.ReadRegister(macAddressRegister, macHi);
1208  macAddressRegister++;
1209  mDevice.ReadRegister(macAddressRegister, macLo);
1210 
1211  uint32_t boardHi = (macHi & 0xffff0000) >>16;
1212  uint32_t boardLo = ((macHi & 0x0000ffff) << 16) + ((macLo & 0xffff0000) >> 16);
1213 
1214  // get sfp2 mac address
1215  macAddressRegister++;
1216  mDevice.ReadRegister(macAddressRegister, macHi);
1217  macAddressRegister++;
1218  mDevice.ReadRegister(macAddressRegister, macLo);
1219 
1220  uint32_t boardHi2 = (macHi & 0xffff0000) >>16;
1221  uint32_t boardLo2 = ((macHi & 0x0000ffff) << 16) + ((macLo & 0xffff0000) >> 16);
1222 
1223  // initialise constants
1226 
1227  // source ip address
1229 
1232 
1235  }
1236 
1237  return true;
1238 }
1239 
1240 bool CNTV2Config2022::Get2022_7_Mode(bool & enable, uint32_t & rx_networkPathDifferential)
1241 {
1242  enable = false;
1243  rx_networkPathDifferential = 0;
1244 
1245  if (!_is2022_7)
1246  {
1248  return false;
1249  }
1250 
1251  GetDualLinkMode(enable);
1252 
1253  if (_numRxChans)
1254  {
1255  // network path differential in ms
1256  uint32_t val;
1257  uint32_t baseAddr;
1258  SelectRxChannel(NTV2_CHANNEL1, SFP_1, baseAddr);
1260  rx_networkPathDifferential = val/27000;
1261  }
1262  return true;
1263 }
1264 
1265 bool CNTV2Config2022::SetIGMPDisable(eSFP sfp, bool disable)
1266 {
1267  uint32_t val = (disable) ? 1 : 0;
1268  if (sfp == SFP_1)
1269  {
1271  }
1272  else
1273  {
1275  }
1276  return true;
1277 }
1278 
1279 bool CNTV2Config2022::GetIGMPDisable(eSFP sfp, bool & disabled)
1280 {
1281  uint32_t val;
1282  if (sfp == SFP_1)
1283  {
1285  }
1286  else
1287  {
1289  }
1290 
1291  disabled = (val == 1) ? true : false;
1292 
1293  return true;
1294 }
1295 
1297 {
1298  uint32_t mbversion;
1299  switch (version)
1300  {
1301  case eIGMPVersion_2:
1302  mbversion = 2;
1303  break;
1304  case eIGMPVersion_3:
1305  mbversion = 3;
1306  break;
1307  default:
1309  return false;
1310  }
1311  return CNTV2MBController::SetIGMPVersion(mbversion);
1312 }
1313 
1315 {
1316  uint32_t version32;
1317  bool rv = mDevice.ReadRegister(SAREK_REGS + kRegSarekIGMPVersion, version32);
1318  version = (version32 == 2) ? eIGMPVersion_2 : eIGMPVersion_3;
1319  return rv;
1320 }
1321 
1323 {
1324  if (_is2022_2)
1325  {
1326  CNTV2ConfigTs2022 tsConfig(mDevice);
1327  bool rv = tsConfig.SetupJ2KEncoder(channel, j2kConfig);
1328  mIpErrorCode = tsConfig.getLastErrorCode();
1329  return rv;
1330  }
1331  return false;
1332 }
1333 
1335 {
1336  if (_is2022_2)
1337  {
1338  CNTV2ConfigTs2022 tsConfig(mDevice);
1339  bool rv = tsConfig.ReadbackJ2KEncoder(channel, j2kConfig);
1340  mIpErrorCode = tsConfig.getLastErrorCode();
1341  return rv;
1342  }
1343  return false;
1344 }
1345 
1347 {
1348  if (_is2022_2)
1349  {
1351  CNTV2ConfigTs2022 tsConfig(mDevice);
1352  bool rv = tsConfig.SetupJ2KDecoder(j2kConfig);
1353  mIpErrorCode = tsConfig.getLastErrorCode();
1354  return rv;
1355  }
1356  return false;
1357 }
1358 
1360 {
1361  if (_is2022_2)
1362  {
1363  CNTV2ConfigTs2022 tsConfig(mDevice);
1364  bool rv = tsConfig.ReadbackJ2KDecoder(j2kConfig);
1365  mIpErrorCode = tsConfig.getLastErrorCode();
1366  return rv;
1367  }
1368  return false;
1369 }
1370 
1372 {
1373  if (_is2022_2)
1374  {
1375  CNTV2ConfigTs2022 tsConfig(mDevice);
1376  bool rv = tsConfig.GetJ2KDecoderStatus(j2kStatus);
1377  return rv;
1378  }
1379  return false;
1380 }
1381 
1382 
1384 //
1385 //
1386 //
1388 
1389 eSFP CNTV2Config2022::GetTxLink(NTV2Channel chan)
1390 {
1391  if (!_is_txTop34)
1392  {
1393  if ((uint32_t)chan >= _numTx0Chans)
1394  {
1395  return SFP_2;
1396  }
1397  else
1398  {
1399  return SFP_1;
1400  }
1401  }
1402  else
1403  {
1404  if ((uint32_t)chan >= _numTx0Chans)
1405  {
1406  return SFP_1;
1407  }
1408  else
1409  {
1410  return SFP_2;
1411  }
1412  }
1413 }
1414 
1415 
1416 bool CNTV2Config2022::SelectRxChannel(NTV2Channel channel, eSFP sfp, uint32_t & baseAddr)
1417 {
1418  uint32_t iChannel = (uint32_t) channel;
1419  uint32_t channelIndex = iChannel;
1420 
1421  if (iChannel > _numRxChans)
1422  return false;
1423 
1424  if (_is2022_6)
1425  {
1426  if (iChannel >= _numRx0Chans)
1427  {
1428  channelIndex = iChannel - _numRx0Chans;
1429  baseAddr = SAREK_2022_6_RX_CORE_1;
1430  }
1431  else
1432  {
1433  channelIndex = iChannel;
1434  baseAddr = SAREK_2022_6_RX_CORE_0;
1435  }
1436  }
1437  else
1438  {
1439  if (iChannel >= _numRx0Chans)
1440  {
1441  channelIndex = iChannel - _numRx0Chans;
1442  baseAddr = SAREK_2022_2_RX_CORE_1;
1443  }
1444  else
1445  {
1446  channelIndex = iChannel;
1447  baseAddr = SAREK_2022_2_RX_CORE_0;
1448  }
1449  }
1450 
1451  if (sfp == SFP_2)
1452  channelIndex |= 0x80000000;
1453 
1454  // select channel
1455  SetChannel(kReg2022_6_rx_channel_access + baseAddr, channelIndex);
1456 
1457  return true;
1458 }
1459 
1460 bool CNTV2Config2022::SelectTxChannel(NTV2Channel channel, eSFP sfp, uint32_t & baseAddr)
1461 {
1462  uint32_t iChannel = (uint32_t) channel;
1463  uint32_t channelIndex = iChannel;
1464 
1465  if (iChannel > _numTxChans)
1466  return false;
1467 
1468  if (_is2022_6)
1469  {
1470  if (iChannel >= _numTx0Chans)
1471  {
1472  channelIndex = iChannel - _numTx0Chans;
1473  baseAddr = SAREK_2022_6_TX_CORE_1;
1474  }
1475  else
1476  {
1477  channelIndex = iChannel;
1478  baseAddr = SAREK_2022_6_TX_CORE_0;
1479  }
1480  }
1481  else
1482  {
1483  if (iChannel >= _numTx0Chans)
1484  {
1485  channelIndex = iChannel - _numTx0Chans;
1486  baseAddr = SAREK_2022_2_TX_CORE_1;
1487  }
1488  else
1489  {
1490  channelIndex = iChannel;
1491  baseAddr = SAREK_2022_2_TX_CORE_0;
1492  }
1493  }
1494 
1495  if (sfp == SFP_2)
1496  channelIndex |= 0x80000000;
1497 
1498  // select channel
1499  SetChannel(kReg2022_6_tx_channel_access + baseAddr, channelIndex);
1500 
1501  return true;
1502 }
1503 
1505 {
1507 }
1508 
1510 {
1511  NTV2IpError error = mIpErrorCode;
1513  return error;
1514 }
1515 
1516 void CNTV2Config2022::ChannelSemaphoreSet(uint32_t controlReg, uint32_t baseAddr)
1517 {
1518  uint32_t val;
1519  ReadChannelRegister(controlReg + baseAddr, &val);
1520  WriteChannelRegister(controlReg + baseAddr, val | VOIP_SEMAPHORE_SET);
1521 }
1522 
1523 void CNTV2Config2022::ChannelSemaphoreClear(uint32_t controlReg, uint32_t baseAddr)
1524 {
1525  uint32_t val;
1526  ReadChannelRegister(controlReg + baseAddr, &val);
1527  WriteChannelRegister(controlReg + baseAddr, val & VOIP_SEMAPHORE_CLEAR);
1528 }
1529 
1530 
1531 bool CNTV2Config2022::GetMACAddress(eSFP sfp, NTV2Stream stream, string remoteIP, uint32_t & hi, uint32_t & lo)
1532 {
1533  uint32_t destIp = AJANetwork::aja_inet_addr(remoteIP.c_str());
1534  destIp = NTV2EndianSwap32(destIp);
1535 
1536  uint32_t mac;
1537  MACAddr macaddr;
1538 
1539  // is remote address muticast?
1540  uint8_t ip0 = (destIp & 0xff000000)>> 24;
1541  if (ip0 >= 224 && ip0 <= 239)
1542  {
1543  // multicast - generate MAC
1544  mac = destIp & 0x7fffff; // lower 23 bits
1545 
1546  macaddr.mac[0] = 0x01;
1547  macaddr.mac[1] = 0x00;
1548  macaddr.mac[2] = 0x5e;
1549  macaddr.mac[3] = mac >> 16;
1550  macaddr.mac[4] = (mac & 0xffff) >> 8;
1551  macaddr.mac[5] = mac & 0xff;
1552  }
1553  else
1554  {
1555  // unicast - get MAC from ARP
1556  string macAddr;
1557  bool rv;
1558  // is destination on the same subnet?
1559  IPVNetConfig nc;
1560  GetNetworkConfiguration(sfp, nc);
1561  if ( (destIp & nc.ipc_subnet) != (nc.ipc_ip & nc.ipc_subnet))
1562  {
1563  struct in_addr addr;
1564  addr.s_addr = NTV2EndianSwap32(nc.ipc_gateway);
1565  string gateIp = AJANetwork::aja_inet_ntoa(addr);
1566  rv = GetRemoteMAC(gateIp, sfp, stream, macAddr);
1567  }
1568  else
1569  {
1570  rv = GetRemoteMAC(remoteIP, sfp, stream, macAddr);
1571  }
1572  if (!rv)
1573  {
1574  SetTxChannelEnable(VideoStreamToChannel(stream), false); // stop transmit
1576  return false;
1577  }
1578 
1579  istringstream ss(macAddr);
1580  string token;
1581  int i=0;
1582  while (i < 6)
1583  {
1584  getline (ss, token, ':');
1585  macaddr.mac[i++] = (uint8_t)strtoul(token.c_str(),NULL,16);
1586  }
1587  }
1588 
1589  return MacAddressToRegisters( macaddr, hi, lo );
1590 }
1591 
1593 {
1594  return GetSFPInfo(sfp, data);
1595 }
1596 
1598 {
1599  uint32_t val;
1601  uint32_t val2;
1603 
1604  if (sfp == SFP_2)
1605  {
1606  sfpStatus.SFP_linkUp = (val & LINK_B_UP) ? true : false;
1607  sfpStatus.SFP_present = (val2 & SFP_2_NOT_PRESENT) ? false : true;
1608  sfpStatus.SFP_rxLoss = (val2 & SFP_2_RX_LOS) ? true : false;
1609  sfpStatus.SFP_txFault = (val2 & SFP_2_TX_FAULT) ? true : false;
1610  }
1611  else
1612  {
1613  sfpStatus.SFP_linkUp = (val & LINK_A_UP) ? true : false;
1614  sfpStatus.SFP_present = (val2 & SFP_1_NOT_PRESENT) ? false : true;
1615  sfpStatus.SFP_rxLoss = (val2 & SFP_1_RX_LOS) ? true : false;
1616  sfpStatus.SFP_txFault = (val2 & SFP_1_TX_FAULT) ? true : false;
1617  }
1618 
1619  return true;
1620 }
1621 
1623 {
1624  uint32_t addr;
1625 
1626  SelectRxChannel(channel, SFP_2, addr);
1629 
1630  SelectRxChannel(channel, SFP_1, addr);
1633 
1634  return true;
1635 }
1636 
1637 bool CNTV2Config2022::SetIPServicesControl(const bool enable, const bool forceReconfig)
1638 {
1639  uint32_t val = 0;
1640  if (enable)
1641  val |= BIT(0);
1642 
1643  if (forceReconfig)
1644  val |= BIT(0);
1645 
1647 
1648  return true;
1649 }
1650 
1651 bool CNTV2Config2022::GetIPServicesControl(bool & enable, bool & forceReconfig)
1652 {
1653  uint32_t val;
1655 
1656  if (val & BIT(0))
1657  enable = true;
1658  else
1659  enable = false;
1660 
1661  if (val & BIT(1))
1662  forceReconfig = true;
1663  else
1664  forceReconfig = false;
1665 
1666  return true;
1667 }
1668 
1669 NTV2Stream CNTV2Config2022::VideoChannelToStream(const NTV2Channel channel)
1670 {
1671  NTV2Stream stream;
1672  switch (channel)
1673  {
1674  case NTV2_CHANNEL1: stream = NTV2_VIDEO1_STREAM; break;
1675  case NTV2_CHANNEL2: stream = NTV2_VIDEO2_STREAM; break;
1676  case NTV2_CHANNEL3: stream = NTV2_VIDEO3_STREAM; break;
1677  case NTV2_CHANNEL4: stream = NTV2_VIDEO4_STREAM; break;
1678  default: stream = NTV2_STREAM_INVALID; break;
1679  }
1680  return stream;
1681 }
1682 
1683 NTV2Channel CNTV2Config2022::VideoStreamToChannel(const NTV2Stream stream)
1684 {
1685  NTV2Channel channel;
1686  switch (stream)
1687  {
1688  case NTV2_VIDEO1_STREAM: channel = NTV2_CHANNEL1; break;
1689  case NTV2_VIDEO2_STREAM: channel = NTV2_CHANNEL2; break;
1690  case NTV2_VIDEO3_STREAM: channel = NTV2_CHANNEL3; break;
1691  case NTV2_VIDEO4_STREAM: channel = NTV2_CHANNEL4; break;
1692  default: channel = NTV2_CHANNEL_INVALID; break;
1693  }
1694  return channel;
1695 }
kReg2022_6_tx_sec_mac_hi_addr
#define kReg2022_6_tx_sec_mac_hi_addr
Definition: ntv2registers2022.h:110
kReg2022_6_tx_ssrc
#define kReg2022_6_tx_ssrc
Definition: ntv2registers2022.h:134
SFPStatus::SFP_rxLoss
bool SFP_rxLoss
Definition: ntv2mbcontroller.h:76
tx_2022_channel::tos
uint8_t tos
Definition: ntv2config2022.h:44
NTV2IpErrCannotGetMacAddress
@ NTV2IpErrCannotGetMacAddress
Definition: ntv2enums.h:4243
rx_2022_channel::sfp2Enable
bool sfp2Enable
Definition: ntv2config2022.h:65
CNTV2MBController::SetIGMPGroup
void SetIGMPGroup(eSFP port, NTV2Stream stream, uint32_t mcast_addr, uint32_t src_addr, bool enable)
Definition: ntv2mbcontroller.cpp:380
eSFP
eSFP
Definition: ntv2mbcontroller.h:38
CNTV2Config2022::GetTxChannelEnable
bool GetTxChannelEnable(const NTV2Channel channel, bool &enabled)
Definition: ntv2config2022.cpp:1125
tx_2022_channel
Configures a SMPTE 2022 Transmit Channel.
Definition: ntv2config2022.h:22
kJ2KChromaSubSamp_422_Standard
@ kJ2KChromaSubSamp_422_Standard
Definition: ntv2tshelper.h:79
IPVNetConfig::ipc_ip
uint32_t ipc_ip
Definition: ntv2mbcontroller.h:123
CNTV2Config2022::GetIPServicesControl
bool GetIPServicesControl(bool &enable, bool &forceReconfig)
Definition: ntv2config2022.cpp:1651
SAREK_2022_6
#define SAREK_2022_6
Definition: ntv2registersmb.h:198
kJ2KStreamTypeStandard
@ kJ2KStreamTypeStandard
Definition: ntv2tshelper.h:71
CNTV2MailBox::getFeatures
uint32_t getFeatures()
Definition: ntv2mailbox.cpp:406
kReg2022_6_rx_chan_enable
#define kReg2022_6_rx_chan_enable
Definition: ntv2registers2022.h:76
kReg2022_6_rx_media_buf_base_addr
#define kReg2022_6_rx_media_buf_base_addr
Definition: ntv2registers2022.h:85
j2kEncoderConfig
Definition: ntv2config2022.h:87
kRegSarekSFPStatus
#define kRegSarekSFPStatus
Definition: ntv2registersmb.h:108
tx_2022_channel::operator!=
bool operator!=(const tx_2022_channel &other)
Definition: ntv2config2022.cpp:39
CNTV2Config2022::SetJ2KDecoderConfiguration
bool SetJ2KDecoderConfiguration(const j2kDecoderConfig &j2kConfig)
Definition: ntv2config2022.cpp:1346
kReg2022_6_rx_channel_access
#define kReg2022_6_rx_channel_access
Definition: ntv2registers2022.h:46
kReg2022_6_tx_link_enable
#define kReg2022_6_tx_link_enable
Definition: ntv2registers2022.h:127
kReg2022_6_tx_pri_mac_hi_addr
#define kReg2022_6_tx_pri_mac_hi_addr
Definition: ntv2registers2022.h:108
s2022RxChannelStatus::sfp1ValidRxPackets
uint32_t sfp1ValidRxPackets
Definition: ntv2config2022.h:151
kReg2022_6_rx_match_dest_ip_addr
#define kReg2022_6_rx_match_dest_ip_addr
Definition: ntv2registers2022.h:65
SAREK_2022_2_TX_CORE_0
#define SAREK_2022_2_TX_CORE_0
Definition: ntv2registers2022.h:24
rx_2022_channel::operator!=
bool operator!=(const rx_2022_channel &other)
Definition: ntv2config2022.cpp:88
kRegSarekMAC
#define kRegSarekMAC
Definition: ntv2registersmb.h:89
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
NTV2_CHANNEL2
@ NTV2_CHANNEL2
Specifies channel or Frame Store 2 (or the 2nd item).
Definition: ntv2enums.h:1308
RX_MATCH_2022_SOURCE_IP
#define RX_MATCH_2022_SOURCE_IP
Definition: ntv2registersmb.h:17
kReg2022_6_rx_network_path_differential
#define kReg2022_6_rx_network_path_differential
Definition: ntv2registers2022.h:50
CNTV2Config2022::GetIGMPDisable
bool GetIGMPDisable(eSFP sfp, bool &disabled)
Definition: ntv2config2022.cpp:1279
CNTV2MailBox::SetChannel
void SetChannel(ULWord channelOffset, ULWord channelNumber)
Definition: ntv2mailbox.cpp:251
CNTV2MailBox::mDevice
CNTV2Card & mDevice
Definition: ntv2mailbox.h:79
CNTV2Config2022::Set2022_7_Mode
bool Set2022_7_Mode(bool enable, uint32_t rx_networkPathDifferential)
Definition: ntv2config2022.cpp:1145
PLL_MATCH_SOURCE_IP
#define PLL_MATCH_SOURCE_IP
Definition: ntv2registersmb.h:36
NTV2IpErrSFP2NotConfigured
@ NTV2IpErrSFP2NotConfigured
Definition: ntv2enums.h:4241
CNTV2MacDriverInterface::ReadRegister
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device....
Definition: ntv2macdriverinterface.cpp:389
kReg2022_6_tx_udp_src_port
#define kReg2022_6_tx_udp_src_port
Definition: ntv2registers2022.h:123
CNTV2MBController::UnsetIGMPGroup
void UnsetIGMPGroup(eSFP port, NTV2Stream stream)
Definition: ntv2mbcontroller.cpp:395
s2022RxChannelStatus::sfp2RxPackets
uint32_t sfp2RxPackets
Definition: ntv2config2022.h:152
NULL
#define NULL
Definition: ntv2caption608types.h:19
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1305
SAREK_2022_6_TX_CORE_0
#define SAREK_2022_6_TX_CORE_0
Definition: ntv2registers2022.h:19
tx_2022_channel::sfp1RemoteIP
std::string sfp1RemoteIP
Specifies remote (destination) IP address.
Definition: ntv2config2022.h:37
CNTV2Config2022::SetTxChannelConfiguration
bool SetTxChannelConfiguration(const NTV2Channel channel, const tx_2022_channel &txConfig)
Definition: ntv2config2022.cpp:831
CNTV2MBController::GetRemoteMAC
bool GetRemoteMAC(std::string remote_IPAddress, eSFP port, NTV2Stream stream, std::string &MACaddress)
Definition: ntv2mbcontroller.cpp:189
SAREK_PLL
#define SAREK_PLL
Definition: ntv2registersmb.h:57
j2kDecoderConfig::init
void init()
Definition: ntv2config2022.cpp:166
kRegSarekIGMPVersion
#define kRegSarekIGMPVersion
Definition: ntv2registersmb.h:82
CNTV2MBController::SetRxMatch
bool SetRxMatch(NTV2Channel channel, eSFP link, uint8_t match)
Definition: ntv2mbcontroller.cpp:507
NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_1
@ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_1
Definition: ntv2enums.h:1914
j2kEncoderConfig::videoPid
uint32_t videoPid
Specifies the PID for the video.
Definition: ntv2config2022.h:105
kReg2022_6_rx_link_valid_media_pkt_cnt
#define kReg2022_6_rx_link_valid_media_pkt_cnt
Definition: ntv2registers2022.h:72
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
SAREK_2022_6_RX_CORE_0
#define SAREK_2022_6_RX_CORE_0
Definition: ntv2registers2022.h:20
CNTV2MailBox::ReadChannelRegister
bool ReadChannelRegister(const ULWord inReg, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0x0)
Definition: ntv2mailbox.cpp:237
DEVICE_ID_IOIP_2022
@ DEVICE_ID_IOIP_2022
See Io IP.
Definition: ntv2enums.h:38
kRegPll_SrcIp
#define kRegPll_SrcIp
Definition: ntv2registersmb.h:383
ntv2endian.h
Defines a number of handy byte-swapping macros.
s2022RxChannelStatus::sfp1RxPackets
uint32_t sfp1RxPackets
Definition: ntv2config2022.h:150
kRegSarekIP1
#define kRegSarekIP1
Definition: ntv2registersmb.h:94
kReg2022_6_rx_playout_delay
#define kReg2022_6_rx_playout_delay
Definition: ntv2registers2022.h:82
kRegSarekIP0
#define kRegSarekIP0
Definition: ntv2registersmb.h:93
NTV2_AUDIOSYSTEM_1
@ NTV2_AUDIOSYSTEM_1
This identifies the first Audio System.
Definition: ntv2enums.h:3816
kReg2022_6_rx_match_vlan
#define kReg2022_6_rx_match_vlan
Definition: ntv2registers2022.h:64
SAREK_TX0_MASK
#define SAREK_TX0_MASK
Definition: ntv2registersmb.h:208
tx_2022_channel::sfp2RemotePort
uint32_t sfp2RemotePort
Specifies the remote (destination) port number.
Definition: ntv2config2022.h:42
j2kDecoderConfig::eProgSel_Default
@ eProgSel_Default
Definition: ntv2config2022.h:120
rx_2022_channel::ssrc
uint32_t ssrc
Specifies the SSRC identifier (if RX_MATCH_2022_SSRC set)
Definition: ntv2config2022.h:83
CNTV2ConfigTs2022::GetJ2KDecoderStatus
bool GetJ2KDecoderStatus(j2kDecoderStatus &status)
Definition: ntv2configts2022.cpp:391
j2kDecoderConfig::programPID
uint32_t programPID
Definition: ntv2config2022.h:131
CNTV2Config2022::GetTxChannelConfiguration
bool GetTxChannelConfiguration(const NTV2Channel channel, tx_2022_channel &txConfig)
Definition: ntv2config2022.cpp:952
tx_2022_channel::sfp1RemotePort
uint32_t sfp1RemotePort
Specifies the remote (destination) port number.
Definition: ntv2config2022.h:38
SFP_2_NOT_PRESENT
#define SFP_2_NOT_PRESENT
Definition: ntv2registersmb.h:238
CNTV2MBController::GetRxLinkState
bool GetRxLinkState(NTV2Channel channel, bool &sfp1Enable, bool &sfp2Enable)
Definition: ntv2mbcontroller.cpp:492
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
RX_MATCH_2022_DEST_IP
#define RX_MATCH_2022_DEST_IP
Definition: ntv2registersmb.h:18
kRegPll_DstPort
#define kRegPll_DstPort
Definition: ntv2registersmb.h:386
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
Definition: ntv2enums.h:1307
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
CNTV2MBController::GetRxMatch
bool GetRxMatch(NTV2Channel channel, eSFP link, uint8_t &match)
Definition: ntv2mbcontroller.cpp:535
CNTV2Card::SetSDITransmitEnable
virtual bool SetSDITransmitEnable(const NTV2Channel inChannel, const bool inEnable)
Sets the specified bidirectional SDI connector to act as an input or an output.
Definition: ntv2register.cpp:3796
CNTV2Config2022::SetIGMPVersion
bool SetIGMPVersion(eIGMPVersion_t version)
Definition: ntv2config2022.cpp:1296
VOIP_SEMAPHORE_SET
#define VOIP_SEMAPHORE_SET
Definition: ntv2registersmb.h:31
CNTV2Config2022::GetJ2KDecoderConfiguration
bool GetJ2KDecoderConfiguration(j2kDecoderConfig &j2kConfig)
Definition: ntv2config2022.cpp:1359
CNTV2Config2022::SetJ2KEncoderConfiguration
bool SetJ2KEncoderConfiguration(const NTV2Channel channel, const j2kEncoderConfig &j2kConfig)
Definition: ntv2config2022.cpp:1322
CNTV2Config2022::GetNetworkConfiguration
bool GetNetworkConfiguration(const eSFP sfp, IPVNetConfig &netConfig)
Definition: ntv2config2022.cpp:260
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
kReg2022_6_tx_dest_mac_low_addr
#define kReg2022_6_tx_dest_mac_low_addr
Definition: ntv2registers2022.h:119
NTV2_CHANNEL_INVALID
@ NTV2_CHANNEL_INVALID
Definition: ntv2enums.h:1316
NTV2IpErrNotSupported
@ NTV2IpErrNotSupported
Definition: ntv2enums.h:4244
CNTV2Card::SetAudioSystemInputSource
virtual bool SetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedInput)
Sets the audio source for the given NTV2AudioSystem on the device.
Definition: ntv2audio.cpp:485
CNTV2ConfigTs2022::SetupJ2KEncoder
bool SetupJ2KEncoder(const NTV2Channel channel, const j2kEncoderConfig &config)
Definition: ntv2configts2022.cpp:36
NTV2_CHANNEL4
@ NTV2_CHANNEL4
Specifies channel or Frame Store 4 (or the 4th item).
Definition: ntv2enums.h:1310
eIGMPVersion_3
@ eIGMPVersion_3
Definition: ntv2mbcontroller.h:59
SFPStatus::SFP_present
bool SFP_present
Definition: ntv2mbcontroller.h:75
SFP_1
@ SFP_1
Definition: ntv2mbcontroller.h:40
tx_2022_channel::sfp2LocalPort
uint32_t sfp2LocalPort
Specifies the local (source) port number.
Definition: ntv2config2022.h:40
PLL_CONFIG_PCR
#define PLL_CONFIG_PCR
Definition: ntv2registersmb.h:42
SFPStatus
Definition: ntv2mbcontroller.h:73
CNTV2MBController::GetDualLinkMode
bool GetDualLinkMode(bool &enable)
Definition: ntv2mbcontroller.cpp:622
SAREK_2022_7
#define SAREK_2022_7
Definition: ntv2registersmb.h:202
tx_2022_channel::sfp1LocalPort
uint32_t sfp1LocalPort
Specifies the local (source) port number.
Definition: ntv2config2022.h:36
ntv2config2022.h
Declares the CNTV2Config2022 class.
CNTV2MBController::DisableNetworkInterface
bool DisableNetworkInterface(eSFP port)
Definition: ntv2mbcontroller.cpp:99
SFP_2_RX_LOS
#define SFP_2_RX_LOS
Definition: ntv2registersmb.h:240
kRegSarekNET0
#define kRegSarekNET0
Definition: ntv2registersmb.h:95
j2kEncoderConfig::bitDepth
uint32_t bitDepth
Specifies the bit depth for J2K encode.
Definition: ntv2config2022.h:99
j2kDecoderStatus
Definition: ntv2config2022.h:135
j2kEncoderConfig::init
void init()
Definition: ntv2config2022.cpp:124
CNTV2ConfigTs2022::ReadbackJ2KEncoder
bool ReadbackJ2KEncoder(const NTV2Channel channel, j2kEncoderConfig &config)
Definition: ntv2configts2022.cpp:154
CNTV2Config2022::DisableNetworkInterface
bool DisableNetworkInterface(const eSFP sfp)
Definition: ntv2config2022.cpp:392
CNTV2MBController::SetIGMPVersion
bool SetIGMPVersion(uint32_t version)
Definition: ntv2mbcontroller.cpp:149
kRegPll_DstIp
#define kRegPll_DstIp
Definition: ntv2registersmb.h:385
SFP_1_TX_FAULT
#define SFP_1_TX_FAULT
Definition: ntv2registersmb.h:236
NTV2IpErrNone
@ NTV2IpErrNone
Definition: ntv2enums.h:4231
PLL_MATCH_ES_PID
#define PLL_MATCH_ES_PID
Definition: ntv2registersmb.h:40
kReg2022_6_rx_control
#define kReg2022_6_rx_control
Definition: ntv2registers2022.h:44
tx_2022_channel::init
void init()
Definition: ntv2config2022.cpp:21
CNTV2MBController::GetSFPActive
bool GetSFPActive(eSFP sfp)
Definition: ntv2mbcontroller.cpp:589
kReg2022_6_rx_match_ssrc
#define kReg2022_6_rx_match_ssrc
Definition: ntv2registers2022.h:79
NTV2EndianSwap32
#define NTV2EndianSwap32(__val__)
Definition: ntv2endian.h:19
CNTV2Config2022::SetTxChannelEnable
bool SetTxChannelEnable(const NTV2Channel channel, bool enable)
Definition: ntv2config2022.cpp:1007
LINK_B_UP
#define LINK_B_UP
Definition: ntv2registersmb.h:243
NTV2_STREAM_INVALID
@ NTV2_STREAM_INVALID
Definition: ntv2enums.h:1369
tx_2022_channel::operator==
bool operator==(const tx_2022_channel &other)
Definition: ntv2config2022.cpp:44
SAREK_RX1_MASK
#define SAREK_RX1_MASK
Definition: ntv2registersmb.h:211
CNTV2Config2022::GetSFPMSAData
bool GetSFPMSAData(eSFP sfp, SFPMSAData &data)
Definition: ntv2config2022.cpp:1592
SAREK_TX1_MASK
#define SAREK_TX1_MASK
Definition: ntv2registersmb.h:210
kReg2022_6_rx_chan_timeout
#define kReg2022_6_rx_chan_timeout
Definition: ntv2registers2022.h:77
CNTV2MBController::SetTxLinkState
bool SetTxLinkState(NTV2Channel channel, bool sfp1Enable, bool sfp2Enable)
Definition: ntv2mbcontroller.cpp:441
CNTV2ConfigTs2022::getLastErrorCode
NTV2IpError getLastErrorCode()
Definition: ntv2configts2022.cpp:606
kRegSarekServices
#define kRegSarekServices
Definition: ntv2registersmb.h:87
ntv2card.h
Declares the CNTV2Card class.
RX_MATCH_2022_SOURCE_PORT
#define RX_MATCH_2022_SOURCE_PORT
Definition: ntv2registersmb.h:19
CNTV2Config2022::SetIPServicesControl
bool SetIPServicesControl(const bool enable, const bool forceReconfig)
Definition: ntv2config2022.cpp:1637
CNTV2MailBox::WriteChannelRegister
bool WriteChannelRegister(ULWord reg, ULWord value, ULWord mask=0xFFFFFFFF, ULWord shift=0x0)
Definition: ntv2mailbox.cpp:246
CNTV2Config2022::GetLinkStatus
bool GetLinkStatus(eSFP sfp, SFPStatus &sfpStatus)
Definition: ntv2config2022.cpp:1597
kReg2022_6_tx_chan_enable
#define kReg2022_6_tx_chan_enable
Definition: ntv2registers2022.h:131
SAREK_REGS
#define SAREK_REGS
Definition: ntv2registersmb.h:54
kReg2022_6_tx_src_ip_addr
#define kReg2022_6_tx_src_ip_addr
Definition: ntv2registers2022.h:122
rx_2022_channel::sfp1RxMatch
uint8_t sfp1RxMatch
Bitmap of rxMatch criteria used.
Definition: ntv2config2022.h:67
SAREK_2022_6_RX_CORE_1
#define SAREK_2022_6_RX_CORE_1
Definition: ntv2registers2022.h:22
NTV2_CHANNEL3
@ NTV2_CHANNEL3
Specifies channel or Frame Store 3 (or the 3rd item).
Definition: ntv2enums.h:1309
kRegPll_SrcPort
#define kRegPll_SrcPort
Definition: ntv2registersmb.h:384
kSarekRegIGMPDisable
#define kSarekRegIGMPDisable
Definition: ntv2registersmb.h:103
j2kEncoderConfig::operator!=
bool operator!=(const j2kEncoderConfig &other)
Definition: ntv2config2022.cpp:139
NTV2IpErrInvalidIGMPVersion
@ NTV2IpErrInvalidIGMPVersion
Definition: ntv2enums.h:4242
SFP_1_NOT_PRESENT
#define SFP_1_NOT_PRESENT
Definition: ntv2registersmb.h:235
ntv2utils.h
Declares numerous NTV2 utility functions.
SFPMSAData
Definition: ntv2mbcontroller.h:68
tx_2022_channel::sfp2Enable
bool sfp2Enable
Definition: ntv2config2022.h:34
rx_2022_channel::sfp1DestIP
std::string sfp1DestIP
Specifies the destination (target) IP address (if RX_MATCH_2022_DEST_IP set)
Definition: ntv2config2022.h:70
RX_MATCH_2022_DEST_PORT
#define RX_MATCH_2022_DEST_PORT
Definition: ntv2registersmb.h:20
kReg2022_6_rx_match_dest_port
#define kReg2022_6_rx_match_dest_port
Definition: ntv2registers2022.h:68
j2kEncoderConfig::ullMode
uint32_t ullMode
Specifies the ull mode for J2K encode.
Definition: ntv2config2022.h:98
CNTV2Card
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
PLL_MATCH_SOURCE_PORT
#define PLL_MATCH_SOURCE_PORT
Definition: ntv2registersmb.h:38
kReg2022_6_tx_dest_ip_addr
#define kReg2022_6_tx_dest_ip_addr
Definition: ntv2registers2022.h:121
SAREK_2022_2_TX_CORE_1
#define SAREK_2022_2_TX_CORE_1
Definition: ntv2registers2022.h:26
NTV2IpErrNotReady
@ NTV2IpErrNotReady
Definition: ntv2enums.h:4238
kSarekRegIGMPDisable2
#define kSarekRegIGMPDisable2
Definition: ntv2registersmb.h:104
kReg2022_6_tx_ip_header
#define kReg2022_6_tx_ip_header
Definition: ntv2registers2022.h:117
j2kDecoderConfig
Definition: ntv2config2022.h:110
kReg2022_6_tx_reset
#define kReg2022_6_tx_reset
Definition: ntv2registers2022.h:105
CNTV2DriverInterface::IsMBSystemValid
virtual bool IsMBSystemValid(void)
Definition: ntv2driverinterface.cpp:1298
CNTV2Config2022::GetIGMPVersion
bool GetIGMPVersion(eIGMPVersion_t &version)
Definition: ntv2config2022.cpp:1314
kReg2022_6_tx_control
#define kReg2022_6_tx_control
Definition: ntv2registers2022.h:104
rx_2022_channel::sfp2DestIP
std::string sfp2DestIP
Specifies the destination (target) IP address (if RX_MATCH_2022_DEST_IP set)
Definition: ntv2config2022.h:78
NTV2_VIDEO4_STREAM
@ NTV2_VIDEO4_STREAM
Definition: ntv2enums.h:1357
CNTV2Config2022::GetRxChannelEnable
bool GetRxChannelEnable(const NTV2Channel channel, bool &enabled)
Definition: ntv2config2022.cpp:785
kReg2022_6_tx_dest_mac_hi_addr
#define kReg2022_6_tx_dest_mac_hi_addr
Definition: ntv2registers2022.h:120
CNTV2MailBox::mIpErrorCode
NTV2IpError mIpErrorCode
Definition: ntv2mailbox.h:81
SAREK_RX0_MASK
#define SAREK_RX0_MASK
Definition: ntv2registersmb.h:209
NTV2Stream
NTV2Stream
Identifies a specific IP-based data stream.
Definition: ntv2enums.h:1352
PLL_MATCH_DEST_PORT
#define PLL_MATCH_DEST_PORT
Definition: ntv2registersmb.h:39
CNTV2MBController::SetDualLinkMode
bool SetDualLinkMode(bool enable)
Definition: ntv2mbcontroller.cpp:606
rx_2022_channel::sfp1DestPort
uint32_t sfp1DestPort
Specifies the destination (target) port number (if RX_MATCH_2022_DEST_PORT set)
Definition: ntv2config2022.h:72
j2kEncoderConfig::operator==
bool operator==(const j2kEncoderConfig &other)
Definition: ntv2config2022.cpp:144
kReg2022_6_tx_sec_mac_low_addr
#define kReg2022_6_tx_sec_mac_low_addr
Definition: ntv2registers2022.h:109
NTV2IpErrSoftwareMismatch
@ NTV2IpErrSoftwareMismatch
Definition: ntv2enums.h:4239
CNTV2Config2022::SetRxChannelEnable
bool SetRxChannelEnable(const NTV2Channel channel, bool enable)
Definition: ntv2config2022.cpp:670
rx_2022_channel::sfp2SourcePort
uint32_t sfp2SourcePort
Specifies the source (sender) port number (if RX_MATCH_2022_SOURCE_PORT set)
Definition: ntv2config2022.h:79
SFPStatus::SFP_txFault
bool SFP_txFault
Definition: ntv2mbcontroller.h:77
CNTV2ConfigTs2022::ReadbackJ2KDecoder
bool ReadbackJ2KDecoder(j2kDecoderConfig &config)
Definition: ntv2configts2022.cpp:381
SAREK_TX_TOP34
#define SAREK_TX_TOP34
Definition: ntv2registersmb.h:204
kRegPll_Match
#define kRegPll_Match
Definition: ntv2registersmb.h:388
j2kDecoderConfig::audioNumber
uint32_t audioNumber
Definition: ntv2config2022.h:132
kReg2022_6_tx_sys_mem_conf
#define kReg2022_6_tx_sys_mem_conf
Definition: ntv2registers2022.h:113
NTV2_AUDIO_AES
@ NTV2_AUDIO_AES
Obtain audio samples from the device AES inputs, if available.
Definition: ntv2enums.h:1953
kRegPll_Config
#define kRegPll_Config
Definition: ntv2registersmb.h:378
tx_2022_channel::sfp1Enable
bool sfp1Enable
Definition: ntv2config2022.h:33
kReg2022_6_rx_reset
#define kReg2022_6_rx_reset
Definition: ntv2registers2022.h:45
CNTV2MBController::GetSFPInfo
bool GetSFPInfo(eSFP port, SFPMSAData &sfpdata)
Definition: ntv2mbcontroller.cpp:785
SAREK_2022_2_RX_CORE_1
#define SAREK_2022_2_RX_CORE_1
Definition: ntv2registers2022.h:27
SAREK_2022_2_RX_CORE_0
#define SAREK_2022_2_RX_CORE_0
Definition: ntv2registers2022.h:25
CNTV2MBController::GetTxLinkState
bool GetTxLinkState(NTV2Channel channel, bool &sfp1Enable, bool &sfp2Enable)
Definition: ntv2mbcontroller.cpp:459
SFP_2
@ SFP_2
Definition: ntv2mbcontroller.h:41
CNTV2MBController
Definition: ntv2mbcontroller.h:128
SFP_1_RX_LOS
#define SFP_1_RX_LOS
Definition: ntv2registersmb.h:237
kReg2022_6_tx_video_para_config
#define kReg2022_6_tx_video_para_config
Definition: ntv2registers2022.h:132
j2kEncoderConfig::pmtPid
uint32_t pmtPid
Specifies the PID for the PMT.
Definition: ntv2config2022.h:104
j2kDecoderConfig::operator!=
bool operator!=(const j2kDecoderConfig &other)
Definition: ntv2config2022.cpp:174
CNTV2Config2022::Get2022ChannelRxStatus
bool Get2022ChannelRxStatus(NTV2Channel channel, s2022RxChannelStatus &status)
Definition: ntv2config2022.cpp:1622
NTV2_VIDEO2_STREAM
@ NTV2_VIDEO2_STREAM
Definition: ntv2enums.h:1355
IPVNetConfig::ipc_subnet
uint32_t ipc_subnet
Definition: ntv2mbcontroller.h:124
SFPStatus::SFP_linkUp
bool SFP_linkUp
Definition: ntv2mbcontroller.h:78
CNTV2Config2022::GetMACAddress
bool GetMACAddress(eSFP sfp, NTV2Stream stream, std::string remoteIP, uint32_t &hi, uint32_t &lo)
Definition: ntv2config2022.cpp:1531
s2022RxChannelStatus::sfp2ValidRxPackets
uint32_t sfp2ValidRxPackets
Definition: ntv2config2022.h:153
kRegSarekGATE0
#define kRegSarekGATE0
Definition: ntv2registersmb.h:97
NTV2_VIDEO1_STREAM
@ NTV2_VIDEO1_STREAM
Definition: ntv2enums.h:1354
tx_2022_channel::ttl
uint8_t ttl
Definition: ntv2config2022.h:45
kReg2022_2_tx_ts_config
#define kReg2022_2_tx_ts_config
Definition: ntv2registers2022.h:239
kReg2022_6_rx_match_sel
#define kReg2022_6_rx_match_sel
Definition: ntv2registers2022.h:69
CNTV2Config2022::~CNTV2Config2022
~CNTV2Config2022()
Definition: ntv2config2022.cpp:237
std
Definition: json.hpp:5362
MACAddr
Definition: ntv2mbcontroller.h:63
NTV2IpError
NTV2IpError
Definition: ntv2enums.h:4229
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
CNTV2ConfigTs2022::SetupJ2KDecoder
bool SetupJ2KDecoder(const j2kDecoderConfig &config)
Definition: ntv2configts2022.cpp:364
rx_2022_channel::init
void init()
Definition: ntv2config2022.cpp:65
CNTV2Config2022::CNTV2Config2022
CNTV2Config2022(CNTV2Card &device)
Definition: ntv2config2022.cpp:209
tx_2022_channel::ssrc
uint32_t ssrc
Definition: ntv2config2022.h:46
s2022RxChannelStatus
Definition: ntv2config2022.h:148
rx_2022_channel::operator==
bool operator==(const rx_2022_channel &other)
Definition: ntv2config2022.cpp:93
SAREK_2022_6_TX_CORE_1
#define SAREK_2022_6_TX_CORE_1
Definition: ntv2registers2022.h:21
SFP_2_TX_FAULT
#define SFP_2_TX_FAULT
Definition: ntv2registersmb.h:239
CNTV2Config2022::Get2022_7_Mode
bool Get2022_7_Mode(bool &enable, uint32_t &rx_networkPathDifferential)
Definition: ntv2config2022.cpp:1240
j2kEncoderConfig::videoFormat
NTV2VideoFormat videoFormat
Specifies the video format for J2K encode.
Definition: ntv2config2022.h:97
kReg2022_6_tx_udp_dest_port
#define kReg2022_6_tx_udp_dest_port
Definition: ntv2registers2022.h:124
CNTV2DriverInterface::GetDeviceID
virtual NTV2DeviceID GetDeviceID(void)
Definition: ntv2driverinterface.cpp:381
rx_2022_channel::sfp1Enable
bool sfp1Enable
Definition: ntv2config2022.h:64
kRegSarekLinkStatus
#define kRegSarekLinkStatus
Definition: ntv2registersmb.h:86
CNTV2MBController::SetMBNetworkConfiguration
bool SetMBNetworkConfiguration(eSFP port, std::string ipaddr, std::string netmask, std::string gateway)
Definition: ntv2mbcontroller.cpp:49
CNTV2Config2022::GetJ2KEncoderConfiguration
bool GetJ2KEncoderConfiguration(const NTV2Channel channel, j2kEncoderConfig &j2kConfig)
Definition: ntv2config2022.cpp:1334
PLL_MATCH_DEST_IP
#define PLL_MATCH_DEST_IP
Definition: ntv2registersmb.h:37
CNTV2MBController::EnableIGMPGroup
void EnableIGMPGroup(eSFP port, NTV2Stream stream, bool enable)
Definition: ntv2mbcontroller.cpp:405
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
MACAddr::mac
uint8_t mac[6]
Definition: ntv2mbcontroller.h:65
rx_2022_channel::sfp2RxMatch
uint8_t sfp2RxMatch
Bitmap of rxMatch criteria used.
Definition: ntv2config2022.h:75
CNTV2Config2022::getLastError
std::string getLastError()
Definition: ntv2config2022.cpp:1504
NTV2_FORMAT_720p_5994
@ NTV2_FORMAT_720p_5994
Definition: ntv2enums.h:514
NTV2IpErrSFP1NotConfigured
@ NTV2IpErrSFP1NotConfigured
Definition: ntv2enums.h:4240
rx_2022_channel::sfp2DestPort
uint32_t sfp2DestPort
Specifies the destination (target) port number (if RX_MATCH_2022_DEST_PORT set)
Definition: ntv2config2022.h:80
kReg2022_6_rx_match_src_port
#define kReg2022_6_rx_match_src_port
Definition: ntv2registers2022.h:67
CNTV2Config2022::GetJ2KDecoderStatus
bool GetJ2KDecoderStatus(j2kDecoderStatus &j2kStatus)
Definition: ntv2config2022.cpp:1371
CNTV2Config2022::SetIGMPDisable
bool SetIGMPDisable(eSFP sfp, bool disable)
Disables the automatic (default) joining of multicast groups using IGMP, based on remote IP address f...
Definition: ntv2config2022.cpp:1265
j2kDecoderConfig::programNumber
uint32_t programNumber
Definition: ntv2config2022.h:130
MacAddressToRegisters
static bool MacAddressToRegisters(const MACAddr &macaddr, uint32_t &hi, uint32_t &lo)
Definition: ntv2config2022.cpp:819
j2kEncoderConfig::pcrPid
uint32_t pcrPid
Specifies the PID for the PCR.
Definition: ntv2config2022.h:106
LINK_A_UP
#define LINK_A_UP
Definition: ntv2registersmb.h:242
BIT
#define BIT(_x_)
Definition: ajatypes.h:561
kReg2022_6_tx_pri_mac_low_addr
#define kReg2022_6_tx_pri_mac_low_addr
Definition: ntv2registers2022.h:107
NTV2IpErrorEnumToString
std::string NTV2IpErrorEnumToString(const NTV2IpError inIpErrorEnumValue)
Definition: ntv2utils.cpp:7350
CNTV2Config2022::getLastErrorCode
NTV2IpError getLastErrorCode()
Definition: ntv2config2022.cpp:1509
j2kDecoderConfig::operator==
bool operator==(const j2kDecoderConfig &other)
Definition: ntv2config2022.cpp:179
CNTV2Config2022::SetRxChannelConfiguration
bool SetRxChannelConfiguration(const NTV2Channel channel, const rx_2022_channel &rxConfig)
Definition: ntv2config2022.cpp:398
ntv2configts2022.h
Declares the CNTV2ConfigTs2022 class.
j2kEncoderConfig::audio1Pid
uint32_t audio1Pid
Specifies the PID for audio 1.
Definition: ntv2config2022.h:107
kReg2022_6_rx_sec_recv_pkt_cnt
#define kReg2022_6_rx_sec_recv_pkt_cnt
Definition: ntv2registers2022.h:55
rx_2022_channel::sfp1SourcePort
uint32_t sfp1SourcePort
Specifies the source (sender) port number (if RX_MATCH_2022_SOURCE_PORT set)
Definition: ntv2config2022.h:71
kReg2022_6_rx_media_pkt_buf_size
#define kReg2022_6_rx_media_pkt_buf_size
Definition: ntv2registers2022.h:86
j2kDecoderStatus::init
void init()
Definition: ntv2config2022.cpp:194
CNTV2Config2022::GetRxChannelConfiguration
bool GetRxChannelConfiguration(const NTV2Channel channel, rx_2022_channel &rxConfig)
Definition: ntv2config2022.cpp:583
IPVNetConfig::ipc_gateway
uint32_t ipc_gateway
Definition: ntv2mbcontroller.h:125
SAREK_2022_2
#define SAREK_2022_2
Definition: ntv2registersmb.h:199
CNTV2MacDriverInterface::WriteRegister
virtual bool WriteRegister(const ULWord inRegNum, const ULWord inValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Updates or replaces all or part of the 32-bit contents of a specific register (real or virtual) on th...
Definition: ntv2macdriverinterface.cpp:430
CNTV2Config2022::SetNetworkConfiguration
bool SetNetworkConfiguration(const eSFP sfp, const IPVNetConfig &netConfig)
Definition: ntv2config2022.cpp:245
eIGMPVersion_2
@ eIGMPVersion_2
Definition: ntv2mbcontroller.h:58
NTV2_VIDEO3_STREAM
@ NTV2_VIDEO3_STREAM
Definition: ntv2enums.h:1356
kRegSarekGATE1
#define kRegSarekGATE1
Definition: ntv2registersmb.h:98
CNTV2DriverInterface::IsMBSystemReady
virtual bool IsMBSystemReady(void)
Definition: ntv2driverinterface.cpp:1309
VOIP_SEMAPHORE_CLEAR
#define VOIP_SEMAPHORE_CLEAR
Definition: ntv2registersmb.h:32
CNTV2MBController::SetRxLinkState
bool SetRxLinkState(NTV2Channel channel, bool sfp1Enable, bool sfp2Enable)
Definition: ntv2mbcontroller.cpp:474
kReg2022_6_rx_pri_recv_pkt_cnt
#define kReg2022_6_rx_pri_recv_pkt_cnt
Definition: ntv2registers2022.h:54
kReg2022_6_tx_channel_access
#define kReg2022_6_tx_channel_access
Definition: ntv2registers2022.h:106
j2kDecoderConfig::selectionMode
eProgSelMode_t selectionMode
Definition: ntv2config2022.h:129
kReg2022_6_tx_hitless_config
#define kReg2022_6_tx_hitless_config
Definition: ntv2registers2022.h:114
kRegSarekNET1
#define kRegSarekNET1
Definition: ntv2registersmb.h:96
kReg2022_6_rx_match_src_ip_addr
#define kReg2022_6_rx_match_src_ip_addr
Definition: ntv2registers2022.h:66
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