mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
- Added Macedonian language texts (thanks to Dimitar Petrovski). - Updated the Estonian OSD texts (thanks to Arthur Konovalov). - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Added handling of EnhancedAC3DescriptorTag (thanks to Eric Valette). - The default SVDRP port is now 6419 (registered with ICANN/IANA by Christian Tramnitz). Use '-p 2001' to switch back to the old port if necessary. - Updated the Italian OSD texts (thanks to Diego Pierotto). - cDvbDevice::ProvidesTransponder() now checks the modulation capabilities of the device (as far as the driver allows this). - Fixed cFrameDetector::Analyze() in case part of the data has been processed and there is less than MIN_TS_PACKETS_FOR_FRAME_DETECTOR left (reported by Derek Kelly). - Added a note about not deleting cDeviceHook objects to device.h. - Added user defined key kUser0 (suggested by Ulf Kiener). - Include paths are now added instead of overwriting INCLUDES in the Makefile (thanks to Paul Menzel). - The various modulation types are now taken into account when selecting a device for a recording or live viewing, so that devices that provide more capabilities are spared. - Fixed generating PMT language descriptors for multi language PIDs (thanks to Rolf Ahrenberg). - Transponders that use "8psk turbo fec" (a non-standard mode used by North American providers) are now identified by assuming that all 8psk transponders on DVB-S use "turbo fec". In order to determine whether a certain device can handle "turbo fec", the new driver flag FE_CAN_TURBO_FEC is checked. If your device can handle "turbo fec", and your driver doesn't have that flag, yet, you can apply the patch from ftp://ftp.tvdr.de/vdr/Developer/v4l-dvb-add-FE_CAN_TURBO_FEC.diff. A temporary macro in dvbdevice.c defines the flag for all those who don't need this in the driver, so that they can continue using an unmodified driver. Thanks to Derek Kelly for testing this. - Updated the Ukrainian OSD texts (thanks to Yarema Aka Knedlyk). - Fixed handling "none" color entries in XPM files (thanks to Thomas Günther). - Fixed a crash when creating a new channel if the channel list is empty (reported by Halim Sahin). - Updated the Czech OSD texts (thanks to Radek Stastny). - Fixed a possible out of buffer memory access in case of bad TS data (reported by Rolf Ahrenberg). - Implemented handling of HD resolution subtitles according to v1.3.1 of ETSI EN 300 743, chapter 7.2.1 (thanks to Rolf Ahrenberg). - The EPG data now handles stream components 5 (H.264-video) and 6 (HEAAC-audio). - Fixed a problem with external Dolby Digital processing via the '-a' option in live mode and with TS recordings (reported by Christopher Reimer). - Added handling MPEG audio types "ISO/IEC 14496-3 Audio with LATM transport syntax" and "ISO/IEC 13818-7 Audio with ADTS transport syntax" (suggested by Luis Fernandes). See man vdr(5) on how the APID section of channels has been extended to store this information. - Added detecting channels that use service type 0x16. - Added full handling of the stream types of Dolby Digital pids (thanks to Jose Alberto Reguero). - The new setup option "OSD/Number keys for characters" can be used to control whether the number keys can be used to enter characters in a text input field (suggested by Stefan Huskamp).
208 lines
6.8 KiB
C++
208 lines
6.8 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.14 2010/04/11 10:29:37 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 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();
|
|
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
|