vdr-plugin-iptv/sectionfilter.h

65 lines
1.5 KiB
C
Raw Normal View History

/*
* sectionfilter.h: IPTV plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
#ifndef __IPTV_SECTIONFILTER_H
#define __IPTV_SECTIONFILTER_H
#ifdef __FreeBSD__
#include <sys/socket.h>
#endif // __FreeBSD__
2009-02-27 15:05:19 +01:00
#include <vdr/device.h>
#include "common.h"
2007-10-05 21:00:44 +02:00
#include "statistics.h"
2007-10-05 21:00:44 +02:00
class cIptvSectionFilter : public cIptvSectionStatistics {
private:
enum dmx_limits {
DMX_MAX_FILTER_SIZE = 18,
DMX_MAX_SECTION_SIZE = 4096,
2009-02-27 15:05:19 +01:00
DMX_MAX_SECFEED_SIZE = (DMX_MAX_SECTION_SIZE + TS_SIZE)
};
2013-02-23 14:31:11 +01:00
int pusiSeenM;
int feedCcM;
int doneqM;
2007-09-24 19:20:58 +02:00
2013-02-23 14:31:11 +01:00
uint8_t *secBufM;
uint8_t secBufBaseM[DMX_MAX_SECFEED_SIZE];
uint16_t secBufpM;
uint16_t secLenM;
uint16_t tsFeedpM;
uint16_t pidM;
2009-02-27 15:05:19 +01:00
2013-02-23 14:31:11 +01:00
int devIdM;
2007-09-24 19:20:58 +02:00
2013-02-23 14:31:11 +01:00
uint8_t filterValueM[DMX_MAX_FILTER_SIZE];
uint8_t filterMaskM[DMX_MAX_FILTER_SIZE];
uint8_t filterModeM[DMX_MAX_FILTER_SIZE];
2009-02-27 15:05:19 +01:00
2013-02-23 14:31:11 +01:00
uint8_t maskAndModeM[DMX_MAX_FILTER_SIZE];
uint8_t maskAndNotModeM[DMX_MAX_FILTER_SIZE];
2013-02-23 14:31:11 +01:00
cRingBufferLinear *ringbufferM;
2013-02-23 14:31:11 +01:00
inline uint16_t GetLength(const uint8_t *dataP);
2009-02-27 15:05:19 +01:00
void New(void);
int Filter(void);
inline int Feed(void);
2013-02-23 14:31:11 +01:00
int CopyDump(const uint8_t *bufP, uint8_t lenP);
public:
2007-09-24 19:20:58 +02:00
// constructor & destructor
2013-02-23 14:31:11 +01:00
cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t tidP, uint8_t maskP);
2007-09-24 19:20:58 +02:00
virtual ~cIptvSectionFilter();
2013-02-23 14:31:11 +01:00
void Process(const uint8_t* dataP);
int Read(void *bufferP, size_t lengthP);
uint16_t GetPid(void) const { return pidM; }
};
#endif // __IPTV_SECTIONFILTER_H