1
0
mirror of https://github.com/rofafor/vdr-plugin-femon.git synced 2023-10-10 11:36:53 +00:00

Compare commits

..

6 Commits

Author SHA1 Message Date
Rolf Ahrenberg
136c9fb73c Refactored the SAT>IP support. 2014-03-15 12:35:49 +02:00
Rolf Ahrenberg
9ca1fcb378 Added support for SAT>IP devices. 2014-03-08 13:28:31 +02:00
Rolf Ahrenberg
1cfbd0b730 Updated translation files and HISTORY. 2014-01-19 00:14:13 +02:00
Rolf Ahrenberg
152e87d443 Updated version number. 2014-01-12 22:27:23 +02:00
Rolf Ahrenberg
08223cf6c4 Added initial support for CAMs. 2014-01-12 22:24:50 +02:00
Rolf Ahrenberg
84572d2187 Fixed indentation. 2014-01-12 01:02:03 +02:00
18 changed files with 161 additions and 77 deletions

12
HISTORY
View File

@@ -480,3 +480,15 @@ VDR Plugin 'femon' Revision History
- Fixed a crash in SVDRP (Thanks for Lothar Englisch for reporting).
- Fixed a memory leak and issues reported by scan-build tool.
2014-01-18: Version 2.0.2
- Added initial support for CAMs.
2014-03-08: Version 2.0.3
- Added support for SAT>IP devices.
2014-03-15: Version 2.0.4
- Refactored the SAT>IP support.

View File

@@ -22,7 +22,7 @@
#define GITVERSION ""
#endif
static const char VERSION[] = "2.0.1" GITVERSION;
static const char VERSION[] = "2.0.4" GITVERSION;
static const char DESCRIPTION[] = trNOOP("DVB Signal Information Monitor (OSD)");
static const char MAINMENUENTRY[] = trNOOP("Signal Information");

View File

@@ -625,6 +625,23 @@ void cFemonOsd::Action(void)
m_BERValid = (ioctl(m_Frontend, FE_READ_BER, &m_BER) >= 0);
m_UNCValid = (ioctl(m_Frontend, FE_READ_UNCORRECTED_BLOCKS, &m_UNC) >= 0);
}
else if (strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
m_Quality = cDevice::ActualDevice()->SignalQuality();
m_QualityValid = (m_Quality >= 0);
m_Strength = cDevice::ActualDevice()->SignalStrength();
m_StrengthValid = (m_Strength >= 0);
m_FrontendName = cDevice::ActualDevice()->DeviceName();
m_FrontendStatus = (fe_status_t)(cDevice::ActualDevice()->HasLock() ? (FE_HAS_LOCK | FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC) : 0);
m_FrontendStatusValid = m_StrengthValid;
m_Signal = uint16_t(m_Strength * 0xFFFF / 100);
m_SignalValid = m_StrengthValid;
m_SNR = uint16_t(m_Quality * 0xFFFF / 100);
m_SNRValid = m_QualityValid;
m_BER = 0;
m_BERValid = false;
m_UNC = 0;
m_UNCValid = false;
}
else if (m_SvdrpConnection.handle >= 0) {
cmd.handle = m_SvdrpConnection.handle;
m_SvdrpPlugin->Service("SvdrpCommand-v1.0", &cmd);
@@ -715,6 +732,9 @@ void cFemonOsd::Show(void)
return;
}
}
else if (strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
// nop
}
else if (femonConfig.usesvdrp) {
if (!SvdrpConnect() || !SvdrpTune())
return;
@@ -789,6 +809,9 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool li
return;
}
}
else if (strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
// nop
}
else if (femonConfig.usesvdrp) {
if (!SvdrpConnect() || !SvdrpTune())
return;
@@ -835,26 +858,83 @@ bool cFemonOsd::DeviceSwitch(int direction)
cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
if (channel) {
for (int i = 0; i < cDevice::NumDevices() - 1; i++) {
if (direction >= 0) {
if (++device >= cDevice::NumDevices())
device = 0;
}
else {
if (--device < 0)
device = cDevice::NumDevices() - 1;
}
if (cDevice::GetDevice(device)->ProvidesChannel(channel, 0)) {
debug("%s(%d) device(%d)\n", __PRETTY_FUNCTION__, direction, device);
cStatus::MsgChannelSwitch(cDevice::PrimaryDevice(), 0, true);
cControl::Shutdown();
cDevice::GetDevice(device)->SwitchChannel(channel, true);
if (cDevice::GetDevice(device) == cDevice::PrimaryDevice())
cDevice::GetDevice(device)->ForceTransferMode();
cControl::Launch(new cTransferControl(cDevice::GetDevice(device), channel));
cStatus::MsgChannelSwitch(cDevice::PrimaryDevice(), channel->Number(), true);
return (true);
}
}
if (direction >= 0) {
if (++device >= cDevice::NumDevices())
device = 0;
}
else {
if (--device < 0)
device = cDevice::NumDevices() - 1;
}
// Collect the current priorities of all CAM slots that can decrypt the channel:
int NumCamSlots = CamSlots.Count();
int SlotPriority[NumCamSlots];
int NumUsableSlots = 0;
bool NeedsDetachAllReceivers = false;
bool InternalCamNeeded = false;
bool ValidDevice = false;
cCamSlot *s = NULL;
cDevice *d = cDevice::GetDevice(device);
if (channel->Ca() >= CA_ENCRYPTED_MIN) {
for (cCamSlot *CamSlot = CamSlots.First(); CamSlot; CamSlot = CamSlots.Next(CamSlot)) {
SlotPriority[CamSlot->Index()] = MAXPRIORITY + 1; // assumes it can't be used
if (CamSlot->ModuleStatus() == msReady) {
if (CamSlot->ProvidesCa(channel->Caids())) {
if (!ChannelCamRelations.CamChecked(channel->GetChannelID(), CamSlot->SlotNumber())) {
SlotPriority[CamSlot->Index()] = CamSlot->Priority();
NumUsableSlots++;
}
}
}
}
if (!NumUsableSlots)
InternalCamNeeded = true; // no CAM is able to decrypt this channel
}
for (int j = 0; j < NumCamSlots || !NumUsableSlots; ++j) {
if (NumUsableSlots && SlotPriority[j] > MAXPRIORITY)
continue; // there is no CAM available in this slot
bool HasInternalCam = d->HasInternalCam();
if (InternalCamNeeded && !HasInternalCam)
continue; // no CAM is able to decrypt this channel and the device uses vdr handled CAMs
if (NumUsableSlots && !HasInternalCam && !CamSlots.Get(j)->Assign(d, true))
continue; // CAM slot can't be used with this device
if (d->ProvidesChannel(channel, 0, &NeedsDetachAllReceivers)) { // this device is basically able to do the job
debug("%s(%d) device(%d)\n", __PRETTY_FUNCTION__, direction, device);
if (NumUsableSlots && !HasInternalCam && d->CamSlot() && d->CamSlot() != CamSlots.Get(j))
NeedsDetachAllReceivers = true; // using a different CAM slot requires detaching receivers
if (NumUsableSlots && !HasInternalCam)
s = CamSlots.Get(j);
ValidDevice = true;
break;
}
if (!NumUsableSlots)
break; // no CAM necessary, so just one loop over the devices
}
// Do the actual switch if valid device found
if (d && ValidDevice) {
cStatus::MsgChannelSwitch(cDevice::PrimaryDevice(), 0, true);
cControl::Shutdown();
if (NeedsDetachAllReceivers)
d->DetachAllReceivers();
if (s) {
if (s->Device() != d) {
if (s->Device())
s->Device()->DetachAllReceivers();
if (d->CamSlot())
d->CamSlot()->Assign(NULL);
s->Assign(d);
}
}
else if (d->CamSlot() && !d->CamSlot()->IsDecrypting())
d->CamSlot()->Assign(NULL);
d->SwitchChannel(channel, true);
if (d == cDevice::PrimaryDevice())
d->ForceTransferMode();
cControl::Launch(new cTransferControl(d, channel));
cStatus::MsgChannelSwitch(cDevice::PrimaryDevice(), channel->Number(), true);
return (true);
}
}
}
}
return (false);

View File

@@ -9,6 +9,7 @@
#define __STDC_FORMAT_MACROS
#endif
#include <ctype.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>

View File

@@ -26,6 +26,8 @@
#define FRONTEND_DEVICE "/dev/dvb/adapter%d/frontend%d"
#define SATIP_DEVICE "SAT>IP"
cDvbDevice *getDvbDevice(cDevice* device);
cString getFrontendInfo(cDvbDevice *device);

View File

@@ -7,10 +7,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: Christian Wieninger\n"
"Language-Team: German <vdr@linuxtv.org>\n"
"Language: de\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: Luis Palacios\n"
"Language-Team: Spanish <vdr@linuxtv.org>\n"
"Language: es\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: Arthur Konovalov\n"
"Language-Team: Estonian <vdr@linuxtv.org>\n"
"Language: et\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: Rolf Ahrenberg\n"
"Language-Team: Finnish <vdr@linuxtv.org>\n"
"Language: fi\n"

View File

@@ -7,10 +7,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: Bernard Jaulin <bernard.jaulin@gmail.com>\n"
"Language-Team: French <vdr@linuxtv.org>\n"
"Language: fr\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2010-10-10 10:10+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: F<>ley Istv<74>n <ifuley at tigercomp dot ro>\n"
"Language-Team: Hungarian <ifuley at tigercomp dot ro>\n"
"Language: hu\n"

View File

@@ -6,10 +6,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: Italian <vdr@linuxtv.org>\n"
"Language: it\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: Valdemaras Pipiras <varas@ambernet.lt>\n"
"Language-Team: Lithuanian <vdr@linuxtv.org>\n"
"Language: lt\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: Vyacheslav Dikonov\n"
"Language-Team: Russian <vdr@linuxtv.org>\n"
"Language: ru\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: Slovak <vdr@linuxtv.org>\n"
"Language: sk\n"
@@ -387,4 +387,3 @@ msgstr "Mbit/s"
msgid "kbit/s"
msgstr "kbit/s"

View File

@@ -4,18 +4,17 @@
# Yarema aka Knedlyk <yupadmin@gmail.com>, 2010.
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: Yarema aka Knedlyk <yupadmin@gmail.com>\n"
"Language-Team: Ukrainian <translation@linux.org.ua>\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\\n\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\\n\n"
msgid "DVB Signal Information Monitor (OSD)"
msgstr "Монітор інформації про DVB сигнал"
@@ -113,12 +112,8 @@ msgstr "Визначення границі зеленої поділки, як
msgid "OSD update interval [0.1s]"
msgstr "Інтервал оновлення повідомлень [0.1с]"
msgid ""
"Define an interval for OSD updates. The smaller interval generates higher "
"CPU load."
msgstr ""
"Визначення інтервалу оновлення повідомлень. Малий інтервал спричинює більше "
"завантаження процесора."
msgid "Define an interval for OSD updates. The smaller interval generates higher CPU load."
msgstr "Визначення інтервалу оновлення повідомлень. Малий інтервал спричинює більше завантаження процесора."
msgid "Analyze stream"
msgstr "Аналіз потоку"
@@ -129,19 +124,14 @@ msgstr "Визначення, чи проводити аналіз DVB пото
msgid "Calculation interval [0.1s]"
msgstr "Інтервал обчислення [0.1с]"
msgid ""
"Define an interval for calculation. The bigger interval generates more "
"stable values."
msgstr ""
"Визначення інтервалу обчислення. Більший інтервал дає стабільніші значення."
msgid "Define an interval for calculation. The bigger interval generates more stable values."
msgstr "Визначення інтервалу обчислення. Більший інтервал дає стабільніші значення."
msgid "Use SVDRP service"
msgstr "Використати SVDRP сервіс"
msgid "Define whether the SVDRP service is used in client/server setups."
msgstr ""
"Визначення чи буде використовуватися SVDRP сервіс в налаштуваннях клієнта/"
"сервера"
msgstr "Визначення чи буде використовуватися SVDRP сервіс в налаштуваннях клієнта/сервера"
msgid "SVDRP service port"
msgstr "Порт SVDRP сервісу"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: NanFeng <nfgx@21cn.com>\n"
"Language-Team: Chinese (simplified) <vdr@linuxtv.org>\n"
"Language: zh_CN\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 2.0.1\n"
"Project-Id-Version: vdr-femon 2.0.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
"POT-Creation-Date: 2014-03-15 03:15+0200\n"
"PO-Revision-Date: 2014-03-15 03:15+0200\n"
"Last-Translator: NanFeng <nfgx@21cn.com>\n"
"Language-Team: Chinese (traditional) <vdr@linuxtv.org>\n"
"Language: zh_TW\n"