summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Hanisch <dvb@flensrocker.de>2010-03-31 23:09:38 +0200
committerLars Hanisch <dvb@flensrocker.de>2010-03-31 23:09:38 +0200
commit8a1f43ea75f9ee7c9a433f11387a595803839ee1 (patch)
treedf986b239de930e6b1b74708b190b4d87207b2d4
parent16cd97a3a4cf67c936658af19e74bbcaead12e4e (diff)
downloadvdr-plugin-pvrinput-8a1f43ea75f9ee7c9a433f11387a595803839ee1.tar.gz
vdr-plugin-pvrinput-8a1f43ea75f9ee7c9a433f11387a595803839ee1.tar.bz2
add hidden expert option for size of read-buffer
Add the following to setup.conf for tweaking: pvrinput.ReadBufferSizeKB = 64
-rw-r--r--device.c2
-rw-r--r--pvrinput.c3
-rw-r--r--reader.c7
-rw-r--r--setup.c3
-rw-r--r--setup.h1
5 files changed, 10 insertions, 6 deletions
diff --git a/device.c b/device.c
index 20b4718..37eb509 100644
--- a/device.c
+++ b/device.c
@@ -949,7 +949,7 @@ bool cPvrDevice::ProvidesSource(int Source) const
#else
if (cSource::IsPlug(Source)) {
#endif
- log(pvrDEBUG1, "cPvrDevice::ProvidesSource Source=%s -> true", (const char*)cSource::ToString(Source));
+ log(pvrDEBUG3, "cPvrDevice::ProvidesSource Source=%s -> true", (const char*)cSource::ToString(Source));
return true;
}
return false;
diff --git a/pvrinput.c b/pvrinput.c
index 8ad5549..a0c09ad 100644
--- a/pvrinput.c
+++ b/pvrinput.c
@@ -6,7 +6,7 @@
#endif
#endif
-static const char *VERSION = "2010-03-27-rc1";
+static const char *VERSION = "2010-04-01-rc1";
static const char *DESCRIPTION = tr("use Hauppauge PVR as input device");
static const char *MAINMENUENTRY = tr("PVR picture settings");
@@ -130,6 +130,7 @@ bool cPluginPvrInput::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "FilterChromaMedianBottom")) PvrSetup.FilterChromaMedianBottom.value = atoi(Value);
else if (!strcasecmp(Name, "FilterChromaMedianTop")) PvrSetup.FilterChromaMedianTop.value = atoi(Value);
else if (!strcasecmp(Name, "HideMainMenuEntry")) PvrSetup.HideMainMenuEntry = atoi(Value);
+ else if (!strcasecmp(Name, "ReadBufferSizeKB")) PvrSetup.ReadBufferSizeKB = atoi(Value);
else if (!strcasecmp(Name, "TsBufferSizeMB")) PvrSetup.TsBufferSizeMB = atoi(Value);
else if (!strcasecmp(Name, "TsBufferPrefillRatio")) PvrSetup.TsBufferPrefillRatio = atoi(Value);
else if (!strcasecmp(Name, "UseExternChannelSwitchScript")) PvrSetup.UseExternChannelSwitchScript = atoi(Value);
diff --git a/reader.c b/reader.c
index 2d15a5e..392abc1 100644
--- a/reader.c
+++ b/reader.c
@@ -1,7 +1,6 @@
#include "common.h"
#include <libsi/si.h>
-#define BUFFSIZE_INPUT 4096 * 16
#define SENDPATPMT_PACKETINTERVAL 500
@@ -489,7 +488,8 @@ void cPvrReadThread::ParseProgramStream(uint8_t *Data, uint32_t Length)
void cPvrReadThread::Action(void)
{
- unsigned char buffer[BUFFSIZE_INPUT];
+ int bufferSize = PvrSetup.ReadBufferSizeKB * 1024;
+ uint8_t *buffer = new uint8_t[bufferSize];
int r;
int retries = 3;
log(pvrDEBUG1,"cPvrReadThread::Action(): Entering Action()");
@@ -535,7 +535,7 @@ void cPvrReadThread::Action(void)
}
retry:
while (Running() && parent->readThreadRunning) {
- r = read(parent->v4l2_fd, buffer, BUFFSIZE_INPUT);
+ r = read(parent->v4l2_fd, buffer, bufferSize);
if (r < 0) {
log(pvrERROR, "cPvrReadThread::Action():error reading from /dev/video%d: %d:%s %s",
parent->number, errno, strerror(errno), (--retries > 0) ? " - retrying" : "");
@@ -552,6 +552,7 @@ void cPvrReadThread::Action(void)
ParseProgramStream(buffer, r);
}
}
+ delete [] buffer;
log(errno ? pvrERROR : pvrDEBUG2, "cPvrReadThread::Action() %s on /dev/video%d ",
errno ? "failed" : "stopped", parent->number);
}
diff --git a/setup.c b/setup.c
index 00bfcb9..e16e13d 100644
--- a/setup.c
+++ b/setup.c
@@ -11,7 +11,8 @@ cPvrSetup::cPvrSetup(void)
SliceVBI = 1; // Slice VBI data into mpeg stream
UseExternChannelSwitchScript = 0; // don't call externchannelswitch.sh on external inputs
ExternChannelSwitchSleep = 0; // sleep x seconds after call of externchannelswitch.sh
- TsBufferSizeMB = 3; // ring buffer size
+ ReadBufferSizeKB = 64; // size of buffer for reader in KB
+ TsBufferSizeMB = 3; // ring buffer size in MB
TsBufferPrefillRatio = 0; // wait with delivering packets to vdr till buffer is filled
/* first initialization of all v4l2 controls,
most values will be re-initialized later one
diff --git a/setup.h b/setup.h
index e5ff35a..1efecf3 100644
--- a/setup.h
+++ b/setup.h
@@ -20,6 +20,7 @@ public:
int AudioVolumeTVExceptionCard;
int UseExternChannelSwitchScript;
int ExternChannelSwitchSleep;
+ int ReadBufferSizeKB;
int TsBufferSizeMB;
int TsBufferPrefillRatio;
valSet Brightness;