vdr  2.4.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 [2048]
 
ucharbufp
 
uchar mtdCatBuffer [TS_SIZE]
 
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 ( void  )

Definition at line 146 of file ci.c.

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

virtual cCaPidReceiver::~cCaPidReceiver ( )
inlinevirtual

Definition at line 131 of file ci.c.

References cReceiver::Detach().

Member Function Documentation

void cCaPidReceiver::AddEmmPid ( int  Pid)
private

Definition at line 158 of file ci.c.

References cReceiver::AddPid(), cVector< T >::Append(), emmPids, handlingPid, mutex, and cVector< T >::Size().

Referenced by Receive().

void cCaPidReceiver::DelEmmPids ( void  )
private

Definition at line 171 of file ci.c.

References cVector< T >::Clear(), cReceiver::DelPid(), emmPids, handlingPid, mutex, and cVector< T >::Size().

Referenced by Receive(), and Reset().

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 263 of file ci.c.

References handlingPid, and mutex.

Referenced by cCamSlot::SetPid().

bool cCaPidReceiver::HasCaPids ( void  ) const
inline

Definition at line 133 of file ci.c.

References emmPids, cReceiver::NumPids(), and cVector< T >::Size().

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 181 of file ci.c.

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

void cCaPidReceiver::Reset ( void  )
inline

Definition at line 134 of file ci.c.

References catVersion, and DelEmmPids().

Referenced by cCamSlot::Assign().

Member Data Documentation

uchar cCaPidReceiver::buffer[2048]
private

Definition at line 121 of file ci.c.

Referenced by Receive().

uchar* cCaPidReceiver::bufp
private

Definition at line 122 of file ci.c.

Referenced by cCaPidReceiver(), and Receive().

int cCaPidReceiver::catVersion
private

Definition at line 119 of file ci.c.

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

cVector<int> cCaPidReceiver::emmPids
private

Definition at line 120 of file ci.c.

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

bool cCaPidReceiver::handlingPid
private

Definition at line 126 of file ci.c.

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

int cCaPidReceiver::length
private

Definition at line 124 of file ci.c.

Referenced by cCaPidReceiver(), and Receive().

uchar cCaPidReceiver::mtdCatBuffer[TS_SIZE]
private

Definition at line 123 of file ci.c.

Referenced by Receive().

cMutex cCaPidReceiver::mutex
private

Definition at line 125 of file ci.c.

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


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