vdr 2.6.9
|
#include <mtd.h>
Public Member Functions | |
cMtdCamSlot (cCamSlot *MasterSlot, int Index) | |
virtual | ~cMtdCamSlot () |
cMtdMapper * | MtdMapper (void) |
virtual bool | RepliesToQuery (void) |
virtual bool | ProvidesCa (const int *CaSystemIds) |
virtual bool | CanDecrypt (const cChannel *Channel, cMtdMapper *MtdMapper=NULL) |
virtual void | StartDecrypting (void) |
virtual void | StopDecrypting (void) |
virtual uchar * | Decrypt (uchar *Data, int &Count) |
virtual bool | TsPostProcess (uchar *Data) |
virtual void | InjectEit (int Sid) |
int | PutData (const uchar *Data, int Count) |
int | PutCat (const uchar *Data, int Count) |
virtual cCamSlot * | Spawn (void) |
virtual bool | Reset (void) |
virtual eModuleStatus | ModuleStatus (void) |
virtual const char * | GetCamName (void) |
virtual bool | Ready (void) |
virtual bool | HasMMI (void) |
virtual bool | HasUserIO (void) |
virtual bool | EnterMenu (void) |
virtual cCiMenu * | GetMenu (void) |
virtual cCiEnquiry * | GetEnquiry (void) |
![]() | |
bool | McdAvailable (void) |
bool | MtdAvailable (void) |
bool | MtdActive (void) |
cCamSlot (cCiAdapter *CiAdapter, bool WantsTsData=false, cCamSlot *MasterSlot=NULL) | |
virtual | ~cCamSlot () |
bool | IsMasterSlot (void) |
cCamSlot * | MasterSlot (void) |
cCamSlot * | MtdSpawn (void) |
void | TriggerResendPmt (void) |
virtual bool | Assign (cDevice *Device, bool Query=false) |
cDevice * | Device (void) |
bool | Devices (cVector< int > &DeviceNumbers) |
bool | WantsTsData (void) const |
int | SlotIndex (void) |
int | SlotNumber (void) |
int | MasterSlotNumber (void) |
virtual bool | CanActivate (void) |
virtual void | StartActivation (void) |
virtual void | CancelActivation (void) |
virtual bool | IsActivating (void) |
int | Priority (void) |
virtual void | AddPid (int ProgramNumber, int Pid, int StreamType) |
virtual void | SetPid (int Pid, bool Active) |
virtual void | AddChannel (const cChannel *Channel) |
virtual bool | IsDecrypting (void) |
virtual bool | Inject (uchar *Data, int Count) |
![]() | |
cListObject (void) | |
virtual | ~cListObject () |
virtual int | Compare (const cListObject &ListObject) const |
void | Append (cListObject *Object) |
void | Insert (cListObject *Object) |
void | Unlink (void) |
int | Index (void) const |
cListObject * | Prev (void) const |
cListObject * | Next (void) const |
Protected Member Functions | |
virtual const int * | GetCaSystemIds (void) |
virtual void | SendCaPmt (uint8_t CmdId) |
![]() | |
void | BuildCaPmts (uint8_t CmdId, cCiCaPmtList &CaPmtList, cMtdMapper *MtdMapper=NULL) |
void | SendCaPmts (cCiCaPmtList &CaPmtList) |
void | MtdEnable (void) |
int | MtdPutData (uchar *Data, int Count) |
Private Attributes | |
cMutex | clearMutex |
cMtdMapper * | mtdMapper |
cRingBufferLinear * | mtdBuffer |
bool | delivered |
cMtdCamSlot::cMtdCamSlot | ( | cCamSlot * | MasterSlot, |
int | Index ) |
Creates a new "Multi Transponder Decryption" CAM slot, connected to the given physical MasterSlot, using the given Index for mapping PIDs.
Definition at line 250 of file mtd.c.
References cCamSlot::ciAdapter, delivered, cListObject::Index(), cCamSlot::MasterSlot(), MTD_BUFFER_SIZE, mtdBuffer, mtdMapper, cCamSlot::SlotNumber(), and TS_SIZE.
|
virtual |
Definition at line 259 of file mtd.c.
References cCamSlot::Assign(), mtdBuffer, and mtdMapper.
|
virtual |
Returns true if there is a CAM in this slot that is able to decrypt the given Channel (or at least claims to be able to do so).
Since the QUERY/REPLY mechanism for CAMs is pretty unreliable (some CAMs don't reply to queries at all), we always return true if the CAM is currently not decrypting anything. If there is already a channel being decrypted, a call to CanDecrypt() checks whether the CAM can also decrypt the given channel. Only CAMs that have replied to the initial QUERY will perform this check at all. CAMs that never replied to the initial QUERY are assumed not to be able to handle more than one channel at a time. If MtdMapper is given, all SIDs and PIDs will be mapped accordingly.
Reimplemented from cCamSlot.
Definition at line 289 of file mtd.c.
References cCamSlot::CanDecrypt(), cCamSlot::MasterSlot(), and mtdMapper.
If this is a CAM slot that can be freely assigned to any device, but will not be directly inserted into the full TS data stream in hardware, it can implement this function to be given access to the data in the device's TS buffer.
Data points to a buffer of Count bytes of TS data. The first byte in Data is guaranteed to be a TS_SYNC_BYTE, and Count is at least TS_SIZE. Note that Decrypt() may be called with Data == NULL! This is necessary to allow CAMs that copy the incoming data into a separate buffer to return previously received and decrypted TS packets. If Data is NULL, Count is 0 and must not be modified, and the return value shall point to the next available decrypted TS packet (if any). There are three possible ways a CAM can handle decryption:
Reimplemented from cCamSlot.
Definition at line 309 of file mtd.c.
References clearMutex, cCamSlot::Decrypt(), cRingBufferLinear::Del(), delivered, cRingBufferLinear::Get(), cCamSlot::MasterSlot(), mtdBuffer, mtdMapper, cMtdMapper::RealToUniqPid(), TS_SIZE, TS_SYNC, TsPid(), TsSetPid(), and cMtdMapper::UniqToRealPid().
|
inlinevirtual |
Requests the CAM in this slot to start its menu.
Reimplemented from cCamSlot.
Definition at line 189 of file mtd.h.
References MTD_DONT_CALL.
|
inlinevirtual |
Returns the name of the CAM in this slot, or NULL if there is no ready CAM in this slot.
Reimplemented from cCamSlot.
Definition at line 185 of file mtd.h.
References MTD_DONT_CALL.
|
protectedvirtual |
Reimplemented from cCamSlot.
Definition at line 266 of file mtd.c.
References cCamSlot::GetCaSystemIds(), and cCamSlot::MasterSlot().
|
inlinevirtual |
Gets a pending enquiry, or NULL if there is no enquiry.
Reimplemented from cCamSlot.
Definition at line 191 of file mtd.h.
References MTD_DONT_CALL.
|
inlinevirtual |
Gets a pending menu, or NULL if there is no menu.
Reimplemented from cCamSlot.
Definition at line 190 of file mtd.h.
References MTD_DONT_CALL.
|
inlinevirtual |
Returns 'true' if the CAM in this slot has an active MMI.
Reimplemented from cCamSlot.
Definition at line 187 of file mtd.h.
References MTD_DONT_CALL.
|
inlinevirtual |
Returns true if there is a pending user interaction, which shall be retrieved via GetMenu() or GetEnquiry().
Reimplemented from cCamSlot.
Definition at line 188 of file mtd.h.
References MTD_DONT_CALL.
|
virtual |
Injects a generated EIT with a "present event" for the given Sid into the TS data stream sent to the CAM.
This only applies to CAM slots that have WantsTsData set to true in their constructor. The default implementation sends an EIT with the minimum event necessary to disable the CAMs parental rating prompt.
Reimplemented from cCamSlot.
Definition at line 351 of file mtd.c.
References cCamSlot::InjectEit(), cCamSlot::MasterSlot(), mtdMapper, and cMtdMapper::RealToUniqSid().
|
inlinevirtual |
Returns the status of the CAM in this slot.
Reimplemented from cCamSlot.
Definition at line 184 of file mtd.h.
References msNone, and MTD_DONT_CALL.
|
inline |
Definition at line 170 of file mtd.h.
References mtdMapper.
Referenced by cCaPidReceiver::Receive().
|
virtual |
Returns true if the CAM in this slot provides one of the given CaSystemIds.
This doesn't necessarily mean that it will be possible to actually decrypt such a programme, since CAMs usually advertise several CA system ids, while the actual decryption is controlled by the smart card inserted into the CAM.
Reimplemented from cCamSlot.
Definition at line 284 of file mtd.c.
References cCamSlot::MasterSlot(), and cCamSlot::ProvidesCa().
int cMtdCamSlot::PutCat | ( | const uchar * | Data, |
int | Count ) |
Definition at line 367 of file mtd.c.
References cCamSlot::Decrypt(), and cCamSlot::MasterSlot().
Referenced by cCaPidReceiver::Receive().
int cMtdCamSlot::PutData | ( | const uchar * | Data, |
int | Count ) |
Definition at line 356 of file mtd.c.
References cRingBufferLinear::Free(), mtdBuffer, cRingBufferLinear::Put(), and TS_SIZE.
|
inlinevirtual |
Returns 'true' if the CAM in this slot is ready to decrypt.
Reimplemented from cCamSlot.
Definition at line 186 of file mtd.h.
References MTD_DONT_CALL.
|
virtual |
Returns true if the CAM in this slot replies to queries and thus supports MCD ("Multi Channel Decryption").
Reimplemented from cCamSlot.
Definition at line 279 of file mtd.c.
References cCamSlot::MasterSlot(), and cCamSlot::RepliesToQuery().
|
inlinevirtual |
Resets the CAM in this slot.
Returns true if the operation was successful.
Reimplemented from cCamSlot.
Definition at line 183 of file mtd.h.
References MTD_DONT_CALL.
|
protectedvirtual |
Reimplemented from cCamSlot.
Definition at line 271 of file mtd.c.
References cCamSlot::BuildCaPmts(), cCamSlot::MasterSlot(), mtdMapper, cCamSlot::mutex, and cCamSlot::SendCaPmts().
|
inlinevirtual |
Definition at line 182 of file mtd.h.
References MTD_DONT_CALL.
|
virtual |
Sends all CA_PMT entries to the CAM that have been modified since the last call to this function.
This includes CA_PMTs that have been added or activated, as well as ones that have been deactivated. StartDecrypting() will be called whenever a PID is activated or deactivated.
Reimplemented from cCamSlot.
Definition at line 294 of file mtd.c.
References cCamSlot::MasterSlot(), and cCamSlot::StartDecrypting().
|
virtual |
Clears the list of CA_PMT entries and tells the CAM to stop decrypting.
Note that this function is only called when there are no more PIDs for the CAM to decrypt. There is no symmetry between StartDecrypting() and StopDecrypting().
Reimplemented from cCamSlot.
Definition at line 300 of file mtd.c.
References cMtdMapper::Clear(), cRingBufferLinear::Clear(), clearMutex, delivered, mtdBuffer, mtdMapper, and cCamSlot::StopDecrypting().
|
virtual |
If there is a cCiSession that needs to do additional processing on TS packets (after the CAM has done the decryption), this function will call its TsPostProcess() function to have it do whatever operations are necessary on the given TsPacket.
Returns true if the TsPacket was in any way modified.
Reimplemented from cCamSlot.
Definition at line 346 of file mtd.c.
References cCamSlot::MasterSlot(), and cCamSlot::TsPostProcess().
|
private |
Definition at line 158 of file mtd.h.
Referenced by Decrypt(), and StopDecrypting().
|
private |
Definition at line 161 of file mtd.h.
Referenced by cMtdCamSlot(), Decrypt(), and StopDecrypting().
|
private |
Definition at line 160 of file mtd.h.
Referenced by cMtdCamSlot(), Decrypt(), PutData(), StopDecrypting(), and ~cMtdCamSlot().
|
private |
Definition at line 159 of file mtd.h.
Referenced by CanDecrypt(), cMtdCamSlot(), Decrypt(), InjectEit(), MtdMapper(), SendCaPmt(), StopDecrypting(), and ~cMtdCamSlot().