non blocking diseqc and sec stuff
[enigma2.git] / lib / dvb / idemux.h
1 #ifndef __dvb_idemux_h
2 #define __dvb_idemux_h
3
4 #include <lib/dvb/idvb.h>
5
6 #ifndef DMX_FILTER_SIZE
7 #define DMX_FILTER_SIZE   16
8 #endif
9
10 struct eDVBSectionFilterMask
11 {
12         int pid;
13                 /* mode is 0 for positive, 1 for negative filtering */
14         __u8 data[DMX_FILTER_SIZE], mask[DMX_FILTER_SIZE], mode[DMX_FILTER_SIZE];
15         enum {
16                 rfCRC=1,
17                 rfNoAbort=2
18         };
19         int flags;
20 };
21
22 struct eDVBTableSpec
23 {
24         int pid, tid, tidext;
25         int version;
26         int timeout;        /* timeout in ms */
27         enum
28         {
29                 tfInOrder=1,
30                 /*
31                         tfAnyVersion      filter ANY version
32                         0                 filter all EXCEPT given version (negative filtering)
33                         tfThisVersion     filter only THIS version
34                 */
35                 tfAnyVersion=2,
36                 tfThisVersion=4,
37                 tfHaveTID=8,
38                 tfHaveTIDExt=16,
39                 tfCheckCRC=32,
40                 tfHaveTimeout=64,
41         };
42         int flags;
43 };
44
45 class iDVBSectionReader: public iObject
46 {
47 public:
48         virtual RESULT start(const eDVBSectionFilterMask &mask)=0;
49         virtual RESULT stop()=0;
50         virtual RESULT connectRead(const Slot1<void,const __u8*> &read, ePtr<eConnection> &conn)=0;
51         virtual ~iDVBSectionReader() { };
52 };
53
54         /* records a given set of pids into a file descriptor. */
55         /* the FD must not be modified between start() and stop() ! */
56 class iDVBTSRecorder: public iObject
57 {
58 public:
59         virtual RESULT start() = 0;
60         virtual RESULT addPID(int pid) = 0;
61         virtual RESULT removePID(int pid) = 0;
62         
63                 /* include timestamps? ... */
64         virtual RESULT setFormat(int pid) = 0;
65         
66         virtual RESULT setTargetFD(int fd) = 0;
67         virtual RESULT setBoundary(off_t max) = 0;
68         
69         virtual RESULT stop() = 0;
70         
71         enum {
72                 eventWriteError,
73                                 /* a write error has occured. data won't get lost if fd is writable after return. */
74                                 /* you MUST respond with either stop() or fixing the problems, else you get the error */
75                                 /* again. */
76                 eventReachedBoundary,
77                                 /* the programmed boundary was reached. you might set a new target fd. you can close the */
78                                 /* old one. */
79         };
80         virtual RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &conn)=0;
81 };
82
83 #endif