============================================================================= -- Constructors and destructor --------------------------------------------- =============================================================================
| 29 | // -- Constructors and destructor --------------------------------------------- |
| 30 | // ============================================================================= |
| 31 | SatPI::SatPI(bool ssdp, |
| 32 | const std::string &ifaceName, |
| 33 | const std::string ¤tPath, |
| 34 | const std::string &appdataPath, |
| 35 | const std::string &webPath, |
| 36 | const std::string &dvbPath, |
| 37 | unsigned int httpPort, |
| 38 | unsigned int rtspPort, |
| 39 | const bool enableChildPIPE) : |
| 40 | XMLSaveSupport((appdataPath.empty() ? currentPath : appdataPath) + "/" + "SatPI.xml"), |
| 41 | _interface(ifaceName), |
| 42 | _streamManager(), |
| 43 | _properties(_interface.getUUID(), currentPath, appdataPath, webPath, _interface.getIPAddress(), httpPort, rtspPort), |
| 44 | _httpServer(*this, _streamManager, _interface.getIPAddress(), _properties), |
| 45 | _rtspServer(_streamManager, _interface.getIPAddress()), |
| 46 | _ssdpServer(_interface.getIPAddress(), _properties) { |
| 47 | _properties.setFunctionNotifyChanges(std::bind(&XMLSaveSupport::notifyChanges, this)); |
| 48 | _ssdpServer.setFunctionNotifyChanges(std::bind(&XMLSaveSupport::notifyChanges, this)); |
| 49 | // |
| 50 | _streamManager.enumerateDevices(_interface.getIPAddress(), |
| 51 | _properties.getAppDataPath(), dvbPath, enableChildPIPE); |
| 52 | // |
| 53 | std::string xml; |
| 54 | if (restoreXML(xml)) { |
| 55 | fromXML(xml); |
| 56 | } else { |
| 57 | saveXML(); |
| 58 | } |
| 59 | |
| 60 | _httpServer.initialize(_properties.getHttpPort(), true); |
| 61 | _rtspServer.initialize(_properties.getRtspPort(), true); |
| 62 | if (ssdp) { |
| 63 | _ssdpServer.startThread(); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | SatPI::~SatPI() {} |
| 68 |
nothing calls this directly
no test coverage detected