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) 103 virtual bool DeviceProvidesTransponder(
const cDevice *Device,
const cChannel *Channel)
const;
120 static bool WaitForAllDevicesReady(
int Timeout = 0);
126 static void SetUseDevice(
int n);
130 static bool UseDevice(
int n) {
return useDevice == 0 || (useDevice & (1 << n)) != 0; }
133 static bool SetPrimaryDevice(
int n);
139 static cDevice *ActualDevice(
void);
146 static cDevice *GetDevice(
const cChannel *Channel,
int Priority,
bool LiveView,
bool Query =
false);
165 static cDevice *GetDeviceForTransponder(
const cChannel *Channel,
int Priority);
170 static void Shutdown(
void);
179 virtual bool Ready(
void);
184 static int NextCardIndex(
int n = 0);
196 virtual void MakePrimaryDevice(
bool On);
207 int DeviceNumber(
void)
const;
209 virtual cString DeviceType(
void)
const;
215 virtual cString DeviceName(
void)
const;
218 virtual bool HasDecoder(
void)
const;
229 bool DeviceHooksProvidesTransponder(
const cChannel *Channel)
const;
248 virtual bool ProvidesSource(
int Source)
const;
250 virtual bool ProvidesTransponder(
const cChannel *Channel)
const;
254 virtual bool ProvidesTransponderExclusively(
const cChannel *Channel)
const;
257 virtual bool ProvidesChannel(
const cChannel *Channel,
int Priority =
IDLEPRIORITY,
bool *NeedsDetachReceivers = NULL)
const;
271 virtual bool ProvidesEIT(
void)
const;
275 virtual int NumProvidedSystems(
void)
const;
286 virtual int SignalStrength(
void)
const;
291 virtual int SignalQuality(
void)
const;
296 virtual const cChannel *GetCurrentlyTunedTransponder(
void)
const;
301 virtual bool IsTunedToTransponder(
const cChannel *Channel)
const;
304 virtual bool MaySwitchTransponder(
const cChannel *Channel)
const;
309 bool SwitchChannel(
const cChannel *Channel,
bool LiveView);
312 static bool SwitchChannel(
int Direction);
320 virtual bool SetChannelDevice(
const cChannel *Channel,
bool LiveView);
329 void ForceTransferMode(
void);
331 int Occupied(
void)
const;
333 void SetOccupied(
int Seconds);
341 virtual bool HasLock(
int TimeoutMs = 0)
const;
347 virtual bool HasProgramme(
void)
const;
354 virtual void Action(
void);
363 cPidHandle(
void) { pid = streamType = used = 0; handle = -1; }
366 bool HasPid(
int Pid)
const;
368 bool AddPid(
int Pid,
ePidType PidType = ptOther,
int StreamType = 0);
370 void DelPid(
int Pid,
ePidType PidType = ptOther);
372 virtual bool SetPid(
cPidHandle *Handle,
int Type,
bool On);
381 void DelLivePids(
void);
393 void StartSectionHandler(
void);
397 void StopSectionHandler(
void);
402 virtual int OpenFilter(u_short Pid,
u_char Tid,
u_char Mask);
406 virtual int ReadFilter(
int Handle,
void *Buffer,
size_t Length);
410 virtual void CloseFilter(
int Handle);
415 void AttachFilter(
cFilter *Filter);
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);
470 virtual void SetVideoFormat(
bool VideoFormat16_9);
475 #ifdef DEPRECATED_VIDEOSYSTEM 481 virtual void GetVideoSize(
int &Width,
int &Height,
double &VideoAspect);
488 virtual void GetOsdSize(
int &Width,
int &Height,
double &PixelAspect);
513 virtual void SetAudioTrackDevice(
eTrackType Type);
515 virtual void SetSubtitleTrackDevice(
eTrackType Type);
518 void ClrAvailableTracks(
bool DescriptionsOnly =
false,
bool IdsOnly =
false);
523 bool SetAvailableTrack(
eTrackType Type,
int Index, uint16_t Id,
const char *Language = NULL,
const char *Description = NULL);
536 int NumAudioTracks(
void)
const;
540 int NumSubtitleTracks(
void)
const;
547 bool SetCurrentSubtitleTrack(
eTrackType Type,
bool Manual =
false);
553 void EnsureAudioTrack(
bool Force =
false);
557 void EnsureSubtitleTrack(
void);
571 virtual int GetAudioChannelDevice(
void);
574 virtual void SetAudioChannelDevice(
int AudioChannel);
576 virtual void SetVolumeDevice(
int Volume);
578 virtual void SetDigitalAudioDevice(
bool On);
584 bool ToggleMute(
void);
586 int GetAudioChannel(
void);
589 void SetAudioChannel(
int AudioChannel);
592 void SetVolume(
int Volume,
bool Absolute =
false);
611 virtual bool CanReplay(
void)
const;
613 virtual bool SetPlayMode(
ePlayMode PlayMode);
616 virtual int PlayVideo(
const uchar *Data,
int Length);
623 virtual int PlayAudio(
const uchar *Data,
int Length,
uchar Id);
631 virtual int PlaySubtitle(
const uchar *Data,
int Length);
638 virtual int PlayPesPacket(
const uchar *Data,
int Length,
bool VideoOnly =
false);
643 virtual int PlayTsVideo(
const uchar *Data,
int Length);
651 virtual int PlayTsAudio(
const uchar *Data,
int Length);
659 virtual int PlayTsSubtitle(
const uchar *Data,
int Length);
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);
738 virtual void StillPicture(
const uchar *Data,
int Length);
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);
781 bool Replaying(
void)
const;
783 bool Transferring(
void)
const;
785 void StopReplay(
void);
787 bool AttachPlayer(
cPlayer *Player);
798 int Priority(
void)
const;
802 virtual bool OpenDvr(
void);
805 virtual void CloseDvr(
void);
807 virtual bool GetTSPacket(
uchar *&Data);
815 bool Receiving(
bool Dummy =
false)
const;
817 bool AttachReceiver(
cReceiver *Receiver);
821 void DetachAll(
int Pid);
823 virtual void DetachAllReceivers(
void);
841 virtual void Action(
void);
843 cTSBuffer(
int File,
int Size,
int CardIndex);
845 uchar *Get(
int *Available = NULL);
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...
cRingBufferLinear * ringBuffer
static int currentChannel
bool autoSelectPreferredSubtitleLanguage
static int NumDevices(void)
Returns the total number of devices.
eTrackType GetCurrentSubtitleTrack(void) const
virtual bool HasIBPTrickSpeed(void)
Returns true if this device can handle all frames in 'fast forward' trick speeds. ...
eTrackType currentSubtitleTrack
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 int CurrentVolume(void)
bool IsPrimaryDevice(void) const
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").
cCamSlot * CamSlot(void) const
Returns the CAM slot that is currently used with this device, or NULL if no CAM slot is in use...
int pre_1_3_19_PrivateStream
static int CurrentChannel(void)
Returns the number of the current channel on the primary device.
time_t startScrambleDetection
cMutex mutexCurrentSubtitleTrack
virtual bool IsPlayingVideo(void) const
Returns true if the currently attached player has delivered any video packets.
static cDevice * primaryDevice
cSectionHandler * sectionHandler
eTrackType currentAudioTrack
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 AvoidRecording(void) const
Returns true if this device should only be used for recording if no other device is available...
const cPatPmtParser * PatPmtParser(void) const
Returns a pointer to the patPmtParser, so that a derived device can use the stream information from i...
int CardIndex(void) const
Returns the card index of this device (0 ... MAXDEVICES - 1).
static cDevice * PrimaryDevice(void)
Returns the primary device.
cLiveSubtitle * liveSubtitle
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...
int currentAudioTrackMissingCount
cMutex mutexCurrentAudioTrack
void SetKeepTracks(bool KeepTracks)
Controls whether the current audio and subtitle track settings shall be kept as they currently are...
char language[MAXLANGCODE2]
Derived cDevice classes that can receive channels will have to provide Transport Stream (TS) packets ...
cDvbSubtitleConverter * dvbSubtitleConverter
eTrackType GetCurrentAudioTrack(void) const
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.