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