summaryrefslogtreecommitdiff
path: root/server/streamer.c
diff options
context:
space:
mode:
authorschmirl <schmirl>2009-06-19 06:32:38 +0000
committerschmirl <schmirl>2009-06-19 06:32:38 +0000
commit008e7c851013722a377aa9ff4485d4af2d991883 (patch)
tree8178a3251d528849d2ccbb0cef9b1bd712cfd6f9 /server/streamer.c
parent64ff2c08be769cf227ac6cf2e318fcb6b80c9689 (diff)
downloadvdr-plugin-streamdev-008e7c851013722a377aa9ff4485d4af2d991883.tar.gz
vdr-plugin-streamdev-008e7c851013722a377aa9ff4485d4af2d991883.tar.bz2
- added namespace to remuxers
- increased WRITERBUFSIZE - buffer was too small for high bandwidth content - removed cStreamdevStreamer::m_Running - eliminated potential busy waits in remuxers - updated cTSRemux static helpers to code of their VDR 1.6.0 counterparts - re-enabled PES vor VDR 1.7.3+. Streamdev now uses a copy of VDR 1.6.0's cRemux for TS to PES remuxing. - make sure that only complete TS packets are written to ringbuffers - use signaling instead of sleeps when writing to ringbuffers - optimized cStreamdevPatFilter PAT packet initialization - fixed cStreamdevPatFilter not processing PATs with length > TS_SIZE - 5 - use a small ringbuffer for cStreamdevPatFilter instead of writing to cStreamdevStreamers SendBuffer as two threads mustn't write to the same ringbuffer Modified Files: CONTRIBUTORS HISTORY Makefile common.c common.h streamdev-server.c libdvbmpeg/transform.h remux/extern.c remux/extern.h remux/ts2es.c remux/ts2es.h remux/ts2ps.c remux/ts2ps.h remux/tsremux.c remux/tsremux.h server/connectionHTTP.c server/connectionVTP.c server/livestreamer.c server/livestreamer.h server/menuHTTP.c server/streamer.c server/streamer.h Added Files: remux/ts2pes.c remux/ts2pes.h
Diffstat (limited to 'server/streamer.c')
-rw-r--r--server/streamer.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/server/streamer.c b/server/streamer.c
index 9795cc6..42e7efa 100644
--- a/server/streamer.c
+++ b/server/streamer.c
@@ -1,5 +1,5 @@
/*
- * $Id: streamer.c,v 1.18 2009/02/13 10:39:22 schmirl Exp $
+ * $Id: streamer.c,v 1.19 2009/06/19 06:32:45 schmirl Exp $
*/
#include <vdr/ringbuffer.h>
@@ -14,6 +14,13 @@
#include "tools/select.h"
#include "common.h"
+// --- cStreamdevBuffer -------------------------------------------------------
+
+cStreamdevBuffer::cStreamdevBuffer(int Size, int Margin, bool Statistics, const char *Description):
+ cRingBufferLinear(Size, Margin, Statistics, Description)
+{
+}
+
// --- cStreamdevWriter -------------------------------------------------------
cStreamdevWriter::cStreamdevWriter(cTBSocket *Socket,
@@ -95,14 +102,13 @@ void cStreamdevWriter::Action(void)
cStreamdevStreamer::cStreamdevStreamer(const char *Name):
cThread(Name),
- m_Running(false),
m_Writer(NULL),
- m_RingBuffer(new cRingBufferLinear(STREAMERBUFSIZE, TS_SIZE * 2,
+ m_RingBuffer(new cStreamdevBuffer(STREAMERBUFSIZE, TS_SIZE * 2,
true, "streamdev-streamer")),
- m_SendBuffer(new cRingBufferLinear(WRITERBUFSIZE, TS_SIZE * 2))
+ m_SendBuffer(new cStreamdevBuffer(WRITERBUFSIZE, TS_SIZE * 2))
{
m_RingBuffer->SetTimeouts(0, 100);
- m_SendBuffer->SetTimeouts(0, 100);
+ m_SendBuffer->SetTimeouts(100, 100);
}
cStreamdevStreamer::~cStreamdevStreamer()
@@ -116,7 +122,6 @@ void cStreamdevStreamer::Start(cTBSocket *Socket)
{
Dprintf("start streamer\n");
m_Writer = new cStreamdevWriter(Socket, this);
- m_Running = true;
Attach();
}
@@ -135,9 +140,8 @@ void cStreamdevStreamer::Stop(void)
Dprintf("stopping streamer\n");
Cancel(3);
}
- if (m_Running) {
+ if (m_Writer) {
Detach();
- m_Running = false;
DELETENULL(m_Writer);
}
}
@@ -152,8 +156,6 @@ void cStreamdevStreamer::Action(void)
int count = Put(block, got);
if (count)
m_RingBuffer->Del(count);
- else
- cCondWait::SleepMs(100);
}
}
}