vdr-plugin-streamdev/common.h
schmirl 008e7c8510 - 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
2009-06-19 06:32:38 +00:00

114 lines
2.6 KiB
C++

/*
* $Id: common.h,v 1.13 2009/06/19 06:32:38 schmirl Exp $
*/
#ifndef VDR_STREAMDEV_COMMON_H
#define VDR_STREAMDEV_COMMON_H
/* FreeBSD has it's own version of isnumber(),
but VDR's version is incompatible */
#ifdef __FreeBSD__
#undef isnumber
#endif
#include <vdr/tools.h>
#include <vdr/plugin.h>
#include "tools/socket.h"
#ifdef DEBUG
# include <stdio.h>
# define Dprintf(x...) fprintf(stderr, x)
#else
# define Dprintf(x...)
#endif
# define TRANSPONDER(c1, c2) (c1->Transponder() == c2->Transponder())
# define MAXPARSEBUFFER KILOBYTE(16)
/* Check if a channel is a radio station. */
#define ISRADIO(x) ((x)->Vpid()==0||(x)->Vpid()==1||(x)->Vpid()==0x1fff)
class cChannel;
char *GetNextLine(char *String, uint Length, uint &Offset);
const cChannel *ChannelFromString(const char *String, int *Apid = NULL);
/* Disable logging if BUFCOUNT buffer overflows occur within BUFOVERTIME
milliseconds. Enable logging again if there is no error within BUFOVERTIME
milliseconds. */
#define BUFOVERTIME 5000
#define BUFOVERCOUNT 100
#define POLLFAIL esyslog("Streamdev: Polling failed: %s", strerror(errno))
#define WRITEFAIL esyslog("Streamdev: Writing failed: %s", strerror(errno))
#define READFAIL esyslog("Streamdev: Reading failed: %s", strerror(errno))
#define CHECKPOLL(x) if ((x)<0){POLLFAIL; return false;}
#define CHECKWRITE(x) if ((x)<0) { WRITEFAIL; return false; }
#define CHECKREAD(x) if ((x)<0) { READFAIL; return false; }
enum eStreamType {
stTS,
stPES,
stPS,
stES,
stExtern,
stTSPIDS,
#define st_CountSetup (stExtern+1)
#define st_Count (stTSPIDS+1)
};
enum eSuspendMode {
smOffer,
smAlways,
smNever,
sm_Count
};
enum eSocketId {
siLive,
siReplay,
siLiveFilter,
si_Count
};
extern const char *VERSION;
extern const char *StreamTypes[st_Count];
extern const char *SuspendModes[sm_Count];
extern const char IpCharacters[];
class cStreamdevMenuSetupPage: public cMenuSetupPage {
protected:
void AddCategory(const char *Title);
virtual void Store(void) = 0;
void AddBoolEdit(const char *Title, int &Value);
void AddIpEdit(const char *Title, char *Value);
void AddShortEdit(const char *Title, int &Value);
void AddRangeEdit(const char *Title, int &Value, int Min, int Max);
void AddSuspEdit(const char *Title, int &Value);
void AddTypeEdit(const char *Title, int &Value);
};
class cMenuEditIpItem: public cMenuEditItem {
private:
char *value;
int curNum;
int pos;
bool step;
protected:
virtual void Set(void);
public:
cMenuEditIpItem(const char *Name, char *Value); // Value must be 16 bytes
~cMenuEditIpItem();
virtual eOSState ProcessKey(eKeys Key);
};
#endif // VDR_STREAMDEV_COMMON_H