capmt.cpp: change CI handling for testing

- reactivate channel->bUseCI Filter
- do not send every event to CI if not required
- some more spam for debug


Origin commit data
------------------
Commit: f3775d1814
Author: FlatTV <FlatTV@gmx.de>
Date: 2017-11-13 (Mon, 13 Nov 2017)
This commit is contained in:
FlatTV
2017-11-13 14:12:08 +01:00
parent 607c0ab1d9
commit 8a4c946679

View File

@@ -312,23 +312,15 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
cam->setCaMask(newmask); cam->setCaMask(newmask);
cam->setSource(source); cam->setSource(source);
if(newmask != 0 && (!filter_channels || !channel->bUseCI)) { if(newmask != 0 && (!filter_channels || !channel->bUseCI)) {
INFO(" ##NI: socket only");
cam->makeCaPmt(channel, true); cam->makeCaPmt(channel, true);
cam->setCaPmt(true); cam->setCaPmt(true);
#if ! HAVE_COOL_HARDWARE
// CI
CaIdVector caids;
cCA::GetInstance()->GetCAIDS(caids);
uint8_t list = CCam::CAPMT_ONLY;
cam->makeCaPmt(channel, false, list, caids);
int len;
unsigned char * buffer = channel->getRawPmt(len);
cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, mode, start);
#endif
} }
} }
#if ! HAVE_COOL_HARDWARE #if ! HAVE_COOL_HARDWARE
// CI // CI
if(oldmask == newmask) { if(oldmask == newmask) {
INFO(" ##NI: (oldmask == newmask)");
if (mode) { if (mode) {
if(start) { if(start) {
CaIdVector caids; CaIdVector caids;
@@ -350,6 +342,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
} }
#endif #endif
if(newmask == 0) { if(newmask == 0) {
INFO(" ##NI: (newmask == 0)");
/* FIXME: back to live channel from playback dont parse pmt and call setCaPmt /* FIXME: back to live channel from playback dont parse pmt and call setCaPmt
* (see CMD_SB_LOCK / UNLOCK PLAYBACK */ * (see CMD_SB_LOCK / UNLOCK PLAYBACK */
//channel->setRawPmt(NULL);//FIXME //channel->setRawPmt(NULL);//FIXME
@@ -378,7 +371,10 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
#if ! HAVE_COOL_HARDWARE #if ! HAVE_COOL_HARDWARE
// CI // CI
if (mode && !start) { if (mode && !start) {
INFO(" ##NI: (mode && !start) do we realy need this?");
}
#endif #endif
CaIdVector caids; CaIdVector caids;
cCA::GetInstance()->GetCAIDS(caids); cCA::GetInstance()->GetCAIDS(caids);
//uint8_t list = CCam::CAPMT_FIRST; //uint8_t list = CCam::CAPMT_FIRST;
@@ -427,13 +423,9 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
cam->makeCaPmt(channel, false, list, caids); cam->makeCaPmt(channel, false, list, caids);
int len; int len;
unsigned char * buffer = channel->getRawPmt(len); unsigned char * buffer = channel->getRawPmt(len);
#if ! HAVE_COOL_HARDWARE #if HAVE_COOL_HARDWARE
cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, 0, true);
#else
cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_SMARTCARD); cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_SMARTCARD);
#endif #endif
#if HAVE_COOL_HARDWARE
if (tunerno >= 0 && tunerno != cDemux::GetSource(cam->getSource())) { if (tunerno >= 0 && tunerno != cDemux::GetSource(cam->getSource())) {
INFO("CI: configured tuner %d do not match %d, skip [%s]", tunerno, cam->getSource(), channel->getName().c_str()); INFO("CI: configured tuner %d do not match %d, skip [%s]", tunerno, cam->getSource(), channel->getName().c_str());
} else if (filter_channels && !channel->bUseCI) { } else if (filter_channels && !channel->bUseCI) {
@@ -441,14 +433,25 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
} else { } else {
useCI = true; //NI useCI = true; //NI
INFO("CI: use CI for [%s]", channel->getName().c_str()); INFO("CI: use CI for [%s]", channel->getName().c_str());
#if HAVE_COOL_HARDWARE
cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI); cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI);
#endif
} }
//list = CCam::CAPMT_MORE; //list = CCam::CAPMT_MORE;
#endif
}
#if ! HAVE_COOL_HARDWARE #if ! HAVE_COOL_HARDWARE
if((oldmask != newmask) || force_update) {
if(useCI) {
INFO(" ##NI: (oldmask != newmask) || force_update)");
cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, 0, true);
} else {
INFO(" ##NI: (oldmask != newmask) || force_update) - no CI needed");
//no CI needed
ca_map_t no_camap;
cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, false /*channel->scrambled*/, no_camap /*channel->camap*/, mode, start);
}
} }
#endif #endif
}
return true; return true;
} }