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
190 virtual bool Ready(
void);
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;
396 virtual void Action(
void);
408 bool HasPid(
int Pid)
const;
444 virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
448 virtual int ReadFilter(
int Handle,
void *Buffer,
size_t Length);
471 virtual bool HasCi(
void);
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);
631 void SetVolume(
int Volume,
bool Absolute =
false);
706 virtual int64_t
GetSTC(
void);
752 virtual void TrickSpeed(
int Speed,
bool Forward);
763 virtual void Clear(
void);
767 virtual void Play(
void);
770 virtual void Freeze(
void);
772 virtual void Mute(
void);
782 virtual bool Poll(
cPoller &Poller,
int TimeoutMs = 0);
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);
853 bool Receiving(
bool Dummy =
false)
const;
882 virtual void Action(
void);
884 cTSBuffer(
int File,
int Size,
int DeviceNumber);
886 uchar *
Get(
int *Available = NULL,
bool CheckAvailable =
false);
897 void Skip(
int Count);
virtual bool DeviceProvidesEIT(const cDevice *Device) const
Returns true if the given Device can provide EIT data.
cDeviceHook(void)
Creates a new device hook object.
virtual bool DeviceProvidesTransponder(const cDevice *Device, const cChannel *Channel) const
Returns true if the given Device can provide the given Channel's transponder.
static int NextCardIndex(int n=0)
Calculates the next card index.
virtual cString DeviceName(void) const
Returns a string identifying the name of this device.
static cList< cDeviceHook > deviceHooks
bool Replaying(void) const
Returns true if we are currently replaying.
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.
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 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).
virtual void SetSubtitleTrackDevice(eTrackType Type)
Sets the current subtitle track to the given value.
virtual int GetAudioChannelDevice(void)
Gets the current audio channel, which is stereo (0), mono left (1) or mono right (2).
virtual int PlayVideo(const uchar *Data, int Length)
Plays the given data block as video.
cSectionHandler * sectionHandler
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.
virtual bool HasInternalCam(void)
Returns true if this device handles encrypted channels itself without VDR assistance.
virtual uchar * GrabImage(int &Size, bool Jpeg=true, int Quality=-1, int SizeX=-1, int SizeY=-1)
Grabs the currently visible screen image.
virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect)
Returns the Width, Height and VideoAspect ratio of the currently displayed video material.
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.
eSetChannelResult SetChannel(const cChannel *Channel, bool LiveView)
Sets the device to the given channel (general setup).
virtual bool HasLock(int TimeoutMs=0) const
Returns true if the device has a lock on the requested transponder.
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.
cMutex mutexCurrentAudioTrack
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 int NumProvidedSystems(void) const
Returns the number of individual "delivery systems" this device provides.
int NumSubtitleTracks(void) const
Returns the number of subtitle tracks that are currently available.
virtual int PlayPes(const uchar *Data, int Length, bool VideoOnly=false)
Plays all valid PES packets in Data with the given Length.
virtual bool ProvidesSource(int Source) const
Returns true if this device can provide the given source.
void ReleaseCamSlot(void)
Releases the CAM slot if it is currently not used.
cDvbSubtitleConverter * dvbSubtitleConverter
bool HasPid(int Pid) const
Returns true if this device is currently receiving the given PID.
virtual void SetAudioTrackDevice(eTrackType Type)
Sets the current audio track to the given value.
virtual bool SetPid(cPidHandle *Handle, int Type, bool On)
Does the actual PID setting on this device.
bool autoSelectPreferredSubtitleLanguage
static bool WaitForAllDevicesReady(int Timeout=0)
Waits until all devices have become ready, or the given Timeout (seconds) has expired.
void SetCamSlot(cCamSlot *CamSlot)
Sets the given CamSlot to be used with this device.
static cDevice * ActualDevice(void)
Returns the actual receiving device in case of Transfer Mode, or the primary device otherwise.
static cDevice * PrimaryDevice(void)
Returns the primary device.
static void SetUseDevice(int n)
Sets the 'useDevice' flag of the given device.
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...
eTrackType currentSubtitleTrack
eTrackType GetCurrentSubtitleTrack(void) const
static cDevice * GetDevice(int Index)
Gets the device with the given Index.
static void Shutdown(void)
Closes down all devices.
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.
virtual int PlayTsVideo(const uchar *Data, int Length)
Plays the given data block as video.
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices - 1).
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...
virtual void SetAudioChannelDevice(int AudioChannel)
Sets the audio channel to stereo (0), mono left (1) or mono right (2).
cReceiver * receiver[MAXRECEIVERS]
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 int CurrentChannel(void)
Returns the number of the current channel on the primary device.
bool IsPrimaryDevice(bool CheckDecoder=true) const
virtual bool AvoidRecording(void) const
Returns true if this device should only be used for recording if no other device is available.
static cDevice * primaryDevice
static bool SetPrimaryDevice(int n)
Sets the primary device to 'n'.
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.
virtual int PlayTsAudio(const uchar *Data, int Length)
Plays the given data block as audio.
void StopReplay(void)
Stops the current replay session (if any).
virtual void MakePrimaryDevice(bool On)
Informs a device that it will be the primary device.
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.
void DetachAll(int Pid)
Detaches all receivers from this device for this pid.
virtual bool ProvidesChannel(const cChannel *Channel, int Priority=IDLEPRIORITY, bool *NeedsDetachReceivers=NULL) const
Returns true if this device can provide the given channel.
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...
virtual int SignalQuality(void) const
Returns the "quality" of the currently received signal.
virtual int SignalStrength(void) const
Returns the "strength" of the currently received signal.
virtual void Play(void)
Sets the device into play mode (after a previous trick mode).
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.
const cSdtFilter * SdtFilter(void) const
cPidHandle pidHandles[MAXPIDHANDLES]
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 bool SetPlayMode(ePlayMode PlayMode)
Sets the device into the given play mode.
virtual bool OpenDvr(void)
Opens the DVR of this device and prepares it to deliver a Transport Stream for use in a cReceiver.
const tTrackId * GetTrack(eTrackType Type)
Returns a pointer to the given track id, or NULL if Type is not less than ttMaxTrackTypes.
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 void TrickSpeed(int Speed, bool Forward)
Sets the device into a mode where replay is done slower.
cLiveSubtitle * liveSubtitle
virtual void Mute(void)
Turns off audio while replaying.
virtual bool HasCi(void)
Returns true if this device has a Common Interface.
virtual cString DeviceType(void) const
Returns a string identifying the type of this device (like "DVB-S").
virtual const cChannel * GetCurrentlyTunedTransponder(void) const
Returns a pointer to the currently tuned transponder.
virtual void Freeze(void)
Puts the device into "freeze frame" mode.
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 int64_t GetSTC(void)
Gets the current System Time Counter, which can be used to synchronize audio, video and subtitles.
virtual bool IsBonded(void) const
Returns true if this device is bonded to an other device.
virtual void SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat)
Sets the video display format to the given one (only useful if this device has an MPEG decoder).
virtual bool Flush(int TimeoutMs=0)
Returns true if the device's output buffers are empty, i.
virtual bool HasDecoder(void) const
Tells whether this device has an MPEG decoder.
virtual int PlayTsSubtitle(const uchar *Data, int Length)
Plays the given data block as a subtitle.
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).
virtual void CloseDvr(void)
Shuts down the DVR.
virtual void CloseFilter(int Handle)
Closes a file handle that has previously been opened by OpenFilter().
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView)
Sets the device to the given channel (actual physical setup).
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 bool HasProgramme(void) const
Returns true if the device is currently showing any programme to the user, either through replaying o...
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 void DetachAllReceivers(void)
Detaches all receivers from this device.
virtual bool IsTunedToTransponder(const cChannel *Channel) const
Returns true if this device is currently tuned to the given Channel's transponder.
virtual bool CanReplay(void) const
Returns true if this device can currently start a replay session.
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 cSpuDecoder * GetSpuDecoder(void)
Returns a pointer to the device's SPU decoder (or NULL, if this device doesn't have an SPU decoder).
virtual bool HasIBPTrickSpeed(void)
Returns true if this device can handle all frames in 'fast forward' trick speeds.
virtual bool Ready(void)
Returns true if this device is ready.
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...
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 ...
tTrackId availableTracks[ttMaxTrackTypes]
virtual bool GetTSPacket(uchar *&Data)
Gets exactly one TS packet from the DVR of this device and returns a pointer to it in Data.
virtual void Clear(void)
Clears all video and audio data from the device.
int CardIndex(void) const
Returns the card index of this device (0 ... MAXDEVICES - 1).
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.
int NumAudioTracks(void) const
Returns the number of audio tracks that are currently available.
virtual int PlayPesPacket(const uchar *Data, int Length, bool VideoOnly=false)
Plays the single PES packet in Data with the given Length.
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
virtual int PlayTs(const uchar *Data, int Length, bool VideoOnly=false)
Plays the given TS packet.
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
bool DeviceHooksProvidesTransponder(const cChannel *Channel) const
virtual int ReadFilter(int Handle, void *Buffer, size_t Length)
Reads data from a handle for the given filter.
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask)
Opens a file handle for the given filter data.
static cDevice * device[MAXDEVICES]
void ForceTransferMode(void)
Forces the device into transfermode for the current channel.
virtual int PlayAudio(const uchar *Data, int Length, uchar Id)
Plays the given data block as audio.
bool SetCurrentAudioTrack(eTrackType Type)
Sets the current audio track to the given Type.
virtual void Action(void)
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
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 SetDigitalAudioDevice(bool On)
Tells the output device that the current audio track is Dolby Digital.
virtual void StillPicture(const uchar *Data, int Length)
Displays the given I-frame as a still picture.
virtual int PlaySubtitle(const uchar *Data, int Length)
Plays the given data block as a subtitle.
virtual void SetVolumeDevice(int Volume)
Sets the audio volume on this device (Volume = 0...255).
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 ...
cTSBuffer(int File, int Size, int DeviceNumber)
virtual void Action(void)
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
uchar * Get(int *Available=NULL, bool CheckAvailable=false)
Returns a pointer to the first TS packet in the buffer.
cRingBufferLinear * ringBuffer
void Skip(int Count)
If after a call to Get() more or less than TS_SIZE of the available data has been processed,...
@ pmExtern_THIS_SHOULD_BE_AVOIDED
char language[MAXLANGCODE2]