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.28 is now available at ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.28.tar.bz2 A 'diff' against the previous version is available at ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.27-1.7.28.diff MD5 checksums: 3ccff2dcc42d112e23dd64f2c39f02f1 vdr-1.7.28.tar.bz2 7249ead4aca4b24e53d49d11c67e1613 vdr-1.7.27-1.7.28.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. The new default skin "LCARS" displays the signal strengths and qualities of all devices in its main menu. For devices that have an stb0899 frontend chip (like the TT-budget S2-3200) retrieving this information from the driver is rather slow, which results in a sluggish response to user input in the main menu. To speed this up you may want to apply the patches from From the HISTORY file: - Fixed cPixmapMemory::DrawEllipse() for quadrants -1 and -4. - Fixed getting the maximum short channel name length in case there are no short names at all (reported by Derek Kelly). - The new function cDevice::DeviceType() returns a string identifying the type of the given device. - Now limiting the number of characters of a channel's (short) name to 16 in the schedules menus, to keep that column from getting overly wide in case there is a channel with a very long name that has no short name. - Fixed EPG scan on systems with only a single DVB device that use software output (reported by Juergen Lock). - Skins can now inquire the menu category for which their cSkinDisplayMenu is currently being used. This can be done either through a call to cSkinDisplayMenu::MenuCategory() or by reimplementing cSkinDisplayMenu::SetMenuCategory(). This information allows a skin to use special icons or decorations for the various types of menus in VDR. - The new setup option "DVB/Standard compliance" can be used to switch between different variations of the DVB standard (thanks to Rolf Ahrenberg). Currently there is "DVB" (for the original DVB standard) and "ANSI/SCTE", which is used to properly handle certain private stream types. - The disk usage is no longer automatically added to the title of the main and "Recordings" menus. This has always been a mekeshift solution and it is now up to the individual skin if, where and how it wants to display this information. A skin can use the new cVideoDiskUsage class to implement such a display. For compatibility, the default skins "Classic VDR", "ST:TNG Panels" and "Text mode" (i.e. curses) have been changed to behave like before. Other skins may want to display the disk usage in totally different ways. - A cOsdMenu can now handle skins that display different numbers of items in the various menu categories. - OSD and skin are now reinitialized after a plugin setup page has been confirmed, to have them react immediately in case any change to a plugin's setup parameter has an effect on the OSD. - The Timers list is now marked as modified whenever a recording starts or ends. - Fixed cDevice::StillPicture(), making sure it doesn't call the derived class's function if no buffer has been allocated (reported by Marcus Roscher). - Fixed the SVDRP command UPDR, which didn't update the global recordings list (reported by Lars Hanisch). - cControl::Control() now has an additional boolean parameter, which can be set to true to get the current player control even if it is hidden. - The new functions cControl::GetRecording() and cControl::GetHeader() can be used to retrieve information about what the current player is playing. - Fixed a possible high CPU load when pausing replay (thanks to Reinhard Nissl). - Fixed character comparisons in cSubtitleObject::DecodeCharacterString() (reported by Reinhard Mantey). - Renamed the function cString::sprintf(const char *fmt, va_list &ap) to vsprintf(), because it might inadvertently be called with a 'char *' as the second argument on some compilers and cause a crash (reported by Sundararaj Reel). - Removed the "bondedMasterFailed" mechanism from cDvbTuner, because it caused problems with the EPG scan in case a transponder is not receivable in a setup with bonded devices (reported by Michael Schneider). - Making sure setup strings don't contain any newline characters (thanks to Joachim Wilke). - The new member function cSkinDisplayReplay::SetRecording() allows a skin to display more information about the currently played recording. - Fixed a mismatched 'delete' in cSchedules::SetEpgDataFileName() (thanks to Reinhard Mantey). - The DrawText() functions of the OSD now accept the new alignment flag taBorder, which triggers keeping a proper distance from the edge that taLeft or taRight aligns to. - Fixed checking for UTF-8 support in cFont::Bidi() (reported by Torsten Lang). - If a recording has no info file, the 'title' of the recording's info is now set to the recording's name. - cVector::Clear() now reinitializes any previously used members. - Fixed resetting CAMs (thanks to Marco Skambraks). - The new function RgbShade() (include osd.h) can be used to generate a brighter or darker version of a given color. - The new class cSortedTimers can be used to quickly get a list of all timers, sorted by their start time. - The new skin "LCARS" is an enhanced version of the "ST:TNG" skin (which is still there in its original layout, for those who don't like the LCARS skin, or can't use it due to OSD limitations). The LCARS skin utilizes the new "menu category" feature to display additional information on the main menu page. It shows upcoming timers and the system's devices, as well as which device is recording which timers. The upper pane of the main menu displays the programme data in live and replay mode, and a progress bar. An indicator on the right side of the device list shows which device is currently used for live viewing, and whether it is in transfer mode. The individual device displays show the device number, the device type, which CAM (if any ) is currently assigned to the device, and the signal strength and quality. On the left side of the OSD there is a permanent display of the current date and time, the disk usage and the system load. "LCARS" is the new default skin of VDR. It requires at least a 4bpp (16 color) full screen OSD, but you can still operate it if your OSD can handle only fewer colors (in which case you may want to switch to the "ST:TNG" or "Classic VDR" skin). - Finally removed the code marked with __RECORDING_H_DEPRECATED_DIRECT_MEMBER_ACCESS and LEGACY_CRECEIVER. - Now making sure that the "small font" is never larger than the "osd font". - Fixed font handling with fontconfig 2.9.0 or newer (thanks to Joerg Bornkessel). - Extended the interface to the script that gets called for recordings, so that in the "edited" case it also provides the name of the original recording (thanks to Christian Richter). - Added DeleteEvent() to the EPG handler interface, so that an EPG handler can trigger deleting of an event (thanks to Christian Kaiser). - Speeded up opening menus on systems with many (several thousands) of recordings, by caching the information whether a recording is stored on the video directory file system within the cRecording data (based on a patch from Torsten Lang).
256 lines
9.3 KiB
C++
256 lines
9.3 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.26 2012/03/31 11:13:31 kls Exp $
|
|
*/
|
|
|
|
#ifndef __DVBDEVICE_H
|
|
#define __DVBDEVICE_H
|
|
|
|
#include <linux/dvb/frontend.h>
|
|
#include <linux/dvb/version.h>
|
|
#include "device.h"
|
|
|
|
#if (DVB_API_VERSION << 8 | DVB_API_VERSION_MINOR) < 0x0503
|
|
#error VDR requires Linux DVB driver API version 5.3 or higher!
|
|
#endif
|
|
|
|
#define MAXDVBDEVICES 8
|
|
#define MAXDELIVERYSYSTEMS 8
|
|
|
|
#define DEV_VIDEO "/dev/video"
|
|
#define DEV_DVB_BASE "/dev/dvb"
|
|
#define DEV_DVB_ADAPTER "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 SystemValuesSat[];
|
|
extern const tDvbParameterMap SystemValuesTerr[];
|
|
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 plpId;
|
|
int PrintParameter(char *p, char Name, int Value) const;
|
|
const char *ParseParameter(const char *s, int &Value, const tDvbParameterMap *Map = NULL);
|
|
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; }
|
|
int PlpId(void) const { return plpId; }
|
|
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; }
|
|
void SetPlpId(int PlpId) { plpId = PlpId; }
|
|
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 deliverySystems[MAXDELIVERYSYSTEMS];
|
|
int numDeliverySystems;
|
|
int numModulations;
|
|
int fd_dvr, fd_ca;
|
|
static cMutex bondMutex;
|
|
cDvbDevice *bondedDevice;
|
|
mutable bool needsDetachBondedReceivers;
|
|
bool QueryDeliverySystems(int fd_frontend);
|
|
public:
|
|
cDvbDevice(int Adapter, int Frontend);
|
|
virtual ~cDvbDevice();
|
|
int Adapter(void) const { return adapter; }
|
|
int Frontend(void) const { return frontend; }
|
|
virtual bool Ready(void);
|
|
virtual cString DeviceType(void) const;
|
|
virtual cString DeviceName(void) const;
|
|
static bool BondDevices(const char *Bondings);
|
|
///< Bonds the devices as defined in the given Bondings string.
|
|
///< A bonding is a sequence of device numbers (starting at 1),
|
|
///< separated by '+' characters. Several bondings are separated by
|
|
///< commas, as in "1+2,3+4+5".
|
|
///< Returns false if an error occurred.
|
|
static void UnBondDevices(void);
|
|
///< Unbonds all devices.
|
|
bool Bond(cDvbDevice *Device);
|
|
///< Bonds this device with the given Device, making both of them use
|
|
///< the same satellite cable and LNB. Only DVB-S(2) devices can be
|
|
///< bonded. When this function is called, the calling device must
|
|
///< not be bonded to any other device. The given Device, however,
|
|
///< may already be bonded to an other device. That way several devices
|
|
///< can be bonded together.
|
|
///< Returns true if the bonding was successful.
|
|
void UnBond(void);
|
|
///< Removes this device from any bonding it might have with other
|
|
///< devices. If this device is not bonded with any other device,
|
|
///< nothing happens.
|
|
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 same satellite, polarization
|
|
///< and band as those the bonded devices are tuned to (if any).
|
|
///< If ConsiderOccupied is true, any bonded devices that are currently
|
|
///< occupied but not otherwise receiving will cause this function to
|
|
///< return false.
|
|
|
|
// Common Interface facilities:
|
|
|
|
private:
|
|
cCiAdapter *ciAdapter;
|
|
|
|
// Channel facilities
|
|
|
|
private:
|
|
cDvbTuner *dvbTuner;
|
|
public:
|
|
virtual bool ProvidesDeliverySystem(int DeliverySystem) const;
|
|
virtual bool ProvidesSource(int Source) const;
|
|
virtual bool ProvidesTransponder(const cChannel *Channel) const;
|
|
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = IDLEPRIORITY, bool *NeedsDetachReceivers = NULL) const;
|
|
virtual bool ProvidesEIT(void) 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) const;
|
|
virtual bool MaySwitchTransponder(const cChannel *Channel) const;
|
|
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 compatibility
|
|
///< 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);
|
|
virtual void DetachAllReceivers(void);
|
|
};
|
|
|
|
// 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
|