vdr 2.7.3
cCaPidReceiver Class Reference

Public Member Functions

 cCaPidReceiver (void)
 
virtual ~cCaPidReceiver ()
 
virtual void Receive (const uchar *Data, int Length)
 
bool HasCaPids (void) const
 
void Reset (void)
 
bool HandlingPid (void)
 
- Public Member Functions inherited from cReceiver
 cReceiver (const cChannel *Channel=NULL, int Priority=MINPRIORITY)
 
virtual ~cReceiver ()
 
int Priority (void)
 
void SetPriority (int Priority)
 
bool AddPid (int Pid)
 
bool AddPids (const int *Pids)
 
bool AddPids (int Pid1, int Pid2, int Pid3=0, int Pid4=0, int Pid5=0, int Pid6=0, int Pid7=0, int Pid8=0, int Pid9=0)
 
bool SetPids (const cChannel *Channel)
 
void DelPid (int Pid)
 
void DelPids (const int *Pids)
 
tChannelID ChannelID (void)
 
int NumPids (void) const
 
bool IsAttached (void)
 

Private Member Functions

void AddEmmPid (int Pid)
 
void DelEmmPids (void)
 

Private Attributes

int catVersion
 
cVector< int > emmPids
 
uchar buffer [1024]
 
ucharbufp
 
uchar mtdCatBuffer [CAT_MAXPACKETS][TS_SIZE]
 
int mtdNumCatPackets
 
int length
 
cMutex mutex
 
bool handlingPid
 

Additional Inherited Members

- Protected Member Functions inherited from cReceiver
cDeviceDevice (void)
 
void Detach (void)
 
virtual void Activate (bool On)
 

Detailed Description

Definition at line 117 of file ci.c.

Constructor & Destructor Documentation

◆ cCaPidReceiver()

cCaPidReceiver::cCaPidReceiver ( void )

Definition at line 148 of file ci.c.

References cReceiver::AddPid(), bufp, CATPID, catVersion, handlingPid, length, mtdNumCatPackets, and mutex.

◆ ~cCaPidReceiver()

virtual cCaPidReceiver::~cCaPidReceiver ( )
inlinevirtual

Definition at line 133 of file ci.c.

References cReceiver::Detach().

Member Function Documentation

◆ AddEmmPid()

void cCaPidReceiver::AddEmmPid ( int Pid)
private

Definition at line 161 of file ci.c.

References cReceiver::AddPid(), emmPids, handlingPid, and mutex.

Referenced by Receive().

◆ DelEmmPids()

void cCaPidReceiver::DelEmmPids ( void )
private

Definition at line 174 of file ci.c.

References cReceiver::DelPid(), emmPids, handlingPid, and mutex.

Referenced by Receive(), and Reset().

◆ HandlingPid()

bool cCaPidReceiver::HandlingPid ( void )

The cCaPidReceiver adds/deletes PIDs to/from the base class cReceiver, which in turn does the same on the cDevice it is attached to.

The cDevice then sets the PIDs on the assigned cCamSlot, which can cause a deadlock on the cCamSlot's mutex if a cReceiver is detached from the device at the same time. Since these PIDs, however, are none that have to be decrypted, it is not necessary to set them in the CAM. Therefore this function is used in cCamSlot::SetPid() to detect this situation, and thus avoid the deadlock.

Definition at line 297 of file ci.c.

References handlingPid, and mutex.

◆ HasCaPids()

bool cCaPidReceiver::HasCaPids ( void ) const
inline

Definition at line 135 of file ci.c.

References emmPids, and cReceiver::NumPids().

◆ Receive()

void cCaPidReceiver::Receive ( const uchar * Data,
int Length )
virtual

This function is called from the cDevice we are attached to, and delivers one TS packet from the set of PIDs the cReceiver has requested.

The data packet must be accepted immediately, and the call must return as soon as possible, without any unnecessary delay. Each TS packet will be delivered only ONCE, so the cReceiver must make sure that it will be able to buffer the data if necessary.

Implements cReceiver.

Definition at line 184 of file ci.c.

References AddEmmPid(), buffer, bufp, cDevice::CamSlot(), CATPID, catVersion, SI::CRC32::crc32(), DelEmmPids(), cReceiver::Device(), dsyslog, esyslog, length, min(), mtdCatBuffer, cMtdCamSlot::MtdMapper(), MtdMapPid(), mtdNumCatPackets, Peek13(), cMtdCamSlot::PutCat(), SI::TableIdCAT, TS_SIZE, TsPayloadStart(), and TsPid().

◆ Reset()

void cCaPidReceiver::Reset ( void )
inline

Definition at line 136 of file ci.c.

References catVersion, and DelEmmPids().

Member Data Documentation

◆ buffer

uchar cCaPidReceiver::buffer[1024]
private

Definition at line 121 of file ci.c.

Referenced by Receive().

◆ bufp

uchar* cCaPidReceiver::bufp
private

Definition at line 122 of file ci.c.

Referenced by cCaPidReceiver(), and Receive().

◆ catVersion

int cCaPidReceiver::catVersion
private

Definition at line 119 of file ci.c.

Referenced by cCaPidReceiver(), Receive(), and Reset().

◆ emmPids

cVector<int> cCaPidReceiver::emmPids
private

Definition at line 120 of file ci.c.

Referenced by AddEmmPid(), DelEmmPids(), and HasCaPids().

◆ handlingPid

bool cCaPidReceiver::handlingPid
private

Definition at line 128 of file ci.c.

Referenced by AddEmmPid(), cCaPidReceiver(), DelEmmPids(), and HandlingPid().

◆ length

int cCaPidReceiver::length
private

Definition at line 126 of file ci.c.

Referenced by cCaPidReceiver(), and Receive().

◆ mtdCatBuffer

uchar cCaPidReceiver::mtdCatBuffer[CAT_MAXPACKETS][TS_SIZE]
private

Definition at line 124 of file ci.c.

Referenced by Receive().

◆ mtdNumCatPackets

int cCaPidReceiver::mtdNumCatPackets
private

Definition at line 125 of file ci.c.

Referenced by cCaPidReceiver(), and Receive().

◆ mutex

cMutex cCaPidReceiver::mutex
private

Definition at line 127 of file ci.c.

Referenced by AddEmmPid(), cCaPidReceiver(), DelEmmPids(), and HandlingPid().


The documentation for this class was generated from the following file: