Configurable buffer for live TV

This commit is contained in:
Frank Schmirler 2014-05-18 15:24:24 +02:00
parent 54440cb080
commit 2cdf160648
15 changed files with 99 additions and 35 deletions

View File

@ -1,6 +1,8 @@
VDR Plugin 'streamdev' Revision History
---------------------------------------
- New option for server side live TV buffer to prevent buffer underruns
2013-11-28: Version 0.6.1
- Updated Slovak translation (thanks to Milan Hrala)

4
README
View File

@ -228,6 +228,10 @@ of the other cards is idle (i.e. if it is not blocked by a recording). If all
cards are in use (i.e. when something is recorded, or by multiple clients), this
applies to Multiple-Card-Systems as well.
If your client suffers from buffer underruns while watching live TV, you can
configure buffering on the server side. Enter a reasonable value (e.g. 300ms)
as "Live TV buffer delay (ms)" in the server setup.
3.1 Usage HTTP server:
----------------------

View File

@ -11,6 +11,7 @@
#include <vdr/ringbuffer.h>
#include "server/livestreamer.h"
#include "server/setup.h"
#include "common.h"
using namespace Streamdev;
@ -534,6 +535,21 @@ void cStreamdevLiveStreamer::Receive(uchar *Data, int Length)
m_ReceiveBuffer->ReportOverflow(Length - p);
}
void cStreamdevLiveStreamer::Action(void)
{
if (StreamdevServerSetup.LiveBufferMs) {
// wait for first data block
int count = 0;
while (Running()) {
if (m_ReceiveBuffer->Get(count) != NULL) {
cCondWait::SleepMs(StreamdevServerSetup.LiveBufferMs);
break;
}
}
}
cStreamdevStreamer::Action();
}
int cStreamdevLiveStreamer::Put(const uchar *Data, int Count)
{
// insert si data

View File

@ -38,6 +38,7 @@ protected:
virtual void DelFromReceiver(int Count) { m_ReceiveBuffer->Del(Count); }
virtual int Put(const uchar *Data, int Count);
virtual void Action(void);
public:
cStreamdevLiveStreamer(int Priority, const cServerConnection *Connection);

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: streamdev\n"
"Report-Msgid-Bugs-To: <vdrdev@schmirler.de>\n"
"POT-Creation-Date: 2013-11-02 16:55+0100\n"
"POT-Creation-Date: 2014-05-05 22:46+0200\n"
"PO-Revision-Date: 2008-03-30 02:11+0200\n"
"Last-Translator: Frank Schmirler <vdrdev@schmirler.de>\n"
"Language-Team: German <vdr@linuxtv.org>\n"
@ -40,6 +40,9 @@ msgstr "Live-TV beim Start pausieren"
msgid "Maximum Number of Clients"
msgstr "Maximalanzahl an Clients"
msgid "Live TV buffer delay (ms)"
msgstr "Live-TV Pufferdauer (ms)"
msgid "VDR-to-VDR Server"
msgstr "VDR-zu-VDR Server"
@ -90,4 +93,3 @@ msgstr "Multicast Streamtyp"
msgid "VDR Streaming Server"
msgstr "VDR Streaming Server"

View File

@ -6,8 +6,8 @@
msgid ""
msgstr ""
"Project-Id-Version: streamdev 0.5.0\n"
"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n"
"POT-Creation-Date: 2012-03-31 15:06+0200\n"
"Report-Msgid-Bugs-To: <vdrdev@schmirler.de>\n"
"POT-Creation-Date: 2014-05-05 22:46+0200\n"
"PO-Revision-Date: 2010-06-19 03:58+0100\n"
"Last-Translator: Javier Bradineras <jbradi@hotmail.com>\n"
"Language-Team: Spanish <vdr@linuxtv.org>\n"
@ -16,9 +16,6 @@ msgstr ""
"Content-Type: text/plain; charset=ISO-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "VDR Streaming Server"
msgstr "Servidor de transmisiones del VDR"
msgid "Streaming active"
msgstr "Trasmisión activa"
@ -37,9 +34,15 @@ msgstr "Configuraci
msgid "Hide Mainmenu Entry"
msgstr ""
msgid "Start with Live TV suspended"
msgstr ""
msgid "Maximum Number of Clients"
msgstr "Numero máximo de clientes"
msgid "Live TV buffer delay (ms)"
msgstr ""
msgid "VDR-to-VDR Server"
msgstr "Servidor VDR-a-VDR"
@ -87,3 +90,6 @@ msgstr "Puerto del Cliente Multicast"
msgid "Multicast Streamtype"
msgstr "Tipo de flujo Multicast"
msgid "VDR Streaming Server"
msgstr "Servidor de transmisiones del VDR"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: streamdev 0.5.0\n"
"Report-Msgid-Bugs-To: <vdrdev@schmirler.de>\n"
"POT-Creation-Date: 2012-03-31 15:06+0200\n"
"POT-Creation-Date: 2014-05-05 22:46+0200\n"
"PO-Revision-Date: 2008-03-30 02:11+0200\n"
"Last-Translator: Rolf Ahrenberg\n"
"Language-Team: Finnish <vdr@linuxtv.org>\n"
@ -16,9 +16,6 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "VDR Streaming Server"
msgstr "VDR-suoratoistopalvelin"
msgid "Streaming active"
msgstr "Suoratoistopalvelin aktiivinen"
@ -43,6 +40,9 @@ msgstr "Käynnistä Live-katselu pysäytettynä"
msgid "Maximum Number of Clients"
msgstr "Suurin sallittu asiakkaiden määrä"
msgid "Live TV buffer delay (ms)"
msgstr ""
msgid "VDR-to-VDR Server"
msgstr "VDR-palvelin"
@ -90,3 +90,6 @@ msgstr "Multicast-portti"
msgid "Multicast Streamtype"
msgstr "Multicast-lähetysmuoto"
msgid "VDR Streaming Server"
msgstr "VDR-suoratoistopalvelin"

View File

@ -6,8 +6,8 @@
msgid ""
msgstr ""
"Project-Id-Version: streamdev 0.5.0\n"
"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n"
"POT-Creation-Date: 2012-03-31 15:06+0200\n"
"Report-Msgid-Bugs-To: <vdrdev@schmirler.de>\n"
"POT-Creation-Date: 2014-05-05 22:46+0200\n"
"PO-Revision-Date: 2008-03-30 02:11+0200\n"
"Last-Translator: micky979 <micky979@free.fr>\n"
"Language-Team: French <vdr@linuxtv.org>\n"
@ -16,9 +16,6 @@ msgstr ""
"Content-Type: text/plain; charset=ISO-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "VDR Streaming Server"
msgstr "Serveur de streaming VDR"
msgid "Streaming active"
msgstr "Streaming actif"
@ -37,9 +34,15 @@ msgstr "Param
msgid "Hide Mainmenu Entry"
msgstr ""
msgid "Start with Live TV suspended"
msgstr ""
msgid "Maximum Number of Clients"
msgstr "Nombre maximun de clients"
msgid "Live TV buffer delay (ms)"
msgstr ""
msgid "VDR-to-VDR Server"
msgstr "VDR-to-VDR Serveur"
@ -87,3 +90,6 @@ msgstr ""
msgid "Multicast Streamtype"
msgstr ""
msgid "VDR Streaming Server"
msgstr "Serveur de streaming VDR"

View File

@ -8,18 +8,15 @@
msgid ""
msgstr ""
"Project-Id-Version: streamdev 0.5.0\n"
"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n"
"POT-Creation-Date: 2012-06-13 08:51+0200\n"
"Report-Msgid-Bugs-To: <vdrdev@schmirler.de>\n"
"POT-Creation-Date: 2014-05-05 22:46+0200\n"
"PO-Revision-Date: 2012-06-12 19:57+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: Italian <vdr@linuxtv.org>\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: it\n"
msgid "VDR Streaming Server"
msgstr "Server trasmissione VDR"
msgid "Streaming active"
msgstr "Trasmissione attiva"
@ -39,9 +36,15 @@ msgstr "Impostazioni comuni"
msgid "Hide Mainmenu Entry"
msgstr "Nascondi voce menu principale"
msgid "Start with Live TV suspended"
msgstr ""
msgid "Maximum Number of Clients"
msgstr "Numero massimo di Client"
msgid "Live TV buffer delay (ms)"
msgstr ""
msgid "VDR-to-VDR Server"
msgstr "Server VDR-a-VDR"
@ -89,3 +92,6 @@ msgstr "Porta Client Multicast"
msgid "Multicast Streamtype"
msgstr "Tipo flusso Multicast"
msgid "VDR Streaming Server"
msgstr "Server trasmissione VDR"

View File

@ -6,8 +6,8 @@
msgid ""
msgstr ""
"Project-Id-Version: streamdev 0.5.0\n"
"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n"
"POT-Creation-Date: 2012-03-31 15:06+0200\n"
"Report-Msgid-Bugs-To: <vdrdev@schmirler.de>\n"
"POT-Creation-Date: 2014-05-05 22:46+0200\n"
"PO-Revision-Date: 2009-11-26 21:57+0200\n"
"Last-Translator: Valdemaras Pipiras <varas@ambernet.lt>\n"
"Language-Team: Lithuanian <vdr@linuxtv.org>\n"
@ -16,9 +16,6 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "VDR Streaming Server"
msgstr "VDR transliavimo serveris"
msgid "Streaming active"
msgstr "Transliavimas vyksta"
@ -37,9 +34,15 @@ msgstr "Bendri nustatymai"
msgid "Hide Mainmenu Entry"
msgstr ""
msgid "Start with Live TV suspended"
msgstr ""
msgid "Maximum Number of Clients"
msgstr "Maksimalus klientų skaičius"
msgid "Live TV buffer delay (ms)"
msgstr ""
msgid "VDR-to-VDR Server"
msgstr "VDR-su-VDR Serveris"
@ -87,3 +90,6 @@ msgstr "Multicast kliento portas"
msgid "Multicast Streamtype"
msgstr "Multicast transliavimo tipas"
msgid "VDR Streaming Server"
msgstr "VDR transliavimo serveris"

View File

@ -6,8 +6,8 @@
msgid ""
msgstr ""
"Project-Id-Version: streamdev 0.5.0\n"
"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n"
"POT-Creation-Date: 2012-03-31 15:06+0200\n"
"Report-Msgid-Bugs-To: <vdrdev@schmirler.de>\n"
"POT-Creation-Date: 2014-05-05 22:46+0200\n"
"PO-Revision-Date: 2008-06-26 15:36+0100\n"
"Last-Translator: Oleg Roitburd <oleg@roitburd.de>\n"
"Language-Team: Russian <vdr@linuxtv.org>\n"
@ -16,9 +16,6 @@ msgstr ""
"Content-Type: text/plain; charset=ISO-8859-5\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "VDR Streaming Server"
msgstr "VDR Streaming áÕàÒÕà"
msgid "Streaming active"
msgstr "ÁâàØÜØÝÓ ÐÚâØÒÕÝ"
@ -37,9 +34,15 @@ msgstr "
msgid "Hide Mainmenu Entry"
msgstr ""
msgid "Start with Live TV suspended"
msgstr ""
msgid "Maximum Number of Clients"
msgstr "¼ÐÚá. ÚÞÛØçÕáâÒÞ ÚÛØÕÝâÞÒ"
msgid "Live TV buffer delay (ms)"
msgstr ""
msgid "VDR-to-VDR Server"
msgstr "VDR-to-VDR áÕàÒÕà"
@ -87,3 +90,6 @@ msgstr ""
msgid "Multicast Streamtype"
msgstr ""
msgid "VDR Streaming Server"
msgstr "VDR Streaming áÕàÒÕà"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: streamdev_SK\n"
"Report-Msgid-Bugs-To: <vdrdev@schmirler.de>\n"
"POT-Creation-Date: 2013-11-22 23:07+0100\n"
"POT-Creation-Date: 2014-05-05 22:46+0200\n"
"PO-Revision-Date: 2013-11-22 23:39+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: Slovak <hrala.milan@gmail.com>\n"
@ -42,6 +42,9 @@ msgstr "Pozastavi
msgid "Maximum Number of Clients"
msgstr "Maximály poèet klientov"
msgid "Live TV buffer delay (ms)"
msgstr ""
msgid "VDR-to-VDR Server"
msgstr "Prenos z VDR do VDR"
@ -92,4 +95,3 @@ msgstr "Typ Multicast streamu"
msgid "VDR Streaming Server"
msgstr "VDR server streamovania"

View File

@ -13,6 +13,7 @@ cStreamdevServerSetup::cStreamdevServerSetup(void) {
HideMenuEntry = false;
MaxClients = 5;
StartSuspended = ssAuto;
LiveBufferMs = 0;
StartVTPServer = true;
VTPServerPort = 2004;
VTPPriority = 0;
@ -35,6 +36,7 @@ bool cStreamdevServerSetup::SetupParse(const char *Name, const char *Value) {
if (strcmp(Name, "HideMenuEntry") == 0) HideMenuEntry = atoi(Value);
else if (strcmp(Name, "MaxClients") == 0) MaxClients = atoi(Value);
else if (strcmp(Name, "StartSuspended") == 0) StartSuspended = atoi(Value);
else if (strcmp(Name, "LiveBufferMs") == 0) LiveBufferMs = atoi(Value);
else if (strcmp(Name, "StartServer") == 0) StartVTPServer = atoi(Value);
else if (strcmp(Name, "ServerPort") == 0) VTPServerPort = atoi(Value);
else if (strcmp(Name, "VTPPriority") == 0) VTPPriority = atoi(Value);
@ -86,6 +88,7 @@ void cStreamdevServerMenuSetupPage::Set(void) {
Add(new cMenuEditBoolItem(tr("Hide Mainmenu Entry"), &m_NewSetup.HideMenuEntry));
Add(new cMenuEditStraItem(tr("Start with Live TV suspended"), &m_NewSetup.StartSuspended, ss_Count, StartSuspendedItems));
Add(new cMenuEditIntItem (tr("Maximum Number of Clients"), &m_NewSetup.MaxClients, 0, 100));
Add(new cMenuEditIntItem (tr("Live TV buffer delay (ms)"), &m_NewSetup.LiveBufferMs, 0, 1500));
AddCategory (tr("VDR-to-VDR Server"));
@ -142,6 +145,7 @@ void cStreamdevServerMenuSetupPage::Store(void) {
SetupStore("HideMenuEntry", m_NewSetup.HideMenuEntry);
SetupStore("MaxClients", m_NewSetup.MaxClients);
SetupStore("StartSuspended", m_NewSetup.StartSuspended);
SetupStore("LiveBufferMs", m_NewSetup.LiveBufferMs);
SetupStore("StartServer", m_NewSetup.StartVTPServer);
SetupStore("ServerPort", m_NewSetup.VTPServerPort);
SetupStore("VTPBindIP", m_NewSetup.VTPBindIP);

View File

@ -22,6 +22,7 @@ struct cStreamdevServerSetup {
int HideMenuEntry;
int MaxClients;
int StartSuspended;
int LiveBufferMs;
int StartVTPServer;
int VTPServerPort;
char VTPBindIP[20];

View File

@ -9,7 +9,6 @@
#include "server/streamer.h"
#include "server/suspend.h"
#include "server/setup.h"
#include "tools/socket.h"
#include "tools/select.h"
#include "common.h"