2003-12-22 13:29:24 +01:00
|
|
|
/*
|
|
|
|
* pat.h: PAT section filter
|
|
|
|
*
|
|
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
|
|
* how to reach the author.
|
|
|
|
*
|
2014-02-18 14:14:33 +01:00
|
|
|
* $Id: pat.h 2.3.1.1 2014/02/18 14:12:24 kls Exp $
|
2003-12-22 13:29:24 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PAT_H
|
|
|
|
#define __PAT_H
|
|
|
|
|
2004-03-13 10:35:38 +01:00
|
|
|
#include <stdint.h>
|
2006-03-26 14:12:08 +02:00
|
|
|
#include "filter.h"
|
2014-02-18 14:14:33 +01:00
|
|
|
#include "thread.h"
|
2004-01-04 12:30:00 +01:00
|
|
|
|
|
|
|
#define MAXPMTENTRIES 64
|
2003-12-22 13:29:24 +01:00
|
|
|
|
|
|
|
class cPatFilter : public cFilter {
|
|
|
|
private:
|
2014-02-18 14:14:33 +01:00
|
|
|
cMutex mutex;
|
|
|
|
cTimeMs timer;
|
|
|
|
int patVersion;
|
2003-12-22 13:29:24 +01:00
|
|
|
int pmtIndex;
|
2014-02-18 14:14:33 +01:00
|
|
|
int pmtId[MAXPMTENTRIES];
|
|
|
|
int pmtVersion[MAXPMTENTRIES];
|
2004-01-04 12:30:00 +01:00
|
|
|
int numPmtEntries;
|
2014-02-18 14:14:33 +01:00
|
|
|
int sid;
|
|
|
|
int GetPmtPid(int Index) { return pmtId[Index] & 0x0000FFFF; }
|
|
|
|
int MakePmtId(int PmtPid, int Sid) { return PmtPid | (Sid << 16); }
|
|
|
|
bool PmtVersionChanged(int PmtPid, int Sid, int Version, bool SetNewVersion = false);
|
|
|
|
void SwitchToNextPmtPid(void);
|
2003-12-22 13:29:24 +01:00
|
|
|
protected:
|
|
|
|
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
|
|
|
|
public:
|
|
|
|
cPatFilter(void);
|
|
|
|
virtual void SetStatus(bool On);
|
2014-02-18 14:14:33 +01:00
|
|
|
void Trigger(int Sid = -1);
|
2003-12-22 13:29:24 +01:00
|
|
|
};
|
|
|
|
|
2009-08-15 22:19:42 +02:00
|
|
|
int GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, uchar *Data, int EsPid);
|
2003-12-22 13:29:24 +01:00
|
|
|
///< Gets all CA descriptors for a given channel.
|
|
|
|
///< Copies all available CA descriptors for the given Source, Transponder and ServiceId
|
|
|
|
///< into the provided buffer at Data (at most BufSize bytes). Only those CA descriptors
|
|
|
|
///< are copied that match one of the given CA system IDs.
|
2013-02-16 15:26:45 +01:00
|
|
|
///< Returns the number of bytes copied into Data (0 if no CA descriptors are
|
2003-12-22 13:29:24 +01:00
|
|
|
///< available), or -1 if BufSize was too small to hold all CA descriptors.
|
2011-12-04 13:40:52 +01:00
|
|
|
///< The return value tells whether these CA descriptors are to be used
|
2003-12-24 10:30:35 +01:00
|
|
|
///< for the individual streams.
|
2003-12-22 13:29:24 +01:00
|
|
|
|
|
|
|
#endif //__PAT_H
|