bool cSatipDevice::ProvidesChannel(const cChannel *channelP, int priorityP, bool *needsDetachReceiversP) const { bool result = false; bool hasPriority = (priorityP == IDLEPRIORITY) || (priorityP > this->Priority()); bool needsDetachReceivers = false; debug9("%s (%d, %d, %d) [device %u]", __PRETTY_FUNCTION__, channelP ? channelP->Number() : -1, priorityP, !!needsDetachReceiversP, deviceIndexM); if (channelP && ProvidesTransponder(channelP)) { result = hasPriority; if (priorityP > IDLEPRIORITY) { if (Receiving()) { if (IsTunedToTransponder(channelP)) { if (channelP->Vpid() && !HasPid(channelP->Vpid()) || channelP->Apid(0) && !HasPid(channelP->Apid(0)) || channelP->Dpid(0) && !HasPid(channelP->Dpid(0))) { if (CamSlot() && channelP->Ca() >= CA_ENCRYPTED_MIN) { if (CamSlot()->CanDecrypt(channelP)) result = true; else needsDetachReceivers = true; } else result = true; } else result = true; } else needsDetachReceivers = Receiving(); } } } if (needsDetachReceiversP) *needsDetachReceiversP = needsDetachReceivers; return result; }
bool cSatipDevice::ProvidesChannel(const cChannel *channelP, int priorityP, bool *needsDetachReceiversP) const { bool result = false; #define IDLEPRIORITY -1 bool hasPriority = (priorityP == IDLEPRIORITY) || (priorityP > this->Priority()); bool needsDetachReceivers = false; debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM); if (channelP && ProvidesTransponder(channelP)) { result = hasPriority; if (priorityP > IDLEPRIORITY) { if (Receiving()) { cSatipDevice *dev = (cSatipDevice *)this; if (dev->IsTunedToTransponder(channelP)) { if (channelP->Vpid() && !HasPid(channelP->Vpid()) || channelP->Apid(0) && !HasPid(channelP->Apid(0)) || channelP->Dpid(0) && !HasPid(channelP->Dpid(0))) { if (CamSlot() && channelP->Ca() >= CA_ENCRYPTED_MIN) { if (CamSlot()->CanDecrypt(channelP)) result = true; else needsDetachReceivers = true; } else result = true; } else result = true; } else needsDetachReceivers = Receiving(); } } } if (needsDetachReceiversP) *needsDetachReceiversP = needsDetachReceivers; return result; }