diff options
Diffstat (limited to 'server/livestreamer.c')
-rw-r--r-- | server/livestreamer.c | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/server/livestreamer.c b/server/livestreamer.c index fad227f..e69d3d3 100644 --- a/server/livestreamer.c +++ b/server/livestreamer.c @@ -33,10 +33,12 @@ cStreamdevLiveStreamer::cStreamdevLiveStreamer(int Priority): cStreamdevStreamer("streamdev-livestreaming") { m_Priority = Priority; m_NumPids = 0; + m_StreamType = stTSPIDS; m_Channel = NULL; m_Device = NULL; m_Receiver = NULL; m_Remux = NULL; + m_PESRemux = NULL; } cStreamdevLiveStreamer::~cStreamdevLiveStreamer() { @@ -103,7 +105,8 @@ bool cStreamdevLiveStreamer::SetChannel(const cChannel *Channel, eStreamType Str Dprintf("Initializing Remuxer for full channel transfer\n"); printf("ca pid: %d\n", Channel->Ca()); m_Channel = Channel; - switch (StreamType) { + m_StreamType = StreamType; + switch (m_StreamType) { case stES: { int pid = ISRADIO(Channel) ? Channel->Apid(0) : Channel->Vpid(); @@ -112,8 +115,8 @@ bool cStreamdevLiveStreamer::SetChannel(const cChannel *Channel, eStreamType Str } case stPES: - m_Remux = new cTS2PSRemux(Channel->Vpid(), Channel->Apid(0), Channel->Apid(1), - Channel->Dpid(0), 0, false); + m_PESRemux = new cRemux(Channel->Vpid(), Channel->Apids(), Channel->Dpids(), + Channel->Spids(), false); return SetPid(Channel->Vpid(), true) && SetPid(Channel->Apid(0), true) && SetPid(Channel->Apid(1), true) @@ -156,6 +159,51 @@ bool cStreamdevLiveStreamer::SetFilter(u_short Pid, u_char Tid, u_char Mask, #endif } +int cStreamdevLiveStreamer::Put(const uchar *Data, int Count) +{ + switch (m_StreamType) { + case stTS: + case stTSPIDS: + return cStreamdevStreamer::Put(Data, Count); + + case stPES: + return m_PESRemux->Put(Data, Count); + + default: + abort(); + } +} + +uchar *cStreamdevLiveStreamer::Get(int &Count) +{ + switch (m_StreamType) { + case stTS: + case stTSPIDS: + return cStreamdevStreamer::Get(Count); + + case stPES: + return m_PESRemux->Get(Count); + + default: + abort(); + } +} + +void cStreamdevLiveStreamer::Del(int Count) +{ + switch (m_StreamType) { + case stTS: + case stTSPIDS: + cStreamdevStreamer::Del(Count); + + case stPES: + m_PESRemux->Del(Count); + + default: + abort(); + } +} + // TODO: Remuxer einbinden #if 0 uchar *cStreamdevLiveStreamer::Process(const uchar *Data, int &Count, int &Result) { |