MythTV  master
satiprtsp.cpp
Go to the documentation of this file.
1 
3 // C++ includes
4 #include <chrono>
5 
6 // Qt includes
7 #include <QRegularExpression>
8 #include <QString>
9 #include <QStringList>
10 #include <QTcpSocket>
11 #include <QUrl>
12 #include <QVector>
13 
14 // MythTV includes
15 #include "satiprtsp.h"
16 #include "mythlogging.h"
17 #include "mythsocket.h"
18 #include "rtppacketbuffer.h"
19 #include "udppacketbuffer.h"
20 #include "rtptsdatapacket.h"
21 #include "satipstreamhandler.h"
22 #include "rtcpdatapacket.h"
23 #include "satiprtcppacket.h"
24 
25 #define LOC QString("SatIPRTSP[%1]: ").arg(m_streamHandler->m_inputId)
26 #define LOC2 QString("SatIPRTSP[%1](%2): ").arg(m_streamHandler->m_inputId).arg(m_requestUrl.toString())
27 
28 
29 // Local functions
30 static uint SetUDPReceiveBufferSize(QUdpSocket *socket, uint rcvbuffersize);
31 
32 
34  : m_streamHandler(handler)
35 {
36  uint port = 0;
39 
40  // Use RTPPacketBuffer if buffering and re-ordering needed
41  m_buffer = new UDPPacketBuffer(0);
42 
44  m_writeHelper = new SatIPRTSPWriteHelper(this, handler);
45 
46  if (!m_readHelper->m_socket->bind(QHostAddress::AnyIPv4, 0,
47  QAbstractSocket::DefaultForPlatform))
48  {
49  LOG(VB_GENERAL, LOG_ERR, LOC + QString("Failed to bind RTP socket"));
50  }
51  else
52  {
53  port = m_readHelper->m_socket->localPort();
54  LOG(VB_RECORD, LOG_INFO, LOC + QString("RTP socket bound to port %1 (0x%2)")
55  .arg(port).arg(port,2,16,QChar('0')));
56  }
57 
58  // Control socket is next higher port
59  port++;
60 
62  if (!m_rtcpReadHelper->m_socket->bind(QHostAddress::AnyIPv4,
63  port,
64  QAbstractSocket::DefaultForPlatform))
65  {
66  LOG(VB_GENERAL, LOG_ERR, LOC + QString("Failed to bind RTCP socket to port %1").arg(port));
67  }
68  else
69  {
70  LOG(VB_RECORD, LOG_INFO, LOC + QString("RTCP socket bound to port %1 (0x%2)")
71  .arg(port).arg(port,2,16,QChar('0')));
72  }
73 
74  // Increase receive packet buffer size for the RTP data stream to prevent packet loss
75  uint desiredsize = 8000000;
76  uint newsize = SetUDPReceiveBufferSize(m_readHelper->m_socket, desiredsize);
77  if (newsize >= desiredsize)
78  {
79  LOG(VB_RECORD, LOG_INFO, LOC + QString("RTP UDP socket receive buffer size set to %1").arg(newsize));
80  }
81  else
82  {
83  LOG(VB_GENERAL, LOG_INFO, LOC + "RTP UDP socket receive buffer too small\n" +
84  QString("\tRTP UDP socket receive buffer size set to %1 but requested %2\n").arg(newsize).arg(desiredsize) +
85  QString("\tTo prevent UDP packet loss increase net.core.rmem_max e.g. with this command:\n") +
86  QString("\tsudo sysctl -w net.core.rmem_max=%1\n").arg(desiredsize) +
87  QString("\tand restart mythbackend."));
88  }
89 }
90 
92 {
93  delete m_rtcpReadHelper;
94  delete m_writeHelper;
95  delete m_readHelper;
96  delete m_buffer;
97 }
98 
99 bool SatIPRTSP::Setup(const QUrl& url)
100 {
101  m_requestUrl = url;
102  LOG(VB_RECORD, LOG_DEBUG, LOC2 + QString("SETUP"));
103 
104  if (url.port() != 554)
105  {
106  LOG(VB_RECORD, LOG_WARNING, LOC + "SatIP specifies RTSP port 554 to be used");
107  }
108 
109  if (url.port() < 1)
110  {
111  LOG(VB_RECORD, LOG_ERR, LOC + QString("Invalid port %1").arg(url.port()));
112  return false;
113  }
114 
115  QStringList headers;
116  headers.append(
117  QString("Transport: RTP/AVP;unicast;client_port=%1-%2")
118  .arg(m_readHelper->m_socket->localPort()).arg(m_readHelper->m_socket->localPort() + 1));
119 
120  if (!sendMessage(m_requestUrl, "SETUP", &headers))
121  {
122  LOG(VB_RECORD, LOG_ERR, LOC + "Failed to send SETUP message");
123  return false;
124  }
125 
126  if (m_headers.contains("COM.SES.STREAMID"))
127  {
128  m_streamid = m_headers["COM.SES.STREAMID"];
129  }
130  else
131  {
132  LOG(VB_RECORD, LOG_ERR, LOC + "SETUP response did not contain the com.ses.streamID field");
133  return false;
134  }
135 
136  QRegExp sessionTimeoutRegex(
137  "^([^\\r\\n]+);timeout=([0-9]+)?", Qt::CaseSensitive, QRegExp::RegExp2);
138 
139  if (m_headers.contains("SESSION"))
140  {
141  if (sessionTimeoutRegex.indexIn(m_headers["SESSION"]) == -1)
142  {
143  LOG(VB_RECORD, LOG_ERR, LOC +
144  QString("Failed to extract session id from session header ('%1')")
145  .arg(m_headers["Session"]));
146  }
147 
148  QStringList parts = sessionTimeoutRegex.capturedTexts();
149  m_sessionid = parts.at(1);
150  m_timeout = (parts.length() > 1 ? parts.at(2).toInt() / 2 : 30) * 1000;
151 
152  LOG(VB_RECORD, LOG_DEBUG, LOC + QString("Sat>IP protocol timeout:%1 ms").arg(m_timeout));
153  }
154  else
155  {
156  LOG(VB_RECORD, LOG_ERR, LOC + "SETUP response did not contain the Session field");
157  return false;
158  }
159 
160  LOG(VB_RECORD, LOG_DEBUG, LOC +
161  QString("Setup completed, sessionID = %1, streamID = %2, timeout = %3s")
164 
165  // Reset tuner lock status
166  QMutexLocker locker(&m_sigmonLock);
167  m_hasLock = false;
168 
169  return true;
170 }
171 
172 bool SatIPRTSP::Play(QStringList &pids)
173 {
174  LOG(VB_RECORD, LOG_DEBUG, LOC2 + "PLAY");
175 
176  QUrl url = QUrl(m_requestUrl);
177  url.setQuery("");
178  url.setPath(QString("/stream=%1").arg(m_streamid));
179 
180  QString pids_str = QString("pids=%1").arg(!pids.empty() ? pids.join(",") : "none");
181  LOG(VB_RECORD, LOG_INFO, LOC + "Play(pids) " + pids_str);
182 
183  // Telestar Digibit R1 Sat>IP box cannot handle a lot of pids
184  if (pids.size() > 32)
185  {
186  LOG(VB_RECORD, LOG_INFO, LOC +
187  QString("Receive full TS, number of PIDs:%1 is more than 32").arg(pids.size()));
188  LOG(VB_RECORD, LOG_DEBUG, LOC + pids_str);
189  pids_str = QString("pids=all");
190  }
191  url.setQuery(pids_str);
192  LOG(VB_RECORD, LOG_DEBUG, LOC + pids_str);
193 
194  if (!sendMessage(url, "PLAY"))
195  {
196  LOG(VB_RECORD, LOG_ERR, LOC + "Failed to send PLAY message");
197  return false;
198  }
199 
200  // Start processing packets when pids are specified
201  m_valid = !pids.empty();
202 
203  return true;
204 }
205 
207 {
208  LOG(VB_RECORD, LOG_DEBUG, LOC2 + "TEARDOWN");
209  emit stopKeepAlive();
210 
211  QUrl url = QUrl(m_requestUrl);
212  url.setQuery(QString());
213  url.setPath(QString("/stream=%1").arg(m_streamid));
214 
215  bool result = sendMessage(url, "TEARDOWN");
216 
217  if (!result)
218  {
219  LOG(VB_RECORD, LOG_ERR, LOC + "Teardown failed");
220  }
221 
222  if (result)
223  {
224  m_sessionid = "";
225  m_streamid = "";
226  }
227 
228  // Discard all RTP packets until the next lock
229  m_valid = false;
230  m_validOld = false;
231 
232  // Reset tuner lock status
233  QMutexLocker locker(&m_sigmonLock);
234  m_hasLock = false;
235 
236  return result;
237 }
238 
240 {
241  QMutexLocker locker(&m_sigmonLock);
242  return m_hasLock;
243 }
244 
246 {
247  QMutexLocker locker(&m_sigmonLock);
248  return m_signalStrength;
249 }
250 
251 void SatIPRTSP::SetSigmonValues(bool lock, int level)
252 {
253  QMutexLocker locker(&m_sigmonLock);
254  m_hasLock = lock;
255  m_signalStrength = level;
256 }
257 
258 bool SatIPRTSP::sendMessage(const QUrl& url, const QString& msg, QStringList *additionalheaders)
259 {
260  QMutexLocker locker(&m_ctrlSocketLock);
261 
262  QTcpSocket ctrl_socket;
263  ctrl_socket.connectToHost(url.host(), url.port());
264 
265  bool ok = ctrl_socket.waitForConnected(30 * 1000);
266  if (!ok)
267  {
268  LOG(VB_GENERAL, LOG_ERR, LOC + QString("Could not connect to server %1:%2").arg(url.host()).arg(url.port()));
269  return false;
270  }
271 
272  QStringList headers;
273  headers.append(QString("%1 %2 RTSP/1.0").arg(msg).arg(url.toString()));
274  headers.append(QString("User-Agent: MythTV Sat>IP client"));
275  headers.append(QString("CSeq: %1").arg(++m_cseq));
276 
277  if (m_sessionid.length() > 0)
278  {
279  headers.append(QString("Session: %1").arg(m_sessionid));
280  }
281 
282  if (additionalheaders != nullptr)
283  {
284  for (auto& adhdr : *additionalheaders)
285  {
286  headers.append(adhdr);
287  }
288  }
289 
290  headers.append("\r\n");
291 
292  for (const auto& requestLine : headers)
293  {
294  LOG(VB_RECORD, LOG_DEBUG, LOC + "sendMessage " +
295  QString("write: %1").arg(requestLine.simplified()));
296  }
297 
298  QString request = headers.join("\r\n");
299  ctrl_socket.write(request.toLatin1());
300 
301  QRegularExpression firstLineRE { "^RTSP/1.0 (\\d+) ([^\r\n]+)" };
302  QRegularExpression headerRE { R"(^([^:]+):\s*([^\r\n]+))" };
303  QRegularExpression blankLineRE { R"(^[\r\n]*$)" };
304 
305  bool firstLine = true;
306  while (true)
307  {
308  if (!ctrl_socket.canReadLine())
309  {
310  bool ready = ctrl_socket.waitForReadyRead(10 * 1000);
311  if (!ready)
312  {
313  LOG(VB_RECORD, LOG_ERR, LOC + "RTSP server did not respond after 10s");
314  return false;
315  }
316  continue;
317  }
318 
319  QString line = ctrl_socket.readLine();
320  LOG(VB_RECORD, LOG_DEBUG, LOC + "sendMessage " +
321  QString("read: %1").arg(line.simplified()));
322 
323  QRegularExpressionMatch match;
324  if (firstLine)
325  {
326  match = firstLineRE.match(line);
327  if (!match.hasMatch())
328  {
329  return false;
330  }
331 
332  QStringList parts = match.capturedTexts();
333  int responseCode = parts.at(1).toInt();
334  const QString& responseMsg = parts.at(2);
335 
336  LOG(VB_RECORD, LOG_DEBUG, LOC + QString("response code:%1 message:%2")
337  .arg(responseCode).arg(responseMsg));
338 
339  if (responseCode != 200)
340  {
341  return false;
342  }
343  firstLine = false;
344  continue;
345  }
346 
347  match = blankLineRE.match(line);
348  if (match.hasMatch()) break;
349 
350  match = headerRE.match(line);
351  if (!match.hasMatch())
352  {
353  return false;
354  }
355  QStringList parts = match.capturedTexts();
356  m_headers.insert(parts.at(1).toUpper(), parts.at(2));
357  }
358 
359  QString cSeq;
360 
361  if (m_headers.contains("CSEQ"))
362  {
363  cSeq = m_headers["CSEQ"];
364  }
365 
366  if (cSeq != QString("%1").arg(m_cseq))
367  {
368  LOG(VB_RECORD, LOG_WARNING, LOC + QString("Expected CSeq of %1 but got %2").arg(m_cseq).arg(cSeq));
369  }
370 
371  ctrl_socket.disconnectFromHost();
372  if (ctrl_socket.state() != QAbstractSocket::UnconnectedState)
373  {
374  ctrl_socket.waitForDisconnected();
375  }
376 
377  return true;
378 }
379 
381 {
382  if (m_timer)
383  return;
384  m_timer = startTimer(timeout);
385  LOG(VB_RECORD, LOG_INFO, LOC + QString("startKeepAliveRequested(%1) m_timer:%2").arg(timeout).arg(m_timer));
386 }
387 
389 {
390  LOG(VB_RECORD, LOG_INFO, LOC + QString("stopKeepAliveRequested() m_timer:%1").arg(m_timer));
391  if (m_timer)
392  {
393  killTimer(m_timer);
394  }
395  m_timer = 0;
396 }
397 
398 void SatIPRTSP::timerEvent(QTimerEvent* timerEvent)
399 {
400  (void) timerEvent;
401  LOG(VB_RECORD, LOG_INFO, LOC + QString("Sending KeepAlive timer %1").arg(timerEvent->timerId()));
402 
403  QUrl url = QUrl(m_requestUrl);
404  url.setPath("/");
405  url.setQuery("");
406 
407  sendMessage(url, "OPTIONS");
408 }
409 
410 // --- RTSP RTP ReadHelper ---------------------------------------------------
411 //
412 // Receive RTP packets with stream data on UDP socket.
413 // Read packets when signalled via readyRead on QUdpSocket.
414 //
415 #define LOC_RH QString("SatIPRTSP[%1]: ").arg(m_parent->m_streamHandler->m_inputId)
416 
418  : QObject(p)
419  , m_socket(new QUdpSocket(this))
420  , m_parent(p)
421 {
422  LOG(VB_RECORD, LOG_INFO, LOC_RH +
423  QString("Starting read helper for UDP (RTP) socket"));
424 
425  // Call ReadPending when there is a message received on m_socket
426  connect(m_socket, &QUdpSocket::readyRead, this, &SatIPRTSPReadHelper::ReadPending);
427 }
428 
430 {
431  delete m_socket;
432 }
433 
435 {
436  while (m_socket->hasPendingDatagrams())
437  {
438  QHostAddress sender;
439  quint16 senderPort = 0;
440 
442  QByteArray &data = packet.GetDataReference();
443  data.resize(m_socket->pendingDatagramSize());
444  m_socket->readDatagram(data.data(), data.size(), &sender, &senderPort);
445  m_parent->m_buffer->PushDataPacket(packet);
446  }
447 }
448 
449 // --- RTSP RTCP ReadHelper --------------------------------------------------
450 //
451 // Receive RTCP packets with control messages on UDP socket
452 // Receive tuner state: lock and signal strength
453 //
454 #define LOC_RTCP QString("SatIPRTCP[%1]: ").arg(m_parent->m_streamHandler->m_inputId)
455 
457  : QObject(p)
458  , m_socket(new QUdpSocket(this))
459  , m_parent(p)
460 {
461  LOG(VB_RECORD, LOG_INFO, LOC_RTCP +
462  QString("Starting read helper for UDP (RTCP) socket"));
463 
464  // Call ReadPending when there is a message received on m_socket
465  connect(m_socket, &QUdpSocket::readyRead, this, &SatIPRTCPReadHelper::ReadPending);
466 }
467 
469 {
470  delete m_socket;
471 }
472 
473 // Process a RTCP packet received on m_socket
475 {
476  while (m_socket->hasPendingDatagrams())
477  {
478 #if 0
479  LOG(VB_RECORD, LOG_INFO, "SatIPRTSP_RH " +
480  QString("Processing RTCP packet(pendingDatagramSize:%1)")
481  .arg(m_socket->pendingDatagramSize()));
482 #endif
483 
484  QHostAddress sender;
485  quint16 senderPort = 0;
486 
487  QByteArray buf = QByteArray(m_socket->pendingDatagramSize(), Qt::Uninitialized);
488  m_socket->readDatagram(buf.data(), buf.size(), &sender, &senderPort);
489 
490  SatIPRTCPPacket pkt = SatIPRTCPPacket(buf);
491  if (!pkt.IsValid())
492  {
493  LOG(VB_GENERAL, LOG_ERR, LOC_RTCP + "Invalid RTCP packet received");
494  continue;
495  }
496 
497  QStringList data = pkt.Data().split(";");
498  bool found = false;
499  int i = 0;
500 
501  while (!found && i < data.length())
502  {
503  const QString& item = data.at(i);
504 
505  if (item.startsWith("tuner="))
506  {
507  found = true;
508  QStringList tuner = item.split(",");
509 
510  if (tuner.length() > 3)
511  {
512  int level = tuner.at(1).toInt(); // [0, 255]
513  bool lock = tuner.at(2).toInt() != 0; // [0 , 1]
514  int quality = tuner.at(3).toInt(); // [0, 15]
515 
516  LOG(VB_RECORD, LOG_DEBUG, LOC_RTCP +
517  QString("Tuner lock:%1 level:%2 quality:%3").arg(lock).arg(level).arg(quality));
518 
519  m_parent->SetSigmonValues(lock, level);
520  }
521  }
522  i++;
523  }
524  }
525 }
526 
527 // --- SatIPRTSPWriteHelper --------------------------------------------------
528 //
529 #define LOC_WH QString("SatIPRTSP[%1]: ").arg(m_streamHandler->m_inputId)
530 
532  : m_parent(parent)
533  , m_streamHandler(handler)
534 {
535  m_timer = startTimer(100);
536 }
537 
538 void SatIPRTSPWriteHelper::timerEvent(QTimerEvent* /*event*/)
539 {
541  {
543 
545  {
546  RTPTSDataPacket ts_packet(pkt);
547 
548  if (!ts_packet.IsValid())
549  {
551  continue;
552  }
553 
554  // Check for sequence number
555  uint exp_seq_num = m_lastSequenceNumber + 1;
556  uint seq_num = ts_packet.GetSequenceNumber();
557  if (m_lastSequenceNumber &&
558  ((exp_seq_num & 0xFFFF) != (seq_num & 0xFFFF)))
559  {
560  // Discard all pending packets to recover from buffer overflow
562  uint discarded = 1;
564  {
567  discarded++;
568  }
570 
571  LOG(VB_RECORD, LOG_INFO, LOC_WH +
572  QString("RTP Sequence number mismatch %1!=%2, discarded %3 RTP packets")
573  .arg(seq_num).arg(exp_seq_num).arg(discarded));
574  continue;
575  }
577 #if 0
578  m_lastTimeStamp = ts_packet.GetTimeStamp();
579  LOG(VB_RECORD, LOG_INFO, LOC_WH +
580  QString("Processing RTP packet(seq:%1 ts:%2, ts_data_size:%3) %4")
582  .arg((m_parent->m_valid && m_parent->m_validOld)?"processed":"discarded"));
583 #endif
585  {
586  int remainder = 0;
587  {
588  QMutexLocker locker(&m_streamHandler->m_listenerLock);
589  auto streamDataList = m_streamHandler->m_streamDataList;
590  if (!streamDataList.isEmpty())
591  {
592  const unsigned char *data_buffer = ts_packet.GetTSData();
593  size_t data_length = ts_packet.GetTSDataSize();
594 
595  for (auto sit = streamDataList.cbegin(); sit != streamDataList.cend(); ++sit)
596  {
597  remainder = sit.key()->ProcessData(data_buffer, data_length);
598  }
599 
600  m_streamHandler->WriteMPTS(data_buffer, data_length - remainder);
601  }
602  }
603 
604  if (remainder != 0)
605  {
606  LOG(VB_RECORD, LOG_INFO, LOC_WH +
607  QString("RTP data_length = %1 remainder = %2")
608  .arg(ts_packet.GetTSDataSize()).arg(remainder));
609  }
610  }
611  }
613  }
615 }
616 
617 // Set receive buffer size of UDP socket
618 //
619 // Note that the size returned by ReceiverBufferSizeSocketOption is
620 // twice the actual buffer size.
621 //
622 static uint SetUDPReceiveBufferSize(QUdpSocket *socket, uint rcvbuffersize)
623 {
624  QVariant ss = socket->socketOption(QAbstractSocket::ReceiveBufferSizeSocketOption);
625  uint oldsize = ss.toUInt();
626  if (oldsize < rcvbuffersize*2)
627  {
628  socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, rcvbuffersize);
629  }
630  ss = socket->socketOption(QAbstractSocket::ReceiveBufferSizeSocketOption);
631  uint newsize = ss.toUInt()/2;
632  return newsize;
633 }
RTPDataPacket::GetTimeStamp
uint GetTimeStamp(void) const
Definition: rtpdatapacket.h:100
SatIPRTSP::m_valid
bool m_valid
Definition: satiprtsp.h:145
rtcpdatapacket.h
SatIPRTSP::Setup
bool Setup(const QUrl &url)
Definition: satiprtsp.cpp:99
SatIPRTSP::stopKeepAlive
void stopKeepAlive(void)
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:103
SatIPRTCPReadHelper::m_parent
SatIPRTSP * m_parent
Definition: satiprtsp.h:66
SatIPRTSP::startKeepAliveRequested
void startKeepAliveRequested(int timeout)
Definition: satiprtsp.cpp:380
RTPTSDataPacket
RTP Transport Stream Data Packet.
Definition: rtptsdatapacket.h:16
SatIPRTSP::Play
bool Play(QStringList &pids)
Definition: satiprtsp.cpp:172
SatIPRTSPWriteHelper::m_timer
int m_timer
Definition: satiprtsp.h:84
SatIPRTSP::SatIPRTSP
SatIPRTSP(SatIPStreamHandler *handler)
Definition: satiprtsp.cpp:33
StreamHandler::WriteMPTS
void WriteMPTS(const unsigned char *buffer, uint len)
Write out a copy of the raw MPTS.
Definition: streamhandler.cpp:349
PacketBuffer::FreePacket
void FreePacket(const UDPPacket &packet)
Frees an RTPDataPacket returned by PopDataPacket.
Definition: packetbuffer.cpp:56
SatIPRTSP::GetSignalStrength
int GetSignalStrength()
Definition: satiprtsp.cpp:245
RTPTSDataPacket::GetTSDataSize
unsigned int GetTSDataSize(void) const
Definition: rtptsdatapacket.h:29
SatIPRTSP::m_buffer
PacketBuffer * m_buffer
Definition: satiprtsp.h:126
SatIPRTSP::SatIPRTSPWriteHelper
friend class SatIPRTSPWriteHelper
Definition: satiprtsp.h:96
SatIPRTSPWriteHelper::m_lastTimeStamp
uint m_lastTimeStamp
Definition: satiprtsp.h:86
SatIPRTSP::SatIPRTSPReadHelper
friend class SatIPRTSPReadHelper
Definition: satiprtsp.h:94
RTPDataPacket::kPayLoadTypeTS
@ kPayLoadTypeTS
Definition: rtpdatapacket.h:86
SatIPRTSP::sendMessage
bool sendMessage(const QUrl &url, const QString &msg, QStringList *additionalHeaders=nullptr)
Definition: satiprtsp.cpp:258
SatIPRTSP::m_writeHelper
SatIPRTSPWriteHelper * m_writeHelper
Definition: satiprtsp.h:151
arg
arg(title).arg(filename).arg(doDelete))
SatIPRTSP::stopKeepAliveRequested
void stopKeepAliveRequested(void)
Definition: satiprtsp.cpp:388
SatIPRTSP::m_requestUrl
QUrl m_requestUrl
Definition: satiprtsp.h:125
SatIPRTSP::SatIPRTCPReadHelper
friend class SatIPRTCPReadHelper
Definition: satiprtsp.h:95
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
SatIPRTSP::m_headers
Headers m_headers
Definition: satiprtsp.h:137
SatIPRTSP::SetSigmonValues
void SetSigmonValues(bool lock, int level)
Definition: satiprtsp.cpp:251
SatIPRTSP::m_readHelper
SatIPRTSPReadHelper * m_readHelper
Definition: satiprtsp.h:150
SatIPRTSP::m_rtcpReadHelper
SatIPRTCPReadHelper * m_rtcpReadHelper
Definition: satiprtsp.h:152
SetUDPReceiveBufferSize
static uint SetUDPReceiveBufferSize(QUdpSocket *socket, uint rcvbuffersize)
Definition: satiprtsp.cpp:622
LOC
#define LOC
-*- Mode: c++ -*-
Definition: satiprtsp.cpp:25
SatIPRTSPWriteHelper::SatIPRTSPWriteHelper
SatIPRTSPWriteHelper(SatIPRTSP *parent, SatIPStreamHandler *handler)
Definition: satiprtsp.cpp:531
mythlogging.h
SatIPRTCPReadHelper::m_socket
QUdpSocket * m_socket
Definition: satiprtsp.h:63
SatIPRTSPReadHelper::~SatIPRTSPReadHelper
~SatIPRTSPReadHelper() override
Definition: satiprtsp.cpp:429
SatIPRTSP::timerEvent
void timerEvent(QTimerEvent *) override
Definition: satiprtsp.cpp:398
SatIPRTSP::m_timeout
int m_timeout
Definition: satiprtsp.h:140
hardwareprofile.config.p
p
Definition: config.py:33
SatIPRTSP::HasLock
bool HasLock()
Definition: satiprtsp.cpp:239
LOC_RH
#define LOC_RH
Definition: satiprtsp.cpp:415
SatIPRTCPReadHelper::SatIPRTCPReadHelper
SatIPRTCPReadHelper(SatIPRTSP *p)
Definition: satiprtsp.cpp:456
SatIPRTCPReadHelper::~SatIPRTCPReadHelper
~SatIPRTCPReadHelper() override
Definition: satiprtsp.cpp:468
SatIPRTSP::m_streamid
QString m_streamid
Definition: satiprtsp.h:136
SatIPRTSP::m_ctrlSocketLock
QMutex m_ctrlSocketLock
Definition: satiprtsp.h:142
RTPTSDataPacket::GetTSData
const unsigned char * GetTSData(void) const
Definition: rtptsdatapacket.h:24
SatIPRTSP::Teardown
bool Teardown()
Definition: satiprtsp.cpp:206
uint
unsigned int uint
Definition: compat.h:141
rtppacketbuffer.h
SatIPRTSP::~SatIPRTSP
~SatIPRTSP() override
Definition: satiprtsp.cpp:91
RTPDataPacket::GetSequenceNumber
uint GetSequenceNumber(void) const
Definition: rtpdatapacket.h:95
SatIPRTSP::m_timer
int m_timer
Definition: satiprtsp.h:139
SatIPRTSPReadHelper::m_socket
QUdpSocket * m_socket
Definition: satiprtsp.h:42
SatIPRTCPPacket::IsValid
bool IsValid() const
Definition: satiprtcppacket.h:19
StreamHandler::m_listenerLock
QMutex m_listenerLock
Definition: streamhandler.h:141
udppacketbuffer.h
SatIPRTSP::m_validOld
bool m_validOld
Definition: satiprtsp.h:146
SatIPRTSP::m_cseq
uint m_cseq
Definition: satiprtsp.h:134
SatIPRTSP::m_hasLock
bool m_hasLock
Definition: satiprtsp.h:147
SatIPRTCPPacket
Definition: satiprtcppacket.h:14
SatIPRTSPReadHelper::SatIPRTSPReadHelper
SatIPRTSPReadHelper(SatIPRTSP *p)
Definition: satiprtsp.cpp:417
PacketBuffer::HasAvailablePacket
bool HasAvailablePacket(void) const
Returns true if there are ordered packets ready for processing.
Definition: packetbuffer.cpp:26
satiprtsp.h
LOC2
#define LOC2
Definition: satiprtsp.cpp:26
SatIPRTCPReadHelper::ReadPending
void ReadPending(void)
Definition: satiprtsp.cpp:474
StreamHandler::m_streamDataList
StreamDataList m_streamDataList
Definition: streamhandler.h:142
PacketBuffer::PushDataPacket
virtual void PushDataPacket(const UDPPacket &)=0
SatIPRTSP::m_sessionid
QString m_sessionid
Definition: satiprtsp.h:135
RTPDataPacket::GetPayloadType
uint GetPayloadType(void) const
Definition: rtpdatapacket.h:90
SatIPRTSP
Definition: satiprtsp.h:92
LOC_RTCP
#define LOC_RTCP
Definition: satiprtsp.cpp:454
rtptsdatapacket.h
satipstreamhandler.h
SatIPRTSP::m_sigmonLock
QMutex m_sigmonLock
Definition: satiprtsp.h:143
RTPDataPacket
RTP Data Packet.
Definition: rtpdatapacket.h:30
SatIPRTSP::startKeepAlive
void startKeepAlive(int timeout)
PacketBuffer::PopDataPacket
UDPPacket PopDataPacket(void)
Fetches a data packet for processing.
Definition: packetbuffer.cpp:31
SatIPRTSPWriteHelper::m_parent
SatIPRTSP * m_parent
Definition: satiprtsp.h:82
SatIPRTSPReadHelper::m_parent
SatIPRTSP * m_parent
Definition: satiprtsp.h:45
UDPPacketBuffer
Definition: udppacketbuffer.h:12
SatIPRTSP::m_signalStrength
int m_signalStrength
Definition: satiprtsp.h:148
UDPPacket::GetDataReference
QByteArray & GetDataReference(void)
Definition: udppacket.h:36
SatIPRTSPWriteHelper::m_streamHandler
SatIPStreamHandler * m_streamHandler
Definition: satiprtsp.h:83
satiprtcppacket.h
SatIPRTCPPacket::Data
QString Data() const
Definition: satiprtcppacket.h:20
SatIPRTSPWriteHelper::timerEvent
void timerEvent(QTimerEvent *) override
Definition: satiprtsp.cpp:538
mythsocket.h
UDPPacket
UDP Packet.
Definition: udppacket.h:20
SatIPRTSPWriteHelper::m_lastSequenceNumber
uint m_lastSequenceNumber
Definition: satiprtsp.h:85
SatIPStreamHandler
Definition: satipstreamhandler.h:24
RTPDataPacket::IsValid
bool IsValid(void) const override
IsValid() must return true before any data access methods are called, other than GetDataReference() a...
Definition: rtpdatapacket.h:40
SatIPRTSPReadHelper::ReadPending
void ReadPending(void)
Definition: satiprtsp.cpp:434
LOC_WH
#define LOC_WH
Definition: satiprtsp.cpp:529
PacketBuffer::GetEmptyPacket
UDPPacket GetEmptyPacket(void)
Gets a packet for use in PushDataPacket/PushFECPacket.
Definition: packetbuffer.cpp:42