ASIRecorder::ASIRecorder(TVRec *rec, ASIChannel *channel) : DTVRecorder(rec), m_channel(channel), m_stream_handler(NULL) { SetStreamData(new MPEGStreamData(-1, rec ? rec->GetInputId() : -1, false)); if (channel->GetProgramNumber() < 0 || !channel->GetMinorChannel()) _stream_data->SetListeningDisabled(true); }
bool IPTVChannel::Tune(const IPTVTuningData &tuning, bool scanning) { QMutexLocker locker(&m_tune_lock); LOG(VB_CHANNEL, LOG_INFO, LOC + QString("Tune(%1)") .arg(tuning.GetDeviceName())); if (tuning.GetDataURL().scheme().toUpper() == "RTSP") { // TODO get RTP info using RTSP } if (!tuning.IsValid()) { LOG(VB_CHANNEL, LOG_ERR, LOC + QString("Invalid tuning info %1") .arg(tuning.GetDeviceName())); return false; } if (m_last_tuning == tuning) { LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("Already tuned to %1") .arg(tuning.GetDeviceName())); return true; } m_last_tuning = tuning; if (!m_firsttune || scanning) // for historical reason, an initial tune is requested at // startup so don't open the stream handler just yet it will // be opened after the next Tune or SetStreamData) { MPEGStreamData *tmp = m_stream_data; CloseStreamHandler(); if (tmp) SetStreamData(tmp); else OpenStreamHandler(); } m_firsttune = false; LOG(VB_CHANNEL, LOG_INFO, LOC + QString("Tuned to (%1)") .arg(tuning.GetDeviceName())); return true; }
bool IPTVChannel::Open(void) { LOG(VB_CHANNEL, LOG_INFO, LOC + "Open()"); if (IsOpen()) return true; QMutexLocker locker(&m_tune_lock); if (!InitializeInputs()) { Close(); return false; } if (m_stream_data) SetStreamData(m_stream_data); return true; }
bool IPTVChannel::Open(void) { LOG(VB_CHANNEL, LOG_INFO, LOC + "Open()"); if (IsOpen()) return true; m_lock.lock(); if (!InitializeInputs()) { m_lock.unlock(); Close(); return false; } if (m_stream_data) SetStreamData(m_stream_data); m_lock.unlock(); return true; }