vdr
2.4.1
|
Public Member Functions | |
cDvbTuner (const cDvbDevice *Device, int Adapter, int Frontend) | |
virtual | ~cDvbTuner () |
bool | ProvidesDeliverySystem (int DeliverySystem) const |
bool | ProvidesModulation (int System, int StreamId, int Modulation) const |
bool | ProvidesFrontend (const cChannel *Channel, bool Activate=false) const |
int | Frontend (void) const |
int | FrontendType (void) const |
const char * | FrontendName (void) |
int | NumProvidedSystems (void) const |
bool | Bond (cDvbTuner *Tuner) |
void | UnBond (void) |
bool | BondingOk (const cChannel *Channel, bool ConsiderOccupied=false) const |
const cChannel * | GetTransponder (void) const |
uint32_t | SubsystemId (void) const |
bool | IsTunedTo (const cChannel *Channel) const |
void | SetChannel (const cChannel *Channel) |
bool | Locked (int TimeoutMs=0) |
const cPositioner * | Positioner (void) const |
bool | GetSignalStats (int &Valid, double *Strength=NULL, double *Cnr=NULL, double *BerPre=NULL, double *BerPost=NULL, double *Per=NULL, int *Status=NULL) const |
int | GetSignalStrength (void) const |
int | GetSignalQuality (void) const |
![]() | |
cThread (const char *Description=NULL, bool LowPriority=false) | |
virtual | ~cThread () |
void | SetDescription (const char *Description,...) __attribute__((format(printf |
void bool | Start (void) |
bool | Active (void) |
Private Types | |
enum | eTunerStatus { tsIdle, tsSet, tsPositioning, tsTuned, tsLocked } |
Private Member Functions | |
bool | SetFrontendType (const cChannel *Channel) |
cString | GetBondingParams (const cChannel *Channel=NULL) const |
cDvbTuner * | GetBondedMaster (void) |
bool | IsBondedMaster (void) const |
void | ClearEventQueue (void) const |
bool | GetFrontendStatus (fe_status_t &Status) const |
cPositioner * | GetPositioner (void) |
void | ExecuteDiseqc (const cDiseqc *Diseqc, int *Frequency) |
void | ResetToneAndVoltage (void) |
bool | SetFrontend (void) |
virtual void | Action (void) |
Private Attributes | |
int | frontendType |
const cDvbDevice * | device |
int | fd_frontend |
int | adapter |
int | frontend |
cVector< cDvbFrontend * > | dvbFrontends |
cDvbFrontend * | dvbFrontend |
int | numDeliverySystems |
int | numModulations |
int | tuneTimeout |
int | lockTimeout |
time_t | lastTimeoutReport |
uint32_t | lastUncValue |
uint32_t | lastUncDelta |
time_t | lastUncChange |
cChannel | channel |
const cDiseqc * | lastDiseqc |
int | diseqcOffset |
int | lastSource |
cPositioner * | positioner |
const cScr * | scr |
bool | lnbPowerTurnedOn |
eTunerStatus | tunerStatus |
cMutex | mutex |
cCondVar | locked |
cCondVar | newSet |
cDvbTuner * | bondedTuner |
bool | bondedMaster |
Static Private Attributes | |
static cMutex | bondMutex |
Additional Inherited Members | |
![]() | |
static tThreadId | ThreadId (void) |
static tThreadId | IsMainThread (void) |
static void | SetMainThreadId (void) |
![]() | |
void | SetPriority (int Priority) |
void | SetIOPriority (int Priority) |
void | Lock (void) |
void | Unlock (void) |
bool | Running (void) |
void | Cancel (int WaitSeconds=0) |
Definition at line 528 of file dvbdevice.c.
|
private |
Enumerator | |
---|---|
tsIdle | |
tsSet | |
tsPositioning | |
tsTuned | |
tsLocked |
Definition at line 531 of file dvbdevice.c.
cDvbTuner::cDvbTuner | ( | const cDvbDevice * | Device, |
int | Adapter, | ||
int | Frontend | ||
) |
Definition at line 597 of file dvbdevice.c.
References adapter, cVector< T >::Append(), bondedMaster, bondedTuner, DEV_DVB_DEMUX, DEV_DVB_FRONTEND, device, diseqcOffset, dvbFrontend, dvbFrontends, DvbName(), fd_frontend, frontend, Frontend(), frontendType, lastDiseqc, lastSource, lastTimeoutReport, lastUncChange, lastUncDelta, lastUncValue, lnbPowerTurnedOn, lockTimeout, cDvbFrontend::NumDeliverySystems(), numDeliverySystems, cDvbFrontend::NumModulations(), numModulations, cDvbFrontend::Open(), positioner, scr, cThread::SetDescription(), cString::sprintf(), cThread::Start(), tsIdle, tunerStatus, and tuneTimeout.
|
virtual |
Definition at line 648 of file dvbdevice.c.
References cCondVar::Broadcast(), cThread::Cancel(), dvbFrontends, locked, newSet, cVector< T >::Size(), tsIdle, tunerStatus, and UnBond().
|
privatevirtual |
A derived cThread class must implement the code it wants to execute as a separate thread in this function.
If this is a loop, it must check Running() repeatedly to see whether it's time to stop.
Implements cThread.
Definition at line 1679 of file dvbdevice.c.
References adapter, cCondVar::Broadcast(), channel, diseqcOffset, esyslog, frontend, GetFrontendStatus(), cPositioner::IsMoving(), isyslog, lastDiseqc, lastSource, lastTimeoutReport, locked, lockTimeout, mutex, cChannel::Name(), newSet, cChannel::Number(), positioner, cThread::Running(), scr, SCR_RANDOM_TIMEOUT, cTimeMs::Set(), SetFrontend(), cTimeMs::TimedOut(), cCondVar::TimedWait(), cChannel::Transponder(), tsIdle, tsLocked, tsPositioning, tsSet, tsTuned, tunerStatus, and tuneTimeout.
bool cDvbTuner::Bond | ( | cDvbTuner * | Tuner | ) |
Definition at line 706 of file dvbdevice.c.
References adapter, bondedMaster, bondedTuner, bondMutex, dsyslog, esyslog, frontend, and ResetToneAndVoltage().
Referenced by cDvbDevice::Bond().
bool cDvbTuner::BondingOk | ( | const cChannel * | Channel, |
bool | ConsiderOccupied = false |
||
) | const |
Definition at line 755 of file dvbdevice.c.
References bondedTuner, bondMutex, GetBondingParams(), and IDLEPRIORITY.
Referenced by cDvbDevice::BondingOk().
|
private |
Definition at line 847 of file dvbdevice.c.
References fd_frontend, cPoller::Poll(), and TUNER_POLL_TIMEOUT.
Referenced by GetFrontendStatus(), GetSignalStats(), and GetSignalStrength().
|
private |
Definition at line 1476 of file dvbdevice.c.
References channel, CHECK, cDiseqc::daCodes, cDiseqc::daMiniA, cDiseqc::daMiniB, cDiseqc::daNone, cDiseqc::daPositionA, cDiseqc::daPositionN, cDiseqc::daScr, cDiseqc::daToneOff, cDiseqc::daToneOn, cDiseqc::daVoltage13, cDiseqc::daVoltage18, cDiseqc::daWait, diseqcOffset, esyslog, cDiseqc::Execute(), fd_frontend, GetPositioner(), cPositioner::GotoAngle(), cPositioner::GotoPosition(), cPositioner::IsMoving(), cDiseqc::IsScr(), lnbPowerTurnedOn, cMutex::Lock(), cSource::Position(), cDiseqc::Position(), positioner, Positioner(), ResetToneAndVoltage(), scr, cChannel::Source(), and cMutex::Unlock().
Referenced by SetFrontend().
|
inline |
Definition at line 577 of file dvbdevice.c.
References frontend.
Referenced by cDvbTuner(), and cDvbDevice::Frontend().
|
inline |
Definition at line 579 of file dvbdevice.c.
References dvbFrontend, and cDvbFrontend::FrontendName().
Referenced by cDvbDevice::DeviceName().
|
inline |
Definition at line 578 of file dvbdevice.c.
References frontendType.
Referenced by cDvbDevice::DeviceType().
|
private |
Definition at line 771 of file dvbdevice.c.
References adapter, bondedMaster, bondedTuner, bondMutex, dsyslog, and frontend.
Referenced by SetChannel().
Definition at line 738 of file dvbdevice.c.
References channel, device, cDevice::DeviceNumber(), cSetup::DiSEqC, Diseqcs, cChannel::Frequency(), cDiseqcs::Get(), cSetup::LnbSLOF, cChannel::Parameters(), Setup, cChannel::Source(), and cString::sprintf().
Referenced by BondingOk(), and SetChannel().
|
private |
Definition at line 857 of file dvbdevice.c.
References ClearEventQueue(), and fd_frontend.
Referenced by Action(), and GetSignalQuality().
|
private |
Definition at line 1467 of file dvbdevice.c.
References fd_frontend, cPositioner::GetPositioner(), positioner, and cPositioner::SetFrontend().
Referenced by ExecuteDiseqc().
int cDvbTuner::GetSignalQuality | ( | void | ) | const |
Definition at line 1288 of file dvbdevice.c.
References adapter, BER_ERROR_FREE, channel, constrain(), dvbFrontend, esyslog, fd_frontend, frontend, frontendType, GetFrontendStatus(), lastUncChange, lastUncDelta, lastUncValue, LOCK_THRESHOLD, MAXFRONTENDCMDS, min(), SETCMD, SignalToSQI(), and cDvbFrontend::SubsystemId().
Referenced by cDvbDevice::SignalQuality().
bool cDvbTuner::GetSignalStats | ( | int & | Valid, |
double * | Strength = NULL , |
||
double * | Cnr = NULL , |
||
double * | BerPre = NULL , |
||
double * | BerPost = NULL , |
||
double * | Per = NULL , |
||
int * | Status = NULL |
||
) | const |
Definition at line 873 of file dvbdevice.c.
References adapter, ClearEventQueue(), DTV_STAT_HAS_CARRIER, DTV_STAT_HAS_LOCK, DTV_STAT_HAS_NONE, DTV_STAT_HAS_SIGNAL, DTV_STAT_HAS_SYNC, DTV_STAT_HAS_VITERBI, DTV_STAT_VALID_BERPOST, DTV_STAT_VALID_BERPRE, DTV_STAT_VALID_CNR, DTV_STAT_VALID_NONE, DTV_STAT_VALID_PER, DTV_STAT_VALID_STATUS, DTV_STAT_VALID_STRENGTH, esyslog, fd_frontend, frontend, MAXFRONTENDCMDS, and SETCMD.
Referenced by cDvbDevice::SignalStats().
int cDvbTuner::GetSignalStrength | ( | void | ) | const |
Definition at line 1223 of file dvbdevice.c.
References adapter, channel, ClearEventQueue(), dvbFrontend, esyslog, fd_frontend, frontend, MAXFRONTENDCMDS, SETCMD, StrengthToSSI(), and cDvbFrontend::SubsystemId().
Referenced by cDvbDevice::SignalStrength().
|
inline |
Definition at line 584 of file dvbdevice.c.
References channel.
Referenced by cDvbDevice::GetCurrentlyTunedTransponder().
|
inlineprivate |
Definition at line 563 of file dvbdevice.c.
References bondedMaster, and bondedTuner.
Referenced by SetFrontend().
bool cDvbTuner::IsTunedTo | ( | const cChannel * | Channel | ) | const |
Definition at line 792 of file dvbdevice.c.
References channel, cChannel::Parameters(), cChannel::Source(), cChannel::Transponder(), tsIdle, and tunerStatus.
Referenced by cDvbDevice::IsTunedToTransponder(), cDvbDevice::ProvidesChannel(), and SetChannel().
bool cDvbTuner::Locked | ( | int | TimeoutMs = 0 | ) |
Definition at line 835 of file dvbdevice.c.
References locked, mutex, cCondVar::TimedWait(), tsLocked, and tunerStatus.
Referenced by cDvbDevice::HasLock().
|
inline |
Definition at line 580 of file dvbdevice.c.
References numDeliverySystems, and numModulations.
Referenced by cDvbDevice::NumProvidedSystems().
|
inline |
Definition at line 589 of file dvbdevice.c.
References positioner.
Referenced by ExecuteDiseqc(), and cDvbDevice::Positioner().
bool cDvbTuner::ProvidesDeliverySystem | ( | int | DeliverySystem | ) | const |
Definition at line 665 of file dvbdevice.c.
References dvbFrontends, and cVector< T >::Size().
Referenced by cDvbDevice::ProvidesDeliverySystem(), and ProvidesFrontend().
bool cDvbTuner::ProvidesFrontend | ( | const cChannel * | Channel, |
bool | Activate = false |
||
) | const |
Definition at line 683 of file dvbdevice.c.
References adapter, cDvbFrontend::Close(), dsyslog, dvbFrontend, dvbFrontends, fd_frontend, frontend, GetRequiredDeliverySystem(), lastUncChange, lastUncDelta, lastUncValue, mutex, cDvbFrontend::Open(), cChannel::Parameters(), ProvidesDeliverySystem(), and cVector< T >::Size().
Referenced by cDvbDevice::ProvidesTransponder(), and cDvbDevice::SetChannelDevice().
bool cDvbTuner::ProvidesModulation | ( | int | System, |
int | StreamId, | ||
int | Modulation | ||
) | const |
Definition at line 674 of file dvbdevice.c.
References dvbFrontends, and cVector< T >::Size().
|
private |
Definition at line 1533 of file dvbdevice.c.
References bondedTuner, CHECK, and fd_frontend.
Referenced by Bond(), ExecuteDiseqc(), SetChannel(), and SetFrontend().
void cDvbTuner::SetChannel | ( | const cChannel * | Channel | ) |
Definition at line 802 of file dvbdevice.c.
References bondedTuner, bondMutex, cCondVar::Broadcast(), channel, cDevice::DelLivePids(), device, diseqcOffset, GetBondedMaster(), GetBondingParams(), cDevice::IsPrimaryDevice(), IsTunedTo(), lastTimeoutReport, mutex, newSet, cDevice::PrimaryDevice(), ResetToneAndVoltage(), SetChannel(), tsIdle, tsSet, and tunerStatus.
Referenced by SetChannel(), and cDvbDevice::SetChannelDevice().
|
private |
Definition at line 1539 of file dvbdevice.c.
References adapter, ATSC_LOCK_TIMEOUT, ATSC_TUNE_TIMEOUT, channel, CHECK, device, cDevice::DeviceNumber(), cSetup::DiSEqC, Diseqcs, DTV_DVBT2_PLP_ID_LEGACY, DTV_STREAM_ID, DvbApiVersion, DVBC_LOCK_TIMEOUT, DVBC_TUNE_TIMEOUT, DVBS_LOCK_TIMEOUT, DVBS_TUNE_TIMEOUT, DVBT_LOCK_TIMEOUT, DVBT_TUNE_TIMEOUT, esyslog, ExecuteDiseqc(), fd_frontend, cChannel::Frequency(), FrequencyToHz(), frontend, frontendType, cDiseqcs::Get(), GetRequiredDeliverySystem(), IsBondedMaster(), cDiseqc::IsScr(), lastDiseqc, lastSource, cSetup::LnbFrequHi, cSetup::LnbFrequLo, cSetup::LnbSLOF, lockTimeout, MAXFRONTENDCMDS, cChannel::Name(), cChannel::Number(), cChannel::Parameters(), ResetToneAndVoltage(), scr, SETCMD, Setup, cChannel::Source(), cChannel::Srate(), SYS_DVBT2, and tuneTimeout.
Referenced by Action().
|
private |
|
inline |
Definition at line 585 of file dvbdevice.c.
References dvbFrontend, and cDvbFrontend::SubsystemId().
void cDvbTuner::UnBond | ( | void | ) |
Definition at line 722 of file dvbdevice.c.
References adapter, bondedMaster, bondedTuner, bondMutex, dsyslog, and frontend.
Referenced by cDvbDevice::UnBond(), and ~cDvbTuner().
|
private |
Definition at line 535 of file dvbdevice.c.
Referenced by Action(), Bond(), cDvbTuner(), GetBondedMaster(), GetSignalQuality(), GetSignalStats(), GetSignalStrength(), ProvidesFrontend(), SetFrontend(), and UnBond().
|
private |
Definition at line 559 of file dvbdevice.c.
Referenced by Bond(), cDvbTuner(), GetBondedMaster(), IsBondedMaster(), and UnBond().
|
private |
Definition at line 558 of file dvbdevice.c.
Referenced by Bond(), BondingOk(), cDvbTuner(), GetBondedMaster(), IsBondedMaster(), ResetToneAndVoltage(), SetChannel(), and UnBond().
|
staticprivate |
Definition at line 530 of file dvbdevice.c.
Referenced by Bond(), BondingOk(), GetBondedMaster(), SetChannel(), and UnBond().
|
private |
Definition at line 547 of file dvbdevice.c.
Referenced by Action(), ExecuteDiseqc(), GetBondingParams(), GetSignalQuality(), GetSignalStrength(), GetTransponder(), IsTunedTo(), SetChannel(), and SetFrontend().
|
private |
Definition at line 533 of file dvbdevice.c.
Referenced by cDvbTuner(), GetBondingParams(), SetChannel(), and SetFrontend().
|
private |
Definition at line 549 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), ExecuteDiseqc(), and SetChannel().
|
mutableprivate |
Definition at line 538 of file dvbdevice.c.
Referenced by cDvbTuner(), FrontendName(), GetSignalQuality(), GetSignalStrength(), ProvidesFrontend(), and SubsystemId().
|
private |
Definition at line 537 of file dvbdevice.c.
Referenced by cDvbTuner(), ProvidesDeliverySystem(), ProvidesFrontend(), ProvidesModulation(), and ~cDvbTuner().
|
mutableprivate |
Definition at line 534 of file dvbdevice.c.
Referenced by cDvbTuner(), ClearEventQueue(), ExecuteDiseqc(), GetFrontendStatus(), GetPositioner(), GetSignalQuality(), GetSignalStats(), GetSignalStrength(), ProvidesFrontend(), ResetToneAndVoltage(), and SetFrontend().
|
mutableprivate |
Definition at line 536 of file dvbdevice.c.
Referenced by Action(), Bond(), cDvbTuner(), Frontend(), GetBondedMaster(), GetSignalQuality(), GetSignalStats(), GetSignalStrength(), ProvidesFrontend(), SetFrontend(), and UnBond().
|
private |
Definition at line 532 of file dvbdevice.c.
Referenced by cDvbTuner(), FrontendType(), GetSignalQuality(), and SetFrontend().
|
private |
Definition at line 548 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), and SetFrontend().
|
private |
Definition at line 550 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), and SetFrontend().
|
private |
Definition at line 543 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), and SetChannel().
|
mutableprivate |
Definition at line 546 of file dvbdevice.c.
Referenced by cDvbTuner(), GetSignalQuality(), and ProvidesFrontend().
|
mutableprivate |
Definition at line 545 of file dvbdevice.c.
Referenced by cDvbTuner(), GetSignalQuality(), and ProvidesFrontend().
|
mutableprivate |
Definition at line 544 of file dvbdevice.c.
Referenced by cDvbTuner(), GetSignalQuality(), and ProvidesFrontend().
|
private |
Definition at line 553 of file dvbdevice.c.
Referenced by cDvbTuner(), and ExecuteDiseqc().
|
private |
Definition at line 556 of file dvbdevice.c.
Referenced by Action(), Locked(), and ~cDvbTuner().
|
private |
Definition at line 542 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), and SetFrontend().
|
mutableprivate |
Definition at line 555 of file dvbdevice.c.
Referenced by Action(), Locked(), ProvidesFrontend(), and SetChannel().
|
private |
Definition at line 557 of file dvbdevice.c.
Referenced by Action(), SetChannel(), and ~cDvbTuner().
|
private |
Definition at line 539 of file dvbdevice.c.
Referenced by cDvbTuner(), and NumProvidedSystems().
|
private |
Definition at line 540 of file dvbdevice.c.
Referenced by cDvbTuner(), and NumProvidedSystems().
|
private |
Definition at line 551 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), ExecuteDiseqc(), GetPositioner(), and Positioner().
|
private |
Definition at line 552 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), ExecuteDiseqc(), and SetFrontend().
|
private |
Definition at line 554 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), IsTunedTo(), Locked(), SetChannel(), and ~cDvbTuner().
|
private |
Definition at line 541 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), and SetFrontend().