diff --git a/mythtv/libs/libmythtv/recorders/cetonrtsp.cpp b/mythtv/libs/libmythtv/recorders/cetonrtsp.cpp
index 80a5b1a..22248fe 100644
a
|
b
|
CetonRTSP::CetonRTSP(const QString &ip, uint tuner, ushort port) : |
25 | 25 | _sessionId("0"), |
26 | 26 | _responseCode(-1), |
27 | 27 | _timeout(60), |
28 | | _timer(0) |
| 28 | _timer(0), |
| 29 | _canGetParameter(false) |
29 | 30 | { |
30 | 31 | _requestUrl.setHost(ip); |
31 | 32 | _requestUrl.setPort(port); |
… |
… |
CetonRTSP::CetonRTSP(const QUrl &url) : |
40 | 41 | _requestUrl(url), |
41 | 42 | _responseCode(-1), |
42 | 43 | _timeout(60), |
43 | | _timer(0) |
| 44 | _timer(0), |
| 45 | _canGetParameter(false) |
44 | 46 | { |
45 | 47 | if (url.port() < 0) |
46 | 48 | { |
… |
… |
CetonRTSP::~CetonRTSP() |
56 | 58 | |
57 | 59 | bool CetonRTSP::ProcessRequest( |
58 | 60 | const QString &method, const QStringList* headers, |
59 | | bool use_control, bool waitforanswer) |
| 61 | bool use_control, bool waitforanswer, const QString &alternative) |
60 | 62 | { |
61 | 63 | QMutexLocker locker(&_rtspMutex); |
62 | 64 | |
… |
… |
bool CetonRTSP::ProcessRequest( |
106 | 108 | QStringList requestHeaders; |
107 | 109 | requestHeaders.append(QString("%1 %2 RTSP/1.0") |
108 | 110 | .arg(method) |
109 | | .arg(use_control ? _controlUrl.toString() : _requestUrl.toString())); |
| 111 | .arg(alternative.size() ? alternative : |
| 112 | (use_control ? _controlUrl.toString() : _requestUrl.toString()))); |
110 | 113 | requestHeaders.append(QString("User-Agent: MythTV Ceton Recorder")); |
111 | 114 | requestHeaders.append(QString("CSeq: %1").arg(++_sequenceNumber)); |
112 | 115 | if (_sessionId != "0") |
… |
… |
bool CetonRTSP::GetOptions(QStringList &options) |
253 | 256 | if (ProcessRequest("OPTIONS")) |
254 | 257 | { |
255 | 258 | options = _responseHeaders.value("Public").split(QRegExp(",\\s*")); |
| 259 | _canGetParameter = options.contains("GET_PARAMETER"); |
| 260 | |
256 | 261 | return true; |
257 | 262 | } |
258 | 263 | return false; |
… |
… |
void CetonRTSP::timerEvent(QTimerEvent*) |
502 | 507 | QStringList dummy; |
503 | 508 | |
504 | 509 | LOG(VB_RECORD, LOG_DEBUG, LOC + "Sending KeepAlive"); |
505 | | ProcessRequest("GET_PARAMETER", NULL, false, false); |
| 510 | if (_canGetParameter) |
| 511 | { |
| 512 | ProcessRequest("GET_PARAMETER", NULL, false, false); |
| 513 | } |
| 514 | else |
| 515 | { |
| 516 | ProcessRequest("OPTIONS", NULL, false, false, "*"); |
| 517 | } |
506 | 518 | } |
diff --git a/mythtv/libs/libmythtv/recorders/cetonrtsp.h b/mythtv/libs/libmythtv/recorders/cetonrtsp.h
index 356edcf..50b0b13 100644
a
|
b
|
class CetonRTSP : QObject |
43 | 43 | protected: |
44 | 44 | bool ProcessRequest( |
45 | 45 | const QString &method, const QStringList *headers = NULL, |
46 | | bool use_control = false, bool waitforanswer = true); |
| 46 | bool use_control = false, bool waitforanswer = true, |
| 47 | const QString &alternative = QString()); |
47 | 48 | |
48 | 49 | private: |
49 | 50 | QStringList splitLines(const QByteArray &lines); |
… |
… |
protected: |
63 | 64 | QByteArray _responseContent; |
64 | 65 | int _timeout; |
65 | 66 | int _timer; |
| 67 | bool _canGetParameter; |
66 | 68 | |
67 | 69 | static QMutex _rtspMutex; |
68 | 70 | |