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
transferred to VDR.
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
be used.
The valid range: 0...1
@ -67,8 +64,19 @@ Setup menu:
contain that many "Disable filter" options
which allow you to disable the individual
section filters.
- [Red] Opens IPTV channel editor.
- [Blue] Opens IPTV information/statistics menu.
- [Red:Channels] Opens IPTV channel editor.
- [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:

View File

@ -3,7 +3,7 @@
*
* 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
@ -26,7 +26,6 @@ uint8_t payload(const uint8_t *tsp);
#define IPTV_DEVICE_INFO_GENERAL 1
#define IPTV_DEVICE_INFO_PIDS 2
#define IPTV_DEVICE_INFO_FILTERS 3
#define IPTV_DEVICE_INFO_BUFFERS 4
#define IPTV_STATS_ACTIVE_PIDS_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.
*
* $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"
@ -97,10 +97,12 @@ cIptvDevice *cIptvDevice::GetIptvDevice(int CardIndex)
cString cIptvDevice::GetGeneralInformation(void)
{
//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 ?
*pIptvStreamer->GetInformation() : "",
pIptvStreamer ? *pIptvStreamer->GetStatistic() : "");
pIptvStreamer ? *pIptvStreamer->GetStatistic() : "",
((MEGABYTE(IptvConfig.GetTsBufferSize()) - tsBuffer->Free()) /
MEGABYTE(IptvConfig.GetTsBufferSize())));
}
cString cIptvDevice::GetPidsInformation(void)
@ -128,13 +130,6 @@ cString cIptvDevice::GetFiltersInformation(void)
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)
{
// generate information string
@ -149,15 +144,11 @@ cString cIptvDevice::GetInformation(unsigned int Page)
case IPTV_DEVICE_INFO_FILTERS:
info = GetFiltersInformation();
break;
case IPTV_DEVICE_INFO_BUFFERS:
info = GetBuffersInformation();
break;
default:
info = cString::sprintf("%s%s%s%s",
info = cString::sprintf("%s%s%s",
*GetGeneralInformation(),
*GetPidsInformation(),
*GetFiltersInformation(),
*GetBuffersInformation());
*GetFiltersInformation());
break;
}
return info;

View File

@ -3,7 +3,7 @@
*
* 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
@ -56,7 +56,6 @@ private:
cString GetGeneralInformation(void);
cString GetPidsInformation(void);
cString GetFiltersInformation(void);
cString GetBuffersInformation(void);
// for channel parsing & buffering
private:

18
iptv.c
View File

@ -3,7 +3,7 @@
*
* 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>
@ -175,8 +175,6 @@ bool cPluginIptv::SetupParse(const char *Name, const char *Value)
IptvConfig.SetTsBufferSize(atoi(Value));
else if (!strcasecmp(Name, "TsBufferPrefill"))
IptvConfig.SetTsBufferPrefillRatio(atoi(Value));
else if (!strcasecmp(Name, "UseBytes"))
IptvConfig.SetUseBytes(atoi(Value));
else if (!strcasecmp(Name, "SectionFiltering"))
IptvConfig.SetSectionFiltering(atoi(Value));
else if (!strcasecmp(Name, "SidScanning"))
@ -201,9 +199,15 @@ bool cPluginIptv::Service(const char *Id, void *Data)
const char **cPluginIptv::SVDRPHelpPages(void)
{
//debug("cPluginIptv::SVDRPHelpPages()\n");
// Return help text for SVDRP commands this plugin implements
return NULL;
debug("cPluginIptv::SVDRPHelpPages()\n");
static const char *HelpPages[] = {
"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)
@ -212,7 +216,7 @@ cString cPluginIptv::SVDRPCommand(const char *Command, const char *Option, int &
if (strcasecmp(Command, "INFO") == 0) {
cIptvDevice *device = cIptvDevice::GetIptvDevice(cDevice::ActualDevice()->CardIndex());
if (device)
return device->GetInformation();
return device->GetInformation((atoi(Option) == 0));
else {
ReplyCode = 550; // Requested action not taken
return cString("IPTV information not available!");

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\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"
"Last-Translator: Rolf Ahrenberg\n"
"Language-Team: <vdr@linuxtv.org>\n"
@ -92,8 +92,8 @@ msgid "IPTV Information"
msgstr "IPTV-tiedot"
#: setup.c:496
msgid "Buffers"
msgstr "Puskurit"
msgid "Bits/bytes"
msgstr "Bitit/tavut"
#: setup.c:496
msgid "Filters"
@ -111,31 +111,27 @@ msgstr "Pidit"
msgid "IPTV information not available!"
msgstr "IPTV-tietoja ei saatavilla!"
#: setup.c:590
#: setup.c:589
msgid "TS buffer size [MB]"
msgstr "TS-puskurin koko [MB]"
#: setup.c:591
#: setup.c:590
msgid "TS buffer prefill ratio [%]"
msgstr "TS-puskurin esitäyttöaste [%]"
#: setup.c:592
msgid "Use bytes in statistics"
msgstr "Käytä tavuja tilastotiedoissa"
#: setup.c:593
#: setup.c:591
msgid "Use section filtering"
msgstr "Käytä sektioiden suodatusta"
#: setup.c:595
#: setup.c:593
msgid "Scan Sid automatically"
msgstr "Etsi palvelu-ID automaattisesti"
#: setup.c:596
#: setup.c:594
msgid "Disable filters"
msgstr "Poista suodattimia käytöstä"
#. TRANSLATORS: note the singular!
#: setup.c:599
#: setup.c:597
msgid "Disable filter"
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.
*
* $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>
@ -493,7 +493,7 @@ cIptvMenuInfo::cIptvMenuInfo()
:cOsdMenu(tr("IPTV Information")), text(""), timeout(INFO_TIMEOUT_MS), page(IPTV_DEVICE_INFO_GENERAL)
{
UpdateInfo();
SetHelp(tr("General"), tr("Pids"), tr("Filters"), tr("Buffers"));
SetHelp(tr("General"), tr("Pids"), tr("Filters"), tr("Bits/bytes"));
}
cIptvMenuInfo::~cIptvMenuInfo()
@ -550,7 +550,7 @@ eOSState cIptvMenuInfo::ProcessKey(eKeys Key)
case kYellow: page = IPTV_DEVICE_INFO_FILTERS;
UpdateInfo();
break;
case kBlue: page = IPTV_DEVICE_INFO_BUFFERS;
case kBlue: IptvConfig.SetUseBytes(!IptvConfig.GetUseBytes());
UpdateInfo();
break;
default: if (timeout.TimedOut())
@ -569,7 +569,6 @@ cIptvPluginSetup::cIptvPluginSetup()
debug("cIptvPluginSetup::cIptvPluginSetup()\n");
tsBufferSize = IptvConfig.GetTsBufferSize();
tsBufferPrefill = IptvConfig.GetTsBufferPrefillRatio();
useBytes = IptvConfig.GetUseBytes();
sectionFiltering = IptvConfig.GetSectionFiltering();
sidScanning = IptvConfig.GetSidScanning();
numDisabledFilters = IptvConfig.GetDisabledFiltersCount();
@ -589,7 +588,6 @@ void cIptvPluginSetup::Setup(void)
Clear();
Add(new cMenuEditIntItem( tr("TS buffer size [MB]"), &tsBufferSize, 2, 16));
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));
if (sectionFiltering) {
Add(new cMenuEditBoolItem(tr("Scan Sid automatically"), &sidScanning));
@ -663,14 +661,12 @@ void cIptvPluginSetup::Store(void)
// Store values into setup.conf
SetupStore("TsBufferSize", tsBufferSize);
SetupStore("TsBufferPrefill", tsBufferPrefill);
SetupStore("UseBytes", useBytes);
SetupStore("SectionFiltering", sectionFiltering);
SetupStore("SidScanning", sidScanning);
StoreFilters("DisabledFilters", disabledFilterIndexes);
// Update global config
IptvConfig.SetTsBufferSize(tsBufferSize);
IptvConfig.SetTsBufferPrefillRatio(tsBufferPrefill);
IptvConfig.SetUseBytes(useBytes);
IptvConfig.SetSectionFiltering(sectionFiltering);
IptvConfig.SetSidScanning(sidScanning);
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.
*
* $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
@ -17,7 +17,6 @@ class cIptvPluginSetup : public cMenuSetupPage
private:
int tsBufferSize;
int tsBufferPrefill;
int useBytes;
int sectionFiltering;
int sidScanning;
int numDisabledFilters;