mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Original announce message: VDR developer version 1.7.19 is now available at ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.19.tar.bz2 A 'diff' against the previous version is available at ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.18-1.7.19.diff MD5 checksums: 1eb04ecdc2b11ab8641ebfaa2cb93f42 vdr-1.7.19.tar.bz2 db16ce7bb51e0db837ed56ef4744a67e vdr-1.7.18-1.7.19.diff WARNING: ======== This is a developer version. Even though I use it in my productive environment. I strongly recommend that you only use it under controlled conditions and for testing and debugging. This version introduces functions to determine the "signal strength" and "signal quality" through cDevice. If you are using a DVB card that contains an stb0899 frontend chip (like the TT-budget S2-3200) you may want to apply the patches from ftp://ftp.tvdr.de/vdr/Developer/Driver-Patches to the LinuxDVB driver source in order to receive useful results from that frontend. Since apparently the various frontend drivers return different maximum values in their FE_READ_SIGNAL_STRENGTH and FE_READ_SNR functions (some deliver a value in the range 0x0000...0xFFFF, while others return values as "dB/10" or "dBm/10" (the latter with an offset to make the value positive, since the parameter is unsigned), the functions cDvbTuner::GetSignalStrength() and cDvbTuner::GetSignalQuality() use the device's "subsystem ID" to map these values into the range 0...100, which is the normalized return value of these functions. Take a look at these two functions and maybe remove the comment characters from the lines //#define DEBUG_SIGNALSTRENGTH //#define DEBUG_SIGNALQUALITY in dvbdevice.c to get some debug output if your device doesn't return any directly useful values and may have to be added appropriately to the 'switch (subsystemId)' statement. The channel display of the 'sttng' skin uses these values to implement a signal strength/quality display. From the HISTORY file: - Fixed cString's operator=(const char *String) in case the given string is the same as the existing one (thanks to Dirk Leber). - Avoiding a gcc 4.6 compiler error in the skincurses plugin (thanks to Tobias Grimm). - TsGetPayload() now checks if there actually is a payload in the given TS packet (reported by Dirk Leber). - Now sorting the source file names in the call to xgettext, to make sure the results are not dependent on the sequence of the files. Plugin authors may want to change the line containing the xgettext call in their Makefile accordingly by changing "$^" to "`ls $^`". - The primary device is now only avoided for recording if it is an old SD full featured card. This is done through the new function cDevice::AvoidRecording(). - Subtitle PIDs are now also decrypted (thanks to Reinhard Nissl). - Fixed a possible race condition in cDiseqc::Execute() (reported by Marco Göbenich). The return value of cDiseqcs::Get() is now const, so plugin authors may need to adjust their code if they use this function. - The new functions cDevice::SignalStrength() and cDevice::SignalQuality() can be used to determine the signal strength and quality of a given device (thanks to Rolf Ahrenberg for some input on how to use BER and UNC values to generate a "quality" value). - The 'sttng' skin now displays two colored bars at the bottom of the channel display, indicating the strength (upper bar) and quality (lower bar) of the received signal. The number to the left of these bars indicates the actual device the current channel is being received with. - Fixed detecting frames in case the Picture Start Code or Access Unit Delimiter extends over TS packet boundaries (reported by Johan Andersson). In order to fix this, the semantics of cFrameDetector had to be changed a little. See cRecorder::Action() and cIndexFileGenerator::Action() on how to use the new cFrameDetector::NewPayload() function. - The frame detector now only starts collecting PTS values after it has seen the first I-frame, otherwise it might get MaxPtsValues values and stop analyzing even though the incoming data is still garbage (reported by Derek Kelly). - The info file of a recording is now only overwritten with a new fps value if that new value is not the default value (thanks to Derek Kelly for reporting a problem with the fps value being overwritten in case a recording was interrupted and resumed, and the fps value could not be determined after resuming recording). - The initial channel is now stored by the channel ID in the setup.conf file, in order to avoid problems in case channels are reordered or deleted (reported by Lars Bläser). - Added support for "content identifier descriptor" and "default authority descriptor" to 'libsi' (thanks to Dave Pickles).
211 lines
7.0 KiB
C++
211 lines
7.0 KiB
C++
/*
|
|
* dvbdevice.h: The DVB device tuner interface
|
|
*
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
* how to reach the author.
|
|
*
|
|
* $Id: dvbdevice.h 2.15 2011/06/02 13:20:05 kls Exp $
|
|
*/
|
|
|
|
#ifndef __DVBDEVICE_H
|
|
#define __DVBDEVICE_H
|
|
|
|
#include <sys/mman.h> // FIXME: workaround for broken linux-dvb header files
|
|
#include <linux/dvb/frontend.h>
|
|
#include <linux/dvb/version.h>
|
|
#include "device.h"
|
|
|
|
#if DVB_API_VERSION < 5
|
|
#error VDR requires Linux DVB driver API version 5.0 or higher!
|
|
#endif
|
|
|
|
#define MAXDVBDEVICES 8
|
|
|
|
#define DEV_VIDEO "/dev/video"
|
|
#define DEV_DVB_ADAPTER "/dev/dvb/adapter"
|
|
#define DEV_DVB_OSD "osd"
|
|
#define DEV_DVB_FRONTEND "frontend"
|
|
#define DEV_DVB_DVR "dvr"
|
|
#define DEV_DVB_DEMUX "demux"
|
|
#define DEV_DVB_VIDEO "video"
|
|
#define DEV_DVB_AUDIO "audio"
|
|
#define DEV_DVB_CA "ca"
|
|
|
|
struct tDvbParameterMap {
|
|
int userValue;
|
|
int driverValue;
|
|
const char *userString;
|
|
};
|
|
|
|
const char *MapToUserString(int Value, const tDvbParameterMap *Map);
|
|
int MapToUser(int Value, const tDvbParameterMap *Map, const char **String = NULL);
|
|
int MapToDriver(int Value, const tDvbParameterMap *Map);
|
|
int UserIndex(int Value, const tDvbParameterMap *Map);
|
|
int DriverIndex(int Value, const tDvbParameterMap *Map);
|
|
|
|
extern const tDvbParameterMap InversionValues[];
|
|
extern const tDvbParameterMap BandwidthValues[];
|
|
extern const tDvbParameterMap CoderateValues[];
|
|
extern const tDvbParameterMap ModulationValues[];
|
|
extern const tDvbParameterMap SystemValues[];
|
|
extern const tDvbParameterMap TransmissionValues[];
|
|
extern const tDvbParameterMap GuardValues[];
|
|
extern const tDvbParameterMap HierarchyValues[];
|
|
extern const tDvbParameterMap RollOffValues[];
|
|
|
|
class cDvbTransponderParameters {
|
|
friend class cDvbSourceParam;
|
|
private:
|
|
char polarization;
|
|
int inversion;
|
|
int bandwidth;
|
|
int coderateH;
|
|
int coderateL;
|
|
int modulation;
|
|
int system;
|
|
int transmission;
|
|
int guard;
|
|
int hierarchy;
|
|
int rollOff;
|
|
int PrintParameter(char *p, char Name, int Value) const;
|
|
const char *ParseParameter(const char *s, int &Value, const tDvbParameterMap *Map);
|
|
public:
|
|
cDvbTransponderParameters(const char *Parameters = NULL);
|
|
char Polarization(void) const { return polarization; }
|
|
int Inversion(void) const { return inversion; }
|
|
int Bandwidth(void) const { return bandwidth; }
|
|
int CoderateH(void) const { return coderateH; }
|
|
int CoderateL(void) const { return coderateL; }
|
|
int Modulation(void) const { return modulation; }
|
|
int System(void) const { return system; }
|
|
int Transmission(void) const { return transmission; }
|
|
int Guard(void) const { return guard; }
|
|
int Hierarchy(void) const { return hierarchy; }
|
|
int RollOff(void) const { return rollOff; }
|
|
void SetPolarization(char Polarization) { polarization = Polarization; }
|
|
void SetInversion(int Inversion) { inversion = Inversion; }
|
|
void SetBandwidth(int Bandwidth) { bandwidth = Bandwidth; }
|
|
void SetCoderateH(int CoderateH) { coderateH = CoderateH; }
|
|
void SetCoderateL(int CoderateL) { coderateL = CoderateL; }
|
|
void SetModulation(int Modulation) { modulation = Modulation; }
|
|
void SetSystem(int System) { system = System; }
|
|
void SetTransmission(int Transmission) { transmission = Transmission; }
|
|
void SetGuard(int Guard) { guard = Guard; }
|
|
void SetHierarchy(int Hierarchy) { hierarchy = Hierarchy; }
|
|
void SetRollOff(int RollOff) { rollOff = RollOff; }
|
|
cString ToString(char Type) const;
|
|
bool Parse(const char *s);
|
|
};
|
|
|
|
class cDvbTuner;
|
|
|
|
/// The cDvbDevice implements a DVB device which can be accessed through the Linux DVB driver API.
|
|
|
|
class cDvbDevice : public cDevice {
|
|
protected:
|
|
static cString DvbName(const char *Name, int Adapter, int Frontend);
|
|
static int DvbOpen(const char *Name, int Adapter, int Frontend, int Mode, bool ReportError = false);
|
|
private:
|
|
static bool Exists(int Adapter, int Frontend);
|
|
///< Checks whether the given adapter/frontend exists.
|
|
static bool Probe(int Adapter, int Frontend);
|
|
///< Probes for existing DVB devices.
|
|
public:
|
|
static bool Initialize(void);
|
|
///< Initializes the DVB devices.
|
|
///< Must be called before accessing any DVB functions.
|
|
///< \return True if any devices are available.
|
|
protected:
|
|
int adapter, frontend;
|
|
private:
|
|
dvb_frontend_info frontendInfo;
|
|
int numProvidedSystems;
|
|
fe_delivery_system frontendType;
|
|
int fd_dvr, fd_ca;
|
|
public:
|
|
cDvbDevice(int Adapter, int Frontend);
|
|
virtual ~cDvbDevice();
|
|
virtual bool Ready(void);
|
|
|
|
// Common Interface facilities:
|
|
|
|
private:
|
|
cCiAdapter *ciAdapter;
|
|
|
|
// Channel facilities
|
|
|
|
private:
|
|
cDvbTuner *dvbTuner;
|
|
public:
|
|
virtual bool ProvidesSource(int Source) const;
|
|
virtual bool ProvidesTransponder(const cChannel *Channel) const;
|
|
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const;
|
|
virtual int NumProvidedSystems(void) const;
|
|
virtual int SignalStrength(void) const;
|
|
virtual int SignalQuality(void) const;
|
|
virtual const cChannel *GetCurrentlyTunedTransponder(void) const;
|
|
virtual bool IsTunedToTransponder(const cChannel *Channel);
|
|
protected:
|
|
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
|
|
public:
|
|
virtual bool HasLock(int TimeoutMs = 0);
|
|
|
|
// PID handle facilities
|
|
|
|
protected:
|
|
virtual bool SetPid(cPidHandle *Handle, int Type, bool On);
|
|
|
|
// Section filter facilities
|
|
|
|
protected:
|
|
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
|
|
virtual void CloseFilter(int Handle);
|
|
|
|
// Common Interface facilities:
|
|
|
|
public:
|
|
virtual bool HasCi(void);
|
|
|
|
// Audio facilities
|
|
|
|
protected:
|
|
static int setTransferModeForDolbyDigital;
|
|
public:
|
|
static void SetTransferModeForDolbyDigital(int Mode); // needs to be here for backwards compatibilty
|
|
///< Controls how the DVB device handles Transfer Mode when replaying
|
|
///< Dolby Digital audio.
|
|
///< 0 = don't set "audio bypass" in driver/firmware, don't force Transfer Mode
|
|
///< 1 = set "audio bypass" in driver/firmware, force Transfer Mode (default)
|
|
///< 2 = don't set "audio bypass" in driver/firmware, force Transfer Mode
|
|
|
|
// Receiver facilities
|
|
|
|
private:
|
|
cTSBuffer *tsBuffer;
|
|
protected:
|
|
virtual bool OpenDvr(void);
|
|
virtual void CloseDvr(void);
|
|
virtual bool GetTSPacket(uchar *&Data);
|
|
};
|
|
|
|
// A plugin that implements a DVB device derived from cDvbDevice needs to create
|
|
// a cDvbDeviceProbe derived object on the heap in order to have its Probe()
|
|
// function called, where it can actually create the appropriate device.
|
|
// The cDvbDeviceProbe object must be created in the plugin's constructor,
|
|
// and deleted in its destructor.
|
|
|
|
class cDvbDeviceProbe : public cListObject {
|
|
public:
|
|
cDvbDeviceProbe(void);
|
|
virtual ~cDvbDeviceProbe();
|
|
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 cDvbDevice if applicable.
|
|
///< Returns true if a device has been created.
|
|
};
|
|
|
|
extern cList<cDvbDeviceProbe> DvbDeviceProbes;
|
|
|
|
#endif //__DVBDEVICE_H
|