Ticket #12145: ceton.patch

File ceton.patch, 4.7 KB (added by JYA, 10 years ago)

Don't send keepalive with Ceton

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

    diff --git a/mythtv/libs/libmythtv/recorders/cetonrtsp.cpp b/mythtv/libs/libmythtv/recorders/cetonrtsp.cpp
    index 4d59e0d..0d39579 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    _doKeepAlive(false) // Ceton doesn't appear to support Keep Alive
    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    _doKeepAlive(true)
    4446{
    4547    if (url.port() < 0)
    4648    {
    bool CetonRTSP::Teardown(void) 
    479481
    480482void CetonRTSP::StartKeepAlive()
    481483{
    482     if (_timer)
     484    if (_timer || !_doKeepAlive)
    483485        return;
    484486    int timeout = std::max(_timeout - 5, 5);
    485487    LOG(VB_RECORD, LOG_DEBUG, LOC +
  • mythtv/libs/libmythtv/recorders/cetonrtsp.h

    diff --git a/mythtv/libs/libmythtv/recorders/cetonrtsp.h b/mythtv/libs/libmythtv/recorders/cetonrtsp.h
    index d76851d..2820832 100644
    a b class CetonRTSP : QObject 
    3737    bool Play(void);
    3838    bool Teardown(void);
    3939
     40    void SetKeepAlive(bool keepalive) { _doKeepAlive = keepalive; }
    4041    void StartKeepAlive(void);
    4142    void StopKeepAlive(void);
    4243
    protected: 
    5758    QUrl        _requestUrl;
    5859    QUrl        _controlUrl;
    5960
    60     int                     _responseCode;
    61     QString                 _responseMessage;
    62     Params                  _responseHeaders;
    63     QByteArray              _responseContent;
    64     int                     _timeout;
    65     int                     _timer;
     61    int         _responseCode;
     62    QString     _responseMessage;
     63    Params      _responseHeaders;
     64    QByteArray  _responseContent;
     65    int         _timeout;
     66    int         _timer;
     67    bool        _doKeepAlive;
    6668
    6769    static QMutex _rtspMutex;
    6870
  • mythtv/libs/libmythtv/recorders/cetonstreamhandler.cpp

    diff --git a/mythtv/libs/libmythtv/recorders/cetonstreamhandler.cpp b/mythtv/libs/libmythtv/recorders/cetonstreamhandler.cpp
    index a83986b..a347bfd 100644
    a b CetonStreamHandler::CetonStreamHandler(const QString &device) : 
    152152        .arg(_ip_address).arg(rtspPort).arg(_tuner);
    153153    m_tuning = IPTVTuningData(url, 0, IPTVTuningData::kNone, "", 0, "", 0);
    154154    m_use_rtp_streaming = true;
     155    m_doKeepAlive = false; // Ceton doesn't support KeepAlive
    155156
    156157    _valid = true;
    157158
  • mythtv/libs/libmythtv/recorders/iptvstreamhandler.cpp

    diff --git a/mythtv/libs/libmythtv/recorders/iptvstreamhandler.cpp b/mythtv/libs/libmythtv/recorders/iptvstreamhandler.cpp
    index cab9be2..1692b31 100644
    a b IPTVStreamHandler::IPTVStreamHandler(const IPTVTuningData &tuning) : 
    111111    m_buffer(NULL),
    112112    m_rtsp_rtp_port(0),
    113113    m_rtsp_rtcp_port(0),
    114     m_rtsp_ssrc(0)
     114    m_rtsp_ssrc(0),
     115    m_doKeepAlive(true)
    115116{
    116117    memset(m_sockets, 0, sizeof(m_sockets));
    117118    memset(m_read_helpers, 0, sizeof(m_read_helpers));
    void IPTVStreamHandler::run(void) 
    134135    if (m_tuning.GetURL(0).scheme().toLower() == "rtsp")
    135136    {
    136137        rtsp = new CetonRTSP(m_tuning.GetURL(0));
     138        rtsp->SetKeepAlive(m_doKeepAlive);
    137139
    138140        // Check RTSP capabilities
    139141        QStringList options;
    void IPTVStreamHandler::run(void) 
    299301                "Starting recording (RTP initialization failed). Aborting.");
    300302            error = true;
    301303        }
    302         if (m_rtsp_rtcp_port > 0)
     304        if (m_rtsp_rtcp_port > 0 && m_doKeepAlive)
    303305        {
    304306            m_write_helper->SendRTCPReport();
    305307            m_write_helper->StartRTCPRR();
  • mythtv/libs/libmythtv/recorders/iptvstreamhandler.h

    diff --git a/mythtv/libs/libmythtv/recorders/iptvstreamhandler.h b/mythtv/libs/libmythtv/recorders/iptvstreamhandler.h
    index 27f1a05..98842fe 100644
    a b class IPTVStreamHandler : public StreamHandler 
    8989
    9090  protected:
    9191    IPTVStreamHandler(const IPTVTuningData &tuning);
     92    virtual void SetKeepAlive(bool keepalive)
     93    {
     94        m_doKeepAlive = keepalive;
     95    }
    9296
    9397    virtual void run(void); // MThread
    9498
    class IPTVStreamHandler : public StreamHandler 
    105109    uint32_t m_rtsp_ssrc;
    106110    QHostAddress m_rtcp_dest;
    107111
     112    bool m_doKeepAlive;
     113
    108114    // for implementing Get & Return
    109115    static QMutex                            s_handlers_lock;
    110116    static QMap<QString, IPTVStreamHandler*> s_handlers;