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.
|
|
|
|
*
|
2021-06-21 20:13:55 +02:00
|
|
|
* $Id: pat.h 5.3 2021/06/21 20:13:55 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 13:12:39 +01:00
|
|
|
#include "thread.h"
|
2004-01-04 12:30:00 +01:00
|
|
|
|
2020-06-19 12:19:15 +02:00
|
|
|
class cPmtPidEntry;
|
|
|
|
class cPmtSidEntry;
|
2021-06-08 14:57:26 +02:00
|
|
|
class cPmtSidRequest;
|
2003-12-22 13:29:24 +01:00
|
|
|
|
|
|
|
class cPatFilter : public cFilter {
|
|
|
|
private:
|
2014-02-18 13:12:39 +01:00
|
|
|
cMutex mutex;
|
|
|
|
cTimeMs timer;
|
|
|
|
int patVersion;
|
2020-06-19 12:19:15 +02:00
|
|
|
cPmtPidEntry *activePmt;
|
|
|
|
cList<cPmtPidEntry> pmtPidList;
|
|
|
|
cList<cPmtSidEntry> pmtSidList;
|
2021-06-08 14:57:26 +02:00
|
|
|
cList<cPmtSidRequest> pmtSidRequestList;
|
|
|
|
int source;
|
|
|
|
int transponder;
|
2020-06-19 12:19:15 +02:00
|
|
|
cSectionSyncer sectionSyncer;
|
2021-06-08 14:57:26 +02:00
|
|
|
bool TransponderChanged(void);
|
2020-06-19 12:19:15 +02:00
|
|
|
bool PmtPidComplete(int PmtPid);
|
|
|
|
void PmtPidReset(int PmtPid);
|
2014-02-18 13:12:39 +01:00
|
|
|
bool PmtVersionChanged(int PmtPid, int Sid, int Version, bool SetNewVersion = false);
|
2021-06-08 14:57:26 +02:00
|
|
|
int NumSidRequests(int Sid);
|
2014-02-18 13:12:39 +01:00
|
|
|
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);
|
2021-06-11 09:38:38 +02:00
|
|
|
virtual void SetStatus(bool On);
|
2021-06-21 20:13:55 +02:00
|
|
|
void Trigger(int = 0); // triggers reading the PMT PIDs that are currently not requested (dummy parameter for backwards compatibility, value is ignored)
|
2021-06-08 14:57:26 +02:00
|
|
|
void Request(int Sid); // requests permanent reading of the PMT PID for this SID
|
|
|
|
void Release(int Sid); // releases permanent reading of the PMT PID for this SID
|
2003-12-22 13:29:24 +01:00
|
|
|
};
|
|
|
|
|
2016-12-23 14:08:14 +01:00
|
|
|
void GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, cDynamicBuffer &Buffer, 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
|
2016-12-23 14:08:14 +01:00
|
|
|
///< into the provided buffer. Only those CA descriptors
|
2014-01-04 11:17:24 +01:00
|
|
|
///< are copied that match one of the given CA system IDs (or all of them, if CaSystemIds
|
|
|
|
///< is 0xFFFF).
|
2014-01-01 12:37:22 +01:00
|
|
|
|
|
|
|
int GetCaPids(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, int *Pids);
|
|
|
|
///< Gets all CA pids for a given channel.
|
|
|
|
///< Copies all available CA pids from the CA descriptors for the given Source, Transponder and ServiceId
|
|
|
|
///< into the provided buffer at Pids (at most BufSize - 1 entries, the list will be zero-terminated).
|
2014-01-04 11:17:24 +01:00
|
|
|
///< Only the CA pids of those CA descriptors are copied that match one of the given CA system IDs
|
|
|
|
///< (or all of them, if CaSystemIds is 0xFFFF).
|
2014-01-01 12:37:22 +01:00
|
|
|
///< Returns the number of pids copied into Pids (0 if no CA descriptors are
|
|
|
|
///< available), or -1 if BufSize was too small to hold all CA pids.
|
2003-12-22 13:29:24 +01:00
|
|
|
|
2015-01-04 13:36:46 +01:00
|
|
|
int GetPmtPid(int Source, int Transponder, int ServiceId);
|
|
|
|
///< Gets the Pid of the PMT in which the CA descriptors for this channel are defined.
|
|
|
|
|
2003-12-22 13:29:24 +01:00
|
|
|
#endif //__PAT_H
|