30#define MAXPIDHANDLES 64
31#define MAXRECEIVERS 16
33#define VOLUMEDELTA (MAXVOLUME / Setup.VolumeSteps)
34#define MAXOCCUPIEDTIMEOUT 99
76#define IS_AUDIO_TRACK(t) (ttAudioFirst <= (t) && (t) <= ttAudioLast)
77#define IS_DOLBY_TRACK(t) (ttDolbyFirst <= (t) && (t) <= ttDolbyLast)
78#define IS_SUBTITLE_TRACK(t) (ttSubtitleFirst <= (t) && (t) <= ttSubtitleLast)
104#define DTV_STAT_VALID_NONE 0x0000
105#define DTV_STAT_VALID_STRENGTH 0x0001
106#define DTV_STAT_VALID_CNR 0x0002
107#define DTV_STAT_VALID_BERPRE 0x0004
108#define DTV_STAT_VALID_BERPOST 0x0008
109#define DTV_STAT_VALID_PER 0x0010
110#define DTV_STAT_VALID_STATUS 0x0020
112#define DTV_STAT_HAS_NONE 0x0000
113#define DTV_STAT_HAS_SIGNAL 0x0001
114#define DTV_STAT_HAS_CARRIER 0x0002
115#define DTV_STAT_HAS_VITERBI 0x0004
116#define DTV_STAT_HAS_SYNC 0x0008
117#define DTV_STAT_HAS_LOCK 0x0010
214 virtual bool IsBonded(
void)
const {
return false; }
304 virtual bool SignalStats(
int &Valid,
double *Strength = NULL,
double *Cnr = NULL,
double *BerPre = NULL,
double *BerPost = NULL,
double *Per = NULL,
int *Status = NULL)
const;
360#ifndef DEPRECATED_SETCURRENTCHANNEL
361#define DEPRECATED_SETCURRENTCHANNEL 0
363#if DEPRECATED_SETCURRENTCHANNEL
382 virtual bool HasLock(
int TimeoutMs = 0)
const;
448 virtual int ReadFilter(
int Handle,
void *Buffer,
size_t Length);
488 virtual uchar *
GrabImage(
int &Size,
bool Jpeg =
true,
int Quality = -1,
int SizeX = -1,
int SizeY = -1);
500 bool GrabImageFile(
const char *FileName,
bool Jpeg =
true,
int Quality = -1,
int SizeX = -1,
int SizeY = -1);
520 virtual void GetVideoSize(
int &Width,
int &Height,
double &VideoAspect);
527 virtual void GetOsdSize(
int &Width,
int &Height,
double &PixelAspect);
787 virtual bool Flush(
int TimeoutMs = 0);
793 virtual int PlayPes(
const uchar *Data,
int Length,
bool VideoOnly =
false);
803 virtual int PlayTs(
const uchar *Data,
int Length,
bool VideoOnly =
false);
886 uchar *
Get(
int *Available = NULL,
bool CheckAvailable =
false);
virtual bool DeviceProvidesTransponder(const cDevice *Device, const cChannel *Channel) const
Returns true if the given Device can provide the given Channel's transponder.
cDeviceHook(void)
Creates a new device hook object.
virtual bool DeviceProvidesEIT(const cDevice *Device) const
Returns true if the given Device can provide EIT data.
virtual bool ProvidesTransponderExclusively(const cChannel *Channel) const
Returns true if this is the only device that is able to provide the given channel's transponder.
virtual bool SetPid(cPidHandle *Handle, int Type, bool On)
Does the actual PID setting on this device.
virtual bool ProvidesChannel(const cChannel *Channel, int Priority=IDLEPRIORITY, bool *NeedsDetachReceivers=NULL) const
Returns true if this device can provide the given channel.
virtual void Action(void)
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
bool Replaying(void) const
Returns true if we are currently replaying.
void SetKeepTracks(bool KeepTracks)
Controls whether the current audio and subtitle track settings shall be kept as they currently are,...
int currentAudioTrackMissingCount
void StopSectionHandler(void)
A device that has called StartSectionHandler() must call this function (typically in its destructor) ...
virtual int PlayAudio(const uchar *Data, int Length, uchar Id)
Plays the given data block as audio.
static bool WaitForAllDevicesReady(int Timeout=0)
Waits until all devices have become ready, or the given Timeout (seconds) has expired.
static cDevice * device[MAXDEVICES]
virtual void CloseDvr(void)
Shuts down the DVR.
void Detach(cReceiver *Receiver, bool ReleaseCam=true)
Detaches the given receiver from this device.
static bool UseDevice(int n)
Tells whether the device with the given card index shall be used in this instance of VDR.
bool SetCurrentSubtitleTrack(eTrackType Type, bool Manual=false)
Sets the current subtitle track to the given Type.
bool IsPrimaryDevice(void) const
virtual void CloseFilter(int Handle)
Closes a file handle that has previously been opened by OpenFilter().
virtual bool HasInternalCam(void)
Returns true if this device handles encrypted channels itself without VDR assistance.
virtual bool HasDecoder(void) const
Tells whether this device has an MPEG decoder.
bool GrabImageFile(const char *FileName, bool Jpeg=true, int Quality=-1, int SizeX=-1, int SizeY=-1)
Calls GrabImage() and stores the resulting image in a file with the given name.
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask)
Opens a file handle for the given filter data.
eSetChannelResult SetChannel(const cChannel *Channel, bool LiveView)
Sets the device to the given channel (general setup).
virtual void SetVolumeDevice(int Volume)
Sets the audio volume on this device (Volume = 0...255).
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView)
Sets the device to the given channel (actual physical setup).
void StartSectionHandler(void)
A derived device that provides section data must call this function (typically in its constructor) to...
virtual bool IsPlayingVideo(void) const
Returns true if the currently attached player has delivered any video packets.
virtual void SetSubtitleTrackDevice(eTrackType Type)
Sets the current subtitle track to the given value.
static cList< cDeviceHook > deviceHooks
virtual cSpuDecoder * GetSpuDecoder(void)
Returns a pointer to the device's SPU decoder (or NULL, if this device doesn't have an SPU decoder).
cMutex mutexCurrentAudioTrack
int NumSubtitleTracks(void) const
Returns the number of subtitle tracks that are currently available.
virtual bool SignalStats(int &Valid, double *Strength=NULL, double *Cnr=NULL, double *BerPre=NULL, double *BerPost=NULL, double *Per=NULL, int *Status=NULL) const
Returns statistics about the currently received signal (if available).
void ReleaseCamSlot(void)
Releases the CAM slot if it is currently not used.
virtual int ReadFilter(int Handle, void *Buffer, size_t Length)
Reads data from a handle for the given filter.
virtual int64_t GetSTC(void)
Gets the current System Time Counter, which can be used to synchronize audio, video and subtitles.
virtual bool CanReplay(void) const
Returns true if this device can currently start a replay session.
bool HasPid(int Pid) const
Returns true if this device is currently receiving the given PID.
static cDevice * GetDevice(const cChannel *Channel, int Priority, bool LiveView, bool Query=false)
Returns a device that is able to receive the given Channel at the given Priority, with the least impa...
virtual uchar * GrabImage(int &Size, bool Jpeg=true, int Quality=-1, int SizeX=-1, int SizeY=-1)
Grabs the currently visible screen image.
virtual bool MaySwitchTransponder(const cChannel *Channel) const
Returns true if it is ok to switch to the Channel's transponder on this device, without disturbing an...
bool autoSelectPreferredSubtitleLanguage
virtual int PlayTsAudio(const uchar *Data, int Length)
Plays the given data block as audio.
virtual bool ProvidesEIT(void) const
Returns true if this device provides EIT data and thus wants to be tuned to the channels it can recei...
void SetCamSlot(cCamSlot *CamSlot)
Sets the given CamSlot to be used with this device.
virtual int PlayPesPacket(const uchar *Data, int Length, bool VideoOnly=false)
Plays the single PES packet in Data with the given Length.
static cDevice * PrimaryDevice(void)
Returns the primary device.
eTrackType currentSubtitleTrack
eTrackType GetCurrentSubtitleTrack(void) const
virtual bool Poll(cPoller &Poller, int TimeoutMs=0)
Returns true if the device itself or any of the file handles in Poller is ready for further action.
virtual void SetDigitalAudioDevice(bool On)
Tells the output device that the current audio track is Dolby Digital.
eTrackType GetCurrentAudioTrack(void) const
void SetOccupied(int Seconds)
Sets the occupied timeout for this device to the given number of Seconds, This can be used to tune a ...
bool DeviceHooksProvidesEIT(void) const
bool SwitchChannel(const cChannel *Channel, bool LiveView)
Switches the device to the given Channel, initiating transfer mode if necessary.
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices - 1).
virtual int PlayTsVideo(const uchar *Data, int Length)
Plays the given data block as video.
virtual void Clear(void)
Clears all video and audio data from the device.
virtual void Mute(void)
Turns off audio while replaying.
void Detach(cPlayer *Player)
Detaches the given player from this device.
virtual cString DeviceName(void) const
Returns a string identifying the name of this device.
void DelPid(int Pid, ePidType PidType=ptOther)
Deletes a PID from the set of PIDs this device shall receive.
bool AttachReceiver(cReceiver *Receiver)
Attaches the given receiver to this device.
static void SetUseDevice(int n)
Sets the 'useDevice' flag of the given device.
static int CurrentChannel(void)
Returns the number of the current channel on the primary device.
virtual bool AvoidRecording(void) const
Returns true if this device should only be used for recording if no other device is available.
virtual void SetAudioChannelDevice(int AudioChannel)
Sets the audio channel to stereo (0), mono left (1) or mono right (2).
virtual void GetOsdSize(int &Width, int &Height, double &PixelAspect)
Returns the Width, Height and PixelAspect ratio the OSD should use to best fit the resolution of the ...
bool Receiving(bool Dummy=false) const
Returns true if we are currently receiving. The parameter has no meaning (for backwards compatibility...
bool Transferring(void) const
Returns true if we are currently in Transfer Mode.
static cDevice * GetDeviceForTransponder(const cChannel *Channel, int Priority)
Returns a device that is not currently "occupied" and can be tuned to the transponder of the given Ch...
void StopReplay(void)
Stops the current replay session (if any).
void DetachAll(int Pid)
Detaches all receivers from this device for this pid.
virtual cRect CanScaleVideo(const cRect &Rect, int Alignment=taCenter)
Asks the output device whether it can scale the currently shown video in such a way that it fits into...
static cDevice * GetDevice(int Index)
Gets the device with the given Index.
virtual bool ProvidesSource(int Source) const
Returns true if this device can provide the given source.
virtual bool GetTSPacket(uchar *&Data)
Gets exactly one TS packet from the DVR of this device and returns a pointer to it in Data.
const cPatPmtParser * PatPmtParser(void) const
Returns a pointer to the patPmtParser, so that a derived device can use the stream information from i...
int GetAudioChannel(void)
Gets the current audio channel, which is stereo (0), mono left (1) or mono right (2).
int Occupied(void) const
Returns the number of seconds this device is still occupied for.
virtual int SignalStrength(void) const
Returns the "strength" of the currently received signal.
virtual void SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat)
Sets the video display format to the given one (only useful if this device has an MPEG decoder).
virtual int PlayTsSubtitle(const uchar *Data, int Length)
Plays the given data block as a subtitle.
const cSdtFilter * SdtFilter(void) const
virtual bool Flush(int TimeoutMs=0)
Returns true if the device's output buffers are empty, i.
void EnsureAudioTrack(bool Force=false)
Makes sure an audio track is selected that is actually available.
void Detach(cFilter *Filter)
Detaches the given filter from this device.
cSectionHandler * SectionHandler(void) const
eTrackType currentAudioTrack
virtual void SetVideoFormat(bool VideoFormat16_9)
Sets the output video format to either 16:9 or 4:3 (only useful if this device has an MPEG decoder).
cSectionHandler * sectionHandler
virtual const cChannel * GetCurrentlyTunedTransponder(void) const
Returns a pointer to the currently tuned transponder.
const tTrackId * GetTrack(eTrackType Type)
Returns a pointer to the given track id, or NULL if Type is not less than ttMaxTrackTypes.
static bool SwitchChannel(int Direction)
Switches the primary device to the next available channel in the given Direction (only the sign of Di...
static void SetCurrentChannel(int ChannelNumber)
Sets the number of the current channel on the primary device, without actually switching to it.
void SetVolume(int Volume, bool Absolute=false)
Sets the volume to the given value, either absolutely or relative to the current volume.
virtual int PlaySubtitle(const uchar *Data, int Length)
Plays the given data block as a subtitle.
virtual void DetachAllReceivers(void)
Detaches all receivers from this device.
virtual int NumProvidedSystems(void) const
Returns the number of individual "delivery systems" this device provides.
static void Shutdown(void)
Closes down all devices.
cDvbSubtitleConverter * dvbSubtitleConverter
static bool SetPrimaryDevice(int n)
Sets the primary device to 'n'.
void SetAudioChannel(int AudioChannel)
Sets the audio channel to stereo (0), mono left (1) or mono right (2).
static int NumDevices(void)
Returns the total number of devices.
virtual bool IsBonded(void) const
Returns true if this device is bonded to an other device.
virtual bool ProvidesTransponder(const cChannel *Channel) const
Returns true if this device can provide the transponder of the given Channel (which implies that it c...
virtual void SetAudioTrackDevice(eTrackType Type)
Sets the current audio track to the given value.
virtual cString DeviceType(void) const
Returns a string identifying the type of this device (like "DVB-S").
virtual bool HasDecoder(void) const
Tells whether this device has an MPEG decoder.
virtual bool OpenDvr(void)
Opens the DVR of this device and prepares it to deliver a Transport Stream for use in a cReceiver.
bool AttachPlayer(cPlayer *Player)
Attaches the given player to this device.
void ClrAvailableTracks(bool DescriptionsOnly=false, bool IdsOnly=false)
Clears the list of currently available tracks.
int Priority(void) const
Returns the priority of the current receiving session (-MAXPRIORITY..MAXPRIORITY),...
virtual void StillPicture(const uchar *Data, int Length)
Displays the given I-frame as a still picture.
virtual const cPositioner * Positioner(void) const
Returns a pointer to the positioner (if any) this device has used to move the satellite dish to the r...
virtual void Freeze(void)
Puts the device into "freeze frame" mode.
virtual void ScaleVideo(const cRect &Rect=cRect::Null)
Scales the currently shown video in such a way that it fits into the given Rect.
void EnsureSubtitleTrack(void)
Makes sure one of the preferred language subtitle tracks is selected.
static int CurrentVolume(void)
virtual bool HasLock(int TimeoutMs=0) const
Returns true if the device has a lock on the requested transponder.
int NumTracks(eTrackType FirstTrack, eTrackType LastTrack) const
Returns the number of tracks in the given range that are currently available.
void AttachFilter(cFilter *Filter)
Attaches the given filter to this device.
virtual bool HasIBPTrickSpeed(void)
Returns true if this device can handle all frames in 'fast forward' trick speeds.
virtual void TrickSpeed(int Speed, bool Forward)
Sets the device into a mode where replay is done slower.
cReceiver * receiver[MAXRECEIVERS]
virtual bool Ready(void)
Returns true if this device is ready.
virtual bool HasProgramme(void) const
Returns true if the device is currently showing any programme to the user, either through replaying o...
static int NextCardIndex(int n=0)
Calculates the next card index.
tTrackId availableTracks[ttMaxTrackTypes]
int CardIndex(void) const
Returns the card index of this device (0 ... MAXDEVICES - 1).
virtual int SignalQuality(void) const
Returns the "quality" of the currently received signal.
cCamSlot * CamSlot(void) const
Returns the CAM slot that is currently used with this device, or NULL if no CAM slot is in use.
bool SetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language=NULL, const char *Description=NULL)
Sets the track of the given Type and Index to the given values.
virtual int PlayPes(const uchar *Data, int Length, bool VideoOnly=false)
Plays all valid PES packets in Data with the given Length.
virtual bool HasCi(void)
Returns true if this device has a Common Interface.
virtual int GetAudioChannelDevice(void)
Gets the current audio channel, which is stereo (0), mono left (1) or mono right (2).
virtual int PlayTs(const uchar *Data, int Length, bool VideoOnly=false)
Plays the given TS packet.
virtual bool SetPlayMode(ePlayMode PlayMode)
Sets the device into the given play mode.
virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect)
Returns the Width, Height and VideoAspect ratio of the currently displayed video material.
int NumAudioTracks(void) const
Returns the number of audio tracks that are currently available.
bool ToggleMute(void)
Turns the volume off or on and returns the new mute state.
void DelLivePids(void)
Deletes the live viewing PIDs.
static int currentChannel
cPatPmtParser patPmtParser
bool AddPid(int Pid, ePidType PidType=ptOther, int StreamType=0)
Adds a PID to the set of PIDs this device shall receive.
cMutex mutexCurrentSubtitleTrack
int pre_1_3_19_PrivateStream
static cDevice * primaryDevice
virtual int PlayVideo(const uchar *Data, int Length)
Plays the given data block as video.
bool DeviceHooksProvidesTransponder(const cChannel *Channel) const
cPidHandle pidHandles[MAXPIDHANDLES]
void ForceTransferMode(void)
Forces the device into transfermode for the current channel.
static cDevice * ActualDevice(void)
Returns the actual receiving device in case of Transfer Mode, or the primary device otherwise.
cLiveSubtitle * liveSubtitle
virtual bool IsTunedToTransponder(const cChannel *Channel) const
Returns true if this device is currently tuned to the given Channel's transponder.
bool SetCurrentAudioTrack(eTrackType Type)
Sets the current audio track to the given Type.
virtual void Play(void)
Sets the device into play mode (after a previous trick mode).
virtual void MakePrimaryDevice(bool On)
Informs a device that it will be the primary device.
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 ...
cRingBufferLinear * ringBuffer
cTSBuffer(int File, int Size, int DeviceNumber)
uchar * Get(int *Available=NULL, bool CheckAvailable=false)
Returns a pointer to the first TS packet in the buffer.
void Skip(int Count)
If after a call to Get() more or less than TS_SIZE of the available data has been processed,...
virtual void Action(void)
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
@ pmExtern_THIS_SHOULD_BE_AVOIDED
char language[MAXLANGCODE2]