mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 18:31:12 +02:00
zapit/src/capmt.cpp: dont send private descriptors;
change ca list mode to ONLY/single channel and ADD, if there are more
Origin commit data
------------------
Commit: 3a0750c5d7
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-10-29 (Mon, 29 Oct 2012)
This commit is contained in:
@@ -65,7 +65,7 @@ class CCam : public CBasicClient
|
|||||||
CCam();
|
CCam();
|
||||||
virtual ~CCam() {};
|
virtual ~CCam() {};
|
||||||
bool sendMessage(const char * const data, const size_t length, bool update = false);
|
bool sendMessage(const char * const data, const size_t length, bool update = false);
|
||||||
bool makeCaPmt(CZapitChannel * channel, uint8_t list = CAPMT_ONLY, const CaIdVector &caids = CaIdVector());
|
bool makeCaPmt(CZapitChannel * channel, bool add_private, uint8_t list = CAPMT_ONLY, const CaIdVector &caids = CaIdVector());
|
||||||
bool setCaPmt(bool update = false);
|
bool setCaPmt(bool update = false);
|
||||||
bool sendCaPmt(uint64_t tpid, uint8_t *rawpmt, int rawlen);
|
bool sendCaPmt(uint64_t tpid, uint8_t *rawpmt, int rawlen);
|
||||||
int makeMask(int demux, bool add);
|
int makeMask(int demux, bool add);
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
#include <dvbsi++/program_map_section.h>
|
#include <dvbsi++/program_map_section.h>
|
||||||
#include <dvbsi++/ca_program_map_section.h>
|
#include <dvbsi++/ca_program_map_section.h>
|
||||||
|
|
||||||
//#define DEBUG_CAPMT
|
#define DEBUG_CAPMT
|
||||||
|
|
||||||
CCam::CCam()
|
CCam::CCam()
|
||||||
{
|
{
|
||||||
@@ -76,12 +76,12 @@ bool CCam::sendMessage(const char * const data, const size_t length, bool update
|
|||||||
return send_data(data, length);
|
return send_data(data, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CCam::makeCaPmt(CZapitChannel * channel, uint8_t list, const CaIdVector &caids)
|
bool CCam::makeCaPmt(CZapitChannel * channel, bool add_private, uint8_t list, const CaIdVector &caids)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
unsigned char * buffer = channel->getRawPmt(len);
|
unsigned char * buffer = channel->getRawPmt(len);
|
||||||
|
|
||||||
DBG("cam %x source %d camask %d list %02x buffer", (int) this, source_demux, camask, list);
|
INFO("cam %x source %d camask %d list %02x buffer", (int) this, source_demux, camask, list);
|
||||||
|
|
||||||
if(!buffer)
|
if(!buffer)
|
||||||
return false;
|
return false;
|
||||||
@@ -89,6 +89,7 @@ bool CCam::makeCaPmt(CZapitChannel * channel, uint8_t list, const CaIdVector &ca
|
|||||||
ProgramMapSection pmt(buffer);
|
ProgramMapSection pmt(buffer);
|
||||||
CaProgramMapSection capmt(&pmt, list, 0x01, caids);
|
CaProgramMapSection capmt(&pmt, list, 0x01, caids);
|
||||||
|
|
||||||
|
if (add_private) {
|
||||||
uint8_t tmp[10];
|
uint8_t tmp[10];
|
||||||
tmp[0] = 0x84;
|
tmp[0] = 0x84;
|
||||||
tmp[1] = 0x02;
|
tmp[1] = 0x02;
|
||||||
@@ -115,6 +116,7 @@ bool CCam::makeCaPmt(CZapitChannel * channel, uint8_t list, const CaIdVector &ca
|
|||||||
tmp[9] = channel->getOriginalNetworkId() & 0xFF;
|
tmp[9] = channel->getOriginalNetworkId() & 0xFF;
|
||||||
|
|
||||||
capmt.injectDescriptor(tmp, false);
|
capmt.injectDescriptor(tmp, false);
|
||||||
|
}
|
||||||
|
|
||||||
calen = capmt.writeToBuffer(cabuf);
|
calen = capmt.writeToBuffer(cabuf);
|
||||||
#ifdef DEBUG_CAPMT
|
#ifdef DEBUG_CAPMT
|
||||||
@@ -235,7 +237,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
|
|||||||
if(newmask == 0) {
|
if(newmask == 0) {
|
||||||
cam->sendMessage(NULL, 0, false);
|
cam->sendMessage(NULL, 0, false);
|
||||||
} else {
|
} else {
|
||||||
cam->makeCaPmt(channel);
|
cam->makeCaPmt(channel, true);
|
||||||
cam->setCaPmt(true);
|
cam->setCaPmt(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -249,7 +251,10 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
|
|||||||
}
|
}
|
||||||
CaIdVector caids;
|
CaIdVector caids;
|
||||||
cCA::GetInstance()->GetCAIDS(caids);
|
cCA::GetInstance()->GetCAIDS(caids);
|
||||||
uint8_t list = CCam::CAPMT_FIRST;
|
//uint8_t list = CCam::CAPMT_FIRST;
|
||||||
|
uint8_t list = CCam::CAPMT_ONLY;
|
||||||
|
if (channel_map.size() > 1)
|
||||||
|
list = CCam::CAPMT_ADD;
|
||||||
for (it = channel_map.begin(); it != channel_map.end(); /*++it*/)
|
for (it = channel_map.begin(); it != channel_map.end(); /*++it*/)
|
||||||
{
|
{
|
||||||
cam = it->second;
|
cam = it->second;
|
||||||
@@ -258,14 +263,16 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
|
|||||||
if(!channel)
|
if(!channel)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (it == channel_map.end())
|
if (it == channel_map.end())
|
||||||
list |= CCam::CAPMT_LAST; // FIRST->ONLY or MORE->LAST
|
list |= CCam::CAPMT_LAST; // FIRST->ONLY or MORE->LAST
|
||||||
|
#endif
|
||||||
|
|
||||||
cam->makeCaPmt(channel, list, caids);
|
cam->makeCaPmt(channel, false, list, caids);
|
||||||
int len;
|
int len;
|
||||||
unsigned char * buffer = channel->getRawPmt(len);
|
unsigned char * buffer = channel->getRawPmt(len);
|
||||||
cam->sendCaPmt(channel->getTransponderId(), buffer, len);
|
cam->sendCaPmt(channel->getTransponderId(), buffer, len);
|
||||||
list = CCam::CAPMT_MORE;
|
//list = CCam::CAPMT_MORE;
|
||||||
}
|
}
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user