13#include <linux/dvb/frontend.h>
14#include <linux/dvb/version.h>
17#define DVBAPIVERSION (DVB_API_VERSION << 8 | DVB_API_VERSION_MINOR)
19#if DVBAPIVERSION < 0x0500
20#error VDR requires Linux DVB driver API version 5.0 or higher!
25#if DVBAPIVERSION < 0x0501
34#if DVBAPIVERSION < 0x0502
40#if DVBAPIVERSION < 0x0503
56#if DVBAPIVERSION < 0x0505
57#define DTV_ENUM_DELSYS 44
60#if DVBAPIVERSION < 0x0508
64#define DTV_STREAM_ID 42
65#define DTV_DVBT2_PLP_ID_LEGACY 43
70#define DEV_VIDEO "/dev/video"
71#define DEV_DVB_BASE "/dev/dvb"
72#define DEV_DVB_ADAPTER "adapter"
73#define DEV_DVB_OSD "osd"
74#define DEV_DVB_FRONTEND "frontend"
75#define DEV_DVB_DVR "dvr"
76#define DEV_DVB_DEMUX "demux"
77#define DEV_DVB_VIDEO "video"
78#define DEV_DVB_AUDIO "audio"
79#define DEV_DVB_CA "ca"
161 bool Parse(
const char *s);
167int DvbOpen(
const char *Name,
int Adapter,
int Frontend,
int Mode,
bool ReportError =
false);
244 virtual bool SignalStats(
int &Valid,
double *Strength = NULL,
double *Cnr = NULL,
double *BerPre = NULL,
double *BerPost = NULL,
double *Per = NULL,
int *Status = NULL)
const override;
254 virtual bool HasLock(
int TimeoutMs = 0)
const override;
264 virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask)
override;
270 virtual bool HasCi(
void)
override;
289 virtual bool OpenDvr(
void)
override;
290 virtual void CloseDvr(
void)
override;
306 virtual bool Probe(
int Adapter,
int Frontend) = 0;
int Priority(bool IgnoreOccupied=false) const
Returns the priority of the current receiving session (-MAXPRIORITY..MAXPRIORITY),...
virtual ~cDvbDeviceProbe() override
static uint32_t GetSubsystemId(int Adapter, int Frontend)
virtual bool Probe(int Adapter, int Frontend)=0
Probes for a DVB device at the given Adapter and creates the appropriate object derived from cDvbDevi...
The cDvbDevice implements a DVB device which can be accessed through the Linux DVB driver API.
virtual bool ProvidesChannel(const cChannel *Channel, int Priority=IDLEPRIORITY, bool *NeedsDetachReceivers=NULL) const override
Returns true if this device can provide the given channel.
static void UnBondDevices(void)
Unbonds all devices.
virtual bool ProvidesTransponder(const cChannel *Channel) const override
Returns true if this device can provide the transponder of the given Channel (which implies that it c...
static void SetTransferModeForDolbyDigital(int Mode)
virtual bool OpenDvr(void) override
Opens the DVR of this device and prepares it to deliver a Transport Stream for use in a cReceiver.
cDvbDevice(int Adapter, int Frontend)
virtual cString DeviceType(void) const override
Returns a string identifying the type of this device (like "DVB-S").
virtual const cPositioner * Positioner(void) const override
Returns a pointer to the positioner (if any) this device has used to move the satellite dish to the r...
virtual const cChannel * GetCurrentlyTunedTransponder(void) const override
Returns a pointer to the currently tuned transponder.
virtual cString DeviceName(void) const override
Returns a string identifying the name of this device.
virtual void CloseDvr(void) override
Shuts down the DVR.
static bool Exists(int Adapter, int Frontend)
Checks whether the given adapter/frontend exists.
static bool BondDevices(const char *Bondings)
Bonds the devices as defined in the given Bondings string.
static bool useDvbDevices
virtual bool IsBonded(void) const override
Returns true if this device is bonded to an other device.
virtual bool MaySwitchTransponder(const cChannel *Channel) const override
Returns true if it is ok to switch to the Channel's transponder on this device, without disturbing an...
static bool Initialize(void)
Initializes the DVB devices.
void UnBond(void)
Removes this device from any bonding it might have with other devices.
virtual bool GetTSPacket(uchar *&Data) override
Gets exactly one TS packet from the DVR of this device and returns a pointer to it in Data.
virtual int NumProvidedSystems(void) const override
Returns the number of individual "delivery systems" this device provides.
bool BondingOk(const cChannel *Channel, bool ConsiderOccupied=false) const
Returns true if this device is either not bonded to any other device, or the given Channel is on the ...
virtual void DetachAllReceivers(void) override
Detaches all receivers from this device.
cTSBuffer * tsBuffer
< Controls how the DVB device handles Transfer Mode when replaying Dolby Digital audio.
virtual bool SetPid(cPidHandle *Handle, int Type, bool On) override
Does the actual PID setting on this device.
bool needsDetachBondedReceivers
virtual bool HasLock(int TimeoutMs=0) const override
Returns true if the device has a lock on the requested transponder.
static int setTransferModeForDolbyDigital
virtual bool ProvidesSource(int Source) const override
Returns true if this device can provide the given source.
virtual int SignalQuality(void) const override
Returns the "quality" of the currently received signal.
bool Bond(cDvbDevice *Device)
Bonds this device with the given Device, making both of them use the same satellite cable and LNB.
virtual bool ProvidesDeliverySystem(int DeliverySystem) const
virtual void CloseFilter(int Handle) override
Closes a file handle that has previously been opened by OpenFilter().
virtual int SignalStrength(void) const override
Returns the "strength" of the currently received signal.
virtual bool ProvidesEIT(void) const override
Returns true if this device provides EIT data and thus wants to be tuned to the channels it can recei...
virtual bool IsTunedToTransponder(const cChannel *Channel) const override
Returns true if this device is currently tuned to the given Channel's transponder.
cDvbDevice * bondedDevice
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView) override
Sets the device to the given channel (actual physical setup).
virtual ~cDvbDevice() override
static bool Probe(int Adapter, int Frontend)
Probes for existing DVB devices.
virtual bool SignalStats(int &Valid, double *Strength=NULL, double *Cnr=NULL, double *BerPre=NULL, double *BerPost=NULL, double *Per=NULL, int *Status=NULL) const override
Returns statistics about the currently received signal (if available).
virtual bool HasCi(void) override
Returns true if this device has a Common Interface.
virtual void SetPowerSaveMode(bool On) override
Puts the device into power save mode, if applicable.
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask) override
Opens a file handle for the given filter data.
cString ToString(char Type) const
const char * ParseParameter(const char *s, int &Value, const tDvbParameterMap *Map=NULL)
char Polarization(void) const
void SetSystem(int System)
void SetSisoMiso(int SisoMiso)
void SetModulation(int Modulation)
void SetInversion(int Inversion)
int T2SystemId(void) const
void SetRollOff(int RollOff)
friend class cDvbSourceParam
void SetCoderateL(int CoderateL)
void SetCoderateH(int CoderateH)
void SetT2SystemId(int T2SystemId)
bool Parse(const char *s)
void SetBandwidth(int Bandwidth)
int PrintParameter(char *p, char Name, int Value) const
int CoderateL(void) const
void SetPolarization(char Polarization)
int Transmission(void) const
int Bandwidth(void) const
void SetTransmission(int Transmission)
int Inversion(void) const
cDvbTransponderParameters(const char *Parameters=NULL)
void SetHierarchy(int Hierarchy)
int Modulation(void) const
void SetStreamId(int StreamId)
int Hierarchy(void) const
int CoderateH(void) const
cListObject(const cListObject &ListObject)
A steerable satellite dish generally points to the south on the northern hemisphere,...
Derived cDevice classes that can receive channels will have to provide Transport Stream (TS) packets ...
const tDvbParameterMap CoderateValues[]
const tDvbParameterMap PilotValues[]
const tDvbParameterMap GuardValues[]
const tDvbParameterMap SystemValuesSat[]
const tDvbParameterMap HierarchyValues[]
const tDvbParameterMap BandwidthValues[]
cList< cDvbDeviceProbe > DvbDeviceProbes
const tDvbParameterMap TransmissionValues[]
const tDvbParameterMap InversionValues[]
const tDvbParameterMap RollOffValues[]
const tDvbParameterMap ModulationValues[]
const tDvbParameterMap SystemValuesTerr[]
int DvbOpen(const char *Name, int Adapter, int Frontend, int Mode, bool ReportError=false)
int DriverIndex(int Value, const tDvbParameterMap *Map)
cString DvbName(const char *Name, int Adapter, int Frontend)
int MapToUser(int Value, const tDvbParameterMap *Map, const char **String=NULL)
int UserIndex(int Value, const tDvbParameterMap *Map)
const char * MapToUserString(int Value, const tDvbParameterMap *Map)
int MapToDriver(int Value, const tDvbParameterMap *Map)