29 #define MAXDEVICES 16 // the maximum number of devices in the system 30 #define MAXPIDHANDLES 64 // the maximum number of different PIDs per device 31 #define MAXRECEIVERS 16 // the maximum number of receivers per device 33 #define VOLUMEDELTA (MAXVOLUME / Setup.VolumeSteps) // used to increase/decrease the volume 34 #define MAXOCCUPIEDTIMEOUT 99 // max. time (in seconds) a device may be occupied 58 #define DEPRECATED_VIDEOSYSTEM 59 #ifdef DEPRECATED_VIDEOSYSTEM 83 #define IS_AUDIO_TRACK(t) (ttAudioFirst <= (t) && (t) <= ttAudioLast) 84 #define IS_DOLBY_TRACK(t) (ttDolbyFirst <= (t) && (t) <= ttDolbyLast) 85 #define IS_SUBTITLE_TRACK(t) (ttSubtitleFirst <= (t) && (t) <= ttSubtitleLast) 179 virtual bool Ready(
void);
341 virtual bool HasLock(
int TimeoutMs = 0)
const;
354 virtual void Action(
void);
366 bool HasPid(
int Pid)
const;
406 virtual int ReadFilter(
int Handle,
void *Buffer,
size_t Length);
426 virtual bool HasCi(
void);
443 virtual uchar *
GrabImage(
int &Size,
bool Jpeg =
true,
int Quality = -1,
int SizeX = -1,
int SizeY = -1);
455 bool GrabImageFile(
const char *FileName,
bool Jpeg =
true,
int Quality = -1,
int SizeX = -1,
int SizeY = -1);
475 #ifdef DEPRECATED_VIDEOSYSTEM 481 virtual void GetVideoSize(
int &Width,
int &Height,
double &VideoAspect);
488 virtual void GetOsdSize(
int &Width,
int &Height,
double &PixelAspect);
592 void SetVolume(
int Volume,
bool Absolute =
false);
668 virtual int64_t
GetSTC(
void);
714 virtual void TrickSpeed(
int Speed,
bool Forward);
725 virtual void Clear(
void);
729 virtual void Play(
void);
732 virtual void Freeze(
void);
734 virtual void Mute(
void);
744 virtual bool Poll(
cPoller &Poller,
int TimeoutMs = 0);
749 virtual bool Flush(
int TimeoutMs = 0);
755 virtual int PlayPes(
const uchar *Data,
int Length,
bool VideoOnly =
false);
765 virtual int PlayTs(
const uchar *Data,
int Length,
bool VideoOnly =
false);
815 bool Receiving(
bool Dummy =
false)
const;
841 virtual void Action(
void);
843 cTSBuffer(
int File,
int Size,
int CardIndex);
852 void Skip(
int Count);
cPatPmtParser patPmtParser
virtual eVideoSystem GetVideoSystem(void)
Returns the video system of the currently displayed material (default is PAL).
static bool UseDevice(int n)
Tells whether the device with the given card index shall be used in this instance of VDR...
int NumTracks(eTrackType FirstTrack, eTrackType LastTrack) const
Returns the number of tracks in the given range that are currently available.
virtual bool HasLock(int TimeoutMs=0) const
Returns true if the device has a lock on the requested transponder.
uchar * Get(int *Available=NULL)
Returns a pointer to the first TS packet in the buffer.
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...
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 ToggleMute(void)
Turns the volume off or on and returns the new mute state.
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 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.
cRingBufferLinear * ringBuffer
void DetachAll(int Pid)
Detaches all receivers from this device for this pid.
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask)
Opens a file handle for the given filter data.
virtual bool SetPlayMode(ePlayMode PlayMode)
Sets the device into the given play mode.
bool IsPrimaryDevice(void) const
cReceiver * receiver[MAXRECEIVERS]
virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect)
Returns the Width, Height and VideoAspect ratio of the currently displayed video material.
virtual bool HasProgramme(void) const
Returns true if the device is currently showing any programme to the user, either through replaying o...
virtual int ReadFilter(int Handle, void *Buffer, size_t Length)
Reads data from a handle for the given filter.
virtual bool AvoidRecording(void) const
Returns true if this device should only be used for recording if no other device is available...
void SetCamSlot(cCamSlot *CamSlot)
Sets the given CamSlot to be used with this device.
virtual void MakePrimaryDevice(bool On)
Informs a device that it will be the primary 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 SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat)
Sets the video display format to the given one (only useful if this device has an MPEG decoder)...
void Detach(cFilter *Filter)
Detaches the given filter from this device.
static cDevice * GetDevice(int Index)
Gets the device with the given Index.
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
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 void Play(void)
Sets the device into play mode (after a previous trick mode).
bool autoSelectPreferredSubtitleLanguage
static int NumDevices(void)
Returns the total number of devices.
virtual void Action(void)
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
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 ...
virtual void Clear(void)
Clears all video and audio data from the device.
virtual int PlayTsAudio(const uchar *Data, int Length)
Plays the given data block as audio.
void DelLivePids(void)
Deletes the live viewing PIDs.
virtual bool DeviceProvidesTransponder(const cDevice *Device, const cChannel *Channel) const
Returns true if the given Device can provide the given Channel's transponder.
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 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)...
int NumSubtitleTracks(void) const
Returns the number of subtitle 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.
eTrackType currentSubtitleTrack
eTrackType GetCurrentAudioTrack(void) const
virtual bool ProvidesSource(int Source) const
Returns true if this device can provide the given source.
virtual int GetAudioChannelDevice(void)
Gets the current audio channel, which is stereo (0), mono left (1) or mono right (2).
virtual int NumProvidedSystems(void) const
Returns the number of individual "delivery systems" this device provides.
virtual void Mute(void)
Turns off audio while replaying.
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...
cTSBuffer(int File, int Size, int CardIndex)
bool SetCurrentAudioTrack(eTrackType Type)
Sets the current audio track to the given Type.
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 cString DeviceName(void) const
Returns a string identifying the name of this device.
static int NextCardIndex(int n=0)
Calculates the next card index.
bool DeviceHooksProvidesTransponder(const cChannel *Channel) const
bool Receiving(bool Dummy=false) const
Returns true if we are currently receiving. The parameter has no meaning (for backwards compatibility...
static int CurrentVolume(void)
virtual bool Ready(void)
Returns true if this device is ready.
A steerable satellite dish generally points to the south on the northern hemisphere, and to the north on the southern hemisphere (unless you're located directly on the equator, in which case the general direction is "up").
void EnsureSubtitleTrack(void)
Makes sure one of the preferred language subtitle tracks is selected.
cDeviceHook(void)
Creates a new device hook object.
virtual void Freeze(void)
Puts the device into "freeze frame" mode.
int pre_1_3_19_PrivateStream
tTrackId availableTracks[ttMaxTrackTypes]
static int CurrentChannel(void)
Returns the number of the current channel on the primary device.
void StartSectionHandler(void)
A derived device that provides section data must call this function (typically in its constructor) to...
time_t startScrambleDetection
virtual void SetVolumeDevice(int Volume)
Sets the audio volume on this device (Volume = 0...255).
void StopSectionHandler(void)
A device that has called StartSectionHandler() must call this function (typically in its destructor) ...
void SetVolume(int Volume, bool Absolute=false)
Sets the volume to the given value, either absolutely or relative to the current volume.
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 mutexCurrentSubtitleTrack
virtual const cChannel * GetCurrentlyTunedTransponder(void) const
Returns a pointer to the currently tuned transponder.
bool SwitchChannel(const cChannel *Channel, bool LiveView)
Switches the device to the given Channel, initiating transfer mode if necessary.
virtual int SignalStrength(void) const
Returns the "strength" of the currently received signal.
virtual int SignalQuality(void) const
Returns the "quality" of the currently received signal.
virtual void CloseDvr(void)
Shuts down the DVR.
virtual bool CanReplay(void) const
Returns true if this device can currently start a replay session.
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView)
Sets the device to the given channel (actual physical setup).
void ClrAvailableTracks(bool DescriptionsOnly=false, bool IdsOnly=false)
Clears the list of currently available tracks.
int Occupied(void) const
Returns the number of seconds this device is still occupied for.
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 uchar * GrabImage(int &Size, bool Jpeg=true, int Quality=-1, int SizeX=-1, int SizeY=-1)
Grabs the currently visible screen image.
static cDevice * primaryDevice
virtual void DetachAllReceivers(void)
Detaches all receivers from this device.
virtual void SetAudioChannelDevice(int AudioChannel)
Sets the audio channel to stereo (0), mono left (1) or mono right (2).
virtual bool SetPid(cPidHandle *Handle, int Type, bool On)
Does the actual PID setting on this device.
cSectionHandler * sectionHandler
eTrackType currentAudioTrack
static bool WaitForAllDevicesReady(int Timeout=0)
Waits until all devices have become ready, or the given Timeout (seconds) has expired.
virtual int PlayPes(const uchar *Data, int Length, bool VideoOnly=false)
Plays all valid PES packets in Data with the given Length.
void Skip(int Count)
If after a call to Get() more or less than TS_SIZE of the available data has been processed...
int CardIndex(void) const
Returns the card index of this device (0 ... MAXDEVICES - 1).
virtual void ScaleVideo(const cRect &Rect=cRect::Null)
Scales the currently shown video in such a way that it fits into the given Rect.
virtual bool HasDecoder(void) const
Tells whether this device has an MPEG decoder.
virtual void Action(void)
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
virtual void CloseFilter(int Handle)
Closes a file handle that has previously been opened by OpenFilter().
virtual bool OpenDvr(void)
Opens the DVR of this device and prepares it to deliver a Transport Stream for use in a cReceiver...
virtual bool Flush(int TimeoutMs=0)
Returns true if the device's output buffers are empty, i.
virtual int PlayTsVideo(const uchar *Data, int Length)
Plays the given data block as video.
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 int PlayAudio(const uchar *Data, int Length, uchar Id)
Plays the given data block as audio.
virtual cString DeviceType(void) const
Returns a string identifying the type of this device (like "DVB-S").
virtual int PlayTs(const uchar *Data, int Length, bool VideoOnly=false)
Plays the given TS packet.
const cPatPmtParser * PatPmtParser(void) const
Returns a pointer to the patPmtParser, so that a derived device can use the stream information from i...
virtual void SetSubtitleTrackDevice(eTrackType Type)
Sets the current subtitle track to the given value.
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices - 1).
void EnsureAudioTrack(bool Force=false)
Makes sure an audio track is selected that is actually available.
static cDevice * PrimaryDevice(void)
Returns the primary device.
virtual bool GetTSPacket(uchar *&Data)
Gets exactly one TS packet from the DVR of this device and returns a pointer to it in Data...
cLiveSubtitle * liveSubtitle
eSetChannelResult SetChannel(const cChannel *Channel, bool LiveView)
Sets the device to the given channel (general setup).
static bool SetPrimaryDevice(int n)
Sets the primary device to 'n'.
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...
void StopReplay(void)
Stops the current replay session (if any).
const tTrackId * GetTrack(eTrackType Type)
Returns a pointer to the given track id, or NULL if Type is not less than ttMaxTrackTypes.
bool HasPid(int Pid) const
Returns true if this device is currently receiving the given PID.
int GetAudioChannel(void)
Gets the current audio channel, which is stereo (0), mono left (1) or mono right (2).
bool Transferring(void) const
Returns true if we are currently in Transfer Mode.
static cList< cDeviceHook > deviceHooks
static void SetCurrentChannel(const cChannel *Channel)
Sets the number of the current channel on the primary device, without actually switching to it...
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 int64_t GetSTC(void)
Gets the current System Time Counter, which can be used to synchronize audio, video and subtitles...
int currentAudioTrackMissingCount
bool AttachPlayer(cPlayer *Player)
Attaches the given player to this device.
static void Shutdown(void)
Closes down all devices.
cMutex mutexCurrentAudioTrack
static cDevice * ActualDevice(void)
Returns the actual receiving device in case of Transfer Mode, or the primary device otherwise...
void SetKeepTracks(bool KeepTracks)
Controls whether the current audio and subtitle track settings shall be kept as they currently are...
virtual bool IsPlayingVideo(void) const
Returns true if the currently attached player has delivered any video packets.
virtual bool IsTunedToTransponder(const cChannel *Channel) const
Returns true if this device is currently tuned to the given Channel's transponder.
char language[MAXLANGCODE2]
virtual void TrickSpeed(int Speed, bool Forward)
Sets the device into a mode where replay is done slower.
virtual int PlayTsSubtitle(const uchar *Data, int Length)
Plays the given data block as a subtitle.
void SetAudioChannel(int AudioChannel)
Sets the audio channel to stereo (0), mono left (1) or mono right (2).
virtual int PlaySubtitle(const uchar *Data, int Length)
Plays the given data block as a subtitle.
void ForceTransferMode(void)
Forces the device into transfermode for the current channel.
bool SetCurrentSubtitleTrack(eTrackType Type, bool Manual=false)
Sets the current subtitle track to the given Type.
Derived cDevice classes that can receive channels will have to provide Transport Stream (TS) packets ...
virtual void StillPicture(const uchar *Data, int Length)
Displays the given I-frame as a still picture.
cDvbSubtitleConverter * dvbSubtitleConverter
virtual int PlayVideo(const uchar *Data, int Length)
Plays the given data block as video.
cPidHandle pidHandles[MAXPIDHANDLES]
virtual void SetDigitalAudioDevice(bool On)
Tells the output device that the current audio track is Dolby Digital.
bool Replaying(void) const
Returns true if we are currently replaying.
int NumAudioTracks(void) const
Returns the number of audio tracks that are currently available.
static void SetUseDevice(int n)
Sets the 'useDevice' flag of the given device.
virtual bool HasCi(void)
Returns true if this device has a Common Interface.
bool AddPid(int Pid, ePidType PidType=ptOther, int StreamType=0)
Adds a PID to the set of PIDs this device shall receive.
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...
int Priority(void) const
Returns the priority of the current receiving session (-MAXPRIORITY..MAXPRIORITY), or IDLEPRIORITY if no receiver is currently active.
The cDevice class is the base from which actual devices can be derived.
virtual bool HasInternalCam(void)
Returns true if this device handles encrypted channels itself without VDR assistance.
virtual void SetAudioTrackDevice(eTrackType Type)
Sets the current audio track to the given value.
static cDevice * device[MAXDEVICES]
eTrackType GetCurrentSubtitleTrack(void) const