MythTV  master
satiprtsp.h
Go to the documentation of this file.
1 
3 #ifndef SATIPRTSP_H
4 #define SATIPRTSP_H
5 
6 // C++ includes
7 #include <cstdint>
8 
9 // Qt includes
10 #include <QObject>
11 #include <QMap>
12 #include <QMutex>
13 #include <QString>
14 #include <QTcpSocket>
15 #include <QTime>
16 #include <QTimerEvent>
17 #include <QUdpSocket>
18 #include <QUrl>
19 
20 // MythTV includes
21 #include "libmythbase/mythchrono.h"
22 
23 // --- SatIPRTSP -------------------------------------------------------------
24 
25 class SatIPRTSP : public QObject
26 {
27  Q_OBJECT
28 
29  public:
30  explicit SatIPRTSP(int m_inputId);
31  ~SatIPRTSP() override;
32 
33  bool Setup(const QUrl& url, ushort clientPort1, ushort clientPort2);
34  bool Play(const QString &pids_str);
35  bool Teardown();
36 
37  protected:
38  void timerEvent(QTimerEvent* timerEvent) override; // QObject
39 
40  signals:
41  void StartKeepAlive(void);
42  void StopKeepAlive(void);
43 
44  protected slots:
45  void StartKeepAliveRequested(void);
46  void StopKeepAliveRequested(void);
47 
48  private:
49  bool sendMessage(const QString& msg, QStringList* additionalHeaders = nullptr);
50 
51  private:
52  int m_inputId {0};
54  uint m_cseq {0};
55  QString m_sessionid;
56  QString m_streamid;
57  QMap<QString, QString> m_responseHeaders;
58 
59  int m_timer {0};
60  std::chrono::seconds m_timeout {60s};
61 
62  static QMutex s_rtspMutex;
63 };
64 
65 #endif // SATIPRTSP_H
SatIPRTSP::SatIPRTSP
SatIPRTSP(int m_inputId)
Definition: satiprtsp.cpp:36
SatIPRTSP::Play
bool Play(const QString &pids_str)
Definition: satiprtsp.cpp:258
SatIPRTSP::m_requestUrl
QUrl m_requestUrl
Definition: satiprtsp.h:53
SatIPRTSP::timerEvent
void timerEvent(QTimerEvent *timerEvent) override
Definition: satiprtsp.cpp:319
SatIPRTSP::m_inputId
int m_inputId
Definition: satiprtsp.h:52
SatIPRTSP::s_rtspMutex
static QMutex s_rtspMutex
Definition: satiprtsp.h:62
SatIPRTSP::m_responseHeaders
QMap< QString, QString > m_responseHeaders
Definition: satiprtsp.h:57
SatIPRTSP::StartKeepAlive
void StartKeepAlive(void)
SatIPRTSP::m_streamid
QString m_streamid
Definition: satiprtsp.h:56
SatIPRTSP::Teardown
bool Teardown()
Definition: satiprtsp.cpp:276
uint
unsigned int uint
Definition: compat.h:79
SatIPRTSP::~SatIPRTSP
~SatIPRTSP() override
Definition: satiprtsp.cpp:44
SatIPRTSP::sendMessage
bool sendMessage(const QString &msg, QStringList *additionalHeaders=nullptr)
Definition: satiprtsp.cpp:49
SatIPRTSP::m_timer
int m_timer
Definition: satiprtsp.h:59
SatIPRTSP::m_cseq
uint m_cseq
Definition: satiprtsp.h:54
SatIPRTSP::StartKeepAliveRequested
void StartKeepAliveRequested(void)
Definition: satiprtsp.cpp:299
SatIPRTSP::StopKeepAliveRequested
void StopKeepAliveRequested(void)
Definition: satiprtsp.cpp:309
SatIPRTSP::m_sessionid
QString m_sessionid
Definition: satiprtsp.h:55
SatIPRTSP
-*- Mode: c++ -*-
Definition: satiprtsp.h:25
mythchrono.h
SatIPRTSP::Setup
bool Setup(const QUrl &url, ushort clientPort1, ushort clientPort2)
Definition: satiprtsp.cpp:184
SatIPRTSP::m_timeout
std::chrono::seconds m_timeout
Definition: satiprtsp.h:60
SatIPRTSP::StopKeepAlive
void StopKeepAlive(void)