mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 19:16:51 +02:00
Snapshot 2007-09-21
This commit is contained in:
parent
5a270cc3ab
commit
7576173547
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: device.c,v 1.13 2007/05/07 12:18:18 schmirl Exp $
|
||||
* $Id: device.c,v 1.14 2007/07/20 06:46:47 schmirl Exp $
|
||||
*/
|
||||
|
||||
#include "client/device.h"
|
||||
@ -51,12 +51,21 @@ cStreamdevDevice::cStreamdevDevice(void) {
|
||||
|
||||
cStreamdevDevice::~cStreamdevDevice() {
|
||||
Dprintf("Device gets destructed\n");
|
||||
|
||||
Lock();
|
||||
m_Device = NULL;
|
||||
delete m_TSBuffer;
|
||||
delete m_Assembler;
|
||||
m_Filters->SetConnection(-1);
|
||||
ClientSocket.Quit();
|
||||
ClientSocket.Reset();
|
||||
Unlock();
|
||||
|
||||
Cancel(3);
|
||||
|
||||
#if VDRVERSNUM >= 10300
|
||||
delete m_Filters;
|
||||
DELETENULL(m_Filters);
|
||||
#endif
|
||||
DELETENULL(m_TSBuffer);
|
||||
delete m_Assembler;
|
||||
}
|
||||
|
||||
bool cStreamdevDevice::ProvidesSource(int Source) const {
|
||||
@ -216,7 +225,7 @@ void cStreamdevDevice::CloseDvr(void) {
|
||||
}
|
||||
|
||||
bool cStreamdevDevice::GetTSPacket(uchar *&Data) {
|
||||
if (m_TSBuffer) {
|
||||
if (m_TSBuffer && m_Device) {
|
||||
Data = m_TSBuffer->Get();
|
||||
#if 1 // TODO: this should be fixed in vdr cTSBuffer
|
||||
// simple disconnect detection
|
||||
|
6
common.c
6
common.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: common.c,v 1.4 2005/02/11 16:44:14 lordjaxom Exp $
|
||||
* $Id: common.c,v 1.5 2007/09/21 11:55:56 schmirl Exp $
|
||||
*/
|
||||
|
||||
#include <vdr/channels.h>
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
const char *VERSION = "0.3.3-20070509";
|
||||
const char *VERSION = "0.3.3-20070921";
|
||||
|
||||
const char *StreamTypes[st_Count] = {
|
||||
"TS",
|
||||
@ -270,7 +270,7 @@ eOSState cMenuEditIpItem::ProcessKey(eKeys Key) {
|
||||
} else
|
||||
curNum = curNum * 10 + (Key - k0);
|
||||
|
||||
if (!step && (curNum * 10 > 255) || (curNum == 0)) {
|
||||
if ((curNum * 10 > 255) || (curNum == 0)) {
|
||||
in_addr addr;
|
||||
addr.s_addr = inet_addr(value);
|
||||
if ((int)addr.s_addr == -1)
|
||||
|
@ -559,11 +559,12 @@ istream & operator >> (istream & stream, PS_Packet & x){
|
||||
p = stream.tellg();
|
||||
while (!stream.eof() && !found && count < MAX_SEARCH) {
|
||||
stream.read((char *)&headr,4);
|
||||
if (headr[0] == 0x00 && headr[1] == 0x00 && headr[2] == 0x01)
|
||||
if (headr[0] == 0x00 && headr[1] == 0x00 && headr[2] == 0x01) {
|
||||
if ( headr[3] == 0xBA )
|
||||
found = 1;
|
||||
else if ( headr[3] == 0xB9 ) break;
|
||||
else stream.seekg(p+streampos(1));
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
||||
@ -776,16 +777,16 @@ int tv_norm(istream &stream){
|
||||
while (!stream.eof() && !found) {
|
||||
p = stream.tellg();
|
||||
stream.read((char *)headr,4);
|
||||
if (headr[0] == 0x00 && headr[1] == 0x00 && headr[2] == 0x01)
|
||||
if (headr[0] == 0x00 && headr[1] == 0x00 && headr[2] == 0x01) {
|
||||
if ( headr[3] == 0xB5 ){
|
||||
char *profile[] = {"reserved", "High", "Spatially Scalable",
|
||||
const char *profile[] = {"reserved", "High", "Spatially Scalable",
|
||||
"SNR Scalable", "Main", "Simple", "undef",
|
||||
"undef"};
|
||||
char *level[] = {"res", "res", "res", "res",
|
||||
const char *level[] = {"res", "res", "res", "res",
|
||||
"High","res", "High 1440", "res",
|
||||
"Main","res", "Low", "res",
|
||||
"res", "res", "res", "res"};
|
||||
char *chroma[] = {"res", "4:2:0", "4:2:2", "4:4:4:"};
|
||||
const char *chroma[] = {"res", "4:2:0", "4:2:2", "4:4:4:"};
|
||||
mpeg = 2;
|
||||
stream.read((char *)headr,4);
|
||||
cerr << "PROFILE: " << profile[headr[0] & 0x7] << endl;
|
||||
@ -795,7 +796,8 @@ int tv_norm(istream &stream){
|
||||
} else {
|
||||
mpeg = 1;
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! found) stream.seekg(p+streampos(1));
|
||||
}
|
||||
|
||||
@ -831,7 +833,7 @@ int stream_type(istream &fin){
|
||||
}
|
||||
|
||||
fin >> pes;
|
||||
fin.read((char *)!headr,4);
|
||||
fin.read((char *)NULL,4);
|
||||
fin.seekg(p);
|
||||
if (fin && headr[0] == 0x00 && headr[1] == 0x00
|
||||
&& headr[2] == 0x01 ){
|
||||
@ -868,7 +870,7 @@ void analyze(istream &fin)
|
||||
PS_Packet ps;
|
||||
PES_Packet pes;
|
||||
int fc = 0;
|
||||
char *frames[3] = {"I-Frame","P-Frame","B-Frame"};
|
||||
const char *frames[3] = {"I-Frame","P-Frame","B-Frame"};
|
||||
|
||||
while(fin){
|
||||
uint32_t pts;
|
||||
|
@ -489,7 +489,7 @@ int get_video_info(Remux *rem)
|
||||
VideoInfo *vi = &rem->video_info;
|
||||
|
||||
while (found < 4 && ring_rest(vid_buffy)){
|
||||
uint8_t b[3];
|
||||
uint8_t b[4];
|
||||
|
||||
vring_peek( rem, b, 4, 0);
|
||||
if ( b[0] == 0x00 && b[1] == 0x00 && b[2] == 0x01
|
||||
|
@ -118,7 +118,12 @@ void cTSExt::Action(void)
|
||||
|
||||
if (FD_ISSET(m_Outpipe, &rfds)) {
|
||||
int result;
|
||||
if ((result = m_ResultBuffer->Read(m_Outpipe)) == -1) {
|
||||
//Read returns 0 if buffer full or EOF
|
||||
bool bufferFull = m_ResultBuffer->Free() <= 0; //Free may be < 0
|
||||
while ((result = m_ResultBuffer->Read(m_Outpipe)) == 0 && bufferFull)
|
||||
dsyslog("streamdev-server: buffer full while reading from externremux");
|
||||
|
||||
if (result == -1) {
|
||||
if (errno != EINTR) {
|
||||
LOG_ERROR_STR("read failed");
|
||||
m_Active = false;
|
||||
@ -149,7 +154,7 @@ cExternRemux::cExternRemux(int VPid, const int *APids, const int *Dpids, const i
|
||||
m_ResultBuffer(new cRingBufferLinear(WRITERBUFSIZE, TS_SIZE * 2)),
|
||||
m_Remux(new cTSExt(m_ResultBuffer))
|
||||
{
|
||||
m_ResultBuffer->SetTimeouts(0, 100);
|
||||
m_ResultBuffer->SetTimeouts(500, 100);
|
||||
}
|
||||
|
||||
cExternRemux::~cExternRemux()
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: connectionVTP.c,v 1.14 2007/05/09 09:12:42 schmirl Exp $
|
||||
* $Id: connectionVTP.c,v 1.15 2007/09/21 12:45:31 schmirl Exp $
|
||||
*/
|
||||
|
||||
#include "server/connectionVTP.h"
|
||||
@ -469,7 +469,7 @@ cConnectionVTP::cConnectionVTP(void):
|
||||
m_FilterSocket(NULL),
|
||||
m_FilterStreamer(NULL),
|
||||
m_LastCommand(NULL),
|
||||
m_NoTSPIDS(false),
|
||||
m_StreamType(stTSPIDS),
|
||||
m_LSTEHandler(NULL),
|
||||
m_LSTCHandler(NULL),
|
||||
m_LSTTHandler(NULL)
|
||||
@ -572,13 +572,27 @@ bool cConnectionVTP::Command(char *Cmd)
|
||||
bool cConnectionVTP::CmdCAPS(char *Opts)
|
||||
{
|
||||
if (strcasecmp(Opts, "TS") == 0) {
|
||||
m_NoTSPIDS = true;
|
||||
return Respond(220, "Ignored, capability \"%s\" accepted for "
|
||||
"compatibility", Opts);
|
||||
m_StreamType = stTS;
|
||||
return Respond(220, "Capability \"%s\" accepted", Opts);
|
||||
}
|
||||
|
||||
if (strcasecmp(Opts, "TSPIDS") == 0) {
|
||||
m_NoTSPIDS = false;
|
||||
m_StreamType = stTSPIDS;
|
||||
return Respond(220, "Capability \"%s\" accepted", Opts);
|
||||
}
|
||||
|
||||
if (strcasecmp(Opts, "PS") == 0) {
|
||||
m_StreamType = stPS;
|
||||
return Respond(220, "Capability \"%s\" accepted", Opts);
|
||||
}
|
||||
|
||||
if (strcasecmp(Opts, "PES") == 0) {
|
||||
m_StreamType = stPES;
|
||||
return Respond(220, "Capability \"%s\" accepted", Opts);
|
||||
}
|
||||
|
||||
if (strcasecmp(Opts, "EXTERN") == 0) {
|
||||
m_StreamType = stExtern;
|
||||
return Respond(220, "Capability \"%s\" accepted", Opts);
|
||||
}
|
||||
|
||||
@ -715,7 +729,7 @@ bool cConnectionVTP::CmdTUNE(char *Opts)
|
||||
|
||||
delete m_LiveStreamer;
|
||||
m_LiveStreamer = new cStreamdevLiveStreamer(1);
|
||||
m_LiveStreamer->SetChannel(chan, m_NoTSPIDS ? stTS : stTSPIDS);
|
||||
m_LiveStreamer->SetChannel(chan, m_StreamType);
|
||||
m_LiveStreamer->SetDevice(dev);
|
||||
if(m_LiveSocket)
|
||||
m_LiveStreamer->Start(m_LiveSocket);
|
||||
|
@ -23,7 +23,7 @@ private:
|
||||
cStreamdevFilterStreamer *m_FilterStreamer;
|
||||
|
||||
char *m_LastCommand;
|
||||
bool m_NoTSPIDS;
|
||||
eStreamType m_StreamType;
|
||||
|
||||
// Members adopted for SVDRP
|
||||
cRecordings Recordings;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: streamer.c,v 1.15 2007/04/02 10:32:34 schmirl Exp $
|
||||
* $Id: streamer.c,v 1.16 2007/09/21 11:45:53 schmirl Exp $
|
||||
*/
|
||||
|
||||
#include <vdr/ringbuffer.h>
|
||||
@ -141,6 +141,8 @@ void cStreamdevStreamer::Action(void)
|
||||
int count = Put(block, got);
|
||||
if (count)
|
||||
m_RingBuffer->Del(count);
|
||||
else
|
||||
cCondWait::SleepMs(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -140,8 +140,10 @@ ssize_t cTBSource::ReadUntil(void *Buffer, size_t Length, const char *Seq,
|
||||
|
||||
len = m_LineBuffer.size();
|
||||
m_LineBuffer.resize(BUFSIZ);
|
||||
if ((b = Read((char*)m_LineBuffer.data() + len, BUFSIZ - len)) == -1)
|
||||
if ((b = Read((char*)m_LineBuffer.data() + len, BUFSIZ - len)) == -1) {
|
||||
m_LineBuffer.resize(len);
|
||||
return -1;
|
||||
}
|
||||
m_LineBuffer.resize(len + b);
|
||||
|
||||
if ((len = m_LineBuffer.find(Seq)) != (size_t)-1) {
|
||||
|
Loading…
Reference in New Issue
Block a user