12 #include <sys/ioctl.h>
64 #define MIN_PRE_1_3_19_PRIVATESTREAM 10
113 esyslog(
"ERROR: too many devices!");
128 for (time_t t0 = time(NULL); time(NULL) - t0 < Timeout; ) {
156 esyslog(
"ERROR: invalid value in nextCardIndex(%d)", n);
191 isyslog(
"setting primary device to %d", n + 1);
200 esyslog(
"ERROR: invalid primary device number: %d", n + 1);
229 int MaxNumProvidedSystems = (1 << AvailableBits) - 1;
231 if (NumProvidedSystems > MaxNumProvidedSystems) {
232 esyslog(
"ERROR: device %d supports %d modulation systems but cDevice::GetDevice() currently only supports %d delivery systems which should be fixed", Device->
CardIndex() + 1, NumProvidedSystems, MaxNumProvidedSystems);
233 NumProvidedSystems = MaxNumProvidedSystems;
235 else if (NumProvidedSystems <= 0) {
236 esyslog(
"ERROR: device %d reported an invalid number (%d) of supported delivery systems - assuming 1", Device->
CardIndex() + 1, NumProvidedSystems);
237 NumProvidedSystems = 1;
239 return NumProvidedSystems;
246 int SlotPriority[NumCamSlots];
247 int NumUsableSlots = 0;
248 bool InternalCamNeeded =
false;
262 InternalCamNeeded =
true;
265 bool NeedsDetachReceivers =
false;
269 uint32_t Impact = 0xFFFFFFFF;
270 for (
int j = 0; j < NumCamSlots || !NumUsableSlots; j++) {
271 if (NumUsableSlots && SlotPriority[j] >
MAXPRIORITY)
277 if (InternalCamNeeded && !HasInternalCam)
299 imp <<= 1; imp |= ndr;
300 imp <<= 1; imp |= (NumUsableSlots || InternalCamNeeded) ? 0 :
device[i]->
HasCi();
308 NeedsDetachReceivers = ndr;
309 if (NumUsableSlots && !HasInternalCam)
318 if (NeedsDetachReceivers)
340 if (d->IsTunedToTransponder(Channel))
342 if (d->ProvidesTransponder(Channel)) {
343 if (d->MaySwitchTransponder(Channel))
345 else if (!d->Occupied() && d->MaySwitchTransponder(Channel)) {
346 if (d->Priority() < Priority && (!Device || d->
Priority() < Device->
Priority()))
382 int fd = open(FileName, O_WRONLY | O_CREAT | O_NOFOLLOW | O_TRUNC, DEFFILEMODE);
387 if (
safe_write(fd, Image, ImageSize) == ImageSize)
388 isyslog(
"grabbed image to %s", FileName);
413 switch (VideoDisplayFormat) {
423 default:
esyslog(
"ERROR: invalid value for VideoDisplayFormat '%d'", VideoDisplayFormat);
466 if (Pid || PidType ==
ptPcr) {
469 if (PidType !=
ptPcr) {
506 esyslog(
"ERROR: no free slot for PID %d on device %d", Pid,
CardIndex() + 1);
530 if (Pid || PidType ==
ptPcr) {
532 if (PidType ==
ptPcr)
605 return safe_read(Handle, Buffer, Length);
701 for (
int i = 3; i--;) {
703 case scrOk:
return true;
709 default:
esyslog(
"ERROR: invalid return value from SetChannel");
719 Direction =
sgn(Direction);
729 n = channel->
Number() + Direction;
734 dsyslog(
"skipped channel %d", first);
736 dsyslog(
"skipped channels %d..%d", first, n -
sgn(d));
758 bool NeedsTransferMode = Device !=
this;
765 if (NeedsTransferMode) {
802 if (Result ==
scrOk) {
815 if (!NeedsTransferMode)
837 return Seconds > 0 ? Seconds : 0;
906 return (0 <= c && c <= 2) ? c : 0;
911 if (0 <= AudioChannel && AudioChannel <= 2)
932 if (DescriptionsOnly) {
976 esyslog(
"ERROR: SetAvailableTrack called with invalid Type/Index (%d/%d)", Type, Index);
988 for (
int i = FirstTrack; i <= LastTrack; i++) {
1041 if (TrackId && TrackId->
id) {
1057 int PreferredAudioChannel = 0;
1058 int LanguagePreference = -1;
1061 for (
int i = StartCheck; i <= EndCheck; i++) {
1066 PreferredAudioChannel = pos;
1077 dsyslog(
"setting audio track to %d (%d)", PreferredTrack, PreferredAudioChannel);
1090 int LanguagePreference = INT_MAX;
1153 if (Data[0] == 0x47) {
1159 int Pid =
TsPid(Data);
1169 int NewSize = Size + l;
1170 if (
uchar *NewBuffer = (
uchar *)realloc(buf, NewSize)) {
1173 memcpy(buf + Offset, p, l);
1191 int NewSize = Size + l;
1192 if (
uchar *NewBuffer = (
uchar *)realloc(buf, NewSize)) {
1195 memcpy(buf + Offset, p, l);
1198 esyslog(
"ERROR: out of memory");
1241 if (Player &&
player == Player) {
1296 bool FirstLoop =
true;
1299 const uchar *End = Start + Length;
1300 while (Start < End) {
1301 int d = End -
Start;
1320 if (Data[8] == 0x24 && Data[45] >= 0x10 && Data[45] < 0x20) {
1325 int PayloadOffset = Data[8] + 9;
1328 if ((Data[7] & 0x01) && (Data[PayloadOffset - 3] & 0x81) == 0x01 && Data[PayloadOffset - 2] == 0x81)
1331 uchar SubStreamId = Data[PayloadOffset];
1332 uchar SubStreamType = SubStreamId & 0xF0;
1333 uchar SubStreamIndex = SubStreamId & 0x1F;
1336 pre_1_3_19_PrivateStreamDetected:
1339 SubStreamType = 0x80;
1344 switch (SubStreamType) {
1375 dsyslog(
"switching to pre 1.3.19 Dolby Digital compatibility mode - substream id = %02X", SubStreamId);
1378 goto pre_1_3_19_PrivateStreamDetected;
1391 esyslog(
"ERROR: incomplete PES packet write!");
1392 return Start == Data ? w : Start - Data;
1407 while (i <= Length - 6) {
1408 if (Data[i] == 0x00 && Data[i + 1] == 0x00 && Data[i + 2] == 0x01) {
1410 if (i + l > Length) {
1411 esyslog(
"ERROR: incomplete PES packet!");
1418 return i == 0 ? w : i;
1424 esyslog(
"ERROR: leftover PES data!");
1487 esyslog(
"ERROR: skipped %d bytes of TS fragment", Length);
1496 esyslog(
"ERROR: skipped %d bytes to sync on start of TS packet", Skipped);
1497 return Played + Skipped;
1499 int Pid =
TsPid(Data);
1502 if (PayloadOffset <
TS_SIZE) {
1511 return Played ? Played : w;
1519 return Played ? Played : w;
1534 if ((l > 45) && (p[0] == 0x00) && (p[1] == 0x00) && (p[2] == 0x01) && (p[3] == 0xbd) && (p[8] == 0x24) && (p[45] >= 0x10) && (p[45] < 0x20))
1545 return Played ? Played : w;
1585 #define TS_SCRAMBLING_TIMEOUT 3 // seconds to wait until a TS becomes unscrambled
1586 #define TS_SCRAMBLING_TIME_OK 10 // seconds before a Channel/CAM combination is marked as known to decrypt
1598 bool DetachReceivers =
false;
1599 bool DescramblingOk =
false;
1600 int CamSlotNumber = 0;
1604 if (CamSlotNumber) {
1609 DetachReceivers =
true;
1612 DescramblingOk =
true;
1621 if (DetachReceivers) {
1659 if (Receiver->
device ==
this)
1663 #ifdef WAIT_FOR_TUNER_LOCK
1664 #define TUNER_LOCK_TIMEOUT 5000 // ms
1665 if (!
HasLock(TUNER_LOCK_TIMEOUT)) {
1666 esyslog(
"ERROR: device %d has no lock, can't attach receiver!",
CardIndex() + 1);
1673 for (
int n = 0; n < Receiver->
numPids; n++) {
1693 esyslog(
"ERROR: no free receiver slot!");
1699 if (!Receiver || Receiver->
device !=
this)
1701 bool receiversLeft =
false;
1710 for (
int n = 0; n < Receiver->
numPids; n++)
1714 receiversLeft =
true;
1728 if (Receiver && Receiver->
WantsPid(Pid))
1764 bool firstRead =
true;
1767 if (firstRead || Poller.
Poll(100)) {
1771 if (errno == EOVERFLOW)
1793 for (
int i = 1; i < Count; i++) {
1800 esyslog(
"ERROR: skipped %d bytes to sync on TS packet on device %d", Count,
cardIndex);
static int GetClippedNumProvidedSystems(int AvailableBits, cDevice *Device)
cPatPmtParser patPmtParser
virtual int SignalQuality(void) const
Returns the "quality" of the currently received signal.
virtual bool ProvidesChannel(const cChannel *Channel, int Priority=IDLEPRIORITY, bool *NeedsDetachReceivers=NULL) const
Returns true if this device can provide the given channel.
bool Replaying(void) const
Returns true if we are currently replaying.
void ParsePat(const uchar *Data, int Length)
Parses the PAT data from the single TS packet in Data.
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices).
virtual eVideoSystem GetVideoSystem(void)
Returns the video system of the currently displayed material (default is PAL).
virtual void setScaleMode(cSpuDecoder::eScaleMode ScaleMode)=0
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.
#define TS_SCRAMBLING_TIMEOUT
virtual const cChannel * GetCurrentlyTunedTransponder(void) const
Returns a pointer to the currently tuned transponder.
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.
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...
bool ProvidesCa(const int *CaSystemIds)
Returns true if the CAM in this slot provides one of the given CaSystemIds.
bool Receiving(bool Dummy=false) const
Returns true if we are currently receiving. The parameter has no meaning (for backwards compatibility...
int NumTracks(eTrackType FirstTrack, eTrackType LastTrack) const
Returns the number of tracks in the given range that are currently available.
cRingBufferLinear * ringBuffer
static cDevice * ReceiverDevice(void)
virtual void TrickSpeed(int Speed)
Sets the device into a mode where replay is done slower.
void DetachAll(int Pid)
Detaches all receivers from this device for this pid.
void ParsePmt(const uchar *Data, int Length)
Parses the PMT data from the single TS packet in Data.
void SetDescription(const char *Description,...) __attribute__((format(printf
bool IsPmtPid(int Pid) const
Returns true if Pid the one of the PMT pids as defined by the current PAT.
friend class cLiveSubtitle
void Add(cListObject *Object, cListObject *After=NULL)
int Convert(const uchar *Data, int Length)
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask)
Opens a file handle for the given filter data.
int Ca(int Index=0) const
virtual bool SetPlayMode(ePlayMode PlayMode)
Sets the device into the given play mode.
void StartDecrypting(void)
Triggers sending all currently active CA_PMT entries to the CAM, so that it will start decrypting...
bool DeviceHooksProvidesTransponder(const cChannel *Channel) const
bool TsPayloadStart(const uchar *p)
void PlayAudio(const uchar *Data, int Length, uchar Id)
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 int ReadFilter(int Handle, void *Buffer, size_t Length)
Reads data from a handle for the given filter.
void SetCamSlot(cCamSlot *CamSlot)
Sets the given CamSlot to be used with this device.
bool TsHasPayload(const uchar *p)
virtual void MakePrimaryDevice(bool On)
Informs a device that it will be the primary device.
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)
#define TS_SCRAMBLING_CONTROL
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.
int Vpid(void) const
Returns the video pid as defined by the current PMT, or 0 if no video pid has been detected...
virtual void Play(void)
Sets the device into play mode (after a previous trick mode).
bool autoSelectPreferredSubtitleLanguage
int Tpid(void)
Returns the teletext pid as defined by the current PMT, or 0 if no teletext pid has been detected...
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 ...
eTrackType GetCurrentSubtitleTrack(void) const
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.
const char * Dlang(int i) const
void DelLivePids(void)
Deletes the live viewing PIDs.
void AttachFilter(cFilter *Filter)
Attaches the given filter to this device.
int NumAudioTracks(void) const
Returns the number of audio tracks that are currently available.
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)...
virtual int PlayPesPacket(const uchar *Data, int Length, bool VideoOnly=false)
Plays the single PES packet in Data with the given Length.
eTrackType currentSubtitleTrack
virtual int GetAudioChannelDevice(void)
Gets the current audio channel, which is stereo (0), mono left (1) or mono right (2).
bool Poll(int TimeoutMs=0)
eModuleStatus ModuleStatus(void)
Returns the status of the CAM in this slot.
virtual void Mute(void)
Turns off audio while replaying.
const char * Alang(int i) const
void AddChannel(const cChannel *Channel)
Adds all PIDs if the given Channel to the current list of PIDs.
cTSBuffer(int File, int Size, int CardIndex)
bool SetCurrentAudioTrack(eTrackType Type)
Sets the current audio track to the given Type.
int TsPid(const uchar *p)
static int NextCardIndex(int n=0)
Calculates the next card index.
bool IsPrimaryDevice(void) const
void SetChannel(const cChannel *Channel)
virtual bool Ready(void)
Returns true if this device is ready.
void EnsureSubtitleTrack(void)
Makes sure one of the preferred language subtitle tracks is selected.
int TotalTeletextSubtitlePages() const
virtual void SetAudioTrack(eTrackType Type, const tTrackId *TrackId)
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 PesLength(const uchar *p)
bool Transferring(void) const
Returns true if we are currently in Transfer Mode.
cDeviceHook(void)
Creates a new device hook object.
virtual int SignalStrength(void) const
Returns the "strength" of the currently received signal.
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...
virtual void Freeze(void)
Puts the device into "freeze frame" mode.
int pre_1_3_19_PrivateStream
virtual void Activate(bool On)
virtual cString DeviceName(void) const
Returns a string identifying the name of this device.
cDevice * Device(void)
Returns the device this CAM slot is currently assigned to.
tTrackId availableTracks[ttMaxTrackTypes]
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 CurrentChannel(void)
Returns the number of the current channel on the primary device.
virtual int NumProvidedSystems(void) const
Returns the number of individual "delivery systems" this device provides.
T * Next(const T *object) const
void StartSectionHandler(void)
A derived device that provides section data must call this function (typically in its constructor) to...
time_t startScrambleDetection
void Reset(void)
Resets the converter.
int Read(int FileHandle, int Max=0)
Reads at most Max bytes from FileHandle and stores them in the ring buffer.
virtual void SetVolumeDevice(int Volume)
Sets the audio volume on this device (Volume = 0...255).
const int * Caids(void) const
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
void SetDecrypt(tChannelID ChannelID, int CamSlotNumber)
#define MAXOCCUPIEDTIMEOUT
bool SwitchChannel(const cChannel *Channel, bool LiveView)
Switches the device to the given Channel, initiating transfer mode if necessary.
#define TS_SCRAMBLING_TIME_OK
virtual void CloseDvr(void)
Shuts down the DVR.
virtual bool HasLock(int TimeoutMs=0) const
Returns true if the device has a lock on the requested transponder.
static void SleepMs(int TimeoutMs)
Creates a cCondWait object and uses it to sleep for TimeoutMs milliseconds, immediately giving up the...
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView)
Sets the device to the given channel (actual physical setup).
void bool Start(void)
Actually starts the thread.
void PutTs(const uchar *Data, int Length)
Puts the payload data of the single TS packet at Data into the converter.
void ClrAvailableTracks(bool DescriptionsOnly=false, bool IdsOnly=false)
Clears the list of currently available tracks.
#define IS_AUDIO_TRACK(t)
virtual bool HasProgramme(void) const
Returns true if the device is currently showing any programme to the user, either through replaying o...
int SubtitleLanguages[I18N_MAX_LANGUAGES+1]
static cVDRTtxtsubsHookListener * Hook(void)
bool CamDecrypt(tChannelID ChannelID, int CamSlotNumber)
tChannelID GetChannelID(void) const
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 Receive(uchar *Data, int Length)=0
This function is called from the cDevice we are attached to, and delivers one TS packet from the set ...
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.
bool Lock(bool Write, int TimeoutMs=0)
cSectionHandler * sectionHandler
bool Running(void)
Returns false if a derived cThread object shall leave its Action() function.
int Occupied(void) const
Returns the number of seconds this device is still occupied for.
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.
bool AddPid(int Pid)
Adds the given Pid to the list of PIDs of this receiver.
void Del(int Count)
Deletes at most Count bytes from the ring buffer.
static void Launch(cControl *Control)
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...
eKeys Message(eMessageType Type, const char *s, int Seconds=0)
Displays the given message, either through a currently visible display object that is capable of doin...
#define IS_SUBTITLE_TRACK(t)
virtual bool AvoidRecording(void) const
Returns true if this device should only be used for recording if no other device is available...
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.
bool IsDecrypting(void)
Returns true if the CAM in this slot is currently used for decrypting.
int CardIndex(void) const
Returns the card index of this device (0 ... MAXDEVICES - 1).
virtual cString DeviceType(void) const
Returns a string identifying the type of this device (like "DVB-S").
int Priority(void) const
Returns the priority of the current receiving session (-MAXPRIORITY..MAXPRIORITY), or IDLEPRIORITY if no receiver is currently active.
virtual void Receive(uchar *Data, int Length)
This function is called from the cDevice we are attached to, and delivers one TS packet from the set ...
virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording=true, const struct tTeletextSubtitlePage teletextSubtitlePages[]=NULL, int pageCount=0)
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.
void SetPid(int Pid, bool Active)
Sets the given Pid (which has previously been added through a call to AddPid()) to Active...
virtual void SetSubtitleTrack(eTrackType Type, const tTrackId *TrackId)
virtual int PlayTs(const uchar *Data, int Length, bool VideoOnly=false)
Plays the given TS packet.
bool I18nIsPreferredLanguage(int *PreferredLanguages, const char *LanguageCode, int &OldPreference, int *Position)
Checks the given LanguageCode (which may be something like "eng" or "eng+deu") against the PreferredL...
virtual void SetSubtitleTrackDevice(eTrackType Type)
Sets the current subtitle track to the given value.
static void MsgChannelSwitch(const cDevice *Device, int ChannelNumber, bool LiveView)
cChannel * GetByNumber(int Number, int SkipGap=0)
void EnsureAudioTrack(bool Force=false)
Makes sure an audio track is selected that is actually available.
int AudioLanguages[I18N_MAX_LANGUAGES+1]
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).
void SetChecked(tChannelID ChannelID, int CamSlotNumber)
static bool SetPrimaryDevice(int n)
Sets the primary device to 'n'.
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.
cChannelCamRelations ChannelCamRelations
int GetAudioChannel(void)
Gets the current audio channel, which is stereo (0), mono left (1) or mono right (2).
static cList< cDeviceHook > deviceHooks
uchar * Get(int &Count)
Gets data from the ring buffer.
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...
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...
int currentAudioTrackMissingCount
virtual bool IsTunedToTransponder(const cChannel *Channel) const
Returns true if this device is currently tuned to the given Channel's transponder.
void Attach(cFilter *Filter)
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...
const char * Slang(int i) const
int Priority(void)
Returns the priority if the device this slot is currently assigned to, or IDLEPRIORITY if it is not a...
static void MsgSetVolume(int Volume, bool Absolute)
bool CamChecked(tChannelID ChannelID, int CamSlotNumber)
virtual bool CanReplay(void) const
Returns true if this device can currently start a replay session.
char language[MAXLANGCODE2]
bool HasPid(int Pid) const
Returns true if this device is currently receiving the given PID.
virtual bool ProvidesSource(int Source) const
Returns true if this device can provide the given source.
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.
const uchar * GetPes(int &Length)
Gets a pointer to the complete PES packet, or NULL if the packet is not complete yet.
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.
#define IS_DOLBY_TRACK(t)
int TsPayloadOffset(const uchar *p)
bool SetCurrentSubtitleTrack(eTrackType Type, bool Manual=false)
Sets the current subtitle track to the given Type.
void SetRepeatLast(void)
Makes the next call to GetPes() return exactly the same data as the last one (provided there was no c...
int Ppid(void) const
Returns the PCR pid as defined by the current PMT, or 0 if no PCR pid has been detected, yet.
bool Assign(cDevice *Device, bool Query=false)
Assigns this CAM slot to the given Device, if this is possible.
virtual void StillPicture(const uchar *Data, int Length)
Displays the given I-frame as a still picture.
cDvbSubtitleConverter * dvbSubtitleConverter
void Cancel(int WaitSeconds=0)
Cancels the thread by first setting 'running' to false, so that the Action() loop can finish in an or...
eTrackType GetCurrentAudioTrack(void) const
virtual int PlayVideo(const uchar *Data, int Length)
Plays the given data block as video.
static void Shutdown(void)
#define MIN_PRE_1_3_19_PRIVATESTREAM
void Reset(void)
Resets the parser.
int ConvertFragments(const uchar *Data, int Length)
cPidHandle pidHandles[MAXPIDHANDLES]
virtual void SetDigitalAudioDevice(bool On)
Tells the actual device that digital audio output shall be switched on or off.
void SetTimeouts(int PutTimeout, int GetTimeout)
int NumSubtitleTracks(void) const
Returns the number of subtitle 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.
int SlotNumber(void)
Returns the number of this CAM slot within the whole system.
The cDevice class is the base from which actual devices can be derived.
void PlayTsAudio(const uchar *Data, int Length)
virtual void Activate(bool On)
This function is called just before the cReceiver gets attached to (On == true) and right after it ge...
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.
const tTeletextSubtitlePage * TeletextSubtitlePages() const
static cDevice * device[MAXDEVICES]