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 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) 96 virtual bool DeviceProvidesTransponder(
const cDevice *Device,
const cChannel *Channel)
const;
102 #define DTV_STAT_VALID_NONE 0x0000 103 #define DTV_STAT_VALID_STRENGTH 0x0001 104 #define DTV_STAT_VALID_CNR 0x0002 105 #define DTV_STAT_VALID_BERPRE 0x0004 106 #define DTV_STAT_VALID_BERPOST 0x0008 107 #define DTV_STAT_VALID_PER 0x0010 108 #define DTV_STAT_VALID_STATUS 0x0020 110 #define DTV_STAT_HAS_NONE 0x0000 111 #define DTV_STAT_HAS_SIGNAL 0x0001 112 #define DTV_STAT_HAS_CARRIER 0x0002 113 #define DTV_STAT_HAS_VITERBI 0x0004 114 #define DTV_STAT_HAS_SYNC 0x0008 115 #define DTV_STAT_HAS_LOCK 0x0010 129 static bool WaitForAllDevicesReady(
int Timeout = 0);
135 static void SetUseDevice(
int n);
139 static bool UseDevice(
int n) {
return useDevice == 0 || (useDevice & (1 << n)) != 0; }
142 static bool SetPrimaryDevice(
int n);
148 static cDevice *ActualDevice(
void);
151 static cDevice *GetDevice(
int Index);
174 static cDevice *GetDeviceForTransponder(
const cChannel *Channel,
int Priority);
179 static void Shutdown(
void);
188 virtual bool Ready(
void);
193 static int NextCardIndex(
int n = 0);
205 virtual void MakePrimaryDevice(
bool On);
216 int DeviceNumber(
void)
const;
218 virtual cString DeviceType(
void)
const;
224 virtual cString DeviceName(
void)
const;
227 virtual bool HasDecoder(
void)
const;
238 bool DeviceHooksProvidesTransponder(
const cChannel *Channel)
const;
258 virtual bool ProvidesSource(
int Source)
const;
260 virtual bool ProvidesTransponder(
const cChannel *Channel)
const;
264 virtual bool ProvidesTransponderExclusively(
const cChannel *Channel)
const;
267 virtual bool ProvidesChannel(
const cChannel *Channel,
int Priority =
IDLEPRIORITY,
bool *NeedsDetachReceivers = NULL)
const;
281 virtual bool ProvidesEIT(
void)
const;
285 virtual int NumProvidedSystems(
void)
const;
296 virtual bool SignalStats(
int &Valid,
double *Strength = NULL,
double *Cnr = NULL,
double *BerPre = NULL,
double *BerPost = NULL,
double *Per = NULL,
int *Status = NULL)
const;
313 virtual int SignalStrength(
void)
const;
318 virtual int SignalQuality(
void)
const;
323 virtual const cChannel *GetCurrentlyTunedTransponder(
void)
const;
328 virtual bool IsTunedToTransponder(
const cChannel *Channel)
const;
331 virtual bool MaySwitchTransponder(
const cChannel *Channel)
const;
336 bool SwitchChannel(
const cChannel *Channel,
bool LiveView);
339 static bool SwitchChannel(
int Direction);
347 virtual bool SetChannelDevice(
const cChannel *Channel,
bool LiveView);
352 #ifndef DEPRECATED_SETCURRENTCHANNEL 353 #define DEPRECATED_SETCURRENTCHANNEL 1 355 #if DEPRECATED_SETCURRENTCHANNEL 362 void ForceTransferMode(
void);
364 int Occupied(
void)
const;
366 void SetOccupied(
int Seconds);
374 virtual bool HasLock(
int TimeoutMs = 0)
const;
380 virtual bool HasProgramme(
void)
const;
388 virtual void Action(
void);
397 cPidHandle(
void) { pid = streamType = used = 0; handle = -1; }
400 bool HasPid(
int Pid)
const;
402 bool AddPid(
int Pid,
ePidType PidType = ptOther,
int StreamType = 0);
404 void DelPid(
int Pid,
ePidType PidType = ptOther);
406 virtual bool SetPid(
cPidHandle *Handle,
int Type,
bool On);
415 void DelLivePids(
void);
427 void StartSectionHandler(
void);
431 void StopSectionHandler(
void);
436 virtual int OpenFilter(u_short Pid,
u_char Tid,
u_char Mask);
440 virtual int ReadFilter(
int Handle,
void *Buffer,
size_t Length);
444 virtual void CloseFilter(
int Handle);
449 void AttachFilter(
cFilter *Filter);
459 virtual bool HasCi(
void);
476 virtual uchar *GrabImage(
int &Size,
bool Jpeg =
true,
int Quality = -1,
int SizeX = -1,
int SizeY = -1);
488 bool GrabImageFile(
const char *FileName,
bool Jpeg =
true,
int Quality = -1,
int SizeX = -1,
int SizeY = -1);
503 virtual void SetVideoFormat(
bool VideoFormat16_9);
508 virtual void GetVideoSize(
int &Width,
int &Height,
double &VideoAspect);
515 virtual void GetOsdSize(
int &Width,
int &Height,
double &PixelAspect);
540 virtual void SetAudioTrackDevice(
eTrackType Type);
542 virtual void SetSubtitleTrackDevice(
eTrackType Type);
545 void ClrAvailableTracks(
bool DescriptionsOnly =
false,
bool IdsOnly =
false);
550 bool SetAvailableTrack(
eTrackType Type,
int Index, uint16_t Id,
const char *Language = NULL,
const char *Description = NULL);
563 int NumAudioTracks(
void)
const;
567 int NumSubtitleTracks(
void)
const;
574 bool SetCurrentSubtitleTrack(
eTrackType Type,
bool Manual =
false);
580 void EnsureAudioTrack(
bool Force =
false);
584 void EnsureSubtitleTrack(
void);
598 virtual int GetAudioChannelDevice(
void);
601 virtual void SetAudioChannelDevice(
int AudioChannel);
603 virtual void SetVolumeDevice(
int Volume);
605 virtual void SetDigitalAudioDevice(
bool On);
611 bool ToggleMute(
void);
613 int GetAudioChannel(
void);
616 void SetAudioChannel(
int AudioChannel);
619 void SetVolume(
int Volume,
bool Absolute =
false);
637 virtual bool CanReplay(
void)
const;
639 virtual bool SetPlayMode(
ePlayMode PlayMode);
642 virtual int PlayVideo(
const uchar *Data,
int Length);
649 virtual int PlayAudio(
const uchar *Data,
int Length,
uchar Id);
657 virtual int PlaySubtitle(
const uchar *Data,
int Length);
664 virtual int PlayPesPacket(
const uchar *Data,
int Length,
bool VideoOnly =
false);
669 virtual int PlayTsVideo(
const uchar *Data,
int Length);
677 virtual int PlayTsAudio(
const uchar *Data,
int Length);
685 virtual int PlayTsSubtitle(
const uchar *Data,
int Length);
694 virtual int64_t GetSTC(
void);
740 virtual void TrickSpeed(
int Speed,
bool Forward);
751 virtual void Clear(
void);
755 virtual void Play(
void);
758 virtual void Freeze(
void);
760 virtual void Mute(
void);
764 virtual void StillPicture(
const uchar *Data,
int Length);
770 virtual bool Poll(
cPoller &Poller,
int TimeoutMs = 0);
775 virtual bool Flush(
int TimeoutMs = 0);
781 virtual int PlayPes(
const uchar *Data,
int Length,
bool VideoOnly =
false);
791 virtual int PlayTs(
const uchar *Data,
int Length,
bool VideoOnly =
false);
807 bool Replaying(
void)
const;
809 bool Transferring(
void)
const;
811 void StopReplay(
void);
813 bool AttachPlayer(
cPlayer *Player);
824 int Priority(
void)
const;
828 virtual bool OpenDvr(
void);
831 virtual void CloseDvr(
void);
833 virtual bool GetTSPacket(
uchar *&Data);
841 bool Receiving(
bool Dummy =
false)
const;
843 bool AttachReceiver(
cReceiver *Receiver);
847 void DetachAll(
int Pid);
849 virtual void DetachAllReceivers(
void);
867 virtual void Action(
void);
869 cTSBuffer(
int File,
int Size,
int CardIndex);
871 uchar *Get(
int *Available = NULL,
bool CheckAvailable =
false);
882 void Skip(
int Count);
cPatPmtParser patPmtParser
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.
cMutex mutexCurrentSubtitleTrack
virtual bool IsPlayingVideo(void) const
Returns true if the currently attached player has delivered any video packets.
static void SetCurrentChannel(int ChannelNumber)
Sets the number of the current channel on the primary device, without actually switching to it...
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)
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
virtual bool HasInternalCam(void)
Returns true if this device handles encrypted channels itself without VDR assistance.