5 #include <QJsonDocument> 14 #if defined (AJALinux) || defined (AJAMac) 15 #include <arpa/inet.h> 28 mEnable2022_7 =
false;
29 mNetworkPathDifferential = 50;
36 QFile loadFile(fileName);
37 if ( !loadFile.open(QIODevice::ReadOnly))
39 qWarning(
"Couldn't open json file.");
43 QByteArray saveData = loadFile.readAll();
46 QJsonDocument loadDoc = (QJsonDocument::fromJson(saveData,&err));
47 if (err.error != QJsonParseError::NoError)
49 qDebug() <<
"JSON ERROR" << err.errorString() <<
"offset=" << err.offset;
58 const QJsonObject &
json = loadDoc.object();
59 QJsonValue qjv =
json.value(
"protocol");
60 if (qjv != QJsonValue::Undefined)
62 QString protocol = qjv.toString();
63 if (protocol ==
"2022")
71 cout <<
"-----Protocol2110-----" << endl;
76 cout <<
"-----Protocol2022-----" << endl;
77 qjv =
json.value(
"enable2022_7");
78 if (qjv != QJsonValue::Undefined)
80 mEnable2022_7 =
getEnable(qjv.toString());
84 mEnable2022_7 =
false;
86 cout <<
"2022-7 mode " << mEnable2022_7 << endl;
88 qjv =
json.value(
"networkPathDifferential");
89 if (qjv != QJsonValue::Undefined)
91 mNetworkPathDifferential = qjv.toString().toUInt();
95 mNetworkPathDifferential = 50;
97 cout <<
"NetworkPathDifferential " << mNetworkPathDifferential << endl;
109 QJsonArray sfpArray =
json[
"sfps"].toArray();
110 for (
int sfpIndex = 0; sfpIndex < sfpArray.size(); ++sfpIndex)
112 cout <<
"SFP" << endl;
114 QJsonObject sfpObject = sfpArray[sfpIndex].toObject();
119 cout <<
"SFPDesignator " << sfpStruct.
mSfpDesignator.toStdString() << endl;
121 sfpStruct.
mIPAddress = sfpObject[
"ipAddress"].toString();
123 cout <<
"IPAddress " << sfpStruct.
mIPAddress.toStdString() << endl;
125 sfpStruct.
mSubnetMask = sfpObject[
"subnetMask"].toString();
127 cout <<
"SubnetMask " << sfpStruct.
mSubnetMask.toStdString() << endl;
129 sfpStruct.
mGateway = sfpObject[
"gateway"].toString();
131 cout <<
"Gateway " << sfpStruct.
mGateway.toStdString() << endl;
133 sfpStruct.
mEnable = sfpObject[
"enable"].toString();
134 if (!sfpStruct.
mEnable.isEmpty())
135 cout <<
"Enable " << sfpStruct.
mEnable.toStdString() << endl;
142 QJsonArray receiveChannelArray =
json[
"receive2022"].toArray();
143 for (
int receiveChannelIndex = 0; receiveChannelIndex < receiveChannelArray.size(); ++receiveChannelIndex)
145 cout <<
"Receive2022Channels" << endl;
147 QJsonObject receiveChannelObject = receiveChannelArray[receiveChannelIndex].toObject();
152 cout <<
"ChannelDesignator " << receive2022Struct.
mChannelDesignator.toStdString() << endl;
154 receive2022Struct.
mSfp1SrcIPAddress = receiveChannelObject[
"sfp1SrcIPAddress"].toString();
156 cout <<
"SFP1SrcIPAddress " << receive2022Struct.
mSfp1SrcIPAddress.toStdString() << endl;
158 receive2022Struct.
mSfp1SrcPort = receiveChannelObject[
"sfp1SrcPort"].toString();
160 cout <<
"SFP1SrcPort " << receive2022Struct.
mSfp1SrcPort.toStdString() << endl;
162 receive2022Struct.
mSfp1DestIPAddress = receiveChannelObject[
"sfp1DestIPAddress"].toString();
164 cout <<
"SFP1DestIPAddress " << receive2022Struct.
mSfp1DestIPAddress.toStdString() << endl;
166 receive2022Struct.
mSfp1DestPort = receiveChannelObject[
"sfp1DestPort"].toString();
168 cout <<
"SFP1DestPort " << receive2022Struct.
mSfp1DestPort.toStdString() << endl;
170 receive2022Struct.
mSfp1Filter = receiveChannelObject[
"sfp1Filter"].toString();
172 cout <<
"SFP1Filter " << receive2022Struct.
mSfp1Filter.toStdString() << endl;
174 receive2022Struct.
mSfp2SrcIPAddress = receiveChannelObject[
"sfp2SrcIPAddress"].toString();
176 cout <<
"SFP2SrcIPAddress " << receive2022Struct.
mSfp2SrcIPAddress.toStdString() << endl;
178 receive2022Struct.
mSfp2SrcPort = receiveChannelObject[
"sfp2SrcPort"].toString();
180 cout <<
"SFP2SrcPort " << receive2022Struct.
mSfp2SrcPort.toStdString() << endl;
182 receive2022Struct.
mSfp2DestIPAddress = receiveChannelObject[
"sfp2DestIPAddress"].toString();
184 cout <<
"SFP1DestIPAddress " << receive2022Struct.
mSfp2DestIPAddress.toStdString() << endl;
186 receive2022Struct.
mSfp2DestPort = receiveChannelObject[
"sfp2DestPort"].toString();
188 cout <<
"SFP1DestPort " << receive2022Struct.
mSfp2DestPort.toStdString() << endl;
190 receive2022Struct.
mSfp2Filter = receiveChannelObject[
"sfp2Filter"].toString();
192 cout <<
"SFP1Filter " << receive2022Struct.
mSfp2Filter.toStdString() << endl;
194 receive2022Struct.
mPlayoutDelay = receiveChannelObject[
"playoutDelay"].toString();
196 cout <<
"PlayoutDelay " << receive2022Struct.
mPlayoutDelay.toStdString() << endl;
198 receive2022Struct.
mVLAN = receiveChannelObject[
"vlan"].toString();
199 if (!receive2022Struct.
mVLAN.isEmpty())
200 cout <<
"VLAN " << receive2022Struct.
mVLAN.toStdString() << endl;
202 receive2022Struct.
mSSRC = receiveChannelObject[
"ssrc"].toString();
203 if (!receive2022Struct.
mSSRC.isEmpty())
204 cout <<
"SSRC " << receive2022Struct.
mSSRC.toStdString() << endl;
206 receive2022Struct.
mSfp1Enable = receiveChannelObject[
"sfp1Enable"].toString();
208 cout <<
"SFP1 Enable " << receive2022Struct.
mSfp1Enable.toStdString() << endl;
210 receive2022Struct.
mSfp2Enable = receiveChannelObject[
"sfp2Enable"].toString();
212 cout <<
"SFP2 Enable " << receive2022Struct.
mSfp2Enable.toStdString() << endl;
214 receive2022Struct.
mEnable = receiveChannelObject[
"enable"].toString();
215 if (!receive2022Struct.
mEnable.isEmpty())
216 cout <<
"Enable " << receive2022Struct.
mEnable.toStdString() << endl;
223 QJsonArray transmitChannelArray =
json[
"transmit2022"].toArray();
224 for (
int transmitChannelIndex = 0; transmitChannelIndex < transmitChannelArray.size(); ++transmitChannelIndex)
226 cout <<
"Transmit2022Channels" << endl;
228 QJsonObject transmitChannelObject = transmitChannelArray[transmitChannelIndex].toObject();
231 transmitStruct2022.
mChannelDesignator = transmitChannelObject[
"designator"].toString();
233 cout <<
"ChannelDesignator " << transmitStruct2022.
mChannelDesignator.toStdString() << endl;
235 transmitStruct2022.
mSfp1RemoteIPAddress = transmitChannelObject[
"sfp1RemoteIPAddress"].toString();
237 cout <<
"SFP1RemoteIPAddress " << transmitStruct2022.
mSfp1RemoteIPAddress.toStdString() << endl;
239 transmitStruct2022.
mSfp1RemotePort = transmitChannelObject[
"sfp1RemotePort"].toString();
241 cout <<
"SFP1RemotePort " << transmitStruct2022.
mSfp1RemotePort.toStdString() << endl;
243 transmitStruct2022.
mSfp1LocalPort = transmitChannelObject[
"sfp1LocalPort"].toString();
245 cout <<
"SFP1LocalPort " << transmitStruct2022.
mSfp1LocalPort.toStdString() << endl;
247 transmitStruct2022.
mSfp2RemoteIPAddress = transmitChannelObject[
"sfp2RemoteIPAddress"].toString();
249 cout <<
"SFP2RemoteIPAddress " << transmitStruct2022.
mSfp2RemoteIPAddress.toStdString() << endl;
251 transmitStruct2022.
mSfp2RemotePort = transmitChannelObject[
"sfp2RemotePort"].toString();
253 cout <<
"SFP2RemotePort " << transmitStruct2022.
mSfp2RemotePort.toStdString() << endl;
255 transmitStruct2022.
mSfp2LocalPort = transmitChannelObject[
"sfp2LocalPort"].toString();
257 cout <<
"SFP2LocalPort " << transmitStruct2022.
mSfp2LocalPort.toStdString() << endl;
259 transmitStruct2022.
mTOS = transmitChannelObject[
"tos"].toString();
260 if (!transmitStruct2022.
mTOS.isEmpty())
261 cout <<
"TOS " << transmitStruct2022.
mTOS.toStdString() << endl;
263 transmitStruct2022.
mTTL = transmitChannelObject[
"ttl"].toString();
264 if (!transmitStruct2022.
mTTL.isEmpty())
265 cout <<
"TTL " << transmitStruct2022.
mTTL.toStdString() << endl;
267 transmitStruct2022.
mSSRC = transmitChannelObject[
"ssrc"].toString();
268 if (!transmitStruct2022.
mSSRC.isEmpty())
269 cout <<
"SSRC " << transmitStruct2022.
mSSRC.toStdString() << endl;
271 transmitStruct2022.
mSfp1Enable = transmitChannelObject[
"sfp1Enable"].toString();
273 cout <<
"SFP1 Enable " << transmitStruct2022.
mSfp1Enable.toStdString() << endl;
275 transmitStruct2022.
mSfp2Enable = transmitChannelObject[
"sfp2Enable"].toString();
277 cout <<
"SFP2 Enable " << transmitStruct2022.
mSfp2Enable.toStdString() << endl;
279 transmitStruct2022.
mEnable = transmitChannelObject[
"enable"].toString();
280 if (!transmitStruct2022.
mEnable.isEmpty())
281 cout <<
"Enable " << transmitStruct2022.
mEnable.toStdString() << endl;
307 cerr <<
"## ERROR: No devices found " << deviceSpec.c_str() << endl;
316 cout <<
"## NOTE: Waiting for device to become ready... (Ctrl-C will abort)" << endl;
320 cout <<
"## NOTE: Device is ready" << endl;
326 cerr <<
"## ERROR: board firmware package is incompatible with this application" << endl;
330 CNTV2Config2022 config2022 (mDevice);
334 cerr <<
"## ERROR: Need To Specify at Least 1 SFP" << endl;
339 while (sfpIter.hasNext())
353 bool rv = config2022.SetNetworkConfiguration (SFP_1,
359 cerr <<
"Error: " << config2022.getLastError() << endl;
365 config2022.DisableNetworkInterface(SFP_1);
378 bool rv = config2022.SetNetworkConfiguration (SFP_2,
384 cerr <<
"Error: " << config2022.getLastError() << endl;
390 config2022.DisableNetworkInterface(SFP_2);
397 bool supports2022_7 = ((val & SAREK_2022_7) != 0);
400 bool rv = config2022.Set2022_7_Mode(mEnable2022_7,mNetworkPathDifferential);
403 cerr <<
"Error: " << config2022.getLastError() << endl;
408 cerr <<
"## receiveIter" << endl;
411 while (receiveIter.hasNext())
413 cerr <<
"## receiveIter " << endl;
416 rx_2022_channel rxChannelConfig;
422 rxChannelConfig.sfp1Enable =
true;
423 rxChannelConfig.sfp2Enable =
true;
433 rxChannelConfig.sfp1SourcePort = receive.
mSfp1SrcPort.toUInt();
435 rxChannelConfig.sfp1DestPort = receive.
mSfp1DestPort.toUInt();
436 rxChannelConfig.sfp1RxMatch = receive.
mSfp1Filter.toUInt(&ok, 16);
438 rxChannelConfig.sfp2SourcePort = receive.
mSfp2SrcPort.toUInt();
440 rxChannelConfig.sfp2DestPort = receive.
mSfp2DestPort.toUInt();
441 rxChannelConfig.sfp2RxMatch = receive.
mSfp2Filter.toUInt(&ok, 16);
442 rxChannelConfig.playoutDelay = receive.
mPlayoutDelay.toUInt();
443 rxChannelConfig.ssrc = receive.
mSSRC.toUInt();
445 bool rv = config2022.SetRxChannelConfiguration (channel, rxChannelConfig);
448 cerr <<
"Error (config2022.SetRxChannelConfiguration) " << config2022.getLastError() << endl;
454 cerr <<
"Error (config2022.SetRxChannelConfiguration) " << config2022.getLastError() << endl;
458 cerr <<
"## transmitIter" << endl;
461 while (transmitIter.hasNext())
463 cerr <<
"## transmitIter " << endl;
466 tx_2022_channel txChannelConfig;
471 txChannelConfig.sfp1Enable =
true;
472 txChannelConfig.sfp2Enable =
true;
487 txChannelConfig.ssrc = transmit.
mSSRC.toUInt();
488 txChannelConfig.tos = transmit.
mTOS.toUInt();
489 txChannelConfig.ttl = transmit.
mTTL.toUInt();
491 bool rv = config2022.SetTxChannelConfiguration (channel, txChannelConfig);
494 cerr <<
"Error (config2022.SetTxChannelConfiguration) " << config2022.getLastError() << endl;
500 cerr <<
"Error (config2022.SetTxChannelEnable) " << config2022.getLastError() << endl;
513 {cerr <<
"## ERROR: No devices found " << deviceSpec.c_str() << endl;
return false;}
520 cout <<
"## NOTE: Waiting for device to become ready... (Ctrl-C will abort)" << endl;
524 cout <<
"## NOTE: Device is ready" << endl;
527 cerr <<
"## ERROR: board firmware package is incompatible with this application" << endl;
533 CNTV2Config2110 config2110 (device);
536 NetworkData2110 net2110 = parse2110.
m_net2110;
539 if (net2110.ptpDomain)
541 config2110.SetPTPDomain(net2110.ptpDomain);
545 if (net2110.ptpPreferredGMID[0] || net2110.ptpPreferredGMID[1] || net2110.ptpPreferredGMID[2] || net2110.ptpPreferredGMID[3] ||
546 net2110.ptpPreferredGMID[4] || net2110.ptpPreferredGMID[5] || net2110.ptpPreferredGMID[6] || net2110.ptpPreferredGMID[7])
548 config2110.SetPTPPreferredGrandMasterId(net2110.ptpPreferredGMID);
552 config2110.Set4KModeEnable(net2110.setup4k);
553 config2110.SetAudioCombineEnable(net2110.audioCombine);
554 config2110.SetPTPDomain(net2110.ptpDomain);
555 config2110.SetPTPPreferredGrandMasterId(net2110.ptpPreferredGMID);
557 for (uint32_t i = 0; i < net2110.numSFPs; i++)
559 cerr <<
"## network " << i+1 << endl;
566 if (net2110.sfp[i].enable)
568 rv = config2110.SetNetworkConfiguration(sfp,
569 net2110.sfp[i].ipAddress,
570 net2110.sfp[i].subnetMask,
571 net2110.sfp[i].gateWay);
574 cerr <<
"Error: " << config2110.getLastError() << endl;
580 config2110.DisableNetworkInterface(sfp);
584 rx_2110Config rxChannelConfig;
588 for (uint32_t i = 0; i < receiveVideo2110.numRxVideoChannels; i++)
590 cerr <<
"## receiveVideo " << i+1 << endl;
592 rxChannelConfig.init();
596 eSFP sfp = SFP_INVALID;
597 if (receiveVideo2110.rxVideoCh[i].sfpEnable[0])
599 else if (receiveVideo2110.rxVideoCh[i].sfpEnable[1])
605 rxChannelConfig.sourceIP = receiveVideo2110.rxVideoCh[i].sourceIP[0];
606 rxChannelConfig.destIP = receiveVideo2110.rxVideoCh[i].destIP[0];
607 rxChannelConfig.sourcePort = receiveVideo2110.rxVideoCh[i].sourcePort[0];
608 rxChannelConfig.destPort = receiveVideo2110.rxVideoCh[i].destPort[0];
612 rxChannelConfig.sourceIP = receiveVideo2110.rxVideoCh[i].sourceIP[1];
613 rxChannelConfig.destIP = receiveVideo2110.rxVideoCh[i].destIP[1];
614 rxChannelConfig.sourcePort = receiveVideo2110.rxVideoCh[i].sourcePort[1];
615 rxChannelConfig.destPort = receiveVideo2110.rxVideoCh[i].destPort[1];
617 rxChannelConfig.ssrc = receiveVideo2110.rxVideoCh[i].vlan;
618 rxChannelConfig.vlan = receiveVideo2110.rxVideoCh[i].ssrc;
619 rxChannelConfig.payloadType = receiveVideo2110.rxVideoCh[i].payloadType;
621 rxChannelConfig.videoFormat = receiveVideo2110.rxVideoCh[i].videoFormat;
625 rxChannelConfig.rxMatch = 0;
627 ip = inet_addr(rxChannelConfig.sourceIP.c_str());
630 rxChannelConfig.rxMatch |= RX_MATCH_2110_SOURCE_IP;
631 ip = inet_addr(rxChannelConfig.destIP.c_str());
634 rxChannelConfig.rxMatch |= RX_MATCH_2110_DEST_IP;
635 if (rxChannelConfig.sourcePort)
636 rxChannelConfig.rxMatch |= RX_MATCH_2110_SOURCE_PORT;
637 if (rxChannelConfig.destPort)
638 rxChannelConfig.rxMatch |= RX_MATCH_2110_DEST_PORT;
639 if (rxChannelConfig.vlan)
640 rxChannelConfig.rxMatch |= RX_MATCH_2110_VLAN;
641 if (rxChannelConfig.payloadType)
642 rxChannelConfig.rxMatch |= RX_MATCH_2110_PAYLOAD;
643 if (rxChannelConfig.ssrc)
644 rxChannelConfig.rxMatch |= RX_MATCH_2110_SSRC;
648 rv = config2110.SetRxStreamConfiguration (sfp,
649 receiveVideo2110.rxVideoCh[i].stream,
653 cerr <<
"SetRxStreamConfiguration: Video FAILED: " << config2110.getLastError() << endl;
657 rv = config2110.SetRxStreamEnable(sfp,
658 receiveVideo2110.rxVideoCh[i].stream,
659 receiveVideo2110.rxVideoCh[i].enable);
662 cerr <<
"SetRxStreamEnable: Video FAILED: " << config2110.getLastError() << endl;
669 for (uint32_t i = 0; i < receiveAudio2110.numRxAudioChannels; i++)
671 cerr <<
"## receiveAudio " << i+1 << endl;
673 rxChannelConfig.init();
677 eSFP sfp = SFP_INVALID;
678 if (receiveAudio2110.rxAudioCh[i].sfpEnable[0])
680 else if (receiveAudio2110.rxAudioCh[i].sfpEnable[1])
686 rxChannelConfig.sourceIP = receiveAudio2110.rxAudioCh[i].sourceIP[0];
687 rxChannelConfig.destIP = receiveAudio2110.rxAudioCh[i].destIP[0];
688 rxChannelConfig.sourcePort = receiveAudio2110.rxAudioCh[i].sourcePort[0];
689 rxChannelConfig.destPort = receiveAudio2110.rxAudioCh[i].destPort[0];
693 rxChannelConfig.sourceIP = receiveAudio2110.rxAudioCh[i].sourceIP[1];
694 rxChannelConfig.destIP = receiveAudio2110.rxAudioCh[i].destIP[1];
695 rxChannelConfig.sourcePort = receiveAudio2110.rxAudioCh[i].sourcePort[1];
696 rxChannelConfig.destPort = receiveAudio2110.rxAudioCh[i].destPort[1];
698 rxChannelConfig.ssrc = receiveAudio2110.rxAudioCh[i].vlan;
699 rxChannelConfig.vlan = receiveAudio2110.rxAudioCh[i].ssrc;
700 rxChannelConfig.payloadType = receiveAudio2110.rxAudioCh[i].payloadType;
701 rxChannelConfig.numAudioChannels = receiveAudio2110.rxAudioCh[i].numAudioChannels;
702 rxChannelConfig.audioPktInterval = receiveAudio2110.rxAudioCh[i].audioPktInterval;
705 rxChannelConfig.rxMatch = 0;
707 ip = inet_addr(rxChannelConfig.sourceIP.c_str());
710 rxChannelConfig.rxMatch |= RX_MATCH_2110_SOURCE_IP;
711 ip = inet_addr(rxChannelConfig.destIP.c_str());
714 rxChannelConfig.rxMatch |= RX_MATCH_2110_DEST_IP;
715 if (rxChannelConfig.sourcePort)
716 rxChannelConfig.rxMatch |= RX_MATCH_2110_SOURCE_PORT;
717 if (rxChannelConfig.destPort)
718 rxChannelConfig.rxMatch |= RX_MATCH_2110_DEST_PORT;
719 if (rxChannelConfig.vlan)
720 rxChannelConfig.rxMatch |= RX_MATCH_2110_VLAN;
721 if (rxChannelConfig.payloadType)
722 rxChannelConfig.rxMatch |= RX_MATCH_2110_PAYLOAD;
723 if (rxChannelConfig.ssrc)
724 rxChannelConfig.rxMatch |= RX_MATCH_2110_SSRC;
728 rv = config2110.SetRxStreamConfiguration (sfp,
729 receiveAudio2110.rxAudioCh[i].stream,
733 cerr <<
"SetRxStreamConfiguration: Audio FAILED: " << config2110.getLastError() << endl;
737 rv = config2110.SetRxStreamEnable(sfp,
738 receiveAudio2110.rxAudioCh[i].stream,
739 receiveAudio2110.rxAudioCh[i].enable);
742 cerr <<
"SetRxStreamEnable: Audio FAILED: " << config2110.getLastError() << endl;
749 for (uint32_t i = 0; i < receiveAnc2110.numRxAncChannels; i++)
751 cerr <<
"## receiveAnc " << i+1 << endl;
753 rxChannelConfig.init();
757 eSFP sfp = SFP_INVALID;
758 if (receiveAnc2110.rxAncCh[i].sfpEnable[0])
760 else if (receiveAnc2110.rxAncCh[i].sfpEnable[1])
766 rxChannelConfig.sourceIP = receiveAnc2110.rxAncCh[i].sourceIP[0];
767 rxChannelConfig.destIP = receiveAnc2110.rxAncCh[i].destIP[0];
768 rxChannelConfig.sourcePort = receiveAnc2110.rxAncCh[i].sourcePort[0];
769 rxChannelConfig.destPort = receiveAnc2110.rxAncCh[i].destPort[0];
773 rxChannelConfig.sourceIP = receiveAnc2110.rxAncCh[i].sourceIP[1];
774 rxChannelConfig.destIP = receiveAnc2110.rxAncCh[i].destIP[1];
775 rxChannelConfig.sourcePort = receiveAnc2110.rxAncCh[i].sourcePort[1];
776 rxChannelConfig.destPort = receiveAnc2110.rxAncCh[i].destPort[1];
778 rxChannelConfig.ssrc = receiveAnc2110.rxAncCh[i].vlan;
779 rxChannelConfig.vlan = receiveAnc2110.rxAncCh[i].ssrc;
780 rxChannelConfig.payloadType = receiveAnc2110.rxAncCh[i].payloadType;
783 rxChannelConfig.rxMatch = 0;
785 ip = inet_addr(rxChannelConfig.sourceIP.c_str());
788 rxChannelConfig.rxMatch |= RX_MATCH_2110_SOURCE_IP;
789 ip = inet_addr(rxChannelConfig.destIP.c_str());
792 rxChannelConfig.rxMatch |= RX_MATCH_2110_DEST_IP;
793 if (rxChannelConfig.sourcePort)
794 rxChannelConfig.rxMatch |= RX_MATCH_2110_SOURCE_PORT;
795 if (rxChannelConfig.destPort)
796 rxChannelConfig.rxMatch |= RX_MATCH_2110_DEST_PORT;
797 if (rxChannelConfig.vlan)
798 rxChannelConfig.rxMatch |= RX_MATCH_2110_VLAN;
799 if (rxChannelConfig.payloadType)
800 rxChannelConfig.rxMatch |= RX_MATCH_2110_PAYLOAD;
801 if (rxChannelConfig.ssrc)
802 rxChannelConfig.rxMatch |= RX_MATCH_2110_SSRC;
805 rv = config2110.SetRxStreamConfiguration (sfp,
806 receiveAnc2110.rxAncCh[i].stream,
810 cerr <<
"SetRxStreamConfiguration: ANC FAILED: " << config2110.getLastError() << endl;
814 rv = config2110.SetRxStreamEnable(sfp,
815 receiveAnc2110.rxAncCh[i].stream,
816 receiveAnc2110.rxAncCh[i].enable);
819 cerr <<
"SetRxStreamEnable: ANC FAILED: " << config2110.getLastError() << endl;
824 tx_2110Config txChannelConfig;
828 for (uint32_t i = 0; i < transmitVideo2110.numTxVideoChannels; i++)
830 cerr <<
"## transmitVideo " << i+1 << endl;
833 txChannelConfig.init();
835 txChannelConfig.localPort[0] = transmitVideo2110.txVideoCh[i].localPort[0];
836 txChannelConfig.remoteIP[0] = transmitVideo2110.txVideoCh[i].remoteIP[0];
837 txChannelConfig.remotePort[0] = transmitVideo2110.txVideoCh[i].remotePort[0];
838 txChannelConfig.localPort[1] = transmitVideo2110.txVideoCh[i].localPort[1];
839 txChannelConfig.remoteIP[1] = transmitVideo2110.txVideoCh[i].remoteIP[1];
840 txChannelConfig.remotePort[1] = transmitVideo2110.txVideoCh[i].remotePort[1];
842 txChannelConfig.payloadType = transmitVideo2110.txVideoCh[i].payloadType;
843 txChannelConfig.ssrc = transmitVideo2110.txVideoCh[i].ssrc;
844 txChannelConfig.ttl = transmitVideo2110.txVideoCh[i].ttl;
845 txChannelConfig.videoFormat = transmitVideo2110.txVideoCh[i].videoFormat;
846 txChannelConfig.videoSamples = transmitVideo2110.txVideoCh[i].sampling;
848 rv = config2110.SetTxStreamConfiguration(transmitVideo2110.txVideoCh[i].stream,
852 cerr <<
"SetTxStreamConfiguration Video: FAILED: " << config2110.getLastError() << endl;
856 if (transmitVideo2110.txVideoCh[i].enable)
858 rv = config2110.SetTxStreamEnable(transmitVideo2110.txVideoCh[i].stream,
859 transmitVideo2110.txVideoCh[i].sfpEnable[0],
860 transmitVideo2110.txVideoCh[i].sfpEnable[1]);
863 cerr <<
"SetTxStreamEnable Video: FAILED: " << config2110.getLastError() << endl;
871 for (uint32_t i = 0; i < transmitAudio2110.numTxAudioChannels; i++)
873 cerr <<
"## transmitAudio " << i+1 << endl;
876 txChannelConfig.init();
878 txChannelConfig.localPort[0] = transmitAudio2110.txAudioCh[i].localPort[0];
879 txChannelConfig.remoteIP[0] = transmitAudio2110.txAudioCh[i].remoteIP[0];
880 txChannelConfig.remotePort[0] = transmitAudio2110.txAudioCh[i].remotePort[0];
881 txChannelConfig.localPort[1] = transmitAudio2110.txAudioCh[i].localPort[1];
882 txChannelConfig.remoteIP[1] = transmitAudio2110.txAudioCh[i].remoteIP[1];
883 txChannelConfig.remotePort[1] = transmitAudio2110.txAudioCh[i].remotePort[1];
885 txChannelConfig.payloadType = transmitAudio2110.txAudioCh[i].payloadType;
886 txChannelConfig.ssrc = transmitAudio2110.txAudioCh[i].ssrc;
887 txChannelConfig.ttl = transmitAudio2110.txAudioCh[i].ttl;
889 txChannelConfig.numAudioChannels = transmitAudio2110.txAudioCh[i].numAudioChannels;
890 txChannelConfig.firstAudioChannel = transmitAudio2110.txAudioCh[i].firstAudioChannel;
891 txChannelConfig.audioPktInterval = transmitAudio2110.txAudioCh[i].audioPktInterval;
893 txChannelConfig.channel = transmitAudio2110.txAudioCh[i].channel;
895 rv = config2110.SetTxStreamConfiguration(transmitAudio2110.txAudioCh[i].stream,
899 cerr <<
"SetTxStreamConfiguration Audio: FAILED: " << config2110.getLastError() << endl;
903 if (transmitAudio2110.txAudioCh[i].enable)
905 rv = config2110.SetTxStreamEnable(transmitAudio2110.txAudioCh[i].stream,
906 transmitAudio2110.txAudioCh[i].sfpEnable[0],
907 transmitAudio2110.txAudioCh[i].sfpEnable[1]);
910 cerr <<
"SetTxStreamEnable Audio: FAILED: " << config2110.getLastError() << endl;
918 for (uint32_t i = 0; i < transmitAnc2110.numTxAncChannels; i++)
920 cerr <<
"## transmitAnc " << i+1 << endl;
923 txChannelConfig.init();
925 txChannelConfig.localPort[0] = transmitAnc2110.txAncCh[i].localPort[0];
926 txChannelConfig.remoteIP[0] = transmitAnc2110.txAncCh[i].remoteIP[0];
927 txChannelConfig.remotePort[0] = transmitAnc2110.txAncCh[i].remotePort[0];
928 txChannelConfig.localPort[1] = transmitAnc2110.txAncCh[i].localPort[1];
929 txChannelConfig.remoteIP[1] = transmitAnc2110.txAncCh[i].remoteIP[1];
930 txChannelConfig.remotePort[1] = transmitAnc2110.txAncCh[i].remotePort[1];
932 txChannelConfig.payloadType = transmitAnc2110.txAncCh[i].payloadType;
933 txChannelConfig.ssrc = transmitAnc2110.txAncCh[i].ssrc;
934 txChannelConfig.ttl = transmitAnc2110.txAncCh[i].ttl;
936 rv = config2110.SetTxStreamConfiguration(transmitAnc2110.txAncCh[i].stream,
940 cerr <<
"SetTxStreamConfiguration ANC: FAILED: " << config2110.getLastError() << endl;
944 if (transmitAnc2110.txAncCh[i].enable)
946 rv = config2110.SetTxStreamEnable(transmitAnc2110.txAncCh[i].stream,
947 transmitAnc2110.txAncCh[i].sfpEnable[0],
948 transmitAnc2110.txAncCh[i].sfpEnable[1]);
951 cerr <<
"SetTxStreamEnable ANC: FAILED: " << config2110.getLastError() << endl;
965 if ( channelDesignator ==
"channel2")
967 else if ( channelDesignator ==
"channel3")
969 else if ( channelDesignator ==
"channel4")
977 return (enableBoolString ==
"true");
QString mSfp1SrcIPAddress
bool setupBoard2022(std::string deviceSpec)
bool readJson2022(const QJsonObject &json)
virtual bool SetReference(const NTV2ReferenceSource inRefSource, const bool inKeepFramePulseSelect=(0))
Sets the device's clock reference source. See Video Output Clocking & Synchronization for more inform...
bool setupBoard2110(std::string deviceSpec)
ReceiveAncData2110 m_receiveAnc2110
QString mSfp2RemoteIPAddress
I interrogate and control an AJA video/audio capture/playout device.
QList< TransmitStruct2022 > mTransmit2022Channels
Declares the AJATime class.
bool getEnable(QString enableBoolString)
Defines a number of handy byte-swapping macros.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
TransmitAncData2110 m_transmitAnc2110
QString mSfp2SrcIPAddress
ReceiveVideoData2110 m_receiveVideo2110
NetworkData2110 m_net2110
Enumerations for controlling NTV2 devices.
virtual bool IsOpen(void) const
static bool GetFirstDeviceFromArgument(const std::string &inArgument, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the AJA device that matches a command li...
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
TransmitAudioData2110 m_transmitAudio2110
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
QString mChannelDesignator
QString mSfp2DestIPAddress
Specifies the PTP source on SFP 1.
Specifies channel or FrameStore 2 (or the 2nd item).
Declares the CNTV2DeviceScanner class.
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...
NTV2Channel getChannel(QString channelDesignator)
QString mSfp1DestIPAddress
ReceiveAudioData2110 m_receiveAudio2110
QString mSfp1RemoteIPAddress
Specifies channel or FrameStore 1 (or the first item).
KonaIP2022ParamSetupStruct mKonaIP2022Params
bool SetJson(const QJsonObject &topObj, bool verbose)
Specifies channel or FrameStore 4 (or the 4th item).
QList< ReceiveStruct2022 > mReceive2022Channels
This file contains some structures, constants, classes and functions that are used in some of the dem...
virtual bool IsMBSystemValid(void)
QString mChannelDesignator
virtual bool IsMBSystemReady(void)
bool setupBoard(std::string deviceSpec)
#define NTV2EndianSwap32(__val__)
Declares device capability functions.
TransmitVideoData2110 m_transmitVideo2110
Specifies channel or FrameStore 3 (or the 3rd item).
bool openJson(QString fileName)