mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-18 10:51:07 +02:00
zapit: align to ddt
Origin commit data
------------------
Commit: 5c6197552b
Author: vanhofen <vanhofen@gmx.de>
Date: 2019-12-16 (Mon, 16 Dec 2019)
Origin message was:
------------------
- zapit: align to ddt
This commit is contained in:
@@ -145,7 +145,7 @@ class CFEManager
|
||||
bool haveFreeFrontend();
|
||||
void linkFrontends(bool init = true);
|
||||
void copySettings(CFrontend * fe);
|
||||
int getDemux(transponder_id_t id);
|
||||
int getDemux(transponder_id_t id, int feNum);
|
||||
bool lockDemux(int i, transponder_id_t id);
|
||||
void unlockDemux(int i);
|
||||
bool haveFreeDemux();
|
||||
|
@@ -157,6 +157,7 @@ class CFrontend
|
||||
bool isMultistream;
|
||||
//fe_delivery_system_t deliverySystems[MAX_DELSYS];
|
||||
//uint32_t numDeliverySystems;
|
||||
t_channel_id channel_id;
|
||||
|
||||
bool buildProperties(const FrontendParameters*, struct dtv_properties &);
|
||||
|
||||
@@ -247,6 +248,9 @@ class CFrontend
|
||||
bool tuneChannel(CZapitChannel *channel, bool nvod);
|
||||
bool retuneChannel(void);
|
||||
|
||||
t_channel_id getChannelID(void) { return channel_id; }
|
||||
void setChannelID(t_channel_id ID) { channel_id = ID; }
|
||||
|
||||
fe_code_rate_t getCFEC ();
|
||||
transponder_id_t getTsidOnid() { return currentTransponder.getTransponderId(); }
|
||||
bool sameTsidOnid(transponder_id_t tpid)
|
||||
|
@@ -67,6 +67,8 @@ typedef struct Zapit_config {
|
||||
int useGotoXX;
|
||||
/* FE common */
|
||||
int feTimeout;
|
||||
int feRetries;
|
||||
int noSameFE;
|
||||
int gotoXXLaDirection;
|
||||
int gotoXXLoDirection;
|
||||
double gotoXXLatitude;
|
||||
@@ -106,6 +108,7 @@ class CZapit : public OpenThreads::Thread
|
||||
};
|
||||
|
||||
OpenThreads::ReentrantMutex mutex;
|
||||
OpenThreads::Mutex zapit_mutex;
|
||||
bool started;
|
||||
bool event_mode;
|
||||
bool firstzap;
|
||||
|
@@ -296,7 +296,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
|
||||
cam->sendMessage(NULL, 0, false);
|
||||
/* clean up channel_map with stopped record/stream/pip services NOT live-tv */
|
||||
it = channel_map.find(channel_id);
|
||||
if(it != channel_map.end() && newmask != 0 && it->second != cam)
|
||||
if(it != channel_map.end() && newmask != 0)
|
||||
{
|
||||
delete it->second;
|
||||
channel_map.erase(channel_id);
|
||||
@@ -311,14 +311,31 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
|
||||
INFO("\033[33m socket only\033[0m");
|
||||
cam->makeCaPmt(channel, true);
|
||||
cam->setCaPmt(true);
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
#if ! HAVE_COOL_HARDWARE
|
||||
// CI
|
||||
if(oldmask == newmask) {
|
||||
INFO("\033[33m (oldmask == newmask)\033[0m");
|
||||
if (mode) {
|
||||
if(!start) {
|
||||
if(start) {
|
||||
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);
|
||||
} else {
|
||||
cam->sendCaPmt(channel->getChannelID(), NULL, 0, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, mode, start);
|
||||
}
|
||||
}
|
||||
@@ -329,6 +346,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(newmask == 0) {
|
||||
INFO("\033[33m (newmask == 0)\033[0m");
|
||||
/* FIXME: back to live channel from playback dont parse pmt and call setCaPmt
|
||||
@@ -340,15 +358,13 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
|
||||
// hack for rezaping to the recording channel
|
||||
CZapitChannel * chan = CServiceManager::getInstance()->GetCurrentChannel();
|
||||
|
||||
//if commig from movieplayer, disable hack
|
||||
//if coming from movieplayer, disable hack
|
||||
if(!mp && ( (!mode || (mode && !chan->scrambled)) && (!start && rmode)) ){
|
||||
INFO("\033[33m HACK: disabling TS\033[0m");
|
||||
cCA::GetInstance()->SetTS(CA_DVBCI_TS_INPUT_DISABLED);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
mp = false;
|
||||
|
||||
/* don't use StopCam() here: ci-cam needs the real mode stop */
|
||||
cam->sendCaPmt(channel->getChannelID(), NULL, 0, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, mode, start);
|
||||
cam->sendMessage(NULL, 0, false);
|
||||
@@ -357,11 +373,10 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ! HAVE_COOL_HARDWARE
|
||||
// CI
|
||||
#if ! HAVE_COOL_HARDWARE
|
||||
if (mode && !start) {
|
||||
#endif
|
||||
|
||||
CaIdVector caids;
|
||||
cCA::GetInstance()->GetCAIDS(caids);
|
||||
//uint8_t list = CCam::CAPMT_FIRST;
|
||||
@@ -399,6 +414,8 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
|
||||
++it;
|
||||
if(!channel)
|
||||
continue;
|
||||
if(!channel->scrambled)
|
||||
continue;
|
||||
|
||||
#if 0
|
||||
if (it == channel_map.end())
|
||||
@@ -410,7 +427,12 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
|
||||
unsigned char * buffer = channel->getRawPmt(len);
|
||||
#if HAVE_COOL_HARDWARE
|
||||
cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_SMARTCARD);
|
||||
#else
|
||||
cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, 0, true);
|
||||
#endif
|
||||
|
||||
/* out commented: causes a double send of capmt, the second without needed parameters */
|
||||
#if HAVE_COOL_HARDWARE
|
||||
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());
|
||||
} else if (filter_channels && !channel->bUseCI) {
|
||||
@@ -418,12 +440,9 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
|
||||
} else if(channel->scrambled) {
|
||||
useCI = true;
|
||||
INFO("CI: use CI for [%s]", channel->getName().c_str());
|
||||
#if HAVE_COOL_HARDWARE
|
||||
cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI);
|
||||
#endif
|
||||
}
|
||||
//list = CCam::CAPMT_MORE;
|
||||
#if ! HAVE_COOL_HARDWARE
|
||||
if((oldmask != newmask) || force_update || (oldmask == newmask && mode && start))
|
||||
{
|
||||
//temp debug output
|
||||
|
@@ -43,6 +43,8 @@
|
||||
|
||||
static int fedebug = 0;
|
||||
static int unused_demux;
|
||||
static int noSameFE = 0;
|
||||
extern Zapit_config zapitCfg;
|
||||
|
||||
#define FEDEBUG(fmt, args...) \
|
||||
do { \
|
||||
@@ -556,8 +558,13 @@ CFrontend * CFEManager::getFrontend(CZapitChannel * channel)
|
||||
CFrontend * retfe = NULL;
|
||||
|
||||
if (livefe && livefe->tuned && livefe->sameTsidOnid(channel->getTransponderId())) {
|
||||
FEDEBUG("live fe %d on the same TP", livefe->fenumber);
|
||||
return livefe;
|
||||
if (!noSameFE) {
|
||||
FEDEBUG("live fe %d on the same TP", livefe->fenumber);
|
||||
return livefe;
|
||||
} else if (livefe->getChannelID() == channel->getChannelID()) {
|
||||
FEDEBUG("live fe %d on the same TP-SID", livefe->fenumber);
|
||||
return livefe;
|
||||
}
|
||||
}
|
||||
|
||||
t_satellite_position satellitePosition = channel->getSatellitePosition();
|
||||
@@ -595,8 +602,13 @@ CFrontend * CFEManager::getFrontend(CZapitChannel * channel)
|
||||
break;
|
||||
}
|
||||
if (fe->tuned && fe->sameTsidOnid(channel->getTransponderId())) {
|
||||
FEDEBUG("fe %d on the same TP", fe->fenumber);
|
||||
return fe;
|
||||
if (!noSameFE) {
|
||||
FEDEBUG("fe %d on the same TP", fe->fenumber);
|
||||
return fe;
|
||||
} else if (fe->getChannelID() == channel->getChannelID()) {
|
||||
FEDEBUG("fe %d on the same TP-SID", fe->fenumber);
|
||||
return fe;
|
||||
}
|
||||
}
|
||||
if (!loop_busy && fe->getMode() != CFrontend::FE_MODE_LINK_TWIN) {
|
||||
if (have_loop && !loopCanTune(fe, channel)) {
|
||||
@@ -623,21 +635,28 @@ CFrontend * CFEManager::getFrontend(CZapitChannel * channel)
|
||||
mfe->Locked(), mfe->getFrequency(), mfe->getTsidOnid(), channel->getFreqId(), channel->getTransponderId());
|
||||
if(mfe->Locked()) {
|
||||
if(mfe->tuned && mfe->sameTsidOnid(channel->getTransponderId())) {
|
||||
FEDEBUG("fe %d on the same TP", mfe->fenumber);
|
||||
return mfe;
|
||||
if (!noSameFE) {
|
||||
FEDEBUG("fe %d on the same TP", mfe->fenumber);
|
||||
return mfe;
|
||||
} else if (mfe->getChannelID() == channel->getChannelID()) {
|
||||
FEDEBUG("fe %d on the same TP-SID", mfe->fenumber);
|
||||
return mfe;
|
||||
}
|
||||
}
|
||||
} else if(!retfe)
|
||||
retfe = mfe;
|
||||
}
|
||||
}
|
||||
FEDEBUG("Selected fe: %d", retfe ? retfe->fenumber : -1);
|
||||
if (noSameFE && retfe)
|
||||
retfe->setChannelID(channel->getChannelID());
|
||||
return retfe;
|
||||
}
|
||||
|
||||
#ifdef DYNAMIC_DEMUX
|
||||
int CFEManager::getDemux(transponder_id_t id)
|
||||
int CFEManager::getDemux(transponder_id_t id, int feNum)
|
||||
{
|
||||
for (unsigned int i = 1; i < dmap.size(); i++) {
|
||||
for (unsigned int i = feNum +1; i < dmap.size(); i++) {
|
||||
if((dmap[i].usecount == 0) || dmap[i].tpid == id)
|
||||
return i;
|
||||
}
|
||||
@@ -679,12 +698,15 @@ CFrontend * CFEManager::allocateFE(CZapitChannel * channel, bool forrecord)
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||
|
||||
CZapit::getInstance()->GetConfig(zapitCfg);
|
||||
noSameFE = zapitCfg.noSameFE;
|
||||
|
||||
if (forrecord)
|
||||
fedebug = 1;
|
||||
CFrontend * frontend = getFrontend(channel);
|
||||
if (frontend) {
|
||||
#ifdef DYNAMIC_DEMUX
|
||||
int dnum = getDemux(channel->getTransponderId());
|
||||
int dnum = getDemux(channel->getTransponderId(), frontend->getNumber());
|
||||
INFO("record demux: %d", dnum);
|
||||
channel->setRecordDemux(dnum);
|
||||
if (forrecord && !dnum) {
|
||||
|
@@ -66,7 +66,7 @@ extern int zapit_debug;
|
||||
// DVB-S/S2 specific
|
||||
#define PILOTS 7
|
||||
#define ROLLOFF 8
|
||||
#define MIS 9
|
||||
#define MIS 9
|
||||
// DVB-T specific
|
||||
#define BANDWIDTH 4
|
||||
#define CODE_RATE_HP 6
|
||||
@@ -394,8 +394,7 @@ void CFrontend::getFEInfo(void)
|
||||
switch (info.type) {
|
||||
case FE_QPSK:
|
||||
deliverySystemMask |= DVB_S;
|
||||
if (info.caps & FE_CAN_2G_MODULATION || get_hwcaps()->force_tuner_2G)
|
||||
deliverySystemMask |= DVB_S2;
|
||||
deliverySystemMask |= DVB_S2;
|
||||
break;
|
||||
case FE_OFDM:
|
||||
deliverySystemMask |= DVB_T;
|
||||
@@ -1018,7 +1017,7 @@ void CFrontend::getDelSys(delivery_system_t delsys, int f, int m, const char *&f
|
||||
}
|
||||
break;
|
||||
default:
|
||||
INFO("unknown delsys %d!", delsys);
|
||||
INFO("[frontend] unknown delsys %d!", delsys);
|
||||
sys = "UNKNOWN";
|
||||
mod = "UNKNOWN";
|
||||
break;
|
||||
@@ -1059,10 +1058,10 @@ void CFrontend::getDelSys(delivery_system_t delsys, int f, int m, const char *&f
|
||||
case FEC_2_5:
|
||||
fec = "2/5";
|
||||
break;
|
||||
#endif
|
||||
case FEC_NONE:
|
||||
fec = "0";
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
INFO("[frontend] getDelSys: unknown FEC: %d !!!\n", f);
|
||||
/* fall through */
|
||||
@@ -1196,6 +1195,7 @@ uint32_t CFrontend::getFEBandwidth(fe_bandwidth_t bandwidth)
|
||||
case BANDWIDTH_6_MHZ:
|
||||
bandwidth_hz = 6000000;
|
||||
break;
|
||||
#if _HAVE_DVB57
|
||||
case BANDWIDTH_5_MHZ:
|
||||
bandwidth_hz = 5000000;
|
||||
break;
|
||||
@@ -1205,6 +1205,7 @@ uint32_t CFrontend::getFEBandwidth(fe_bandwidth_t bandwidth)
|
||||
case BANDWIDTH_10_MHZ:
|
||||
bandwidth_hz = 10000000;
|
||||
break;
|
||||
#endif
|
||||
case BANDWIDTH_AUTO:
|
||||
bandwidth_hz = 0;
|
||||
}
|
||||
@@ -1281,12 +1282,14 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
|
||||
case FEC_9_10:
|
||||
fec = FEC_9_10;
|
||||
break;
|
||||
#if _HAVE_DVB57
|
||||
case FEC_2_5:
|
||||
fec = FEC_2_5;
|
||||
break;
|
||||
case FEC_NONE:
|
||||
fec = FEC_NONE;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
INFO("[fe%d/%d] DEMOD: unknown FEC: %d\n", adapter, fenumber, fec_inner);
|
||||
/* fall through */
|
||||
@@ -1369,10 +1372,10 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
|
||||
cmdseq.props[HIERARCHY].u.data = feparams->hierarchy;
|
||||
cmdseq.props[DELIVERY_SYSTEM].u.data = getFEDeliverySystem(feparams->delsys);
|
||||
cmdseq.props[BANDWIDTH].u.data = getFEBandwidth(feparams->bandwidth);
|
||||
cmdseq.props[PLP_ID].u.data = feparams->plp_id;
|
||||
cmdseq.props[PLP_ID].u.data = feparams->plp_id;
|
||||
break;
|
||||
default:
|
||||
INFO("unknown frontend type, exiting");
|
||||
INFO("[frontend] unknown frontend type, exiting");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1484,7 +1487,7 @@ void CFrontend::secSetVoltage(const fe_sec_voltage_t voltage, const uint32_t ms)
|
||||
return;
|
||||
|
||||
if (zapit_debug) printf("[fe%d/%d] voltage %s\n", adapter, fenumber, voltage == SEC_VOLTAGE_OFF ? "OFF" : voltage == SEC_VOLTAGE_13 ? "13" : "18");
|
||||
if (config.diseqcType == DISEQC_UNICABLE || config.diseqcType == DISEQC_UNICABLE2) {
|
||||
if ((config.diseqcType == DISEQC_UNICABLE || config.diseqcType == DISEQC_UNICABLE2) && voltage != SEC_VOLTAGE_OFF) {
|
||||
/* see my comment in secSetTone... */
|
||||
currentVoltage = voltage; /* need to know polarization for unicable */
|
||||
fop(ioctl, FE_SET_VOLTAGE, unicable_lowvolt); /* voltage must not be 18V */
|
||||
@@ -1736,7 +1739,7 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int
|
||||
}
|
||||
fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_18);
|
||||
usleep(20 * 1000); /* en50494 says: >4ms and < 22 ms */
|
||||
sendDiseqcCommand(&cmd, 120); /* en50494 says: >2ms and < 60 ms -- it seems we must add the lengthe of telegramm itself (~65ms)*/
|
||||
sendDiseqcCommand(&cmd, 120); /* en50494 says: >2ms and < 60 ms -- it seems we must add the lengthe of telegramm itself (~65ms)*/
|
||||
fop(ioctl, FE_SET_VOLTAGE, unicable_lowvolt);
|
||||
}
|
||||
return ret;
|
||||
@@ -1956,6 +1959,14 @@ void CFrontend::setDiseqc(int sat_no, const uint8_t pol, const uint32_t frequenc
|
||||
|
||||
delay = 100; // delay for 1.0 after 1.1 command
|
||||
cmd.msg[2] = 0x39; /* port group = uncommited switches */
|
||||
/* new code */
|
||||
sat_no &= 0x0F;
|
||||
cmd.msg[3] = 0xF0 | sat_no;
|
||||
sendDiseqcCommand(&cmd, delay);
|
||||
cmd.msg[2] = 0x38; /* port group = commited switches */
|
||||
cmd.msg[3] = 0xF0 | ((pol & 1) ? 0 : 2) | (high_band ? 1 : 0);
|
||||
sendDiseqcCommand(&cmd, delay);
|
||||
#if 0 /* old code */
|
||||
#if 1
|
||||
/* for 16 inputs */
|
||||
cmd.msg[3] = 0xF0 | ((sat_no / 4) & 0x03);
|
||||
@@ -1971,10 +1982,11 @@ void CFrontend::setDiseqc(int sat_no, const uint8_t pol, const uint32_t frequenc
|
||||
sendDiseqcCommand(&cmd, 100); /* send the command to setup first uncommited switch and wait 100 ms !!! */
|
||||
cmd.msg[3] &= 0xCF;
|
||||
sendDiseqcCommand(&cmd, 100); /* send the command to setup second uncommited switch and wait 100 ms !!! */
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
if (config.diseqcType >= DISEQC_1_0) { /* DISEQC 1.0 */
|
||||
if (config.diseqcType == DISEQC_1_0) { /* DISEQC 1.0 */
|
||||
usleep(delay * 1000);
|
||||
//cmd.msg[0] |= 0x01; /* repeated transmission */
|
||||
cmd.msg[2] = 0x38; /* port group = commited switches */
|
||||
|
@@ -93,7 +93,7 @@ bool CPmt::Parse(CZapitChannel * const channel)
|
||||
|
||||
ProgramMapSection pmt(buffer);
|
||||
|
||||
DBG("pcr pid: old 0x%x new 0x%x\n", channel->getPcrPid(), pmt.getPcrPid());
|
||||
DBG("[pmt] pcr pid: old 0x%x new 0x%x\n", channel->getPcrPid(), pmt.getPcrPid());
|
||||
|
||||
channel->resetPids();
|
||||
|
||||
@@ -182,14 +182,14 @@ bool CPmt::ParseEsInfo(ElementaryStreamInfo *esinfo, CZapitChannel * const chann
|
||||
TeletextDescriptor *td = (TeletextDescriptor*)d;
|
||||
const VbiTeletextList *vbilist = td->getVbiTeletexts();
|
||||
VbiTeletextConstIterator it;
|
||||
DBG("teletext pid %04x\n", esinfo->getPid());
|
||||
DBG("[pmt] teletext pid %04x\n", esinfo->getPid());
|
||||
for (it = vbilist->begin(); it != vbilist->end(); ++it) {
|
||||
VbiTeletext * vbi = *it;
|
||||
|
||||
std::string lang = vbi->getIso639LanguageCode();
|
||||
uint8_t page = vbi->getTeletextPageNumber();
|
||||
uint8_t magazine = vbi->getTeletextMagazineNumber();
|
||||
DBG("teletext type %d mag %d page %d lang [%s]\n",
|
||||
DBG("[pmt] teletext type %d mag %d page %d lang [%s]\n",
|
||||
vbi->getTeletextType(), magazine, page, lang.c_str());
|
||||
if (vbi->getTeletextType() == 0x01)
|
||||
channel->setTeletextLang(lang);
|
||||
@@ -320,7 +320,7 @@ bool CPmt::ParseEsInfo(ElementaryStreamInfo *esinfo, CZapitChannel * const chann
|
||||
snprintf(str, DESC_MAX_LEN, "Unknown");
|
||||
description = str;
|
||||
}
|
||||
DBG("apid %04x stream %02x type %d [%s]\n", esinfo->getPid(), stream_type,
|
||||
DBG("[pmt] apid %04x stream %02x type %d [%s]\n", esinfo->getPid(), stream_type,
|
||||
(int) audio_type, description.c_str());
|
||||
if(CServiceScan::getInstance()->Scanning()) {
|
||||
if(channel->getPreAudioPid() == 0)
|
||||
@@ -416,7 +416,7 @@ int pmt_set_update_filter(CZapitChannel * const channel, int * fd)
|
||||
|
||||
int pmt_stop_update_filter(int * fd)
|
||||
{
|
||||
DBG("\n");
|
||||
DBG("[pmt] stop update filter\n");
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
if (pmtDemux)
|
||||
delete pmtDemux;
|
||||
|
@@ -265,7 +265,7 @@ bool CSdt::Parse(t_transport_stream_id &tsid, t_original_network_id &onid)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SDT
|
||||
printf("SDT: tid %02x onid %02x\n", sdt->getTransportStreamId(), sdt->getOriginalNetworkId());
|
||||
printf("[SDT] tid %02x onid %02x\n", sdt->getTransportStreamId(), sdt->getOriginalNetworkId());
|
||||
#endif
|
||||
const ServiceDescriptionList &slist = *sdt->getDescriptions();
|
||||
for (ServiceDescriptionConstIterator sit = slist.begin(); sit != slist.end(); ++sit) {
|
||||
@@ -303,7 +303,7 @@ bool CSdt::Parse(t_transport_stream_id &tsid, t_original_network_id &onid)
|
||||
default:
|
||||
{
|
||||
#ifdef DEBUG_SDT_UNUSED
|
||||
printf("SDT: sid %x descriptor %02x: ", service->getServiceId(), d->getTag());
|
||||
printf("[SDT] sid %x descriptor %02x: ", service->getServiceId(), d->getTag());
|
||||
uint8_t len = 2+d->getLength();
|
||||
uint8_t buf[len];
|
||||
d->writeToBuffer(buf);
|
||||
@@ -373,7 +373,7 @@ bool CSdt::ParseServiceDescriptor(ServiceDescription * service, ServiceDescripto
|
||||
std::string serviceName = SID ? "" : stringDVBUTF8(sd->getServiceName(), 0, tsidonid);
|
||||
|
||||
#ifdef DEBUG_SDT_SERVICE
|
||||
printf("SDT: sid %04x type %x provider [%s] service [%s] scrambled %d\n", service_id, sd->getServiceType(),
|
||||
printf("[SDT] sid %04x type %x provider [%s] service [%s] scrambled %d\n", service_id, sd->getServiceType(),
|
||||
providerName.c_str(), serviceName.c_str(), free_ca);
|
||||
#endif
|
||||
if(!current && free_ca && CServiceScan::getInstance()->isFtaOnly())
|
||||
@@ -412,7 +412,7 @@ bool CSdt::ParseServiceDescriptor(ServiceDescription * service, ServiceDescripto
|
||||
channel->scrambled = false;
|
||||
#ifdef DEBUG_SDT_SERVICE
|
||||
if(free_ca != channel->scrambled)
|
||||
printf("SDT: service update: [%s] free_ca %d scrambled %d\n",
|
||||
printf("[SDT] service update: [%s] free_ca %d scrambled %d\n",
|
||||
serviceName.c_str(), free_ca, channel->scrambled);
|
||||
#endif
|
||||
}
|
||||
@@ -468,7 +468,7 @@ bool CSdt::ParseServiceDescriptor(ServiceDescription * service, ServiceDescripto
|
||||
pmt.Parse(channel);
|
||||
#ifdef DEBUG_SDT_SERVICE
|
||||
if(free_ca != channel->scrambled)
|
||||
printf("SDT: provider [%s] service [%s] free_ca %d scrambled %d camap.size %d\n", providerName.c_str(),
|
||||
printf("[SDT] provider [%s] service [%s] free_ca %d scrambled %d camap.size %d\n", providerName.c_str(),
|
||||
serviceName.c_str(), free_ca, channel->scrambled, channel->camap.size());
|
||||
#endif
|
||||
}
|
||||
|
@@ -183,6 +183,7 @@ void CZapit::SaveSettings(bool write)
|
||||
configfile.setInt32("writeChannelsNames", config.writeChannelsNames);
|
||||
configfile.setBool("makeRemainingChannelsBouquet", config.makeRemainingChannelsBouquet);
|
||||
configfile.setInt32("feTimeout", config.feTimeout);
|
||||
configfile.setInt32("feRetries", config.feRetries);
|
||||
|
||||
configfile.setInt32("rezapTimeout", config.rezapTimeout);
|
||||
configfile.setBool("scanPids", config.scanPids);
|
||||
@@ -194,6 +195,7 @@ void CZapit::SaveSettings(bool write)
|
||||
#endif
|
||||
|
||||
/* FIXME FE global */
|
||||
configfile.setInt32("noSameFE", config.noSameFE);
|
||||
char tempd[12];
|
||||
sprintf(tempd, "%3.6f", config.gotoXXLatitude);
|
||||
configfile.setString("gotoXXLatitude", tempd);
|
||||
@@ -300,7 +302,7 @@ void CZapit::ClearVolumeMap()
|
||||
unlink(VOLUME_CONFIG_FILE);
|
||||
if (current_channel) {
|
||||
CZapitAudioChannel *currentAudioChannel = current_channel->getAudioChannel();
|
||||
if (currentAudioChannel && currentAudioChannel->audioChannelType == CZapitAudioChannel::AC3) {
|
||||
if (currentAudioChannel && (currentAudioChannel->audioChannelType == CZapitAudioChannel::AC3 || currentAudioChannel->audioChannelType == CZapitAudioChannel::EAC3)) {
|
||||
SetVolumePercent(volume_percent_ac3);
|
||||
return;
|
||||
}
|
||||
@@ -330,10 +332,12 @@ void CZapit::LoadSettings()
|
||||
config.makeRemainingChannelsBouquet = 1;
|
||||
config.scanPids = configfile.getBool("scanPids", 0);
|
||||
config.scanSDT = configfile.getInt32("scanSDT", 0);
|
||||
config.cam_ci = configfile.getInt32("cam_ci", 1); //NI
|
||||
config.cam_ci = configfile.getInt32("cam_ci", 2);
|
||||
config.rezapTimeout = configfile.getInt32("rezapTimeout", 1);
|
||||
|
||||
config.feTimeout = configfile.getInt32("feTimeout", 40);
|
||||
config.feRetries = configfile.getInt32("feRetries", 1);
|
||||
config.noSameFE = configfile.getInt32("noSameFE", 0);
|
||||
config.highVoltage = configfile.getBool("highVoltage", 0);
|
||||
|
||||
config.gotoXXLatitude = strtod(configfile.getString("gotoXXLatitude", "0.0").c_str(), NULL);
|
||||
@@ -581,8 +585,8 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay
|
||||
SaveSettings(false);
|
||||
srand(time(NULL));
|
||||
|
||||
/* retry tuning twice when using unicable, TODO: EN50494 sect.8 specifies 4 retries... */
|
||||
int retry = (live_fe->getDiseqcType() == DISEQC_UNICABLE) * 2;
|
||||
/* retry tuning, at least twice when using unicable, TODO: EN50494 sect.8 specifies 4 retries... */
|
||||
int retry = std::max(config.feRetries, (live_fe->getDiseqcType() == DISEQC_UNICABLE) * 2);
|
||||
again:
|
||||
if(!TuneChannel(live_fe, newchannel, transponder_change)) {
|
||||
if (retry < 1) {
|
||||
@@ -750,8 +754,8 @@ bool CZapit::ZapForRecord(const t_channel_id channel_id)
|
||||
{
|
||||
CZapitChannel* newchannel;
|
||||
bool transponder_change;
|
||||
/* retry tuning twice when using unicable */
|
||||
int retry = (live_fe->getDiseqcType() == DISEQC_UNICABLE) * 2;
|
||||
/* retry tuning, at least twice when using unicable */
|
||||
int retry = std::max(config.feRetries, (live_fe->getDiseqcType() == DISEQC_UNICABLE) * 2);
|
||||
|
||||
if((newchannel = CServiceManager::getInstance()->FindChannel(channel_id)) == NULL) {
|
||||
INFO("channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id);
|
||||
@@ -891,7 +895,8 @@ int CZapit::GetPidVolume(t_channel_id channel_id, int pid, bool ac3)
|
||||
if ((channel_id == live_channel_id) && current_channel) {
|
||||
for (int i = 0; i < current_channel->getAudioChannelCount(); i++) {
|
||||
if (pid == current_channel->getAudioPid(i)) {
|
||||
percent = current_channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::AC3 ?
|
||||
percent = (current_channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::AC3
|
||||
|| current_channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::EAC3) ?
|
||||
volume_percent_ac3 : volume_percent_pcm;
|
||||
break;
|
||||
}
|
||||
@@ -922,7 +927,8 @@ int CZapit::SetVolumePercent(int percent)
|
||||
|
||||
if (volume_percent != percent) {
|
||||
volume_percent = percent;
|
||||
SetVolume(current_volume);
|
||||
if (!audioDecoder->getMuteStatus())
|
||||
SetVolume(current_volume);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -967,10 +973,10 @@ void CZapit::SetAudioStreamType(CZapitAudioChannel::ZapitAudioChannelType audioC
|
||||
}
|
||||
|
||||
/* FIXME: bigger percent for AC3 only, what about AAC etc ? */
|
||||
int newpercent = GetPidVolume(0, 0, audioChannelType == CZapitAudioChannel::AC3);
|
||||
int newpercent = GetPidVolume(0, 0, audioChannelType == CZapitAudioChannel::AC3 || audioChannelType == CZapitAudioChannel::EAC3);
|
||||
SetVolumePercent(newpercent);
|
||||
|
||||
DBG("starting %s audio\n", audioStr);
|
||||
DBG("[zapit] starting %s audio\n", audioStr);
|
||||
}
|
||||
|
||||
bool CZapit::ChangeAudioPid(uint8_t index)
|
||||
@@ -1763,30 +1769,19 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
|
||||
|
||||
case CZapitMessages::CMD_SB_LOCK_PLAYBACK:
|
||||
{
|
||||
#ifdef CHECK_MERGE
|
||||
CZapitMessages::commandBoolean msgBool;
|
||||
CBasicServer::receive_data(connfd, &msgBool, sizeof(msgBool));
|
||||
StopPlayBack(msgBool.truefalse, false);
|
||||
#endif
|
||||
#if 0
|
||||
/* hack. if standby true, dont blank video */
|
||||
standby = true;
|
||||
StopPlayBack(true);
|
||||
standby = false;
|
||||
playbackStopForced = true;
|
||||
lock_channel_id = live_channel_id;
|
||||
#endif
|
||||
lockPlayBack();
|
||||
//lockPlayBack();
|
||||
SendCmdReady(connfd);
|
||||
break;
|
||||
}
|
||||
case CZapitMessages::CMD_SB_UNLOCK_PLAYBACK:
|
||||
{
|
||||
#ifdef CHECK_MERGE
|
||||
CZapitMessages::commandBoolean msgBool;
|
||||
CBasicServer::receive_data(connfd, &msgBool, sizeof(msgBool));
|
||||
#endif
|
||||
#if 0
|
||||
playbackStopForced = false;
|
||||
if (lock_channel_id == live_channel_id) {
|
||||
StartPlayBack(current_channel);
|
||||
@@ -1798,8 +1793,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
|
||||
SendEvent(CZapitClient::EVT_ZAP_FAILED, &lock_channel_id, sizeof(lock_channel_id));
|
||||
lock_channel_id = 0;
|
||||
}
|
||||
#endif
|
||||
unlockPlayBack();
|
||||
//unlockPlayBack();
|
||||
SendCmdReady(connfd);
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user