MythTV
master
|
#include <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 () |
![]() | |
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 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) |
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... | |
![]() | |
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 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 |
constexpr static int | kNumberOfSockets = 3 |
Additional Inherited Members | |
![]() | |
MThreadInternal * | m_thread {nullptr} |
QRunnable * | m_runnable {nullptr} |
bool | m_prologExecuted {true} |
bool | m_epilogExecuted {true} |
|
private |
Definition at line 76 of file ssdp.cpp.
Referenced by Instance().
|
protected |
Definition at line 515 of file ssdp.cpp.
Referenced by ProcessData().
|
staticprotected |
Definition at line 603 of file ssdp.cpp.
Referenced by ProcessData().
|
staticprotected |
Definition at line 637 of file ssdp.cpp.
Referenced by ProcessData().
|
protected |
|
staticprotected |
Definition at line 500 of file ssdp.cpp.
Referenced by ProcessNotify(), ProcessSearchRequest(), and ProcessSearchResponse().
|
protected |
|
protected |
Definition at line 469 of file ssdp.cpp.
Referenced by ProcessData().
|
overrideprotectedvirtual |
|
static |
Definition at line 55 of file ssdp.cpp.
Referenced by cleanup(), UPnp::CleanUp(), MythContextPrivate::DefaultUPnP(), UPnp::DisableNotifications(), UPnp::EnableNotificatins(), BackendSelection::Load(), main(), MediaRenderer::MediaRenderer(), SatIP::probeDevices(), VBox::probeDevices(), UPnp::Start(), and MythContextPrivate::UPnPautoconf().
|
static |
Definition at line 65 of file ssdp.cpp.
Referenced by MythContext::~MythContext().
void SSDP::RequestTerminate | ( | void | ) |
void SSDP::PerformSearch | ( | const QString & | sST, |
std::chrono::seconds | timeout = 2s |
||
) |
Definition at line 204 of file ssdp.cpp.
Referenced by MythContextPrivate::DefaultUPnP(), BackendSelection::Load(), main(), MediaRenderer::MediaRenderer(), SatIP::probeDevices(), VBox::probeDevices(), and MythContextPrivate::UPnPautoconf().
void SSDP::EnableNotifications | ( | int | nServicePort | ) |
Definition at line 148 of file ssdp.cpp.
Referenced by UPnp::EnableNotificatins(), and UPnp::Start().
void SSDP::DisableNotifications | ( | ) |
Definition at line 188 of file ssdp.cpp.
Referenced by UPnp::CleanUp(), UPnp::DisableNotifications(), and ~SSDP().
|
inlinestatic |
Definition at line 127 of file ssdp.h.
Referenced by BackendSelection::Load(), and UPNPScanner::Start().
|
inlinestatic |
Definition at line 129 of file ssdp.h.
Referenced by UPNPScanner::Stop(), and BackendSelection::~BackendSelection().
|
inlinestatic |
Definition at line 132 of file ssdp.h.
Referenced by UPNPScanner::CheckStatus(), BackendSelection::customEvent(), MythContextPrivate::DefaultUPnP(), SatIP::doUPNPsearch(), VBox::doUPNPSearch(), HttpStatus::FillStatusXML(), V2Status::FillStatusXML(), SatIP::findServers(), and MythContextPrivate::UPnPautoconf().
|
inlinestatic |
|
staticprivate |
Definition at line 67 of file ssdp.h.
Referenced by Instance(), and Shutdown().
|
private |
Definition at line 69 of file ssdp.h.
Referenced by ProcessRequestLine().
|
staticconstexprprivate |
|
private |
|
private |
|
private |
Definition at line 75 of file ssdp.h.
Referenced by EnableNotifications(), and ProcessSearchRequest().
|
private |
Definition at line 77 of file ssdp.h.
Referenced by DisableNotifications(), EnableNotifications(), ProcessData(), and ~SSDP().
Definition at line 78 of file ssdp.h.
Referenced by DisableNotifications(), and EnableNotifications().
Definition at line 80 of file ssdp.h.
Referenced by ProcessData(), RequestTerminate(), and run().