diff options
author | Lars Hanisch <dvb@flensrocker.de> | 2010-03-31 23:09:38 +0200 |
---|---|---|
committer | Lars Hanisch <dvb@flensrocker.de> | 2010-03-31 23:09:38 +0200 |
commit | 8a1f43ea75f9ee7c9a433f11387a595803839ee1 (patch) | |
tree | df986b239de930e6b1b74708b190b4d87207b2d4 | |
parent | 16cd97a3a4cf67c936658af19e74bbcaead12e4e (diff) | |
download | vdr-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.c | 2 | ||||
-rw-r--r-- | pvrinput.c | 3 | ||||
-rw-r--r-- | reader.c | 7 | ||||
-rw-r--r-- | setup.c | 3 | ||||
-rw-r--r-- | setup.h | 1 |
5 files changed, 10 insertions, 6 deletions
@@ -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; @@ -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); @@ -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); } @@ -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 @@ -20,6 +20,7 @@ public: int AudioVolumeTVExceptionCard; int UseExternChannelSwitchScript; int ExternChannelSwitchSleep; + int ReadBufferSizeKB; int TsBufferSizeMB; int TsBufferPrefillRatio; valSet Brightness; |