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);
178 virtual bool Ready(
void);
183 static int NextCardIndex(
int n = 0);
195 virtual void MakePrimaryDevice(
bool On);
203 int DeviceNumber(
void)
const;
205 virtual cString DeviceType(
void)
const;
211 virtual cString DeviceName(
void)
const;
214 virtual bool HasDecoder(
void)
const;
225 bool DeviceHooksProvidesTransponder(
const cChannel *Channel)
const;
244 virtual bool ProvidesSource(
int Source)
const;
246 virtual bool ProvidesTransponder(
const cChannel *Channel)
const;
250 virtual bool ProvidesTransponderExclusively(
const cChannel *Channel)
const;
253 virtual bool ProvidesChannel(
const cChannel *Channel,
int Priority =
IDLEPRIORITY,
bool *NeedsDetachReceivers = NULL)
const;
267 virtual bool ProvidesEIT(
void)
const;
271 virtual int NumProvidedSystems(
void)
const;
282 virtual int SignalStrength(
void)
const;
287 virtual int SignalQuality(
void)
const;
292 virtual const cChannel *GetCurrentlyTunedTransponder(
void)
const;
297 virtual bool IsTunedToTransponder(
const cChannel *Channel)
const;
300 virtual bool MaySwitchTransponder(
const cChannel *Channel)
const;
305 bool SwitchChannel(
const cChannel *Channel,
bool LiveView);
308 static bool SwitchChannel(
int Direction);
316 virtual bool SetChannelDevice(
const cChannel *Channel,
bool LiveView);
325 void ForceTransferMode(
void);
327 int Occupied(
void)
const;
329 void SetOccupied(
int Seconds);
337 virtual bool HasLock(
int TimeoutMs = 0)
const;
343 virtual bool HasProgramme(
void)
const;
350 virtual void Action(
void);
359 cPidHandle(
void) { pid = streamType = used = 0; handle = -1; }
362 bool HasPid(
int Pid)
const;
364 bool AddPid(
int Pid,
ePidType PidType = ptOther,
int StreamType = 0);
366 void DelPid(
int Pid,
ePidType PidType = ptOther);
368 virtual bool SetPid(
cPidHandle *Handle,
int Type,
bool On);
377 void DelLivePids(
void);
389 void StartSectionHandler(
void);
393 void StopSectionHandler(
void);
398 virtual int OpenFilter(u_short Pid,
u_char Tid,
u_char Mask);
402 virtual int ReadFilter(
int Handle,
void *Buffer,
size_t Length);
406 virtual void CloseFilter(
int Handle);
411 void AttachFilter(
cFilter *Filter);
422 virtual bool HasCi(
void);
436 virtual uchar *GrabImage(
int &Size,
bool Jpeg =
true,
int Quality = -1,
int SizeX = -1,
int SizeY = -1);
448 bool GrabImageFile(
const char *FileName,
bool Jpeg =
true,
int Quality = -1,
int SizeX = -1,
int SizeY = -1);
463 virtual void SetVideoFormat(
bool VideoFormat16_9);
468 #ifdef DEPRECATED_VIDEOSYSTEM 474 virtual void GetVideoSize(
int &Width,
int &Height,
double &VideoAspect);
481 virtual void GetOsdSize(
int &Width,
int &Height,
double &PixelAspect);
506 virtual void SetAudioTrackDevice(
eTrackType Type);
508 virtual void SetSubtitleTrackDevice(
eTrackType Type);
511 void ClrAvailableTracks(
bool DescriptionsOnly =
false,
bool IdsOnly =
false);
516 bool SetAvailableTrack(
eTrackType Type,
int Index, uint16_t Id,
const char *Language = NULL,
const char *Description = NULL);
529 int NumAudioTracks(
void)
const;
533 int NumSubtitleTracks(
void)
const;
540 bool SetCurrentSubtitleTrack(
eTrackType Type,
bool Manual =
false);
546 void EnsureAudioTrack(
bool Force =
false);
550 void EnsureSubtitleTrack(
void);
564 virtual int GetAudioChannelDevice(
void);
567 virtual void SetAudioChannelDevice(
int AudioChannel);
569 virtual void SetVolumeDevice(
int Volume);
571 virtual void SetDigitalAudioDevice(
bool On);
577 bool ToggleMute(
void);
579 int GetAudioChannel(
void);
582 void SetAudioChannel(
int AudioChannel);
585 void SetVolume(
int Volume,
bool Absolute =
false);
600 virtual bool CanReplay(
void)
const;
602 virtual bool SetPlayMode(
ePlayMode PlayMode);
605 virtual int PlayVideo(
const uchar *Data,
int Length);
612 virtual int PlayAudio(
const uchar *Data,
int Length,
uchar Id);
620 virtual int PlaySubtitle(
const uchar *Data,
int Length);
627 virtual int PlayPesPacket(
const uchar *Data,
int Length,
bool VideoOnly =
false);
632 virtual int PlayTsVideo(
const uchar *Data,
int Length);
640 virtual int PlayTsAudio(
const uchar *Data,
int Length);
648 virtual int PlayTsSubtitle(
const uchar *Data,
int Length);
657 virtual int64_t GetSTC(
void);
703 virtual void TrickSpeed(
int Speed,
bool Forward);
714 virtual void Clear(
void);
718 virtual void Play(
void);
721 virtual void Freeze(
void);
723 virtual void Mute(
void);
727 virtual void StillPicture(
const uchar *Data,
int Length);
733 virtual bool Poll(
cPoller &Poller,
int TimeoutMs = 0);
738 virtual bool Flush(
int TimeoutMs = 0);
744 virtual int PlayPes(
const uchar *Data,
int Length,
bool VideoOnly =
false);
754 virtual int PlayTs(
const uchar *Data,
int Length,
bool VideoOnly =
false);
770 bool Replaying(
void)
const;
772 bool Transferring(
void)
const;
774 void StopReplay(
void);
776 bool AttachPlayer(
cPlayer *Player);
787 int Priority(
void)
const;
791 virtual bool OpenDvr(
void);
794 virtual void CloseDvr(
void);
796 virtual bool GetTSPacket(
uchar *&Data);
804 bool Receiving(
bool Dummy =
false)
const;
806 bool AttachReceiver(
cReceiver *Receiver);
810 void DetachAll(
int Pid);
812 virtual void DetachAllReceivers(
void);
816 friend class cDynamicDevice;
839 bool IsIdle(
void)
const {
if (parentDevice)
return parentDevice->
IsIdle();
return isIdle; }
840 bool SetIdle(
bool Idle);
862 virtual void Action(
void);
864 cTSBuffer(
int File,
int Size,
int CardIndex);
866 uchar *Get(
int *Available = NULL);
873 void Skip(
int Count);
890 #define __DYNAMIC_DEVICE_PROBE 895 friend class cDynamicDevice;
915 virtual cDevice *Attach(
cDevice *ParentDevice,
const char *DevPath) = 0;
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 cList< cDynamicDeviceProbeItem > commandQueue
A list where all attach/detach commands are queued so they can be processed in the MainThreadHook of ...
static int currentChannel
cList< cDynamicDeviceProbe > DynamicDeviceProbes
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. ...
cDynamicDeviceProbeItem(eDynamicDeviceProbeCommand Cmd, cString *DevPath)
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.
virtual bool SetIdleDevice(bool Idle, bool TestOnly)
Called by SetIdle if TestOnly, don't do anything, just return, if the device can be set to the new id...
bool HasSubDevice(void) const
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.
static cDevice * nextParentDevice
Holds the parent device for the next subdevice so the dynamite-plugin can work with unpatched plugins...
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).
virtual ~cDynamicDeviceProbeItem()
static cDevice * PrimaryDevice(void)
Returns the primary device.
cLiveSubtitle * liveSubtitle
bool IsSubDevice(void) const
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...
eDynamicDeviceProbeCommand cmd
char language[MAXLANGCODE2]
eDynamicDeviceProbeCommand
cDevice * SubDevice(void) const
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.