AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
konaipjsonparse.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
2 //-------------------------------------------------------------------------------------------
3 // konaipjsonparse.cpp
4 // Implementation of ip json parser for 2110.
5 //
6 // Copyright (C) 2018 AJA Video Systems, Inc.
7 // Proprietary and Confidential information. All rights reserved.
8 //-------------------------------------------------------------------------------------------
9 #include "konaipjsonparse.h"
10 
11 #ifdef BUILD_DEMO
12  #include "ntv2democommon.h"
13 #endif
14 
15 
16 const int kStrMax = IP_STRSIZE-1;
17 
18 //-------------------------------------------------------------------------------------------------
19 // CKonaIpJsonParse2110
20 //-------------------------------------------------------------------------------------------------
21 
23 {
24  m_verbose = false;
25 }
26 
28 {
29 }
30 
31 bool CKonaIpJsonParse2110::SetJson(const QJsonObject& topObj, bool verbose)
32 {
33  if (topObj.isEmpty())
34  return false;
35 
36  bool success = true;
37  m_verbose = verbose;
38 
39  memset(&m_net2110, 0, sizeof(NetworkData2110));
40  memset(&m_receiveVideo2110, 0, sizeof(ReceiveVideoData2110));
41  memset(&m_receiveAudio2110, 0, sizeof(ReceiveAudioData2110));
42  memset(&m_receiveAnc2110, 0, sizeof(ReceiveAncData2110));
43  memset(&m_transmitVideo2110, 0, sizeof(TransmitVideoData2110));
44  memset(&m_transmitAudio2110, 0, sizeof(TransmitAudioData2110));
45  memset(&m_transmitAnc2110, 0, sizeof(TransmitAncData2110));
46 
47  //
48  // Network
49  //
50  if (topObj.contains("protocol"))
51  {
52  QJsonObject obj2110 = topObj["protocol"].toObject();
53  success = SetJsonProtocol(obj2110) && success;
54  }
55 
56  if (topObj.contains("network2110"))
57  {
58  QJsonObject obj2110 = topObj["network2110"].toObject();
59  success = SetJsonNetwork(obj2110) && success;
60  }
61 
62  if (topObj.contains("receiveVideo2110"))
63  {
64  QJsonArray receiveVideoArray = topObj["receiveVideo2110"].toArray();
65  success = SetJsonReceiveVideo(receiveVideoArray) && success;
66  }
67 
68  if (topObj.contains("receiveAudio2110"))
69  {
70  QJsonArray receiveAudioArray = topObj["receiveAudio2110"].toArray();
71  success = SetJsonReceiveAudio(receiveAudioArray) && success;
72  }
73 
74  if (topObj.contains("receiveAnc2110"))
75  {
76  QJsonArray receiveAncArray = topObj["receiveAnc2110"].toArray();
77  success = SetJsonReceiveAnc(receiveAncArray) && success;
78  }
79 
80  if (topObj.contains("transmitVideo2110"))
81  {
82  QJsonArray transmitVideoArray = topObj["transmitVideo2110"].toArray();
83  success = SetJsonTransmitVideo(transmitVideoArray) && success;
84  }
85 
86  if (topObj.contains("transmitAudio2110"))
87  {
88  QJsonArray transmitAudioArray = topObj["transmitAudio2110"].toArray();
89  success = SetJsonTransmitAudio(transmitAudioArray) && success;
90  }
91 
92  if (topObj.contains("transmitAnc2110"))
93  {
94  QJsonArray transmitAncArray = topObj["transmitAnc2110"].toArray();
95  success = SetJsonTransmitAnc(transmitAncArray) && success;
96  }
97 
98  QJsonObject newTopObj;
99  newTopObj.insert("protocol", m_protocolJson);
100  newTopObj.insert("network2110", m_netJson);
101  newTopObj.insert("receiveVideo2110", m_receiveVideoJson);
102  newTopObj.insert("receiveAudio2110", m_receiveAudioJson);
103  newTopObj.insert("receiveAnc2110", m_receiveAncJson);
104  newTopObj.insert("transmitVideo2110", m_transmitVideoJson);
105  newTopObj.insert("transmitAudio2110", m_transmitAudioJson);
106  newTopObj.insert("transmitAnc2110", m_transmitAncJson);
107  m_topJson = newTopObj;
108 
109  return success;
110 }
111 
112 bool CKonaIpJsonParse2110::SetJsonProtocol(const QJsonObject& topObj)
113 {
114  m_protocolJson = topObj;
115  return true;
116 }
117 
118 bool CKonaIpJsonParse2110::SetJsonNetwork(const QJsonObject& topObj)
119 {
120  NetworkData2110 n2110;
121  bool success = JsonToStructNetwork(topObj, n2110);
122 
123  if (success)
124  {
125  memcpy(&m_net2110, &n2110, sizeof(NetworkData2110));
126  m_netJson = topObj;
127  }
128 
129  return success;
130 }
131 
132 bool CKonaIpJsonParse2110::SetJsonReceiveVideo(const QJsonArray& jsonArray)
133 {
134  ReceiveVideoData2110 rVideo2110;
135  bool success = JsonToStructReceiveVideo(jsonArray, rVideo2110);
136 
137  if (success)
138  {
139  memcpy(&m_receiveVideo2110, &rVideo2110, sizeof(ReceiveVideoData2110));
140  m_receiveVideoJson = jsonArray;
141  }
142 
143  return success;
144 }
145 
146 bool CKonaIpJsonParse2110::SetJsonReceiveAudio(const QJsonArray& jsonArray)
147 {
148  ReceiveAudioData2110 rAudio2110;
149  bool success = JsonToStructReceiveAudio(jsonArray, rAudio2110);
150 
151  if (success)
152  {
153  memcpy(&m_receiveAudio2110, &rAudio2110, sizeof(ReceiveAudioData2110));
154  m_receiveAudioJson = jsonArray;
155  }
156 
157  return success;
158 }
159 
160 bool CKonaIpJsonParse2110::SetJsonReceiveAnc(const QJsonArray& jsonArray)
161 {
162  ReceiveAncData2110 rAnc2110;
163  bool success = JsonToStructReceiveAnc(jsonArray, rAnc2110);
164 
165  if (success)
166  {
167  memcpy(&m_receiveAnc2110, &rAnc2110, sizeof(ReceiveAncData2110));
168  m_receiveAncJson = jsonArray;
169  }
170 
171  return success;
172 }
173 
174 bool CKonaIpJsonParse2110::SetJsonTransmitVideo(const QJsonArray& jsonArray)
175 {
176  TransmitVideoData2110 tVideo2110;
177  bool success = JsonToStructTransmitVideo(jsonArray, tVideo2110);
178 
179  if (success)
180  {
181  memcpy(&m_transmitVideo2110, &tVideo2110, sizeof(TransmitVideoData2110));
182  m_transmitVideoJson = jsonArray;
183  }
184 
185  return success;
186 }
187 
188 bool CKonaIpJsonParse2110::SetJsonTransmitAudio(const QJsonArray& jsonArray)
189 {
190  TransmitAudioData2110 tAudio2110;
191  bool success = JsonToStructTransmitAudio(jsonArray, tAudio2110);
192 
193  if (success)
194  {
195  memcpy(&m_transmitAudio2110, &tAudio2110, sizeof(TransmitAudioData2110));
196  m_transmitAudioJson = jsonArray;
197  }
198 
199  return success;
200 }
201 
202 bool CKonaIpJsonParse2110::SetJsonTransmitAnc(const QJsonArray& jsonArray)
203 {
204  TransmitAncData2110 tAnc2110;
205  bool success = JsonToStructTransmitAnc(jsonArray, tAnc2110);
206 
207  if (success)
208  {
209  memcpy(&m_transmitAnc2110, &tAnc2110, sizeof(TransmitAncData2110));
210  m_transmitAncJson = jsonArray;
211  }
212 
213  return success;
214 }
215 
216 bool CKonaIpJsonParse2110::GetEnable(const std::string enableBoolString)
217 {
218  return (enableBoolString == "true");
219 }
220 
221 QString CKonaIpJsonParse2110::GetEnable(const bool enabled)
222 {
223  if (enabled)
224  return "true";
225  else
226  return "false";
227 }
228 
229 VPIDSampling CKonaIpJsonParse2110::GetSampling(const std::string samplingString)
230 {
231  VPIDSampling sampling;
232 
233  if (samplingString == "RGB")
234  sampling = VPIDSampling_GBR_444;
235  else
236  sampling = VPIDSampling_YUV_422;
237 
238  return sampling;
239 }
240 
242 {
243  QString str;
244 
245  if (sampling == VPIDSampling_YUV_422)
246  str = "YCbCr-4:2:2";
247  else if (sampling == VPIDSampling_GBR_444)
248  str = "RGB";
249  else
250  str = "invalid";
251 
252  return str;
253 }
254 
255 NTV2Channel CKonaIpJsonParse2110::GetChannel(const std::string channelString)
256 {
257  NTV2Channel chan;
258 
259  if (channelString == "channel1")
260  chan = NTV2_CHANNEL1;
261  else if (channelString == "channel2")
262  chan = NTV2_CHANNEL2;
263  else if (channelString == "channel3")
264  chan = NTV2_CHANNEL3;
265  else if (channelString == "channel4")
266  chan = NTV2_CHANNEL4;
267  else
268  chan = NTV2_CHANNEL_INVALID;
269 
270  return chan;
271 }
272 
274 {
275  QString str;
276 
277  if (channel == NTV2_CHANNEL1)
278  str = "channel1";
279  else if (channel == NTV2_CHANNEL2)
280  str = "channel2";
281  else if (channel == NTV2_CHANNEL3)
282  str = "channel3";
283  else if (channel == NTV2_CHANNEL4)
284  str = "channel4";
285  else
286  str = "invalid";
287 
288  return str;
289 }
290 
291 eSFP CKonaIpJsonParse2110::GetSfp(const std::string sfpString)
292 {
293  eSFP sfp;
294 
295  if (sfpString == "sfp1")
296  sfp = SFP_1;
297  else if (sfpString == "sfp2")
298  sfp = SFP_2;
299  else
300  sfp = SFP_INVALID;
301 
302  return sfp;
303 }
304 
306 {
307  QString str;
308 
309  if (sfp == SFP_1)
310  str = "sfp1";
311  else if (sfp == SFP_2)
312  str = "sfp2";
313  else
314  str = "invalid";
315 
316  return str;
317 }
318 
319 NTV2Stream CKonaIpJsonParse2110::GetVideoStream(const std::string streamString)
320 {
321  NTV2Stream stream;
322 
323  if (streamString == "video1")
324  stream = NTV2_VIDEO1_STREAM;
325  else if (streamString == "video2")
326  stream = NTV2_VIDEO2_STREAM;
327  else if (streamString == "video3")
328  stream = NTV2_VIDEO3_STREAM;
329  else if (streamString == "video4")
330  stream = NTV2_VIDEO4_STREAM;
331  else
332  stream = NTV2_STREAM_INVALID;
333 
334  return stream;
335 }
336 
338 {
339  QString str;
340 
341  if (stream == NTV2_VIDEO1_STREAM)
342  str = "video1";
343  else if (stream == NTV2_VIDEO2_STREAM)
344  str = "video2";
345  else if (stream == NTV2_VIDEO3_STREAM)
346  str = "video3";
347  else if (stream == NTV2_VIDEO4_STREAM)
348  str = "video4";
349  else
350  str = "invalid";
351 
352  return str;
353 }
354 
355 NTV2Stream CKonaIpJsonParse2110::GetAudioStream(const std::string streamString)
356 {
357  NTV2Stream stream;
358 
359  if (streamString == "audio1")
360  stream = NTV2_AUDIO1_STREAM;
361  else if (streamString == "audio2")
362  stream = NTV2_AUDIO2_STREAM;
363  else if (streamString == "audio3")
364  stream = NTV2_AUDIO3_STREAM;
365  else if (streamString == "audio4")
366  stream = NTV2_AUDIO4_STREAM;
367  else
368  stream = NTV2_STREAM_INVALID;
369 
370  return stream;
371 }
372 
374 {
375  QString str;
376 
377  if (stream == NTV2_AUDIO1_STREAM)
378  str = "audio1";
379  else if (stream == NTV2_AUDIO2_STREAM)
380  str = "audio2";
381  else if (stream == NTV2_AUDIO3_STREAM)
382  str = "audio3";
383  else if (stream == NTV2_AUDIO4_STREAM)
384  str = "audio4";
385  else
386  str = "invalid";
387 
388  return str;
389 }
390 
391 NTV2Stream CKonaIpJsonParse2110::GetAncStream(const std::string streamString)
392 {
393  NTV2Stream stream;
394 
395  if (streamString == "anc1")
396  stream = NTV2_ANC1_STREAM;
397  else if (streamString == "anc2")
398  stream = NTV2_ANC2_STREAM;
399  else if (streamString == "anc3")
400  stream = NTV2_ANC3_STREAM;
401  else if (streamString == "anc4")
402  stream = NTV2_ANC4_STREAM;
403  else
404  stream = NTV2_STREAM_INVALID;
405 
406  return stream;
407 }
408 
410 {
411  QString str;
412 
413  if (stream == NTV2_ANC1_STREAM)
414  str = "anc1";
415  else if (stream == NTV2_ANC2_STREAM)
416  str = "anc2";
417  else if (stream == NTV2_ANC3_STREAM)
418  str = "anc3";
419  else if (stream == NTV2_ANC4_STREAM)
420  str = "anc4";
421  else
422  str = "invalid";
423 
424  return str;
425 }
426 
428 {
429  eNTV2PacketInterval pktInterval;
430 
431  if (pktIntervalString == "1000us")
432  pktInterval = PACKET_INTERVAL_1mS;
433  else if (pktIntervalString == "125us")
434  pktInterval = PACKET_INTERVAL_125uS;
435  else
436  pktInterval = PACKET_INTERVAL_125uS;
437 
438  return pktInterval;
439 }
440 
442 {
443  QString str;
444 
445  if (pktInterval == PACKET_INTERVAL_1mS)
446  str = "1000us";
447  else if (pktInterval == PACKET_INTERVAL_125uS)
448  str = "125us";
449  else
450  str = "invalid";
451 
452  return str;
453 }
454 
455 void CKonaIpJsonParse2110::GetGrandMasterID(const std::string str, uint8_t (&id)[8])
456 {
457  QString idstr = QString::fromStdString(str);
458  for (int i=0; i<8; i++)
459  {
460  id[i] = 0;
461  }
462 
463  if (idstr != "")
464  {
465  if (idstr.contains('-') || idstr.contains(':'))
466  {
467  QByteArray vals = QByteArray::fromHex(idstr.toLatin1());
468  if (vals.size() == 8)
469  {
470  for (int i=0; i<8; i++)
471  {
472  id[i] = vals[i];
473  }
474  }
475  }
476  }
477 }
478 
479 QString CKonaIpJsonParse2110::GetGrandMasterID(const uint8_t id[8])
480 {
481  char buf[256];
482  sprintf(buf, "%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X",
483  id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7]);
484  return QString(buf);
485 }
486 
487 bool CKonaIpJsonParse2110::JsonToStructNetwork(const QJsonObject& topObj, NetworkData2110& n2110)
488 {
489  memset(&n2110, 0, sizeof(NetworkData2110));
490  std::string str;
491 
492  std::cout << "Network2110" << std::endl;
493 
494  n2110.ptpDomain = topObj["ptpDomain"].toInt();
495  if (m_verbose) std::cout << " ptpDomain " << n2110.ptpDomain << std::endl;
496 
497  str = topObj["ptpPreferredGMID"].toString().toStdString();
498  if (m_verbose) std::cout << " ptpPreferredGMID " << str.c_str() << std::endl;
500 
501  str = topObj["setup4k"].toString().toStdString();
502  if (m_verbose) std::cout << " setup4k " << str.c_str() << std::endl;
503  n2110.setup4k = GetEnable(str);
504 
505  str = topObj["multiSDP"].toString().toStdString();
506  if (m_verbose) std::cout << " multiSDP " << str.c_str() << std::endl;
507  n2110.multiSDP = GetEnable(str);
508 
509  str = topObj["audioCombine"].toString().toStdString();
510  if (m_verbose) std::cout << " audioCombine " << str.c_str() << std::endl;
511  n2110.audioCombine = GetEnable(str);
512 
513  n2110.rxMatchOverride = topObj["rxMatchOverride"].toInt();
514  if (m_verbose) std::cout << " rxMatchOverride " << n2110.rxMatchOverride << std::endl;
515 
516  // sfp
517  QJsonArray sfpArray = topObj["sfps"].toArray();
518  n2110.numSFPs = MinVal(sfpArray.count(), 2);
519  if (n2110.numSFPs == 0)
520  return false;
521 
522  for (uint32_t i=0; i<n2110.numSFPs; i++)
523  {
524  if (m_verbose) std::cout << " SFP " << i << std::endl;
525 
526  QJsonObject sfpObj = sfpArray[i].toObject();
527 
528  str = sfpObj["designator"].toString().toStdString();
529  if (m_verbose) std::cout << " designator " << str.c_str() << std::endl;
530  n2110.sfp[i].sfp = GetSfp(str);
531 
532  str = sfpObj["ipAddress"].toString().toStdString();
533  if (m_verbose) std::cout << " ipAddress " << str.c_str() << std::endl;
534  strncpy(n2110.sfp[i].ipAddress, str.c_str(), kStrMax);
535 
536  str = sfpObj["subnetMask"].toString().toStdString();
537  if (m_verbose) std::cout << " subnetMask " << str.c_str() << std::endl;
538  strncpy(n2110.sfp[i].subnetMask, str.c_str(), kStrMax);
539 
540  str = sfpObj["gateWay"].toString().toStdString();
541  if (m_verbose) std::cout << " gateWay " << str.c_str() << std::endl;
542  strncpy(n2110.sfp[i].gateWay, str.c_str(), kStrMax);
543 
544  str = sfpObj["enable"].toString().toStdString();
545  if (m_verbose) std::cout << " enable " << str.c_str() << std::endl << std::endl;
546  n2110.sfp[i].enable = GetEnable(str);
547  }
548 
549  return true;
550 }
551 
552 bool CKonaIpJsonParse2110::StructToJsonNetwork(const NetworkData2110& n2110, QJsonObject& topObj)
553 {
554  topObj.insert("ptpDomain", QJsonValue((int)n2110.ptpDomain));
555  topObj.insert("ptpPreferredGMID", QJsonValue(QString(GetGrandMasterID(n2110.ptpPreferredGMID))));
556 
557  topObj.insert("setup4k", QJsonValue(QString(GetEnable(n2110.setup4k))));
558 
559  topObj.insert("multiSDP", QJsonValue(QString(GetEnable(n2110.multiSDP))));
560 
561  topObj.insert("audioCombine", QJsonValue(QString(GetEnable(n2110.audioCombine))));
562 
563  topObj.insert("rxMatchOverride", QJsonValue((int)n2110.rxMatchOverride));
564 
565  QJsonArray sfpArray;
566 
567  for (uint32_t i=0; i<n2110.numSFPs; i++)
568  {
569  QJsonObject obj;
570  if (i == 0)
571  obj.insert("designator", QJsonValue(QString("sfp1")));
572  else
573  obj.insert("designator", QJsonValue(QString("sfp2")));
574 
575  obj.insert("ipAddress", QJsonValue(QString(n2110.sfp[i].ipAddress)));
576  obj.insert("subnetMask", QJsonValue(QString(n2110.sfp[i].subnetMask)));
577  obj.insert("gateWay", QJsonValue(QString(n2110.sfp[i].gateWay)));
578  obj.insert("enable", QJsonValue(QString(GetEnable(n2110.sfp[i].enable))));
579  sfpArray += QJsonValue(obj);
580  }
581 
582  if (n2110.numSFPs > 0)
583  topObj.insert("sfps", QJsonValue(sfpArray));
584 
585  return true;
586 }
587 
588 bool CKonaIpJsonParse2110::JsonToStructReceiveVideo(const QJsonArray& vArray, ReceiveVideoData2110& rVideo2110)
589 {
590  memset(&rVideo2110, 0, sizeof(ReceiveVideoData2110));
591 
592  std::cout << "ReceiveVideo2110" << std::endl;
593 
594  // up to 4 channels
595  rVideo2110.numRxVideoChannels = MinVal(vArray.count(), 4);
596  if (rVideo2110.numRxVideoChannels == 0)
597  return false;
598 
599  std::string str;
600 
601  for (uint32_t i=0; i<rVideo2110.numRxVideoChannels; i++)
602  {
603  QJsonObject vObj = vArray[i].toObject();
604 
605  rVideo2110.rxVideoCh[i].sourcePort[0] = vObj["sfp1srcPort"].toInt();
606  if (m_verbose) std::cout << " sfp1srcPort " << rVideo2110.rxVideoCh[i].sourcePort[0] << std::endl;
607  rVideo2110.rxVideoCh[i].destPort[0] = vObj["sfp1DestPort"].toInt();
608  if (m_verbose) std::cout << " sfp1DestPort " << rVideo2110.rxVideoCh[i].destPort[0] << std::endl;
609  str = vObj["sfp1srcIPAddress"].toString().toStdString();
610  if (m_verbose) std::cout << " sfp1srcIPAddress " << str.c_str() << std::endl;
611  strncpy(rVideo2110.rxVideoCh[i].sourceIP[0], str.c_str(), kStrMax);
612  str = vObj["sfp1DestIPAddress"].toString().toStdString();
613  if (m_verbose) std::cout << " sfp1DestIPAddress " << str.c_str() << std::endl;
614  strncpy(rVideo2110.rxVideoCh[i].destIP[0], str.c_str(), kStrMax);
615  str = vObj["sfp1Enable"].toString().toStdString();
616  if (m_verbose) std::cout << " sfp1Enable " << str.c_str() << std::endl;
617  rVideo2110.rxVideoCh[i].sfpEnable[0] = GetEnable(str);
618 
619  rVideo2110.rxVideoCh[i].sourcePort[1] = vObj["sfp2srcPort"].toInt();
620  if (m_verbose) std::cout << " sfp2srcPort " << rVideo2110.rxVideoCh[i].sourcePort[1] << std::endl;
621  rVideo2110.rxVideoCh[i].destPort[1] = vObj["sfp2DestPort"].toInt();
622  if (m_verbose) std::cout << " sfp2DestPort " << rVideo2110.rxVideoCh[i].destPort[1] << std::endl;
623  str = vObj["sfp2srcIPAddress"].toString().toStdString();
624  if (m_verbose) std::cout << " sfp2srcIPAddress " << str.c_str() << std::endl;
625  strncpy(rVideo2110.rxVideoCh[i].sourceIP[1], str.c_str(), kStrMax);
626  str = vObj["sfp2DestIPAddress"].toString().toStdString();
627  if (m_verbose) std::cout << " sfp2DestIPAddress " << str.c_str() << std::endl;
628  strncpy(rVideo2110.rxVideoCh[i].destIP[1], str.c_str(), kStrMax);
629  str = vObj["sfp2Enable"].toString().toStdString();
630  if (m_verbose) std::cout << " sfp2Enable " << str.c_str() << std::endl;
631  rVideo2110.rxVideoCh[i].sfpEnable[1] = GetEnable(str);
632 
633  rVideo2110.rxVideoCh[i].vlan = vObj["vlan"].toInt();
634  if (m_verbose) std::cout << " vlan " << rVideo2110.rxVideoCh[i].vlan << std::endl;
635  rVideo2110.rxVideoCh[i].ssrc = vObj["ssrc"].toInt();
636  if (m_verbose) std::cout << " ssrc " << rVideo2110.rxVideoCh[i].ssrc << std::endl;
637  rVideo2110.rxVideoCh[i].payloadType = vObj["payloadType"].toInt();
638  if (m_verbose) std::cout << " payloadType " << rVideo2110.rxVideoCh[i].payloadType << std::endl;
639  str = vObj["videoFormat"].toString().toStdString();
640  if (m_verbose) std::cout << " videoFormat " << str.c_str() << std::endl;
641 #ifdef BUILD_DEMO
643 #else
644  rVideo2110.rxVideoCh[i].videoFormat = NTV2_FORMAT_UNKNOWN;
645 #endif
646  str = vObj["enable"].toString().toStdString();
647  if (m_verbose) std::cout << " enable " << str.c_str() << std::endl;
648  rVideo2110.rxVideoCh[i].enable = GetEnable(str);
649  str = vObj["stream"].toString().toStdString();
650  if (m_verbose) std::cout << " stream " << str.c_str() << std::endl << std::endl;
651  rVideo2110.rxVideoCh[i].stream = GetVideoStream(str);
652  }
653 
654  return true;
655 }
656 
657 bool CKonaIpJsonParse2110::StructToJsonReceiveVideo(const ReceiveVideoData2110& rVideo2110, QJsonArray& vArray)
658 {
659  for (uint32_t i=0; i<rVideo2110.numRxVideoChannels; i++)
660  {
661  QJsonObject obj;
662  obj.insert("sfp1Enable", QJsonValue(QString(GetEnable(rVideo2110.rxVideoCh[i].sfpEnable[0]))));
663  obj.insert("sfp1srcPort", QJsonValue(static_cast<int>(rVideo2110.rxVideoCh[i].sourcePort[0])));
664  obj.insert("sfp1DestPort", QJsonValue(static_cast<int>(rVideo2110.rxVideoCh[i].destPort[0])));
665  obj.insert("sfp1srcIPAddress", QJsonValue(QString(rVideo2110.rxVideoCh[i].sourceIP[0])));
666  obj.insert("sfp1DestIPAddress", QJsonValue(QString(rVideo2110.rxVideoCh[i].destIP[0])));
667 
668  obj.insert("sfp2Enable", QJsonValue(QString(GetEnable(rVideo2110.rxVideoCh[i].sfpEnable[1]))));
669  obj.insert("sfp2srcPort", QJsonValue(static_cast<int>(rVideo2110.rxVideoCh[i].sourcePort[1])));
670  obj.insert("sfp2DestPort", QJsonValue(static_cast<int>(rVideo2110.rxVideoCh[i].destPort[1])));
671  obj.insert("sfp2srcIPAddress", QJsonValue(QString(rVideo2110.rxVideoCh[i].sourceIP[1])));
672  obj.insert("sfp2DestIPAddress", QJsonValue(QString(rVideo2110.rxVideoCh[i].destIP[1])));
673 
674  obj.insert("vlan", QJsonValue(static_cast<int>(rVideo2110.rxVideoCh[i].vlan)));
675  obj.insert("ssrc", QJsonValue(static_cast<int>(rVideo2110.rxVideoCh[i].ssrc)));
676  obj.insert("payloadType", QJsonValue(static_cast<int>(rVideo2110.rxVideoCh[i].payloadType)));
677  obj.insert("enable", QJsonValue(QString(GetEnable(rVideo2110.rxVideoCh[i].enable))));
678  obj.insert("stream", QJsonValue(QString(GetVideoStream(rVideo2110.rxVideoCh[i].stream))));
679 
680  vArray += QJsonValue(obj);
681  }
682 
683  return true;
684 }
685 
686 bool CKonaIpJsonParse2110::JsonToStructReceiveAudio(const QJsonArray& aArray, ReceiveAudioData2110& rAudio2110)
687 {
688  memset(&rAudio2110, 0, sizeof(ReceiveAudioData2110));
689 
690  std::cout << "ReceiveAudio2110" << std::endl;
691 
692  // up to 4 channels
693  rAudio2110.numRxAudioChannels = MinVal(aArray.count(), 4);
694  if (rAudio2110.numRxAudioChannels == 0)
695  return false;
696 
697  std::string str;
698 
699  for (uint32_t i=0; i<rAudio2110.numRxAudioChannels; i++)
700  {
701  QJsonObject vObj = aArray[i].toObject();
702 
703  rAudio2110.rxAudioCh[i].sourcePort[0] = vObj["sfp1srcPort"].toInt();
704  if (m_verbose) std::cout << " sfp1srcPort " << rAudio2110.rxAudioCh[i].sourcePort[0] << std::endl;
705  rAudio2110.rxAudioCh[i].destPort[0] = vObj["sfp1DestPort"].toInt();
706  if (m_verbose) std::cout << " sfp1DestPort " << rAudio2110.rxAudioCh[i].destPort[0] << std::endl;
707  str = vObj["sfp1srcIPAddress"].toString().toStdString();
708  if (m_verbose) std::cout << " sfp1srcIPAddress " << str.c_str() << std::endl;
709  strncpy(rAudio2110.rxAudioCh[i].sourceIP[0], str.c_str(), kStrMax);
710  str = vObj["sfp1DestIPAddress"].toString().toStdString();
711  if (m_verbose) std::cout << " sfp1DestIPAddress " << str.c_str() << std::endl;
712  strncpy(rAudio2110.rxAudioCh[i].destIP[0], str.c_str(), kStrMax);
713  str = vObj["sfp1Enable"].toString().toStdString();
714  if (m_verbose) std::cout << " sfp1Enable " << str.c_str() << std::endl;
715  rAudio2110.rxAudioCh[i].sfpEnable[0] = GetEnable(str);
716 
717  rAudio2110.rxAudioCh[i].sourcePort[1] = vObj["sfp2srcPort"].toInt();
718  if (m_verbose) std::cout << " sfp2srcPort " << rAudio2110.rxAudioCh[i].sourcePort[1] << std::endl;
719  rAudio2110.rxAudioCh[i].destPort[1] = vObj["sfp2DestPort"].toInt();
720  if (m_verbose) std::cout << " sfp2DestPort " << rAudio2110.rxAudioCh[i].destPort[1] << std::endl;
721  str = vObj["sfp2srcIPAddress"].toString().toStdString();
722  if (m_verbose) std::cout << " sfp2srcIPAddress " << str.c_str() << std::endl;
723  strncpy(rAudio2110.rxAudioCh[i].sourceIP[1], str.c_str(), kStrMax);
724  str = vObj["sfp2DestIPAddress"].toString().toStdString();
725  if (m_verbose) std::cout << " sfp2DestIPAddress " << str.c_str() << std::endl;
726  strncpy(rAudio2110.rxAudioCh[i].destIP[1], str.c_str(), kStrMax);
727  str = vObj["sfp2Enable"].toString().toStdString();
728  if (m_verbose) std::cout << " sfp2Enable " << str.c_str() << std::endl;
729  rAudio2110.rxAudioCh[i].sfpEnable[1] = GetEnable(str);
730 
731  rAudio2110.rxAudioCh[i].vlan = vObj["vlan"].toInt();
732  if (m_verbose) std::cout << " vlan " << rAudio2110.rxAudioCh[i].vlan << std::endl;
733  rAudio2110.rxAudioCh[i].ssrc = vObj["ssrc"].toInt();
734  if (m_verbose) std::cout << " ssrc " << rAudio2110.rxAudioCh[i].ssrc << std::endl;
735  rAudio2110.rxAudioCh[i].payloadType = vObj["payloadType"].toInt();
736  if (m_verbose) std::cout << " payloadType " << rAudio2110.rxAudioCh[i].payloadType << std::endl;
737  rAudio2110.rxAudioCh[i].numAudioChannels = vObj["numAudioChannels"].toInt();
738  if (m_verbose) std::cout << " numAudioChannels " << rAudio2110.rxAudioCh[i].numAudioChannels << std::endl;
739 
740  str = vObj["audioPktInterval"].toString().toStdString();
741  if (m_verbose) std::cout << " audioPktInterval " << str.c_str() << std::endl;
742  rAudio2110.rxAudioCh[i].audioPktInterval = GetAudioPktInterval(str);
743  str = vObj["enable"].toString().toStdString();
744  if (m_verbose) std::cout << " enable " << str.c_str() << std::endl;
745  rAudio2110.rxAudioCh[i].enable = GetEnable(str);
746  str = vObj["designator"].toString().toStdString();
747  if (m_verbose) std::cout << " designator " << str.c_str() << std::endl << std::endl;
748  rAudio2110.rxAudioCh[i].channel = GetChannel(str);
749  str = vObj["stream"].toString().toStdString();
750  if (m_verbose) std::cout << " stream " << str.c_str() << std::endl;
751  rAudio2110.rxAudioCh[i].stream = GetAudioStream(str);
752  }
753 
754  return true;
755 }
756 
757 bool CKonaIpJsonParse2110::StructToJsonReceiveAudio(const ReceiveAudioData2110& rAudio2110, QJsonArray& aArray)
758 {
759  for (uint32_t i=0; i<rAudio2110.numRxAudioChannels; i++)
760  {
761  QJsonObject obj;
762  obj.insert("sfp1Enable", QJsonValue(QString(GetEnable(rAudio2110.rxAudioCh[i].sfpEnable[0]))));
763  obj.insert("sfp1srcPort", QJsonValue(static_cast<int>(rAudio2110.rxAudioCh[i].sourcePort[0])));
764  obj.insert("sfp1DestPort", QJsonValue(static_cast<int>(rAudio2110.rxAudioCh[i].destPort[0])));
765  obj.insert("sfp1srcIPAddress", QJsonValue(QString(rAudio2110.rxAudioCh[i].sourceIP[0])));
766  obj.insert("sfp1DestIPAddress", QJsonValue(QString(rAudio2110.rxAudioCh[i].destIP[0])));
767 
768  obj.insert("sfp2Enable", QJsonValue(QString(GetEnable(rAudio2110.rxAudioCh[i].sfpEnable[1]))));
769  obj.insert("sfp2srcPort", QJsonValue(static_cast<int>(rAudio2110.rxAudioCh[i].sourcePort[1])));
770  obj.insert("sfp2DestPort", QJsonValue(static_cast<int>(rAudio2110.rxAudioCh[i].destPort[1])));
771  obj.insert("sfp2srcIPAddress", QJsonValue(QString(rAudio2110.rxAudioCh[i].sourceIP[1])));
772  obj.insert("sfp2DestIPAddress", QJsonValue(QString(rAudio2110.rxAudioCh[i].destIP[1])));
773 
774  obj.insert("vlan", QJsonValue(static_cast<int>(rAudio2110.rxAudioCh[i].vlan)));
775  obj.insert("ssrc", QJsonValue(static_cast<int>(rAudio2110.rxAudioCh[i].ssrc)));
776  obj.insert("payloadType", QJsonValue(static_cast<int>(rAudio2110.rxAudioCh[i].payloadType)));
777  obj.insert("numAudioChannels", QJsonValue(static_cast<int>(rAudio2110.rxAudioCh[i].numAudioChannels)));
778 
779  obj.insert("audioPktInterval", QJsonValue(QString(GetAudioPktInterval(rAudio2110.rxAudioCh[i].audioPktInterval))));
780  obj.insert("enable", QJsonValue(QString(GetEnable(rAudio2110.rxAudioCh[i].enable))));
781  obj.insert("designator", QJsonValue(QString(GetChannel(rAudio2110.rxAudioCh[i].channel))));
782  obj.insert("stream", QJsonValue(QString(GetAudioStream(rAudio2110.rxAudioCh[i].stream))));
783 
784  aArray += QJsonValue(obj);
785  }
786 
787  return true;
788 }
789 
790 bool CKonaIpJsonParse2110::JsonToStructReceiveAnc(const QJsonArray& aArray, ReceiveAncData2110& rAnc2110)
791 {
792  memset(&rAnc2110, 0, sizeof(ReceiveAncData2110));
793 
794  std::cout << "ReceiveAnc2110" << std::endl;
795 
796  // up to 4 channels
797  rAnc2110.numRxAncChannels = MinVal(aArray.count(), 4);
798  if (rAnc2110.numRxAncChannels == 0)
799  return false;
800 
801  std::string str;
802 
803  for (uint32_t i=0; i<rAnc2110.numRxAncChannels; i++)
804  {
805  QJsonObject vObj = aArray[i].toObject();
806 
807  rAnc2110.rxAncCh[i].sourcePort[0] = vObj["sfp1srcPort"].toInt();
808  if (m_verbose) std::cout << " sfp1srcPort " << rAnc2110.rxAncCh[i].sourcePort[0] << std::endl;
809  rAnc2110.rxAncCh[i].destPort[0] = vObj["sfp1DestPort"].toInt();
810  if (m_verbose) std::cout << " sfp1DestPort " << rAnc2110.rxAncCh[i].destPort[0] << std::endl;
811  str = vObj["sfp1srcIPAddress"].toString().toStdString();
812  if (m_verbose) std::cout << " sfp1srcIPAddress " << str.c_str() << std::endl;
813  strncpy(rAnc2110.rxAncCh[i].sourceIP[0], str.c_str(), kStrMax);
814  str = vObj["sfp1DestIPAddress"].toString().toStdString();
815  if (m_verbose) std::cout << " sfp1DestIPAddress " << str.c_str() << std::endl;
816  strncpy(rAnc2110.rxAncCh[i].destIP[0], str.c_str(), kStrMax);
817  str = vObj["sfp1Enable"].toString().toStdString();
818  if (m_verbose) std::cout << " sfp1Enable " << str.c_str() << std::endl;
819  rAnc2110.rxAncCh[i].sfpEnable[0] = GetEnable(str);
820 
821  rAnc2110.rxAncCh[i].sourcePort[1] = vObj["sfp2srcPort"].toInt();
822  if (m_verbose) std::cout << " sfp2srcPort " << rAnc2110.rxAncCh[i].sourcePort[1] << std::endl;
823  rAnc2110.rxAncCh[i].destPort[1] = vObj["sfp2DestPort"].toInt();
824  if (m_verbose) std::cout << " sfp2DestPort " << rAnc2110.rxAncCh[i].destPort[1] << std::endl;
825  str = vObj["sfp2srcIPAddress"].toString().toStdString();
826  if (m_verbose) std::cout << " sfp2srcIPAddress " << str.c_str() << std::endl;
827  strncpy(rAnc2110.rxAncCh[i].sourceIP[1], str.c_str(), kStrMax);
828  str = vObj["sfp2DestIPAddress"].toString().toStdString();
829  if (m_verbose) std::cout << " sfp2DestIPAddress " << str.c_str() << std::endl;
830  strncpy(rAnc2110.rxAncCh[i].destIP[1], str.c_str(), kStrMax);
831  str = vObj["sfp2Enable"].toString().toStdString();
832  if (m_verbose) std::cout << " sfp2Enable " << str.c_str() << std::endl;
833  rAnc2110.rxAncCh[i].sfpEnable[1] = GetEnable(str);
834 
835  rAnc2110.rxAncCh[i].vlan = vObj["vlan"].toInt();
836  if (m_verbose) std::cout << " vlan " << rAnc2110.rxAncCh[i].vlan << std::endl;
837  rAnc2110.rxAncCh[i].ssrc = vObj["ssrc"].toInt();
838  if (m_verbose) std::cout << " ssrc " << rAnc2110.rxAncCh[i].ssrc << std::endl;
839  rAnc2110.rxAncCh[i].payloadType = vObj["payloadType"].toInt();
840  if (m_verbose) std::cout << " payloadType " << rAnc2110.rxAncCh[i].payloadType << std::endl;
841 
842  str = vObj["enable"].toString().toStdString();
843  if (m_verbose) std::cout << " enable " << str.c_str() << std::endl;
844  rAnc2110.rxAncCh[i].enable = GetEnable(str);
845  str = vObj["stream"].toString().toStdString();
846  if (m_verbose) std::cout << " stream " << str.c_str() << std::endl;
847  rAnc2110.rxAncCh[i].stream = GetAncStream(str);
848  }
849 
850  return true;
851 }
852 
853 bool CKonaIpJsonParse2110::StructToJsonReceiveAnc(const ReceiveAncData2110& rAnc2110, QJsonArray& aArray)
854 {
855  for (uint32_t i=0; i<rAnc2110.numRxAncChannels; i++)
856  {
857  QJsonObject obj;
858  obj.insert("sfp1Enable", QJsonValue(QString(GetEnable(rAnc2110.rxAncCh[i].sfpEnable[0]))));
859  obj.insert("sfp1srcPort", QJsonValue(static_cast<int>(rAnc2110.rxAncCh[i].sourcePort[0])));
860  obj.insert("sfp1DestPort", QJsonValue(static_cast<int>(rAnc2110.rxAncCh[i].destPort[0])));
861  obj.insert("sfp1srcIPAddress", QJsonValue(QString(rAnc2110.rxAncCh[i].sourceIP[0])));
862  obj.insert("sfp1DestIPAddress", QJsonValue(QString(rAnc2110.rxAncCh[i].destIP[0])));
863 
864  obj.insert("sfp2Enable", QJsonValue(QString(GetEnable(rAnc2110.rxAncCh[i].sfpEnable[1]))));
865  obj.insert("sfp2srcPort", QJsonValue(static_cast<int>(rAnc2110.rxAncCh[i].sourcePort[1])));
866  obj.insert("sfp2DestPort", QJsonValue(static_cast<int>(rAnc2110.rxAncCh[i].destPort[1])));
867  obj.insert("sfp2srcIPAddress", QJsonValue(QString(rAnc2110.rxAncCh[i].sourceIP[1])));
868  obj.insert("sfp2DestIPAddress", QJsonValue(QString(rAnc2110.rxAncCh[i].destIP[1])));
869 
870  obj.insert("vlan", QJsonValue(static_cast<int>(rAnc2110.rxAncCh[i].vlan)));
871  obj.insert("ssrc", QJsonValue(static_cast<int>(rAnc2110.rxAncCh[i].ssrc)));
872  obj.insert("payloadType", QJsonValue(static_cast<int>(rAnc2110.rxAncCh[i].payloadType)));
873 
874  obj.insert("enable", QJsonValue(QString(GetEnable(rAnc2110.rxAncCh[i].enable))));
875  obj.insert("stream", QJsonValue(QString(GetAncStream(rAnc2110.rxAncCh[i].stream))));
876 
877  aArray += QJsonValue(obj);
878  }
879 
880  return true;
881 }
882 
884 {
885  memset(&tVideo2110, 0, sizeof(TransmitVideoData2110));
886 
887  std::cout << "TransmitVideo2110" << std::endl;
888 
889  // up to 4 channels
890  tVideo2110.numTxVideoChannels = MinVal(vArray.count(), 4);
891  if (tVideo2110.numTxVideoChannels == 0)
892  return false;
893 
894  std::string str;
895 
896  for (uint32_t i=0; i<tVideo2110.numTxVideoChannels; i++)
897  {
898  QJsonObject vObj = vArray[i].toObject();
899 
900  tVideo2110.txVideoCh[i].localPort[0] = vObj["sfp1LocalPort"].toInt();
901  if (m_verbose) std::cout << " sfp1LocalPort " << tVideo2110.txVideoCh[i].localPort[0] << std::endl;
902  tVideo2110.txVideoCh[i].remotePort[0] = vObj["sfp1RemotePort"].toInt();
903  if (m_verbose) std::cout << " sfp1RemotePort " << tVideo2110.txVideoCh[i].remotePort[0] << std::endl;
904  str = vObj["sfp1RemoteIPAddress"].toString().toStdString();
905  if (m_verbose) std::cout << " sfp1RemoteIPAddress " << str.c_str() << std::endl;
906  strncpy(tVideo2110.txVideoCh[i].remoteIP[0], str.c_str(), kStrMax);
907  str = vObj["sfp1Enable"].toString().toStdString();
908  if (m_verbose) std::cout << " sfp1Enable " << str.c_str() << std::endl;
909  tVideo2110.txVideoCh[i].sfpEnable[0] = GetEnable(str);
910 
911  tVideo2110.txVideoCh[i].localPort[1] = vObj["sfp2LocalPort"].toInt();
912  if (m_verbose) std::cout << " sfp2LocalPort " << tVideo2110.txVideoCh[i].localPort[1] << std::endl;
913  tVideo2110.txVideoCh[i].remotePort[1] = vObj["sfp2RemotePort"].toInt();
914  if (m_verbose) std::cout << " sfp2RemotePort " << tVideo2110.txVideoCh[i].remotePort[1] << std::endl;
915  str = vObj["sfp2RemoteIPAddress"].toString().toStdString();
916  if (m_verbose) std::cout << " sfp2RemoteIPAddress " << str.c_str() << std::endl;
917  strncpy(tVideo2110.txVideoCh[i].remoteIP[1], str.c_str(), kStrMax);
918  str = vObj["sfp2Enable"].toString().toStdString();
919  if (m_verbose) std::cout << " sfp2Enable " << str.c_str() << std::endl;
920  tVideo2110.txVideoCh[i].sfpEnable[1] = GetEnable(str);
921 
922  tVideo2110.txVideoCh[i].ttl = vObj["ttl"].toInt();
923  if (m_verbose) std::cout << " ttl " << tVideo2110.txVideoCh[i].ttl << std::endl;
924  tVideo2110.txVideoCh[i].ssrc = vObj["ssrc"].toInt();
925  if (m_verbose) std::cout << " ssrc " << tVideo2110.txVideoCh[i].ssrc << std::endl;
926  tVideo2110.txVideoCh[i].payloadType = vObj["payloadType"].toInt();
927  if (m_verbose) std::cout << " payloadType " << tVideo2110.txVideoCh[i].payloadType << std::endl;
928 
929  str = vObj["sampling"].toString().toStdString();
930  if (m_verbose) std::cout << " sampling " << str.c_str() << std::endl;
931  tVideo2110.txVideoCh[i].sampling = GetSampling(str);
932 
933  str = vObj["videoFormat"].toString().toStdString();
934  if (m_verbose) std::cout << " videoFormat " << str.c_str() << std::endl;
935 #ifdef BUILD_DEMO
937 #else
938  tVideo2110.txVideoCh[i].videoFormat = NTV2_FORMAT_UNKNOWN;
939 #endif
940  str = vObj["enable"].toString().toStdString();
941  if (m_verbose) std::cout << " enable " << str.c_str() << std::endl;
942  tVideo2110.txVideoCh[i].enable = GetEnable(str);
943  str = vObj["stream"].toString().toStdString();
944  if (m_verbose) std::cout << " stream " << str.c_str() << std::endl << std::endl;
945  tVideo2110.txVideoCh[i].stream = GetVideoStream(str);
946  }
947 
948  return true;
949 }
950 
952 {
953  for (uint32_t i=0; i<tVideo2110.numTxVideoChannels; i++)
954  {
955  QJsonObject obj;
956  obj.insert("sfp1LocalPort", QJsonValue(static_cast<int>(tVideo2110.txVideoCh[i].localPort[0])));
957  obj.insert("sfp1RemoteIPAddress", QJsonValue(QString(tVideo2110.txVideoCh[i].remoteIP[0])));
958  obj.insert("sfp1RemotePort", QJsonValue(static_cast<int>(tVideo2110.txVideoCh[i].remotePort[0])));
959  obj.insert("sfp1Enable", QJsonValue(QString(GetEnable(tVideo2110.txVideoCh[i].sfpEnable[0]))));
960 
961  obj.insert("sfp2LocalPort", QJsonValue(static_cast<int>(tVideo2110.txVideoCh[i].localPort[1])));
962  obj.insert("sfp2RemoteIPAddress", QJsonValue(QString(tVideo2110.txVideoCh[i].remoteIP[1])));
963  obj.insert("sfp2RemotePort", QJsonValue(static_cast<int>(tVideo2110.txVideoCh[i].remotePort[1])));
964  obj.insert("sfp2Enable", QJsonValue(QString(GetEnable(tVideo2110.txVideoCh[i].sfpEnable[1]))));
965 
966  obj.insert("ttl", QJsonValue(static_cast<int>(tVideo2110.txVideoCh[i].ttl)));
967  obj.insert("ssrc", QJsonValue(static_cast<int>(tVideo2110.txVideoCh[i].ssrc)));
968  obj.insert("payloadType", QJsonValue(static_cast<int>(tVideo2110.txVideoCh[i].payloadType)));
969  obj.insert("sampling", QJsonValue(QString(GetSampling(tVideo2110.txVideoCh[i].sampling))));
970 
971  obj.insert("enable", QJsonValue(QString(GetEnable(tVideo2110.txVideoCh[i].enable))));
972  obj.insert("stream", QJsonValue(QString(GetVideoStream(tVideo2110.txVideoCh[i].stream))));
973 
974  vArray += QJsonValue(obj);
975  }
976 
977  return true;
978 }
979 
981 {
982  memset(&tAudio2110, 0, sizeof(TransmitAudioData2110));
983 
984  std::cout << "TransmitAudio2110" << std::endl;
985 
986  // up to 4 channels
987  tAudio2110.numTxAudioChannels = MinVal(aArray.count(), 4);
988  if (tAudio2110.numTxAudioChannels == 0)
989  return false;
990 
991  std::string str;
992 
993  for (uint32_t i=0; i<tAudio2110.numTxAudioChannels; i++)
994  {
995  QJsonObject vObj = aArray[i].toObject();
996 
997  tAudio2110.txAudioCh[i].localPort[0] = vObj["sfp1LocalPort"].toInt();
998  if (m_verbose) std::cout << " sfp1LocalPort " << tAudio2110.txAudioCh[i].localPort[0] << std::endl;
999  tAudio2110.txAudioCh[i].remotePort[0] = vObj["sfp1RemotePort"].toInt();
1000  if (m_verbose) std::cout << " sfp1RemotePort " << tAudio2110.txAudioCh[i].remotePort[0] << std::endl;
1001  str = vObj["sfp1RemoteIPAddress"].toString().toStdString();
1002  if (m_verbose) std::cout << " sfp1RemoteIPAddress " << str.c_str() << std::endl;
1003  strncpy(tAudio2110.txAudioCh[i].remoteIP[0], str.c_str(), kStrMax);
1004  str = vObj["sfp1Enable"].toString().toStdString();
1005  if (m_verbose) std::cout << " sfp1Enable " << str.c_str() << std::endl;
1006  tAudio2110.txAudioCh[i].sfpEnable[0] = GetEnable(str);
1007 
1008  tAudio2110.txAudioCh[i].localPort[1] = vObj["sfp2LocalPort"].toInt();
1009  if (m_verbose) std::cout << " sfp2LocalPort " << tAudio2110.txAudioCh[i].localPort[1] << std::endl;
1010  tAudio2110.txAudioCh[i].remotePort[1] = vObj["sfp2RemotePort"].toInt();
1011  if (m_verbose) std::cout << " sfp2RemotePort " << tAudio2110.txAudioCh[i].remotePort[1] << std::endl;
1012  str = vObj["sfp2RemoteIPAddress"].toString().toStdString();
1013  if (m_verbose) std::cout << " sfp2RemoteIPAddress " << str.c_str() << std::endl;
1014  strncpy(tAudio2110.txAudioCh[i].remoteIP[1], str.c_str(), kStrMax);
1015  str = vObj["sfp2Enable"].toString().toStdString();
1016  if (m_verbose) std::cout << " sfp2Enable " << str.c_str() << std::endl;
1017  tAudio2110.txAudioCh[i].sfpEnable[1] = GetEnable(str);
1018 
1019  tAudio2110.txAudioCh[i].ttl = vObj["ttl"].toInt();
1020  if (m_verbose) std::cout << " ttl " << tAudio2110.txAudioCh[i].ttl << std::endl;
1021  tAudio2110.txAudioCh[i].ssrc = vObj["ssrc"].toInt();
1022  if (m_verbose) std::cout << " ssrc " << tAudio2110.txAudioCh[i].ssrc << std::endl;
1023  tAudio2110.txAudioCh[i].payloadType = vObj["payloadType"].toInt();
1024  if (m_verbose) std::cout << " payloadType " << tAudio2110.txAudioCh[i].payloadType << std::endl;
1025  tAudio2110.txAudioCh[i].numAudioChannels = vObj["numAudioChannels"].toInt();
1026  if (m_verbose) std::cout << " numAudioChannels " << tAudio2110.txAudioCh[i].numAudioChannels << std::endl;
1027  tAudio2110.txAudioCh[i].firstAudioChannel = vObj["firstAudioChannel"].toInt();
1028  if (m_verbose) std::cout << " firstAudioChannel " << tAudio2110.txAudioCh[i].firstAudioChannel << std::endl;
1029 
1030  str = vObj["audioPktInterval"].toString().toStdString();
1031  if (m_verbose) std::cout << " audioPktInterval " << str.c_str() << std::endl;
1032  tAudio2110.txAudioCh[i].audioPktInterval = GetAudioPktInterval(str);
1033  str = vObj["enable"].toString().toStdString();
1034  if (m_verbose) std::cout << " enable " << str.c_str() << std::endl;
1035  tAudio2110.txAudioCh[i].enable = GetEnable(str);
1036  str = vObj["stream"].toString().toStdString();
1037  if (m_verbose) std::cout << " stream " << str.c_str() << std::endl;
1038  tAudio2110.txAudioCh[i].stream = GetAudioStream(str);
1039  str = vObj["designator"].toString().toStdString();
1040  if (m_verbose) std::cout << " designator " << str.c_str() << std::endl << std::endl;
1041  tAudio2110.txAudioCh[i].channel = GetChannel(str);
1042  }
1043 
1044  return true;
1045 }
1046 
1048 {
1049  for (uint32_t i=0; i<tAudio2110.numTxAudioChannels; i++)
1050  {
1051  QJsonObject obj;
1052  obj.insert("sfp1LocalPort", QJsonValue(static_cast<int>(tAudio2110.txAudioCh[i].localPort[0])));
1053  obj.insert("sfp1RemoteIPAddress", QJsonValue(QString(tAudio2110.txAudioCh[i].remoteIP[0])));
1054  obj.insert("sfp1RemotePort", QJsonValue(static_cast<int>(tAudio2110.txAudioCh[i].remotePort[0])));
1055  obj.insert("sfp1Enable", QJsonValue(QString(GetEnable(tAudio2110.txAudioCh[i].sfpEnable[0]))));
1056 
1057  obj.insert("sfp2LocalPort", QJsonValue(static_cast<int>(tAudio2110.txAudioCh[i].localPort[1])));
1058  obj.insert("sfp2RemoteIPAddress", QJsonValue(QString(tAudio2110.txAudioCh[i].remoteIP[1])));
1059  obj.insert("sfp2RemotePort", QJsonValue(static_cast<int>(tAudio2110.txAudioCh[i].remotePort[1])));
1060  obj.insert("sfp2Enable", QJsonValue(QString(GetEnable(tAudio2110.txAudioCh[i].sfpEnable[1]))));
1061 
1062  obj.insert("ttl", QJsonValue(static_cast<int>(tAudio2110.txAudioCh[i].ttl)));
1063  obj.insert("ssrc", QJsonValue(static_cast<int>(tAudio2110.txAudioCh[i].ssrc)));
1064  obj.insert("payloadType", QJsonValue(static_cast<int>(tAudio2110.txAudioCh[i].payloadType)));
1065  obj.insert("numAudioChannels", QJsonValue(static_cast<int>(tAudio2110.txAudioCh[i].numAudioChannels)));
1066  obj.insert("firstAudioChannel", QJsonValue(static_cast<int>(tAudio2110.txAudioCh[i].firstAudioChannel)));
1067 
1068  obj.insert("audioPktInterval", QJsonValue(QString(GetAudioPktInterval(tAudio2110.txAudioCh[i].audioPktInterval))));
1069  obj.insert("enable", QJsonValue(QString(GetEnable(tAudio2110.txAudioCh[i].enable))));
1070  obj.insert("stream", QJsonValue(QString(GetAudioStream(tAudio2110.txAudioCh[i].stream))));
1071  obj.insert("designator", QJsonValue(QString(GetChannel(tAudio2110.txAudioCh[i].channel))));
1072  aArray += QJsonValue(obj);
1073  }
1074 
1075  return true;
1076 }
1077 
1079 {
1080  memset(&tAnc2110, 0, sizeof(TransmitAncData2110));
1081 
1082  std::cout << "TransmitAnc2110" << std::endl;
1083 
1084  // up to 4 channels
1085  tAnc2110.numTxAncChannels = MinVal(aArray.count(), 4);
1086  if (tAnc2110.numTxAncChannels == 0)
1087  return false;
1088 
1089  std::string str;
1090 
1091  for (uint32_t i=0; i<tAnc2110.numTxAncChannels; i++)
1092  {
1093  QJsonObject vObj = aArray[i].toObject();
1094 
1095  tAnc2110.txAncCh[i].localPort[0] = vObj["sfp1LocalPort"].toInt();
1096  if (m_verbose) std::cout << " sfp1LocalPort " << tAnc2110.txAncCh[i].localPort[0] << std::endl;
1097  tAnc2110.txAncCh[i].remotePort[0] = vObj["sfp1RemotePort"].toInt();
1098  if (m_verbose) std::cout << " sfp1RemotePort " << tAnc2110.txAncCh[i].remotePort[0] << std::endl;
1099  str = vObj["sfp1RemoteIPAddress"].toString().toStdString();
1100  if (m_verbose) std::cout << " sfp1RemoteIPAddress " << str.c_str() << std::endl;
1101  strncpy(tAnc2110.txAncCh[i].remoteIP[0], str.c_str(), kStrMax);
1102  str = vObj["sfp1Enable"].toString().toStdString();
1103  if (m_verbose) std::cout << " sfp1Enable " << str.c_str() << std::endl;
1104  tAnc2110.txAncCh[i].sfpEnable[0] = GetEnable(str);
1105 
1106  tAnc2110.txAncCh[i].localPort[1] = vObj["sfp2LocalPort"].toInt();
1107  if (m_verbose) std::cout << " sfp2LocalPort " << tAnc2110.txAncCh[i].localPort[1] << std::endl;
1108  tAnc2110.txAncCh[i].remotePort[1] = vObj["sfp2RemotePort"].toInt();
1109  if (m_verbose) std::cout << " sfp2RemotePort " << tAnc2110.txAncCh[i].remotePort[1] << std::endl;
1110  str = vObj["sfp2RemoteIPAddress"].toString().toStdString();
1111  if (m_verbose) std::cout << " sfp2RemoteIPAddress " << str.c_str() << std::endl;
1112  strncpy(tAnc2110.txAncCh[i].remoteIP[1], str.c_str(), kStrMax);
1113  str = vObj["sfp2Enable"].toString().toStdString();
1114  if (m_verbose) std::cout << " sfp2Enable " << str.c_str() << std::endl;
1115  tAnc2110.txAncCh[i].sfpEnable[1] = GetEnable(str);
1116 
1117  tAnc2110.txAncCh[i].ttl = vObj["ttl"].toInt();
1118  if (m_verbose) std::cout << " ttl " << tAnc2110.txAncCh[i].ttl << std::endl;
1119  tAnc2110.txAncCh[i].ssrc = vObj["ssrc"].toInt();
1120  if (m_verbose) std::cout << " ssrc " << tAnc2110.txAncCh[i].ssrc << std::endl;
1121  tAnc2110.txAncCh[i].payloadType = vObj["payloadType"].toInt();
1122  if (m_verbose) std::cout << " payloadType " << tAnc2110.txAncCh[i].payloadType << std::endl;
1123 
1124  str = vObj["enable"].toString().toStdString();
1125  if (m_verbose) std::cout << " enable " << str.c_str() << std::endl;
1126  tAnc2110.txAncCh[i].enable = GetEnable(str);
1127  str = vObj["stream"].toString().toStdString();
1128  if (m_verbose) std::cout << " stream " << str.c_str() << std::endl;
1129  tAnc2110.txAncCh[i].stream = GetAncStream(str);
1130  }
1131 
1132  return true;
1133 }
1134 
1136 {
1137  for (uint32_t i=0; i<tAnc2110.numTxAncChannels; i++)
1138  {
1139  QJsonObject obj;
1140  obj.insert("sfp1LocalPort", QJsonValue(static_cast<int>(tAnc2110.txAncCh[i].localPort[0])));
1141  obj.insert("sfp1RemoteIPAddress", QJsonValue(QString(tAnc2110.txAncCh[i].remoteIP[0])));
1142  obj.insert("sfp1RemotePort", QJsonValue(static_cast<int>(tAnc2110.txAncCh[i].remotePort[0])));
1143  obj.insert("sfp1Enable", QJsonValue(QString(GetEnable(tAnc2110.txAncCh[i].sfpEnable[0]))));
1144 
1145  obj.insert("sfp2LocalPort", QJsonValue(static_cast<int>(tAnc2110.txAncCh[i].localPort[1])));
1146  obj.insert("sfp2RemoteIPAddress", QJsonValue(QString(tAnc2110.txAncCh[i].remoteIP[1])));
1147  obj.insert("sfp2RemotePort", QJsonValue(static_cast<int>(tAnc2110.txAncCh[i].remotePort[1])));
1148  obj.insert("sfp2Enable", QJsonValue(QString(GetEnable(tAnc2110.txAncCh[i].sfpEnable[1]))));
1149 
1150  obj.insert("ttl", QJsonValue(static_cast<int>(tAnc2110.txAncCh[i].ttl)));
1151  obj.insert("ssrc", QJsonValue(static_cast<int>(tAnc2110.txAncCh[i].ssrc)));
1152  obj.insert("payloadType", QJsonValue(static_cast<int>(tAnc2110.txAncCh[i].payloadType)));
1153 
1154  obj.insert("enable", QJsonValue(QString(GetEnable(tAnc2110.txAncCh[i].enable))));
1155  obj.insert("stream", QJsonValue(QString(GetAncStream(tAnc2110.txAncCh[i].stream))));
1156  aArray += QJsonValue(obj);
1157  }
1158 
1159  return true;
1160 }
1161 
1163  const ReceiveVideoData2110& vidRec2110,
1164  const ReceiveAudioData2110& audRec2110,
1165  const ReceiveAncData2110& ancRec2110,
1166  const TransmitVideoData2110& vidTran2110,
1167  const TransmitAudioData2110& audTran2110,
1168  const TransmitAncData2110& ancTran2110,
1169  QJsonObject& topObj)
1170 {
1171  QJsonObject netJson;
1172  memcpy(&m_net2110, &net2110, sizeof(NetworkData2110));
1173  StructToJsonNetwork(m_net2110, netJson);
1174  m_netJson = netJson;
1175 
1176  QJsonArray vidRecJson;
1177  memcpy(&m_receiveVideo2110, &vidRec2110, sizeof(ReceiveVideoData2110));
1179  m_receiveVideoJson = vidRecJson;
1180  QJsonArray audRecJson;
1181  memcpy(&m_receiveAudio2110, &audRec2110, sizeof(ReceiveAudioData2110));
1183  m_receiveAudioJson = audRecJson;
1184  QJsonArray ancRecJson;
1185  memcpy(&m_receiveAnc2110, &ancRec2110, sizeof(ReceiveAncData2110));
1187  m_receiveAncJson = ancRecJson;
1188 
1189  QJsonArray vidTransJson;
1190  memcpy(&m_transmitVideo2110, &vidTran2110, sizeof(TransmitVideoData2110));
1192  m_transmitVideoJson = vidTransJson;
1193  QJsonArray audTransJson;
1194  memcpy(&m_transmitAudio2110, &audTran2110, sizeof(TransmitAudioData2110));
1196  m_transmitAudioJson = audTransJson;
1197  QJsonArray ancTransJson;
1198  memcpy(&m_transmitAnc2110, &ancTran2110, sizeof(TransmitAncData2110));
1200  m_transmitAncJson = ancTransJson;
1201 
1202  topObj.insert("protocol", QJsonValue(QString("2110")));
1203  topObj.insert("network2110", m_netJson);
1204  topObj.insert("receiveVideo2110", m_receiveVideoJson);
1205  topObj.insert("receiveAudio2110", m_receiveAudioJson);
1206  topObj.insert("receiveAnc2110", m_receiveAncJson);
1207  topObj.insert("transmitVideo2110", m_transmitVideoJson);
1208  topObj.insert("transmitAudio2110", m_transmitAudioJson);
1209  topObj.insert("transmitAnc2110", m_transmitAncJson);
1210 
1211  return true;
1212 }
TxVideoChData2110::ttl
uint32_t ttl
Definition: ntv2config2110.h:57
TxAudioChData2110::localPort
uint32_t localPort[2]
Definition: ntv2config2110.h:71
ReceiveAncData2110::rxAncCh
RxAncChData2110 rxAncCh[4]
Definition: ntv2config2110.h:210
TransmitVideoData2110::txVideoCh
TxVideoChData2110 txVideoCh[4]
Definition: ntv2config2110.h:180
CKonaIpJsonParse2110::StructToJsonReceiveAudio
bool StructToJsonReceiveAudio(const ReceiveAudioData2110 &n2110, QJsonArray &aArray)
Definition: konaipjsonparse.cpp:757
eSFP
eSFP
Definition: ntv2mbcontroller.h:38
CKonaIpJsonParse2110::m_receiveAncJson
QJsonArray m_receiveAncJson
Definition: konaipjsonparse.h:100
TxAudioChData2110::payloadType
uint32_t payloadType
Definition: ntv2config2110.h:76
TxAudioChData2110::enable
uint32_t enable
Definition: ntv2config2110.h:80
RxAudioChData2110::enable
uint32_t enable
Definition: ntv2config2110.h:128
SFPData2110::gateWay
char gateWay[32]
Definition: ntv2config2110.h:152
TxAncChData2110::ssrc
uint32_t ssrc
Definition: ntv2config2110.h:92
CKonaIpJsonParse2110::m_receiveVideo2110
ReceiveVideoData2110 m_receiveVideo2110
Definition: konaipjsonparse.h:106
IP_STRSIZE
#define IP_STRSIZE
Definition: ntv2config2110.h:25
CKonaIpJsonParse2110::m_transmitAncJson
QJsonArray m_transmitAncJson
Definition: konaipjsonparse.h:103
CKonaIpJsonParse2110::StructToJsonTransmitVideo
bool StructToJsonTransmitVideo(const TransmitVideoData2110 &n2110, QJsonArray &vArray)
Definition: konaipjsonparse.cpp:951
RxAudioChData2110::destIP
char destIP[2][32]
Definition: ntv2config2110.h:119
NTV2_CHANNEL2
@ NTV2_CHANNEL2
Specifies channel or Frame Store 2 (or the 2nd item).
Definition: ntv2enums.h:1308
TransmitAudioData2110::numTxAudioChannels
uint32_t numTxAudioChannels
Definition: ntv2config2110.h:185
RxAudioChData2110::channel
NTV2Channel channel
Definition: ntv2config2110.h:117
TxVideoChData2110::remotePort
uint32_t remotePort[2]
Definition: ntv2config2110.h:54
TxVideoChData2110::videoFormat
NTV2VideoFormat videoFormat
Definition: ntv2config2110.h:60
SFPData2110::sfp
eSFP sfp
Definition: ntv2config2110.h:149
TxAncChData2110::enable
uint32_t enable
Definition: ntv2config2110.h:94
SFPData2110::subnetMask
char subnetMask[32]
Definition: ntv2config2110.h:151
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
TxAudioChData2110::numAudioChannels
uint32_t numAudioChannels
Definition: ntv2config2110.h:77
RxVideoChData2110::videoFormat
NTV2VideoFormat videoFormat
Definition: ntv2config2110.h:109
NetworkData2110::audioCombine
bool audioCombine
Definition: ntv2config2110.h:172
CKonaIpJsonParse2110::SetJsonNetwork
bool SetJsonNetwork(const QJsonObject &obj)
Definition: konaipjsonparse.cpp:118
TxAudioChData2110::firstAudioChannel
uint32_t firstAudioChannel
Definition: ntv2config2110.h:78
CKonaIpJsonParse2110::m_transmitAudioJson
QJsonArray m_transmitAudioJson
Definition: konaipjsonparse.h:102
CKonaIpJsonParse2110::m_protocolJson
QJsonObject m_protocolJson
Definition: konaipjsonparse.h:96
NTV2_AUDIO3_STREAM
@ NTV2_AUDIO3_STREAM
Definition: ntv2enums.h:1360
RxAncChData2110::ssrc
uint32_t ssrc
Definition: ntv2config2110.h:141
TxAncChData2110::remotePort
uint32_t remotePort[2]
Definition: ntv2config2110.h:89
RxAncChData2110::sfpEnable
uint32_t sfpEnable[2]
Definition: ntv2config2110.h:139
CKonaIpJsonParse2110::m_netJson
QJsonObject m_netJson
Definition: konaipjsonparse.h:97
RxAudioChData2110::audioPktInterval
eNTV2PacketInterval audioPktInterval
Definition: ntv2config2110.h:127
CKonaIpJsonParse2110::GetAncStream
NTV2Stream GetAncStream(const std::string streamString)
Definition: konaipjsonparse.cpp:391
CKonaIpJsonParse2110::SetJsonReceiveAudio
bool SetJsonReceiveAudio(const QJsonArray &jsonArray)
Definition: konaipjsonparse.cpp:146
TransmitAudioData2110::txAudioCh
TxAudioChData2110 txAudioCh[4]
Definition: ntv2config2110.h:186
NetworkData2110::sfp
SFPData2110 sfp[2]
Definition: ntv2config2110.h:170
TransmitVideoData2110
Definition: ntv2config2110.h:177
MinVal
#define MinVal(X, Y)
Definition: konaipjsonparse.h:21
TxVideoChData2110::stream
NTV2Stream stream
Definition: ntv2config2110.h:52
RxAudioChData2110::payloadType
uint32_t payloadType
Definition: ntv2config2110.h:125
RxAncChData2110::destPort
uint32_t destPort[2]
Definition: ntv2config2110.h:138
RxAudioChData2110::ssrc
uint32_t ssrc
Definition: ntv2config2110.h:124
TxAncChData2110::ttl
uint32_t ttl
Definition: ntv2config2110.h:91
konaipjsonparse.h
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
Definition: ntv2enums.h:1307
RxVideoChData2110::sourceIP
char sourceIP[2][32]
Definition: ntv2config2110.h:101
RxAncChData2110::enable
uint32_t enable
Definition: ntv2config2110.h:143
NetworkData2110::rxMatchOverride
uint32_t rxMatchOverride
Definition: ntv2config2110.h:173
CKonaIpJsonParse2110::m_receiveAnc2110
ReceiveAncData2110 m_receiveAnc2110
Definition: konaipjsonparse.h:108
TransmitVideoData2110::numTxVideoChannels
uint32_t numTxVideoChannels
Definition: ntv2config2110.h:179
eNTV2PacketInterval
eNTV2PacketInterval
Definition: ntv2mbcontroller.h:32
CKonaIpJsonParse2110::m_receiveAudio2110
ReceiveAudioData2110 m_receiveAudio2110
Definition: konaipjsonparse.h:107
TxAudioChData2110::ttl
uint32_t ttl
Definition: ntv2config2110.h:74
NTV2_CHANNEL_INVALID
@ NTV2_CHANNEL_INVALID
Definition: ntv2enums.h:1316
CKonaIpJsonParse2110::m_transmitAnc2110
TransmitAncData2110 m_transmitAnc2110
Definition: konaipjsonparse.h:111
CKonaIpJsonParse2110::m_receiveVideoJson
QJsonArray m_receiveVideoJson
Definition: konaipjsonparse.h:98
CKonaIpJsonParse2110::GetVideoStream
NTV2Stream GetVideoStream(const std::string streamString)
Definition: konaipjsonparse.cpp:319
CKonaIpJsonParse2110::JsonToStructReceiveAnc
bool JsonToStructReceiveAnc(const QJsonArray &aArray, ReceiveAncData2110 &n2110)
Definition: konaipjsonparse.cpp:790
ReceiveAudioData2110::rxAudioCh
RxAudioChData2110 rxAudioCh[4]
Definition: ntv2config2110.h:204
RxAudioChData2110::numAudioChannels
uint32_t numAudioChannels
Definition: ntv2config2110.h:126
ReceiveVideoData2110::numRxVideoChannels
uint32_t numRxVideoChannels
Definition: ntv2config2110.h:197
ReceiveAncData2110::numRxAncChannels
uint32_t numRxAncChannels
Definition: ntv2config2110.h:209
CNTV2DemoCommon::GetVideoFormatFromString
static NTV2VideoFormat GetVideoFormatFromString(const std::string &inStr, const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_NON_4KUHD)
Returns the NTV2VideoFormat that matches the given string.
Definition: ntv2democommon.cpp:642
NTV2_CHANNEL4
@ NTV2_CHANNEL4
Specifies channel or Frame Store 4 (or the 4th item).
Definition: ntv2enums.h:1310
CKonaIpJsonParse2110::m_transmitVideo2110
TransmitVideoData2110 m_transmitVideo2110
Definition: konaipjsonparse.h:109
CKonaIpJsonParse2110::StructToJson
bool StructToJson(const NetworkData2110 &net2110, const ReceiveVideoData2110 &vidRec2110, const ReceiveAudioData2110 &audRec2110, const ReceiveAncData2110 &ancRec2110, const TransmitVideoData2110 &vidTran2110, const TransmitAudioData2110 &audTran2110, const TransmitAncData2110 &ancTran2110, QJsonObject &topObj)
Definition: konaipjsonparse.cpp:1162
VIDEO_FORMATS_ALL
@ VIDEO_FORMATS_ALL
Definition: ntv2democommon.h:224
NTV2_ANC1_STREAM
@ NTV2_ANC1_STREAM
Definition: ntv2enums.h:1362
VPIDSampling_YUV_422
@ VPIDSampling_YUV_422
Definition: ntv2enums.h:4002
CKonaIpJsonParse2110::m_verbose
bool m_verbose
Definition: konaipjsonparse.h:93
PACKET_INTERVAL_1mS
@ PACKET_INTERVAL_1mS
Definition: ntv2mbcontroller.h:35
SFP_1
@ SFP_1
Definition: ntv2mbcontroller.h:40
TxVideoChData2110::payloadType
uint32_t payloadType
Definition: ntv2config2110.h:59
ReceiveVideoData2110
Definition: ntv2config2110.h:195
CKonaIpJsonParse2110::SetJsonReceiveVideo
bool SetJsonReceiveVideo(const QJsonArray &jsonArray)
Definition: konaipjsonparse.cpp:132
RxVideoChData2110::stream
NTV2Stream stream
Definition: ntv2config2110.h:100
TransmitAudioData2110
Definition: ntv2config2110.h:183
CKonaIpJsonParse2110::m_transmitVideoJson
QJsonArray m_transmitVideoJson
Definition: konaipjsonparse.h:101
TxVideoChData2110::sfpEnable
uint32_t sfpEnable[2]
Definition: ntv2config2110.h:56
CKonaIpJsonParse2110::m_topJson
QJsonObject m_topJson
Definition: konaipjsonparse.h:95
CKonaIpJsonParse2110::StructToJsonReceiveAnc
bool StructToJsonReceiveAnc(const ReceiveAncData2110 &n2110, QJsonArray &aArray)
Definition: konaipjsonparse.cpp:853
CKonaIpJsonParse2110::SetJsonReceiveAnc
bool SetJsonReceiveAnc(const QJsonArray &jsonArray)
Definition: konaipjsonparse.cpp:160
TxAudioChData2110::audioPktInterval
eNTV2PacketInterval audioPktInterval
Definition: ntv2config2110.h:79
RxVideoChData2110::ssrc
uint32_t ssrc
Definition: ntv2config2110.h:107
NTV2_ANC4_STREAM
@ NTV2_ANC4_STREAM
Definition: ntv2enums.h:1365
TxAncChData2110::localPort
uint32_t localPort[2]
Definition: ntv2config2110.h:88
TxAncChData2110::sfpEnable
uint32_t sfpEnable[2]
Definition: ntv2config2110.h:90
RxVideoChData2110::destPort
uint32_t destPort[2]
Definition: ntv2config2110.h:104
CKonaIpJsonParse2110::m_net2110
NetworkData2110 m_net2110
Definition: konaipjsonparse.h:105
NTV2_STREAM_INVALID
@ NTV2_STREAM_INVALID
Definition: ntv2enums.h:1369
CKonaIpJsonParse2110::JsonToStructReceiveVideo
bool JsonToStructReceiveVideo(const QJsonArray &vArray, ReceiveVideoData2110 &n2110)
Definition: konaipjsonparse.cpp:588
TxVideoChData2110::localPort
uint32_t localPort[2]
Definition: ntv2config2110.h:55
CKonaIpJsonParse2110::SetJsonTransmitVideo
bool SetJsonTransmitVideo(const QJsonArray &jsonArray)
Definition: konaipjsonparse.cpp:174
TxAncChData2110::payloadType
uint32_t payloadType
Definition: ntv2config2110.h:93
CKonaIpJsonParse2110::JsonToStructTransmitAnc
bool JsonToStructTransmitAnc(const QJsonArray &aArray, TransmitAncData2110 &n2110)
Definition: konaipjsonparse.cpp:1078
NTV2_AUDIO2_STREAM
@ NTV2_AUDIO2_STREAM
Definition: ntv2enums.h:1359
NTV2_CHANNEL3
@ NTV2_CHANNEL3
Specifies channel or Frame Store 3 (or the 3rd item).
Definition: ntv2enums.h:1309
CKonaIpJsonParse2110::StructToJsonReceiveVideo
bool StructToJsonReceiveVideo(const ReceiveVideoData2110 &n2110, QJsonArray &topObj)
Definition: konaipjsonparse.cpp:657
RxAncChData2110::payloadType
uint32_t payloadType
Definition: ntv2config2110.h:142
NetworkData2110::multiSDP
bool multiSDP
Definition: ntv2config2110.h:171
NetworkData2110
Definition: ntv2config2110.h:164
TransmitAncData2110
Definition: ntv2config2110.h:189
NTV2_AUDIO1_STREAM
@ NTV2_AUDIO1_STREAM
Definition: ntv2enums.h:1358
TxAudioChData2110::ssrc
uint32_t ssrc
Definition: ntv2config2110.h:75
RxAncChData2110::sourceIP
char sourceIP[2][32]
Definition: ntv2config2110.h:135
RxAudioChData2110::sfpEnable
uint32_t sfpEnable[2]
Definition: ntv2config2110.h:122
RxVideoChData2110::payloadType
uint32_t payloadType
Definition: ntv2config2110.h:108
NetworkData2110::numSFPs
uint32_t numSFPs
Definition: ntv2config2110.h:169
TransmitAncData2110::numTxAncChannels
uint32_t numTxAncChannels
Definition: ntv2config2110.h:191
CKonaIpJsonParse2110::JsonToStructReceiveAudio
bool JsonToStructReceiveAudio(const QJsonArray &aArray, ReceiveAudioData2110 &n2110)
Definition: konaipjsonparse.cpp:686
VPIDSampling
VPIDSampling
Definition: ntv2enums.h:4000
CKonaIpJsonParse2110::m_transmitAudio2110
TransmitAudioData2110 m_transmitAudio2110
Definition: konaipjsonparse.h:110
TxAudioChData2110::stream
NTV2Stream stream
Definition: ntv2config2110.h:68
TransmitAncData2110::txAncCh
TxAncChData2110 txAncCh[4]
Definition: ntv2config2110.h:192
CKonaIpJsonParse2110::GetEnable
bool GetEnable(const std::string enableBoolString)
Definition: konaipjsonparse.cpp:216
TxVideoChData2110::enable
uint32_t enable
Definition: ntv2config2110.h:62
NTV2_VIDEO4_STREAM
@ NTV2_VIDEO4_STREAM
Definition: ntv2enums.h:1357
CKonaIpJsonParse2110::SetJsonTransmitAnc
bool SetJsonTransmitAnc(const QJsonArray &jsonArray)
Definition: konaipjsonparse.cpp:202
RxVideoChData2110::sfpEnable
uint32_t sfpEnable[2]
Definition: ntv2config2110.h:105
CKonaIpJsonParse2110::GetSfp
eSFP GetSfp(const std::string sfpString)
Definition: konaipjsonparse.cpp:291
NTV2Stream
NTV2Stream
Identifies a specific IP-based data stream.
Definition: ntv2enums.h:1352
CKonaIpJsonParse2110::JsonToStructNetwork
bool JsonToStructNetwork(const QJsonObject &topObj, NetworkData2110 &n2110)
Definition: konaipjsonparse.cpp:487
CKonaIpJsonParse2110::GetChannel
NTV2Channel GetChannel(const std::string channelString)
Definition: konaipjsonparse.cpp:255
PACKET_INTERVAL_125uS
@ PACKET_INTERVAL_125uS
Definition: ntv2mbcontroller.h:34
RxVideoChData2110::destIP
char destIP[2][32]
Definition: ntv2config2110.h:102
RxAudioChData2110::sourceIP
char sourceIP[2][32]
Definition: ntv2config2110.h:118
TxAudioChData2110::channel
NTV2Channel channel
Definition: ntv2config2110.h:69
RxAudioChData2110::vlan
uint32_t vlan
Definition: ntv2config2110.h:123
NTV2_FORMAT_UNKNOWN
@ NTV2_FORMAT_UNKNOWN
Definition: ntv2enums.h:498
RxAudioChData2110::destPort
uint32_t destPort[2]
Definition: ntv2config2110.h:121
RxAncChData2110::stream
NTV2Stream stream
Definition: ntv2config2110.h:134
RxAudioChData2110::stream
NTV2Stream stream
Definition: ntv2config2110.h:116
CKonaIpJsonParse2110::GetAudioStream
NTV2Stream GetAudioStream(const std::string streamString)
Definition: konaipjsonparse.cpp:355
SFP_2
@ SFP_2
Definition: ntv2mbcontroller.h:41
CKonaIpJsonParse2110::SetJson
bool SetJson(const QJsonObject &topObj, bool verbose)
Definition: konaipjsonparse.cpp:31
SFPData2110::enable
uint32_t enable
Definition: ntv2config2110.h:153
ntv2democommon.h
This file contains some structures, constants, classes and functions that are used in some of the dem...
NTV2_VIDEO2_STREAM
@ NTV2_VIDEO2_STREAM
Definition: ntv2enums.h:1355
TxAncChData2110::stream
NTV2Stream stream
Definition: ntv2config2110.h:86
CKonaIpJsonParse2110::~CKonaIpJsonParse2110
~CKonaIpJsonParse2110()
Definition: konaipjsonparse.cpp:27
RxAncChData2110::destIP
char destIP[2][32]
Definition: ntv2config2110.h:136
NTV2_VIDEO1_STREAM
@ NTV2_VIDEO1_STREAM
Definition: ntv2enums.h:1354
TxAncChData2110::remoteIP
char remoteIP[2][32]
Definition: ntv2config2110.h:87
NetworkData2110::setup4k
bool setup4k
Definition: ntv2config2110.h:166
ReceiveAncData2110
Definition: ntv2config2110.h:207
CKonaIpJsonParse2110::GetGrandMasterID
void GetGrandMasterID(const std::string str, uint8_t(&id)[8])
Definition: konaipjsonparse.cpp:455
CKonaIpJsonParse2110::SetJsonProtocol
bool SetJsonProtocol(const QJsonObject &obj)
Definition: konaipjsonparse.cpp:112
CKonaIpJsonParse2110::CKonaIpJsonParse2110
CKonaIpJsonParse2110()
Definition: konaipjsonparse.cpp:22
VPIDSampling_GBR_444
@ VPIDSampling_GBR_444
Definition: ntv2enums.h:4004
ReceiveAudioData2110
Definition: ntv2config2110.h:201
NTV2_ANC3_STREAM
@ NTV2_ANC3_STREAM
Definition: ntv2enums.h:1364
RxVideoChData2110::enable
uint32_t enable
Definition: ntv2config2110.h:110
CKonaIpJsonParse2110::m_receiveAudioJson
QJsonArray m_receiveAudioJson
Definition: konaipjsonparse.h:99
kStrMax
const int kStrMax
Definition: konaipjsonparse.cpp:16
RxAncChData2110::sourcePort
uint32_t sourcePort[2]
Definition: ntv2config2110.h:137
CKonaIpJsonParse2110::SetJsonTransmitAudio
bool SetJsonTransmitAudio(const QJsonArray &jsonArray)
Definition: konaipjsonparse.cpp:188
SFPData2110::ipAddress
char ipAddress[32]
Definition: ntv2config2110.h:150
RxVideoChData2110::vlan
uint32_t vlan
Definition: ntv2config2110.h:106
ReceiveVideoData2110::rxVideoCh
RxVideoChData2110 rxVideoCh[4]
Definition: ntv2config2110.h:198
NTV2_ANC2_STREAM
@ NTV2_ANC2_STREAM
Definition: ntv2enums.h:1363
CKonaIpJsonParse2110::StructToJsonNetwork
bool StructToJsonNetwork(const NetworkData2110 &n2110, QJsonObject &topObj)
Definition: konaipjsonparse.cpp:552
SFP_INVALID
@ SFP_INVALID
Definition: ntv2mbcontroller.h:43
NetworkData2110::ptpDomain
uint32_t ptpDomain
Definition: ntv2config2110.h:167
TxVideoChData2110::sampling
VPIDSampling sampling
Definition: ntv2config2110.h:61
TxAudioChData2110::remotePort
uint32_t remotePort[2]
Definition: ntv2config2110.h:72
CKonaIpJsonParse2110::StructToJsonTransmitAnc
bool StructToJsonTransmitAnc(const TransmitAncData2110 &n2110, QJsonArray &aArray)
Definition: konaipjsonparse.cpp:1135
TxAudioChData2110::remoteIP
char remoteIP[2][32]
Definition: ntv2config2110.h:70
TxVideoChData2110::remoteIP
char remoteIP[2][32]
Definition: ntv2config2110.h:53
CKonaIpJsonParse2110::GetSampling
VPIDSampling GetSampling(const std::string samplingString)
Definition: konaipjsonparse.cpp:229
ReceiveAudioData2110::numRxAudioChannels
uint32_t numRxAudioChannels
Definition: ntv2config2110.h:203
TxAudioChData2110::sfpEnable
uint32_t sfpEnable[2]
Definition: ntv2config2110.h:73
NTV2_VIDEO3_STREAM
@ NTV2_VIDEO3_STREAM
Definition: ntv2enums.h:1356
RxAncChData2110::vlan
uint32_t vlan
Definition: ntv2config2110.h:140
CKonaIpJsonParse2110::JsonToStructTransmitVideo
bool JsonToStructTransmitVideo(const QJsonArray &vArray, TransmitVideoData2110 &n2110)
Definition: konaipjsonparse.cpp:883
CKonaIpJsonParse2110::GetAudioPktInterval
eNTV2PacketInterval GetAudioPktInterval(const std::string streamString)
Definition: konaipjsonparse.cpp:427
RxVideoChData2110::sourcePort
uint32_t sourcePort[2]
Definition: ntv2config2110.h:103
RxAudioChData2110::sourcePort
uint32_t sourcePort[2]
Definition: ntv2config2110.h:120
CKonaIpJsonParse2110::JsonToStructTransmitAudio
bool JsonToStructTransmitAudio(const QJsonArray &aArray, TransmitAudioData2110 &n2110)
Definition: konaipjsonparse.cpp:980
CKonaIpJsonParse2110::StructToJsonTransmitAudio
bool StructToJsonTransmitAudio(const TransmitAudioData2110 &n2110, QJsonArray &aArray)
Definition: konaipjsonparse.cpp:1047
TxVideoChData2110::ssrc
uint32_t ssrc
Definition: ntv2config2110.h:58
NTV2_AUDIO4_STREAM
@ NTV2_AUDIO4_STREAM
Definition: ntv2enums.h:1361
NetworkData2110::ptpPreferredGMID
uint8_t ptpPreferredGMID[8]
Definition: ntv2config2110.h:168