vdr 2.7.6
|
Public Member Functions | |
cDvbTuner (const cDvbDevice *Device, int Adapter, int Frontend) | |
virtual | ~cDvbTuner () override |
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 |
void | SetPowerSaveMode (bool On) |
Public Member Functions inherited from cThread | |
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 | |
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) override |
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 Public Member Functions inherited from cThread | |
static tThreadId | ThreadId (void) |
static tThreadId | IsMainThread (void) |
static void | SetMainThreadId (void) |
Protected Member Functions inherited from cThread | |
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 532 of file dvbdevice.c.
|
private |
Enumerator | |
---|---|
tsIdle | |
tsSet | |
tsPositioning | |
tsTuned | |
tsLocked |
Definition at line 535 of file dvbdevice.c.
cDvbTuner::cDvbTuner | ( | const cDvbDevice * | Device, |
int | Adapter, | ||
int | Frontend ) |
Definition at line 601 of file dvbdevice.c.
References adapter, 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, positioner, scr, cThread::SetDescription(), cString::sprintf(), cThread::Start(), tsIdle, tunerStatus, and tuneTimeout.
Referenced by Bond(), BondingOk(), GetBondedMaster(), SetChannel(), and UnBond().
|
overridevirtual |
Definition at line 652 of file dvbdevice.c.
References cThread::Cancel(), dvbFrontends, locked, newSet, tsIdle, tunerStatus, and UnBond().
|
overrideprivatevirtual |
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 1697 of file dvbdevice.c.
References adapter, channel, device, diseqcOffset, esyslog, frontend, GetFrontendStatus(), isyslog, lastDiseqc, lastSource, lastTimeoutReport, locked, lockTimeout, mutex, newSet, positioner, cThread::Running(), scr, SCR_RANDOM_TIMEOUT, cTimeMs::Set(), SetFrontend(), cTimeMs::TimedOut(), tsIdle, tsLocked, tsPositioning, tsSet, tsTuned, tunerStatus, and tuneTimeout.
bool cDvbTuner::Bond | ( | cDvbTuner * | Tuner | ) |
Definition at line 713 of file dvbdevice.c.
References adapter, bondedMaster, bondedTuner, bondMutex, cDvbTuner(), dsyslog, esyslog, frontend, and ResetToneAndVoltage().
bool cDvbTuner::BondingOk | ( | const cChannel * | Channel, |
bool | ConsiderOccupied = false ) const |
Definition at line 762 of file dvbdevice.c.
References bondedTuner, bondMutex, cDvbTuner(), GetBondingParams(), and IDLEPRIORITY.
|
private |
Definition at line 854 of file dvbdevice.c.
References fd_frontend, cPoller::Poll(), and TUNER_POLL_TIMEOUT.
Referenced by GetFrontendStatus(), GetSignalStats(), and GetSignalStrength().
|
private |
Definition at line 1492 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(), cDiseqc::IsScr(), lnbPowerTurnedOn, Mutex, cDiseqc::Position(), cSource::Position(), Positioner(), positioner, ResetToneAndVoltage(), and scr.
Referenced by SetFrontend().
|
inline |
|
inline |
Definition at line 582 of file dvbdevice.c.
References dvbFrontend.
|
inline |
Definition at line 581 of file dvbdevice.c.
References frontendType.
|
private |
Definition at line 778 of file dvbdevice.c.
References adapter, bondedMaster, bondedTuner, bondMutex, cDvbTuner(), dsyslog, and frontend.
Referenced by SetChannel().
Definition at line 745 of file dvbdevice.c.
References channel, device, Diseqcs, cChannel::Frequency(), cChannel::Parameters(), cDvbTransponderParameters::Polarization(), Setup, cChannel::Source(), and cString::sprintf().
Referenced by BondingOk(), and SetChannel().
|
private |
Definition at line 864 of file dvbdevice.c.
References ClearEventQueue(), and fd_frontend.
Referenced by Action(), and GetSignalQuality().
|
private |
Definition at line 1483 of file dvbdevice.c.
References fd_frontend, cPositioner::GetPositioner(), and positioner.
Referenced by ExecuteDiseqc().
int cDvbTuner::GetSignalQuality | ( | void | ) | const |
Definition at line 1302 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, and SignalToSQI().
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 883 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.
int cDvbTuner::GetSignalStrength | ( | void | ) | const |
Definition at line 1235 of file dvbdevice.c.
References adapter, channel, ClearEventQueue(), dvbFrontend, esyslog, fd_frontend, frontend, MAXFRONTENDCMDS, SETCMD, and StrengthToSSI().
|
inline |
Definition at line 587 of file dvbdevice.c.
References channel.
|
inlineprivate |
Definition at line 566 of file dvbdevice.c.
References bondedMaster, and bondedTuner.
Referenced by SetFrontend().
bool cDvbTuner::IsTunedTo | ( | const cChannel * | Channel | ) | const |
Definition at line 799 of file dvbdevice.c.
References channel, cChannel::Parameters(), cChannel::Source(), cChannel::Srate(), cChannel::Transponder(), tsIdle, and tunerStatus.
Referenced by SetChannel().
bool cDvbTuner::Locked | ( | int | TimeoutMs = 0 | ) |
Definition at line 842 of file dvbdevice.c.
References locked, mutex, tsLocked, and tunerStatus.
|
inline |
Definition at line 583 of file dvbdevice.c.
References numDeliverySystems, and numModulations.
|
inline |
bool cDvbTuner::ProvidesDeliverySystem | ( | int | DeliverySystem | ) | const |
Definition at line 669 of file dvbdevice.c.
References dvbFrontends, and ProvidesDeliverySystem().
Referenced by ProvidesDeliverySystem(), and ProvidesFrontend().
bool cDvbTuner::ProvidesFrontend | ( | const cChannel * | Channel, |
bool | Activate = false ) const |
Definition at line 687 of file dvbdevice.c.
References adapter, dsyslog, dvbFrontend, dvbFrontends, fd_frontend, frontend, GetRequiredDeliverySystem(), lastDiseqc, lastSource, lastUncChange, lastUncDelta, lastUncValue, lnbPowerTurnedOn, cDvbTransponderParameters::Modulation(), mutex, cChannel::Parameters(), ProvidesDeliverySystem(), ProvidesModulation(), cDvbTransponderParameters::StreamId(), and cDvbTransponderParameters::System().
bool cDvbTuner::ProvidesModulation | ( | int | System, |
int | StreamId, | ||
int | Modulation ) const |
Definition at line 678 of file dvbdevice.c.
References dvbFrontends, and ProvidesModulation().
Referenced by ProvidesFrontend(), and ProvidesModulation().
|
private |
Definition at line 1549 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 809 of file dvbdevice.c.
References bondedTuner, bondMutex, cDvbTuner(), channel, cDevice::DelLivePids(), device, diseqcOffset, GetBondedMaster(), GetBondingParams(), IsTunedTo(), lastTimeoutReport, mutex, newSet, cDevice::PrimaryDevice(), ResetToneAndVoltage(), SetChannel(), tsIdle, tsSet, and tunerStatus.
Referenced by SetChannel().
|
private |
Definition at line 1557 of file dvbdevice.c.
References adapter, ATSC_LOCK_TIMEOUT, ATSC_TUNE_TIMEOUT, cDvbTransponderParameters::Bandwidth(), channel, CHECK, cDvbTransponderParameters::CoderateH(), cDvbTransponderParameters::CoderateL(), device, 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, FrequencyToHz(), frontend, frontendType, GetRequiredDeliverySystem(), cDvbTransponderParameters::Guard(), cDvbTransponderParameters::Hierarchy(), cDvbTransponderParameters::Inversion(), IsBondedMaster(), lastDiseqc, lastSource, lockTimeout, MAXFRONTENDCMDS, cDvbTransponderParameters::Modulation(), cDvbTransponderParameters::Pilot(), cDvbTransponderParameters::Polarization(), ResetToneAndVoltage(), cDvbTransponderParameters::RollOff(), scr, SETCMD, Setup, cDvbTransponderParameters::StreamId(), SYS_DVBT2, cDvbTransponderParameters::Transmission(), and tuneTimeout.
Referenced by Action().
void cDvbTuner::SetPowerSaveMode | ( | bool | On | ) |
Definition at line 1785 of file dvbdevice.c.
References adapter, channel, dsyslog, dvbFrontend, fd_frontend, frontend, lastDiseqc, lastSource, lastUncChange, lastUncDelta, lastUncValue, lnbPowerTurnedOn, mutex, tsIdle, and tunerStatus.
|
inline |
Definition at line 588 of file dvbdevice.c.
References dvbFrontend.
void cDvbTuner::UnBond | ( | void | ) |
Definition at line 729 of file dvbdevice.c.
References adapter, bondedMaster, bondedTuner, bondMutex, cDvbTuner(), dsyslog, and frontend.
Referenced by ~cDvbTuner().
|
private |
Definition at line 539 of file dvbdevice.c.
Referenced by Action(), Bond(), cDvbTuner(), GetBondedMaster(), GetSignalQuality(), GetSignalStats(), GetSignalStrength(), ProvidesFrontend(), SetFrontend(), SetPowerSaveMode(), and UnBond().
|
private |
Definition at line 563 of file dvbdevice.c.
Referenced by Bond(), cDvbTuner(), GetBondedMaster(), IsBondedMaster(), and UnBond().
|
private |
Definition at line 562 of file dvbdevice.c.
Referenced by Bond(), BondingOk(), cDvbTuner(), GetBondedMaster(), IsBondedMaster(), ResetToneAndVoltage(), SetChannel(), and UnBond().
|
staticprivate |
Definition at line 534 of file dvbdevice.c.
Referenced by Bond(), BondingOk(), GetBondedMaster(), SetChannel(), and UnBond().
|
private |
Definition at line 551 of file dvbdevice.c.
Referenced by Action(), ExecuteDiseqc(), GetBondingParams(), GetSignalQuality(), GetSignalStrength(), GetTransponder(), IsTunedTo(), SetChannel(), SetFrontend(), and SetPowerSaveMode().
|
private |
Definition at line 537 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), GetBondingParams(), SetChannel(), and SetFrontend().
|
private |
Definition at line 553 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), ExecuteDiseqc(), and SetChannel().
|
mutableprivate |
Definition at line 542 of file dvbdevice.c.
Referenced by cDvbTuner(), FrontendName(), GetSignalQuality(), GetSignalStrength(), ProvidesFrontend(), SetPowerSaveMode(), and SubsystemId().
|
private |
Definition at line 541 of file dvbdevice.c.
Referenced by cDvbTuner(), ProvidesDeliverySystem(), ProvidesFrontend(), ProvidesModulation(), and ~cDvbTuner().
|
mutableprivate |
Definition at line 538 of file dvbdevice.c.
Referenced by cDvbTuner(), ClearEventQueue(), ExecuteDiseqc(), GetFrontendStatus(), GetPositioner(), GetSignalQuality(), GetSignalStats(), GetSignalStrength(), ProvidesFrontend(), ResetToneAndVoltage(), SetFrontend(), and SetPowerSaveMode().
|
mutableprivate |
Definition at line 540 of file dvbdevice.c.
Referenced by Action(), Bond(), cDvbTuner(), Frontend(), GetBondedMaster(), GetSignalQuality(), GetSignalStats(), GetSignalStrength(), ProvidesFrontend(), SetFrontend(), SetPowerSaveMode(), and UnBond().
|
private |
Definition at line 536 of file dvbdevice.c.
Referenced by cDvbTuner(), FrontendType(), GetSignalQuality(), and SetFrontend().
|
mutableprivate |
Definition at line 552 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), ProvidesFrontend(), SetFrontend(), and SetPowerSaveMode().
|
mutableprivate |
Definition at line 554 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), ProvidesFrontend(), SetFrontend(), and SetPowerSaveMode().
|
private |
Definition at line 547 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), and SetChannel().
|
mutableprivate |
Definition at line 550 of file dvbdevice.c.
Referenced by cDvbTuner(), GetSignalQuality(), ProvidesFrontend(), and SetPowerSaveMode().
|
mutableprivate |
Definition at line 549 of file dvbdevice.c.
Referenced by cDvbTuner(), GetSignalQuality(), ProvidesFrontend(), and SetPowerSaveMode().
|
mutableprivate |
Definition at line 548 of file dvbdevice.c.
Referenced by cDvbTuner(), GetSignalQuality(), ProvidesFrontend(), and SetPowerSaveMode().
|
mutableprivate |
Definition at line 557 of file dvbdevice.c.
Referenced by cDvbTuner(), ExecuteDiseqc(), ProvidesFrontend(), and SetPowerSaveMode().
|
private |
Definition at line 560 of file dvbdevice.c.
Referenced by Action(), Locked(), and ~cDvbTuner().
|
private |
Definition at line 546 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), and SetFrontend().
|
mutableprivate |
Definition at line 559 of file dvbdevice.c.
Referenced by Action(), Locked(), ProvidesFrontend(), SetChannel(), and SetPowerSaveMode().
|
private |
Definition at line 561 of file dvbdevice.c.
Referenced by Action(), SetChannel(), and ~cDvbTuner().
|
private |
Definition at line 543 of file dvbdevice.c.
Referenced by cDvbTuner(), and NumProvidedSystems().
|
private |
Definition at line 544 of file dvbdevice.c.
Referenced by cDvbTuner(), and NumProvidedSystems().
|
private |
Definition at line 555 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), ExecuteDiseqc(), GetPositioner(), and Positioner().
|
private |
Definition at line 556 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), ExecuteDiseqc(), and SetFrontend().
|
private |
Definition at line 558 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), IsTunedTo(), Locked(), SetChannel(), SetPowerSaveMode(), and ~cDvbTuner().
|
private |
Definition at line 545 of file dvbdevice.c.
Referenced by Action(), cDvbTuner(), and SetFrontend().