diff --git a/Makefile b/Makefile index 5a4abb6..a4b12ce 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.2 2007/09/14 15:44:25 rahrenbe Exp $ +# $Id: Makefile,v 1.3 2007/09/15 15:38:38 rahrenbe Exp $ # Debugging on/off IPTV_DEBUG = 1 @@ -57,7 +57,7 @@ endif ### The object files (add further files here): -OBJS = $(PLUGIN).o device.o streamer.o protocoludp.o +OBJS = $(PLUGIN).o config.o setup.o device.o streamer.o protocoludp.o ### The main target: diff --git a/config.c b/config.c new file mode 100644 index 0000000..c0fc9d3 --- /dev/null +++ b/config.c @@ -0,0 +1,17 @@ +/* + * config.c: IPTV plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + * $Id: config.c,v 1.1 2007/09/15 15:38:38 rahrenbe Exp $ + */ + +#include "common.h" +#include "config.h" + +cIptvConfig IptvConfig; + +cIptvConfig::cIptvConfig(void) +: bufferSizeMB(8) +{ +} diff --git a/config.h b/config.h new file mode 100644 index 0000000..c5bca69 --- /dev/null +++ b/config.h @@ -0,0 +1,27 @@ +/* + * config.h: IPTV plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + * $Id: config.h,v 1.1 2007/09/15 15:38:38 rahrenbe Exp $ + */ + +#ifndef __IPTV_CONFIG_H +#define __IPTV_CONFIG_H + +#include +#include "config.h" + +class cIptvConfig +{ +protected: + unsigned int bufferSizeMB; +public: + cIptvConfig(); + unsigned int GetBufferSizeMB(void) { return bufferSizeMB; } + void SetBufferSizeMB(unsigned int Size) { bufferSizeMB = Size; } +}; + +extern cIptvConfig IptvConfig; + +#endif // __IPTV_CONFIG_H diff --git a/device.c b/device.c index b8bc113..aa46304 100644 --- a/device.c +++ b/device.c @@ -3,10 +3,11 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: device.c,v 1.12 2007/09/15 15:02:33 rahrenbe Exp $ + * $Id: device.c,v 1.13 2007/09/15 15:38:38 rahrenbe Exp $ */ #include "common.h" +#include "config.h" #include "device.h" #define IPTV_MAX_DEVICES 8 @@ -22,7 +23,7 @@ cIptvDevice::cIptvDevice(unsigned int Index) mutex() { debug("cIptvDevice::cIptvDevice(%d)\n", deviceIndex); - tsBuffer = new cRingBufferLinear(MEGABYTE(8), TS_SIZE * 2, false, "IPTV"); + tsBuffer = new cRingBufferLinear(MEGABYTE(IptvConfig.GetBufferSizeMB()), TS_SIZE * 2, false, "IPTV"); //tsBuffer->SetTimeouts(100, 100); pUdpProtocol = new cIptvProtocolUdp(); //pRtspProtocol = new cIptvProtocolRtsp(); diff --git a/iptv.c b/iptv.c index 53276dc..ebbe713 100644 --- a/iptv.c +++ b/iptv.c @@ -3,12 +3,14 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: iptv.c,v 1.2 2007/09/15 15:02:33 rahrenbe Exp $ + * $Id: iptv.c,v 1.3 2007/09/15 15:38:38 rahrenbe Exp $ */ #include #include #include "common.h" +#include "config.h" +#include "setup.h" #include "device.h" static const char *VERSION = "0.0.1"; @@ -145,14 +147,18 @@ cMenuSetupPage *cPluginIptv::SetupMenu(void) { debug("cPluginIptv::SetupMenu()\n"); // Return a setup menu in case the plugin supports one. - return NULL; + return new cIptvPluginSetup(); } bool cPluginIptv::SetupParse(const char *Name, const char *Value) { debug("cPluginIptv::SetupParse()\n"); // Parse your own setup parameters and store their values. - return false; + if (!strcasecmp(Name, "BufferSize")) + IptvConfig.SetBufferSizeMB(atoi(Value)); + else + return false; + return true; } bool cPluginIptv::Service(const char *Id, void *Data) diff --git a/po/fi_FI.po b/po/fi_FI.po index 7867c02..aafbd25 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -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-08-12 23:22+0300\n" +"POT-Creation-Date: 2007-09-15 18:35+0300\n" "PO-Revision-Date: 2007-08-12 23:22+0300\n" "Last-Translator: Rolf Ahrenberg\n" "Language-Team: \n" @@ -15,6 +15,10 @@ msgstr "" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" -#: iptv.c:15 +#: iptv.c:17 msgid "Experiment the IPTV" msgstr "Koe IPTV:n ihmeellinen maailma" + +#: setup.c:23 +msgid "Buffer size [MB]" +msgstr "Puskurin koko [MB]" diff --git a/setup.c b/setup.c new file mode 100644 index 0000000..1cc5fd3 --- /dev/null +++ b/setup.c @@ -0,0 +1,38 @@ +/* + * setup.c: IPTV plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + * $Id: setup.c,v 1.1 2007/09/15 15:38:38 rahrenbe Exp $ + */ + +#include "common.h" +#include "config.h" +#include "setup.h" + +cIptvPluginSetup::cIptvPluginSetup(void) +{ + bufferSize = IptvConfig.GetBufferSizeMB(); + Setup(); +} + +void cIptvPluginSetup::Setup(void) +{ + int current = Current(); + Clear(); + Add(new cMenuEditIntItem(tr("Buffer size [MB]"), &bufferSize, 0, 16)); + SetCurrent(Get(current)); + Display(); +} + +eOSState cIptvPluginSetup::ProcessKey(eKeys Key) +{ + eOSState state = cMenuSetupPage::ProcessKey(Key); + return state; +} + +void cIptvPluginSetup::Store(void) +{ + SetupStore("BufferSize", bufferSize); + IptvConfig.SetBufferSizeMB(bufferSize); +} diff --git a/setup.h b/setup.h new file mode 100644 index 0000000..77add45 --- /dev/null +++ b/setup.h @@ -0,0 +1,28 @@ +/* + * setup.h: IPTV plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + * $Id: setup.h,v 1.1 2007/09/15 15:38:38 rahrenbe Exp $ + */ + +#ifndef __IPTV_SETUP_H +#define __IPTV_SETUP_H + +#include + +class cIptvPluginSetup : public cMenuSetupPage +{ +private: + int bufferSize; + virtual void Setup(void); + +protected: + virtual eOSState ProcessKey(eKeys Key); + virtual void Store(void); + +public: + cIptvPluginSetup(); +}; + +#endif // __IPTV_SETUP_H