8 #ifndef NTV2_2110CONFIG_H
9 #define NTV2_2110CONFIG_H
24 #define RX_USE_SFP_IP BIT(31)
54 uint32_t remotePort[2];
55 uint32_t localPort[2];
56 uint32_t sfpEnable[2];
71 uint32_t localPort[2];
72 uint32_t remotePort[2];
73 uint32_t sfpEnable[2];
88 uint32_t localPort[2];
89 uint32_t remotePort[2];
90 uint32_t sfpEnable[2];
103 uint32_t sourcePort[2];
104 uint32_t destPort[2];
105 uint32_t sfpEnable[2];
120 uint32_t sourcePort[2];
121 uint32_t destPort[2];
122 uint32_t sfpEnable[2];
137 uint32_t sourcePort[2];
138 uint32_t destPort[2];
139 uint32_t sfpEnable[2];
159 uint32_t txChStatus[4];
160 uint32_t rxChStatus[4];
168 uint8_t ptpPreferredGMID[8];
245 std::string remoteIP[2];
246 uint32_t localPort[2];
247 uint32_t remotePort[2];
307 bool SetNetworkConfiguration (
const eSFP sfp,
const IPVNetConfig & netConfig);
309 bool SetNetworkConfiguration (
const eSFP sfp,
const std::string localIPAddress,
const std::string subnetMask,
const std::string gateway);
310 bool GetNetworkConfiguration (
const eSFP sfp, std::string & localIPAddress, std::string & subnetMask, std::string & gateway);
314 bool SetRxStreamEnable (
const eSFP sfp,
const NTV2Stream stream,
bool enable);
315 bool GetRxStreamEnable (
const eSFP sfp,
const NTV2Stream stream,
bool & enabled);
316 bool GetRxPacketCount (
const NTV2Stream stream, uint32_t &packets);
317 bool GetRxByteCount (
const NTV2Stream stream, uint32_t &bytes);
318 bool GetRxByteCount (
const eSFP sfp, uint64_t &bytes);
322 bool SetTxStreamEnable (
const NTV2Stream stream,
bool enableSfp1,
bool enableSfp2 =
false);
323 bool GetTxStreamEnable (
const NTV2Stream stream,
bool & sfp1Enabled,
bool & sfp2Enabled);
324 bool GetTxPacketCount (
NTV2Stream stream, uint32_t &packets);
325 bool GetTxByteCount (
const eSFP sfp, uint64_t &bytes);
327 bool SetPTPDomain (
const uint8_t domain);
328 bool GetPTPDomain (uint8_t &domain);
329 bool SetPTPPreferredGrandMasterId (
const uint8_t
id[8]);
330 bool GetPTPPreferredGrandMasterId (uint8_t (&
id)[8]);
331 bool GetPTPStatus (
PTPStatus & ptpStatus);
333 bool Set4KModeEnable (
const bool enable);
334 bool Get4KModeEnable (
bool & enable);
347 bool SetAudioCombineEnable (
const bool enable);
359 bool GetAudioCombineEnable (
bool & enable);
361 bool SetIPServicesControl (
const bool enable,
const bool forceReconfig);
362 bool GetIPServicesControl (
bool & enable,
bool & forceReconfig);
365 std::string GetGeneratedSDP (
bool enabledSfp1,
bool enabledSfp2,
const NTV2Stream stream);
366 bool GetActualSDP (std::string url, std::string & sdp);
367 bool ExtractRxVideoConfigFromSDP (std::string sdp,
rx_2110Config & rxConfig);
369 bool ExtractRxAudioConfigFromSDP (std::string sdp,
rx_2110Config & rxConfig);
370 bool ExtractRxAncConfigFromSDP (std::string sdp,
rx_2110Config & rxConfig);
380 bool SetIGMPDisable (
const eSFP sfp,
const bool disable);
381 bool GetIGMPDisable (
const eSFP sfp,
bool & disabled);
389 bool GetMACAddress (
const eSFP port,
const NTV2Stream stream, std::string remoteIP, uint32_t & hi, uint32_t & lo);
394 bool GenSDP (
bool enableSfp1,
bool enableSfp2,
const NTV2Stream stream,
bool pushit=
true);
396 static uint32_t Get2110TxStreamIndex (
NTV2Stream stream );
397 static uint32_t GetDecapsulatorAddress (
eSFP sfp,
NTV2Stream stream);
400 bool GetLLDPInfo (std::string &chassisId0, std::string &portId0,
401 std::string &chassisId1, std::string &portId1);
405 std::string getLastError (
void);
408 static uint32_t videoPacketizers[4];
409 static uint32_t videoRGB12Packetizers[4];
410 static uint32_t audioPacketizers[4];
412 static uint32_t videoDepacketizers[4];
413 static uint32_t audioDepacketizers[4];
416 uint32_t GetDepacketizerAddress (
const NTV2Stream stream);
418 uint32_t GetFramerAddress (
const eSFP sfp,
const NTV2Stream stream);
419 void SelectTxFramerChannel (
const NTV2Stream stream,
const uint32_t baseAddr);
420 void AcquireFramerControlAccess (
const uint32_t baseAddr);
421 void ReleaseFramerControlAccess (
const uint32_t baseAddr);
423 void EnableFramerStream (
const eSFP sfp,
const NTV2Stream stream,
bool enable);
426 void SetArbiter (
const eSFP sfp,
const NTV2Stream stream,
bool enable);
427 void GetArbiter (
const eSFP sfp,
const NTV2Stream stream,
bool & enable);
432 void DisableDepacketizerStream (
const NTV2Stream stream);
433 void EnableDepacketizerStream (
const NTV2Stream stream);
434 void DisableDecapsulatorStream (
const eSFP sfp,
const NTV2Stream stream);
435 void EnableDecapsulatorStream (
const eSFP sfp,
const NTV2Stream stream);
439 void ResetPacketizerStream (
const NTV2Stream stream);
442 void ResetDepacketizerStream (
const NTV2Stream stream);
447 bool ConfigurePTP (
const eSFP sfp,
const std::string localIPAddress);
449 bool GenVideoStreamSDP (std::stringstream &sdp,
const bool enableSfp1,
450 const bool enableSfp2,
const NTV2Stream stream,
char *gmInfo);
451 bool GenVideoStreamSDPInfo (std::stringstream & sdp,
const eSFP sfp,
const NTV2Stream stream,
char* gmInfo);
452 bool GenVideoStreamMultiSDPInfo (std::stringstream & sdp,
char* gmInfo);
453 bool GenAudioStreamSDP (std::stringstream &sdp,
const bool enableSfp1,
454 const bool enableSfp2,
const NTV2Stream stream,
char *gmInfo);
455 bool GenAudioStreamSDPInfo (std::stringstream & sdp,
const eSFP sfp,
const NTV2Stream stream,
char* gmInfo);
456 bool GenAncStreamSDP (std::stringstream &sdp,
const bool enableSfp1,
457 const bool enableSfp2,
const NTV2Stream stream,
char *gmInfo);
458 bool GenAncStreamSDPInfo (std::stringstream & sdp,
const eSFP sfp,
const NTV2Stream stream,
char* gmInfo);
464 std::string To_String (
int val);
466 std::vector<std::string>
split (
const char *str,
char delim);
471 int LeastCommonMultiple (
int a,
int b);
472 int getDescriptionValue (
int startLine, std::string type, std::string & value);
473 std::string getVideoDescriptionValue (std::string type);
475 std::stringstream txsdp;
477 uint32_t _numRx0Chans;
478 uint32_t _numRx1Chans;
479 uint32_t _numTx0Chans;
480 uint32_t _numTx1Chans;
481 uint32_t _numRxChans;
482 uint32_t _numTxChans;
483 bool _biDirectionalChannels;
485 std::vector<std::string> sdpLines;
486 std::vector<std::string> tokens;
490 #endif // NTV2_2110CONFIG_H