|
MythTV master
|
#include <libmythupnp/ssdp.h>
Public Member Functions | |
| ~SSDP () override | |
| void | RequestTerminate (void) |
| void | PerformSearch (const QString &sST, std::chrono::seconds timeout=2s) |
| void | EnableNotifications (int nServicePort) |
| void | DisableNotifications () |
Public Member Functions inherited from MThread | |
| MThread (const QString &objectName) | |
| Standard constructor. More... | |
| MThread (const QString &objectName, QRunnable *runnable) | |
| Use this constructor if you want the default run() method to run the QRunnable's run() method instead of entering the Qt event loop. More... | |
| virtual | ~MThread () |
| MThread (const MThread &)=delete | |
| MThread & | operator= (const MThread &)=delete |
| void | RunProlog (void) |
| Sets up a thread, call this if you reimplement run(). More... | |
| void | RunEpilog (void) |
| Cleans up a thread's resources, call this if you reimplement run(). More... | |
| QThread * | qthread (void) |
| Returns the thread, this will always return the same pointer no matter how often you restart the thread. More... | |
| void | setObjectName (const QString &name) |
| QString | objectName (void) const |
| void | setPriority (QThread::Priority priority) |
| QThread::Priority | priority (void) const |
| bool | isFinished (void) const |
| bool | isRunning (void) const |
| void | setStackSize (uint stackSize) |
| uint | stackSize (void) const |
| void | exit (int retcode=0) |
| Use this to exit from the thread if you are using a Qt event loop. More... | |
| void | start (QThread::Priority p=QThread::InheritPriority) |
| Tell MThread to start running the thread in the near future. More... | |
| void | terminate (void) |
| Kill a thread unsafely. More... | |
| void | quit (void) |
| calls exit(0) More... | |
| bool | wait (std::chrono::milliseconds time=std::chrono::milliseconds::max()) |
| Wait for the MThread to exit, with a maximum timeout. More... | |
Static Public Member Functions | |
| static SSDP * | Instance () |
| static void | Shutdown () |
| static void | AddListener (QObject *listener) |
| static void | RemoveListener (QObject *listener) |
| static SSDPCacheEntries * | Find (const QString &sURI) |
| static DeviceLocation * | Find (const QString &sURI, const QString &sUSN) |
Static Public Member Functions inherited from MThread | |
| static void | ThreadSetup (const QString &name) |
| This is to be called on startup in those few threads that haven't been ported to MThread. More... | |
| static void | ThreadCleanup (void) |
| This is to be called on exit in those few threads that haven't been ported to MThread. More... | |
| static void | Cleanup (void) |
| This will print out all the running threads, call exit(1) on each and then wait up to 5 seconds total for all the threads to exit. More... | |
| static void | GetAllThreadNames (QStringList &list) |
| static void | GetAllRunningThreadNames (QStringList &list) |
Static Public Attributes | |
| static const QString | kBackendURI = "urn:schemas-mythtv-org:device:MasterMediaServer:1" |
Protected Member Functions | |
| bool | ProcessSearchRequest (const QStringMap &sHeaders, const QHostAddress &peerAddress, quint16 peerPort) const |
| bool | IsTermRequested () |
| void | ProcessData (MSocketDevice *pSocket) |
| SSDPRequestType | ProcessRequestLine (const QString &sLine) |
| void | run () override |
| Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead. More... | |
Protected Member Functions inherited from MThread | |
| virtual void | run (void) |
| Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead. More... | |
| int | exec (void) |
| Enters the qt event loop. call exit or quit to exit thread. More... | |
Static Protected Member Functions | |
| static bool | ProcessSearchResponse (const QStringMap &sHeaders) |
| static bool | ProcessNotify (const QStringMap &sHeaders) |
| static QString | GetHeaderValue (const QStringMap &headers, const QString &sKey, const QString &sDefault) |
Static Protected Member Functions inherited from MThread | |
| static void | setTerminationEnabled (bool enabled=true) |
| static void | usleep (std::chrono::microseconds time) |
| template<typename R , typename P > | |
| static std::enable_if_t< std::chrono::treat_as_floating_point< R >::value, void > | usleep (std::chrono::duration< R, P > time) |
Private Member Functions | |
| SSDP () | |
Private Attributes | |
| QRegularExpression | m_procReqLineExp {"\\s+"} |
| std::array< MSocketDevice *, kNumberOfSockets > | m_sockets {nullptr,nullptr,nullptr} |
| int | m_nPort {SSDP_PORT} |
| int | m_nSearchPort {SSDP_SEARCHPORT} |
| int | m_nServicePort {0} |
| UPnpNotifyTask * | m_pNotifyTask {nullptr} |
| bool | m_bAnnouncementsEnabled {false} |
| bool | m_bTermRequested {false} |
| QMutex | m_lock |
Static Private Attributes | |
| static SSDP * | g_pSSDP = nullptr |
| static constexpr int | kNumberOfSockets = 3 |
Additional Inherited Members | |
Protected Attributes inherited from MThread | |
| MThreadInternal * | m_thread {nullptr} |
| QRunnable * | m_runnable {nullptr} |
| bool | m_prologExecuted {true} |
| bool | m_epilogExecuted {true} |
|
private |
Definition at line 123 of file ssdp.cpp.
Referenced by Instance().
|
inlinestatic |
Definition at line 132 of file ssdp.h.
Referenced by BackendSelection::Load(), and UPNPScanner::Start().
| void SSDP::DisableNotifications | ( | ) |
Definition at line 235 of file ssdp.cpp.
Referenced by UPnp::CleanUp(), UPnp::DisableNotifications(), and ~SSDP().
| void SSDP::EnableNotifications | ( | int | nServicePort | ) |
Definition at line 195 of file ssdp.cpp.
Referenced by UPnp::EnableNotificatins(), and UPnp::Start().
|
inlinestatic |
Definition at line 137 of file ssdp.h.
Referenced by UPNPScanner::CheckStatus(), BackendSelection::customEvent(), MythContext::Impl::DefaultUPnP(), SatIP::doUPNPsearch(), VBox::doUPNPSearch(), HttpStatus::FillStatusXML(), V2Status::FillStatusXML(), SatIP::findServers(), and MythContext::Impl::UPnPautoconf().
|
inlinestatic |
|
staticprotected |
Definition at line 538 of file ssdp.cpp.
Referenced by ProcessNotify(), ProcessSearchRequest(), and ProcessSearchResponse().
|
static |
Definition at line 102 of file ssdp.cpp.
Referenced by UPnp::CleanUp(), cleanup(), MythContext::Impl::DefaultUPnP(), UPnp::DisableNotifications(), UPnp::EnableNotificatins(), BackendSelection::Load(), main(), MediaRenderer::MediaRenderer(), SatIP::probeDevices(), VBox::probeDevices(), UPnp::Start(), and MythContext::Impl::UPnPautoconf().
|
protected |
| void SSDP::PerformSearch | ( | const QString & | sST, |
| std::chrono::seconds | timeout = 2s |
||
| ) |
Definition at line 251 of file ssdp.cpp.
Referenced by MythContext::Impl::DefaultUPnP(), BackendSelection::Load(), main(), MediaRenderer::MediaRenderer(), SatIP::probeDevices(), VBox::probeDevices(), and MythContext::Impl::UPnPautoconf().
|
protected |
|
staticprotected |
Definition at line 676 of file ssdp.cpp.
Referenced by ProcessData().
|
protected |
Definition at line 511 of file ssdp.cpp.
Referenced by ProcessData().
|
protected |
Definition at line 553 of file ssdp.cpp.
Referenced by ProcessData().
|
staticprotected |
Definition at line 641 of file ssdp.cpp.
Referenced by ProcessData().
|
inlinestatic |
Definition at line 134 of file ssdp.h.
Referenced by UPNPScanner::Stop(), and BackendSelection::~BackendSelection().
| void SSDP::RequestTerminate | ( | void | ) |
|
overrideprotectedvirtual |
|
static |
Definition at line 112 of file ssdp.cpp.
Referenced by MythContext::~MythContext().
|
staticprivate |
Definition at line 70 of file ssdp.h.
Referenced by Instance(), and Shutdown().
|
inlinestatic |
Definition at line 116 of file ssdp.h.
Referenced by MythContext::Impl::DefaultUPnP(), BackendSelection::Init(), BackendSelection::Load(), and MythContext::Impl::UPnPautoconf().
|
staticconstexprprivate |
Definition at line 81 of file ssdp.h.
Referenced by DisableNotifications(), and EnableNotifications().
Definition at line 83 of file ssdp.h.
Referenced by ProcessData(), RequestTerminate(), and run().
|
private |
|
private |
Definition at line 78 of file ssdp.h.
Referenced by EnableNotifications(), and ProcessSearchRequest().
|
private |
Definition at line 80 of file ssdp.h.
Referenced by DisableNotifications(), EnableNotifications(), ProcessData(), and ~SSDP().
|
private |
Definition at line 72 of file ssdp.h.
Referenced by ProcessRequestLine().
|
private |