1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00

Added 'Bits/Bytes' button.

This commit is contained in:
Rolf Ahrenberg 2007-10-09 16:37:16 +00:00
parent b0df5006b6
commit 784b64f5c0
8 changed files with 46 additions and 54 deletions

18
README
View File

@ -50,9 +50,6 @@ Setup menu:
stream ringbuffer before data is stream ringbuffer before data is
transferred to VDR. transferred to VDR.
The valid range: 0...40 The valid range: 0...40
- Show statistics in = 0 Defines unit (bytes, kbytes, bits, kbits)
used in statistics menu.
The valid range: 0...3
- Use section filtering = 1 Defines whether section filtering shall - Use section filtering = 1 Defines whether section filtering shall
be used. be used.
The valid range: 0...1 The valid range: 0...1
@ -67,8 +64,19 @@ Setup menu:
contain that many "Disable filter" options contain that many "Disable filter" options
which allow you to disable the individual which allow you to disable the individual
section filters. section filters.
- [Red] Opens IPTV channel editor. - [Red:Channels] Opens IPTV channel editor.
- [Blue] Opens IPTV information/statistics menu. - [Blue:Info] Opens IPTV information/statistics menu.
Channel editor menu:
- Read VDR's MANUAL for detailed information.
Information menu:
- [Red:General] Opens the general information page.
- [Green:Pids] Opens the pid statistics page.
- [Yellow:Filters] Opens the section filter statistics page.
- [Blue:Bits/bytes] Toggles between bits and bytes mode.
Configuration: Configuration:

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: common.h,v 1.7 2007/10/08 23:51:58 rahrenbe Exp $ * $Id: common.h,v 1.8 2007/10/09 16:37:16 rahrenbe Exp $
*/ */
#ifndef __IPTV_COMMON_H #ifndef __IPTV_COMMON_H
@ -26,7 +26,6 @@ uint8_t payload(const uint8_t *tsp);
#define IPTV_DEVICE_INFO_GENERAL 1 #define IPTV_DEVICE_INFO_GENERAL 1
#define IPTV_DEVICE_INFO_PIDS 2 #define IPTV_DEVICE_INFO_PIDS 2
#define IPTV_DEVICE_INFO_FILTERS 3 #define IPTV_DEVICE_INFO_FILTERS 3
#define IPTV_DEVICE_INFO_BUFFERS 4
#define IPTV_STATS_ACTIVE_PIDS_COUNT 10 #define IPTV_STATS_ACTIVE_PIDS_COUNT 10
#define IPTV_STATS_ACTIVE_FILTERS_COUNT 10 #define IPTV_STATS_ACTIVE_FILTERS_COUNT 10

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: device.c,v 1.61 2007/10/08 23:51:58 rahrenbe Exp $ * $Id: device.c,v 1.62 2007/10/09 16:37:16 rahrenbe Exp $
*/ */
#include "config.h" #include "config.h"
@ -97,10 +97,12 @@ cIptvDevice *cIptvDevice::GetIptvDevice(int CardIndex)
cString cIptvDevice::GetGeneralInformation(void) cString cIptvDevice::GetGeneralInformation(void)
{ {
//debug("cIptvDevice::GetGeneralInformation(%d)\n", deviceIndex); //debug("cIptvDevice::GetGeneralInformation(%d)\n", deviceIndex);
return cString::sprintf("IPTV device #%d (CardIndex: %d)\n%s\n%s", return cString::sprintf("IPTV device #%d (CardIndex: %d)\n%s\n%s\nTS buffer usage: %d%%\n",
deviceIndex, CardIndex(), pIptvStreamer ? deviceIndex, CardIndex(), pIptvStreamer ?
*pIptvStreamer->GetInformation() : "", *pIptvStreamer->GetInformation() : "",
pIptvStreamer ? *pIptvStreamer->GetStatistic() : ""); pIptvStreamer ? *pIptvStreamer->GetStatistic() : "",
((MEGABYTE(IptvConfig.GetTsBufferSize()) - tsBuffer->Free()) /
MEGABYTE(IptvConfig.GetTsBufferSize())));
} }
cString cIptvDevice::GetPidsInformation(void) cString cIptvDevice::GetPidsInformation(void)
@ -128,13 +130,6 @@ cString cIptvDevice::GetFiltersInformation(void)
return info; return info;
} }
cString cIptvDevice::GetBuffersInformation(void)
{
//debug("cIptvDevice::GetBuffersInformation(%d)\n", deviceIndex);
cString info("Buffers information is not yet implemented!\n");
return info;
}
cString cIptvDevice::GetInformation(unsigned int Page) cString cIptvDevice::GetInformation(unsigned int Page)
{ {
// generate information string // generate information string
@ -149,15 +144,11 @@ cString cIptvDevice::GetInformation(unsigned int Page)
case IPTV_DEVICE_INFO_FILTERS: case IPTV_DEVICE_INFO_FILTERS:
info = GetFiltersInformation(); info = GetFiltersInformation();
break; break;
case IPTV_DEVICE_INFO_BUFFERS:
info = GetBuffersInformation();
break;
default: default:
info = cString::sprintf("%s%s%s%s", info = cString::sprintf("%s%s%s",
*GetGeneralInformation(), *GetGeneralInformation(),
*GetPidsInformation(), *GetPidsInformation(),
*GetFiltersInformation(), *GetFiltersInformation());
*GetBuffersInformation());
break; break;
} }
return info; return info;

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: device.h,v 1.28 2007/10/08 23:51:58 rahrenbe Exp $ * $Id: device.h,v 1.29 2007/10/09 16:37:16 rahrenbe Exp $
*/ */
#ifndef __IPTV_DEVICE_H #ifndef __IPTV_DEVICE_H
@ -56,7 +56,6 @@ private:
cString GetGeneralInformation(void); cString GetGeneralInformation(void);
cString GetPidsInformation(void); cString GetPidsInformation(void);
cString GetFiltersInformation(void); cString GetFiltersInformation(void);
cString GetBuffersInformation(void);
// for channel parsing & buffering // for channel parsing & buffering
private: private:

18
iptv.c
View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: iptv.c,v 1.15 2007/10/08 23:51:58 rahrenbe Exp $ * $Id: iptv.c,v 1.16 2007/10/09 16:37:16 rahrenbe Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -175,8 +175,6 @@ bool cPluginIptv::SetupParse(const char *Name, const char *Value)
IptvConfig.SetTsBufferSize(atoi(Value)); IptvConfig.SetTsBufferSize(atoi(Value));
else if (!strcasecmp(Name, "TsBufferPrefill")) else if (!strcasecmp(Name, "TsBufferPrefill"))
IptvConfig.SetTsBufferPrefillRatio(atoi(Value)); IptvConfig.SetTsBufferPrefillRatio(atoi(Value));
else if (!strcasecmp(Name, "UseBytes"))
IptvConfig.SetUseBytes(atoi(Value));
else if (!strcasecmp(Name, "SectionFiltering")) else if (!strcasecmp(Name, "SectionFiltering"))
IptvConfig.SetSectionFiltering(atoi(Value)); IptvConfig.SetSectionFiltering(atoi(Value));
else if (!strcasecmp(Name, "SidScanning")) else if (!strcasecmp(Name, "SidScanning"))
@ -201,9 +199,15 @@ bool cPluginIptv::Service(const char *Id, void *Data)
const char **cPluginIptv::SVDRPHelpPages(void) const char **cPluginIptv::SVDRPHelpPages(void)
{ {
//debug("cPluginIptv::SVDRPHelpPages()\n"); debug("cPluginIptv::SVDRPHelpPages()\n");
// Return help text for SVDRP commands this plugin implements static const char *HelpPages[] = {
return NULL; "INFO [ <option> ]\n"
" Print IPTV device information and statistics.\n"
" The data can be shown either in bits or bytes\n"
" according the given option (bits=0; bytes=1).\n",
NULL
};
return HelpPages;
} }
cString cPluginIptv::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) cString cPluginIptv::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
@ -212,7 +216,7 @@ cString cPluginIptv::SVDRPCommand(const char *Command, const char *Option, int &
if (strcasecmp(Command, "INFO") == 0) { if (strcasecmp(Command, "INFO") == 0) {
cIptvDevice *device = cIptvDevice::GetIptvDevice(cDevice::ActualDevice()->CardIndex()); cIptvDevice *device = cIptvDevice::GetIptvDevice(cDevice::ActualDevice()->CardIndex());
if (device) if (device)
return device->GetInformation(); return device->GetInformation((atoi(Option) == 0));
else { else {
ReplyCode = 550; // Requested action not taken ReplyCode = 550; // Requested action not taken
return cString("IPTV information not available!"); return cString("IPTV information not available!");

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: VDR 1.5.7\n" "Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2007-10-09 02:46+0300\n" "POT-Creation-Date: 2007-10-09 18:24+0300\n"
"PO-Revision-Date: 2007-08-12 23:22+0300\n" "PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Rolf Ahrenberg\n" "Last-Translator: Rolf Ahrenberg\n"
"Language-Team: <vdr@linuxtv.org>\n" "Language-Team: <vdr@linuxtv.org>\n"
@ -92,8 +92,8 @@ msgid "IPTV Information"
msgstr "IPTV-tiedot" msgstr "IPTV-tiedot"
#: setup.c:496 #: setup.c:496
msgid "Buffers" msgid "Bits/bytes"
msgstr "Puskurit" msgstr "Bitit/tavut"
#: setup.c:496 #: setup.c:496
msgid "Filters" msgid "Filters"
@ -111,31 +111,27 @@ msgstr "Pidit"
msgid "IPTV information not available!" msgid "IPTV information not available!"
msgstr "IPTV-tietoja ei saatavilla!" msgstr "IPTV-tietoja ei saatavilla!"
#: setup.c:590 #: setup.c:589
msgid "TS buffer size [MB]" msgid "TS buffer size [MB]"
msgstr "TS-puskurin koko [MB]" msgstr "TS-puskurin koko [MB]"
#: setup.c:591 #: setup.c:590
msgid "TS buffer prefill ratio [%]" msgid "TS buffer prefill ratio [%]"
msgstr "TS-puskurin esitäyttöaste [%]" msgstr "TS-puskurin esitäyttöaste [%]"
#: setup.c:592 #: setup.c:591
msgid "Use bytes in statistics"
msgstr "Käytä tavuja tilastotiedoissa"
#: setup.c:593
msgid "Use section filtering" msgid "Use section filtering"
msgstr "Käytä sektioiden suodatusta" msgstr "Käytä sektioiden suodatusta"
#: setup.c:595 #: setup.c:593
msgid "Scan Sid automatically" msgid "Scan Sid automatically"
msgstr "Etsi palvelu-ID automaattisesti" msgstr "Etsi palvelu-ID automaattisesti"
#: setup.c:596 #: setup.c:594
msgid "Disable filters" msgid "Disable filters"
msgstr "Poista suodattimia käytöstä" msgstr "Poista suodattimia käytöstä"
#. TRANSLATORS: note the singular! #. TRANSLATORS: note the singular!
#: setup.c:599 #: setup.c:597
msgid "Disable filter" msgid "Disable filter"
msgstr "Poista suodatin käytöstä" msgstr "Poista suodatin käytöstä"

10
setup.c
View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: setup.c,v 1.27 2007/10/08 23:51:58 rahrenbe Exp $ * $Id: setup.c,v 1.28 2007/10/09 16:37:16 rahrenbe Exp $
*/ */
#include <string.h> #include <string.h>
@ -493,7 +493,7 @@ cIptvMenuInfo::cIptvMenuInfo()
:cOsdMenu(tr("IPTV Information")), text(""), timeout(INFO_TIMEOUT_MS), page(IPTV_DEVICE_INFO_GENERAL) :cOsdMenu(tr("IPTV Information")), text(""), timeout(INFO_TIMEOUT_MS), page(IPTV_DEVICE_INFO_GENERAL)
{ {
UpdateInfo(); UpdateInfo();
SetHelp(tr("General"), tr("Pids"), tr("Filters"), tr("Buffers")); SetHelp(tr("General"), tr("Pids"), tr("Filters"), tr("Bits/bytes"));
} }
cIptvMenuInfo::~cIptvMenuInfo() cIptvMenuInfo::~cIptvMenuInfo()
@ -550,7 +550,7 @@ eOSState cIptvMenuInfo::ProcessKey(eKeys Key)
case kYellow: page = IPTV_DEVICE_INFO_FILTERS; case kYellow: page = IPTV_DEVICE_INFO_FILTERS;
UpdateInfo(); UpdateInfo();
break; break;
case kBlue: page = IPTV_DEVICE_INFO_BUFFERS; case kBlue: IptvConfig.SetUseBytes(!IptvConfig.GetUseBytes());
UpdateInfo(); UpdateInfo();
break; break;
default: if (timeout.TimedOut()) default: if (timeout.TimedOut())
@ -569,7 +569,6 @@ cIptvPluginSetup::cIptvPluginSetup()
debug("cIptvPluginSetup::cIptvPluginSetup()\n"); debug("cIptvPluginSetup::cIptvPluginSetup()\n");
tsBufferSize = IptvConfig.GetTsBufferSize(); tsBufferSize = IptvConfig.GetTsBufferSize();
tsBufferPrefill = IptvConfig.GetTsBufferPrefillRatio(); tsBufferPrefill = IptvConfig.GetTsBufferPrefillRatio();
useBytes = IptvConfig.GetUseBytes();
sectionFiltering = IptvConfig.GetSectionFiltering(); sectionFiltering = IptvConfig.GetSectionFiltering();
sidScanning = IptvConfig.GetSidScanning(); sidScanning = IptvConfig.GetSidScanning();
numDisabledFilters = IptvConfig.GetDisabledFiltersCount(); numDisabledFilters = IptvConfig.GetDisabledFiltersCount();
@ -589,7 +588,6 @@ void cIptvPluginSetup::Setup(void)
Clear(); Clear();
Add(new cMenuEditIntItem( tr("TS buffer size [MB]"), &tsBufferSize, 2, 16)); Add(new cMenuEditIntItem( tr("TS buffer size [MB]"), &tsBufferSize, 2, 16));
Add(new cMenuEditIntItem( tr("TS buffer prefill ratio [%]"), &tsBufferPrefill, 0, 40)); Add(new cMenuEditIntItem( tr("TS buffer prefill ratio [%]"), &tsBufferPrefill, 0, 40));
Add(new cMenuEditBoolItem(tr("Use bytes in statistics"), &useBytes));
Add(new cMenuEditBoolItem(tr("Use section filtering"), &sectionFiltering)); Add(new cMenuEditBoolItem(tr("Use section filtering"), &sectionFiltering));
if (sectionFiltering) { if (sectionFiltering) {
Add(new cMenuEditBoolItem(tr("Scan Sid automatically"), &sidScanning)); Add(new cMenuEditBoolItem(tr("Scan Sid automatically"), &sidScanning));
@ -663,14 +661,12 @@ void cIptvPluginSetup::Store(void)
// Store values into setup.conf // Store values into setup.conf
SetupStore("TsBufferSize", tsBufferSize); SetupStore("TsBufferSize", tsBufferSize);
SetupStore("TsBufferPrefill", tsBufferPrefill); SetupStore("TsBufferPrefill", tsBufferPrefill);
SetupStore("UseBytes", useBytes);
SetupStore("SectionFiltering", sectionFiltering); SetupStore("SectionFiltering", sectionFiltering);
SetupStore("SidScanning", sidScanning); SetupStore("SidScanning", sidScanning);
StoreFilters("DisabledFilters", disabledFilterIndexes); StoreFilters("DisabledFilters", disabledFilterIndexes);
// Update global config // Update global config
IptvConfig.SetTsBufferSize(tsBufferSize); IptvConfig.SetTsBufferSize(tsBufferSize);
IptvConfig.SetTsBufferPrefillRatio(tsBufferPrefill); IptvConfig.SetTsBufferPrefillRatio(tsBufferPrefill);
IptvConfig.SetUseBytes(useBytes);
IptvConfig.SetSectionFiltering(sectionFiltering); IptvConfig.SetSectionFiltering(sectionFiltering);
IptvConfig.SetSidScanning(sidScanning); IptvConfig.SetSidScanning(sidScanning);
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i)

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: setup.h,v 1.14 2007/10/08 23:51:58 rahrenbe Exp $ * $Id: setup.h,v 1.15 2007/10/09 16:37:16 rahrenbe Exp $
*/ */
#ifndef __IPTV_SETUP_H #ifndef __IPTV_SETUP_H
@ -17,7 +17,6 @@ class cIptvPluginSetup : public cMenuSetupPage
private: private:
int tsBufferSize; int tsBufferSize;
int tsBufferPrefill; int tsBufferPrefill;
int useBytes;
int sectionFiltering; int sectionFiltering;
int sidScanning; int sidScanning;
int numDisabledFilters; int numDisabledFilters;