mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 17:16:51 +00:00
- transfer
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: connectionHTTP.c,v 1.2 2005/02/08 13:59:16 lordjaxom Exp $
|
||||
* $Id: connectionHTTP.c,v 1.3 2005/02/08 15:34:38 lordjaxom Exp $
|
||||
*/
|
||||
|
||||
#include "server/connectionHTTP.h"
|
||||
@@ -57,7 +57,7 @@ bool cConnectionHTTP::Command(char *Cmd) {
|
||||
if (device != NULL) {
|
||||
device->SwitchChannel(m_Channel, false);
|
||||
m_LiveStreamer->SetDevice(device);
|
||||
if (m_LiveStreamer->SetChannel(m_Channel, m_StreamType, false)) {
|
||||
if (m_LiveStreamer->SetChannel(m_Channel, m_StreamType)) {
|
||||
m_Startup = true;
|
||||
if (m_StreamType == stES && (m_Channel->Vpid() == 0
|
||||
|| m_Channel->Vpid() == 1 || m_Channel->Vpid() == 0x1FFF)) {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: connectionVTP.c,v 1.2 2005/02/08 13:59:16 lordjaxom Exp $
|
||||
* $Id: connectionVTP.c,v 1.3 2005/02/08 15:34:38 lordjaxom Exp $
|
||||
*/
|
||||
|
||||
#include "server/connectionVTP.h"
|
||||
@@ -27,10 +27,7 @@
|
||||
*/
|
||||
|
||||
cConnectionVTP::cConnectionVTP(void): cServerConnection("VTP") {
|
||||
m_StreamPIDS = false;
|
||||
m_LiveStreamer = NULL;
|
||||
m_ClientCaps = stTS;
|
||||
|
||||
memset(m_DataSockets, 0, sizeof(cTBSocket*) * si_Count);
|
||||
}
|
||||
|
||||
@@ -89,18 +86,9 @@ bool cConnectionVTP::Command(char *Cmd) {
|
||||
}
|
||||
|
||||
bool cConnectionVTP::CmdCAPS(char *Opts) {
|
||||
if (strcasecmp(Opts, "TSPIDS") == 0) m_StreamPIDS = true;
|
||||
else {
|
||||
int idx = 0;
|
||||
while (idx < st_Count && strcasecmp(Opts, StreamTypes[idx]) != 0)
|
||||
++idx;
|
||||
|
||||
if (idx == st_Count)
|
||||
return Respond(561, (cTBString)"Capability \"" + Opts + "\" not known");
|
||||
|
||||
m_ClientCaps = (eStreamType)idx;
|
||||
}
|
||||
return Respond(220, (cTBString)"Capability \"" + Opts + "\" accepted");
|
||||
if (strcasecmp(Opts, "TSPIDS") == 0)
|
||||
return Respond(220, (cTBString)"Capability \"" + Opts + "\" accepted");
|
||||
return Respond(561, (cTBString)"Capability \"" + Opts + "\" not known");
|
||||
}
|
||||
|
||||
bool cConnectionVTP::CmdPROV(char *Opts) {
|
||||
@@ -188,7 +176,7 @@ bool cConnectionVTP::CmdTUNE(char *Opts) {
|
||||
|
||||
delete m_LiveStreamer;
|
||||
m_LiveStreamer = new cStreamdevLiveStreamer(1);
|
||||
m_LiveStreamer->SetChannel(chan, m_ClientCaps, m_StreamPIDS);
|
||||
m_LiveStreamer->SetChannel(chan, stTSPIDS);
|
||||
m_LiveStreamer->SetDevice(dev);
|
||||
|
||||
return Respond(220, "Channel tuned");
|
||||
|
@@ -10,9 +10,6 @@ class cStreamdevLiveStreamer;
|
||||
class cConnectionVTP: public cServerConnection {
|
||||
private:
|
||||
cTBSocket *m_DataSockets[si_Count];
|
||||
eStreamType m_ClientCaps;
|
||||
bool m_StreamPIDS;
|
||||
|
||||
cStreamdevLiveStreamer *m_LiveStreamer;
|
||||
|
||||
// Members adopted from SVDRP
|
||||
|
@@ -34,9 +34,6 @@ cStreamdevLiveStreamer::cStreamdevLiveStreamer(int Priority):
|
||||
m_Remux = NULL;
|
||||
m_Buffer = NULL;
|
||||
m_Sequence = 0;
|
||||
#if VDRVERSNUM >= 10300
|
||||
m_Filter = NULL;
|
||||
#endif
|
||||
memset(m_Pids, 0, sizeof(m_Pids));
|
||||
}
|
||||
|
||||
@@ -45,7 +42,7 @@ cStreamdevLiveStreamer::~cStreamdevLiveStreamer() {
|
||||
delete m_Receiver;
|
||||
delete m_Remux;
|
||||
#if VDRVERSNUM >= 10300
|
||||
delete m_Filter;
|
||||
//delete m_Filter; TODO
|
||||
#endif
|
||||
free(m_Buffer);
|
||||
}
|
||||
@@ -100,8 +97,8 @@ bool cStreamdevLiveStreamer::SetPid(int Pid, bool On) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cStreamdevLiveStreamer::SetChannel(const cChannel *Channel, int StreamType,
|
||||
bool StreamPIDS) {
|
||||
bool cStreamdevLiveStreamer::SetChannel(const cChannel *Channel, eStreamType StreamType)
|
||||
{
|
||||
Dprintf("Initializing Remuxer for full channel transfer\n");
|
||||
printf("ca pid: %d\n", Channel->Ca());
|
||||
m_Channel = Channel;
|
||||
@@ -120,31 +117,28 @@ bool cStreamdevLiveStreamer::SetChannel(const cChannel *Channel, int StreamType,
|
||||
&& SetPid(Channel->Apid(0), true)
|
||||
&& SetPid(Channel->Apid(1), true)
|
||||
&& SetPid(Channel->Dpid(0), true);
|
||||
break;
|
||||
|
||||
case stPS:
|
||||
m_Remux = new cTS2PSRemux(Channel->Vpid(), Channel->Apid(0), 0, 0, 0, true);
|
||||
return SetPid(Channel->Vpid(), true)
|
||||
&& SetPid(Channel->Apid(0), true);
|
||||
break;
|
||||
|
||||
case stTS:
|
||||
if (!StreamPIDS) {
|
||||
return SetPid(Channel->Vpid(), true)
|
||||
&& SetPid(Channel->Apid(0), true)
|
||||
&& SetPid(Channel->Apid(1), true)
|
||||
&& SetPid(Channel->Dpid(0), true);
|
||||
}
|
||||
return SetPid(Channel->Vpid(), true)
|
||||
&& SetPid(Channel->Apid(0), true)
|
||||
&& SetPid(Channel->Apid(1), true)
|
||||
&& SetPid(Channel->Dpid(0), true);
|
||||
|
||||
case stTSPIDS:
|
||||
Dprintf("pid streaming mode\n");
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cStreamdevLiveStreamer::SetFilter(u_short Pid, u_char Tid, u_char Mask,
|
||||
bool On) {
|
||||
#if VDRVERSNUM >= 10300
|
||||
#if 0
|
||||
Dprintf("setting filter\n");
|
||||
if (On) {
|
||||
if (m_Filter == NULL) {
|
||||
|
@@ -40,9 +40,6 @@ private:
|
||||
cTSRemux *m_Remux;
|
||||
uchar *m_Buffer;
|
||||
int m_Sequence;
|
||||
#if VDRVERSNUM >= 10300
|
||||
cStreamdevLiveFilter *m_Filter;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual uchar *Process(const uchar *Data, int &Count, int &Result);
|
||||
@@ -53,7 +50,7 @@ public:
|
||||
|
||||
void SetDevice(cDevice *Device) { m_Device = Device; }
|
||||
bool SetPid(int Pid, bool On);
|
||||
bool SetChannel(const cChannel *Channel, int StreamType, bool StreamPIDS);
|
||||
bool SetChannel(const cChannel *Channel, eStreamType StreamType);
|
||||
bool SetFilter(u_short Pid, u_char Tid, u_char Mask, bool On);
|
||||
|
||||
virtual void Detach(void);
|
||||
|
Reference in New Issue
Block a user