Ticket #12145: ceton3.diff

File ceton3.diff, 3.1 KB (added by JYA, 10 years ago)

latest and greatest

  • mythtv/libs/libmythtv/recorders/cetonrtsp.cpp

    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) : 
    2525    _sessionId("0"),
    2626    _responseCode(-1),
    2727    _timeout(60),
    28     _timer(0)
     28    _timer(0),
     29    _canGetParameter(false)
    2930{
    3031    _requestUrl.setHost(ip);
    3132    _requestUrl.setPort(port);
    CetonRTSP::CetonRTSP(const QUrl &url) : 
    4041    _requestUrl(url),
    4142    _responseCode(-1),
    4243    _timeout(60),
    43     _timer(0)
     44    _timer(0),
     45    _canGetParameter(false)
    4446{
    4547    if (url.port() < 0)
    4648    {
    CetonRTSP::~CetonRTSP() 
    5658
    5759bool CetonRTSP::ProcessRequest(
    5860    const QString &method, const QStringList* headers,
    59     bool use_control, bool waitforanswer)
     61    bool use_control, bool waitforanswer, const QString &alternative)
    6062{
    6163    QMutexLocker locker(&_rtspMutex);
    6264
    bool CetonRTSP::ProcessRequest( 
    106108    QStringList requestHeaders;
    107109    requestHeaders.append(QString("%1 %2 RTSP/1.0")
    108110        .arg(method)
    109         .arg(use_control ? _controlUrl.toString() :  _requestUrl.toString()));
     111        .arg(alternative.size() ? alternative :
     112             (use_control ? _controlUrl.toString() : _requestUrl.toString())));
    110113    requestHeaders.append(QString("User-Agent: MythTV Ceton Recorder"));
    111114    requestHeaders.append(QString("CSeq: %1").arg(++_sequenceNumber));
    112115    if (_sessionId != "0")
    bool CetonRTSP::GetOptions(QStringList &options) 
    253256    if (ProcessRequest("OPTIONS"))
    254257    {
    255258        options = _responseHeaders.value("Public").split(QRegExp(",\\s*"));
     259        _canGetParameter = options.contains("GET_PARAMETER");
     260
    256261        return true;
    257262    }
    258263    return false;
    void CetonRTSP::timerEvent(QTimerEvent*) 
    502507    QStringList dummy;
    503508
    504509    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    }
    506518}
  • mythtv/libs/libmythtv/recorders/cetonrtsp.h

    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 
    4343protected:
    4444    bool ProcessRequest(
    4545        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());
    4748
    4849  private:
    4950    QStringList splitLines(const QByteArray &lines);
    protected: 
    6364    QByteArray              _responseContent;
    6465    int                     _timeout;
    6566    int                     _timer;
     67    bool                    _canGetParameter;
    6668
    6769    static QMutex _rtspMutex;
    6870