Annotation of margi2/dvb_demux.h, revision 1.4
1.1 mocm 1: /*
2: * dvb_demux.h - DVB kernel demux API
3: *
1.3 mocm 4: * Copyright (C) 2000-2001 Marcus Metzler <marcus@convergence.de>
5: * & Ralph Metzler <ralph@convergence.de>
6: * for convergence integrated media GmbH
1.1 mocm 7: *
8: * This program is free software; you can redistribute it and/or
9: * modify it under the terms of the GNU Lesser General Public License
10: * as published by the Free Software Foundation; either version 2.1
11: * of the License, or (at your option) any later version.
12: *
13: * This program is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: * GNU General Public License for more details.
17: *
18: * You should have received a copy of the GNU Lesser General Public License
19: * along with this program; if not, write to the Free Software
20: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21: *
22: */
23:
24: #ifndef _DVB_DEMUX_H_
25: #define _DVB_DEMUX_H_
26:
27: #if LINUX_VERSION_CODE < 0x020300
28: #define WAIT_QUEUE struct wait_queue*
29: #define init_waitqueue_head(wq) *(wq) = NULL;
30: #define DECLARE_WAITQUEUE(wait, current) struct wait_queue wait = { current, NULL }
31: #define list_for_each(pos, head) \
32: for (pos = (head)->next; pos != (head); pos = pos->next)
33: #else
34: #define WAIT_QUEUE wait_queue_head_t
35: #endif
36:
37: #ifdef __DVB_PACK__
38: #include <ost/demux.h>
39: #else
40: #include <linux/ost/demux.h>
41: #endif
42:
43: #define DMX_TYPE_TS 0
44: #define DMX_TYPE_SEC 1
45: #define DMX_TYPE_PES 2
46:
47: #define DMX_STATE_FREE 0
48: #define DMX_STATE_ALLOCATED 1
49: #define DMX_STATE_SET 2
50: #define DMX_STATE_READY 3
51: #define DMX_STATE_GO 4
52:
53: #define DVB_DEMUX_MASK_MAX 18
54:
55: typedef struct dvb_demux_filter_s {
56: dmx_section_filter_t filter;
57: struct dvb_demux_filter_s *next;
58: struct dvb_demux_feed_s *feed;
59: int index;
60: int state;
61: int type;
62: int pesto;
63:
64: u32 flags;
65: u16 handle;
66: u16 hw_handle;
67: struct timer_list timer;
68: int ts_state;
69:
70: u16 pid; //to be removed
71: } dvb_demux_filter_t;
72:
73: typedef struct dvb_demux_feed_s {
74: union {
75: dmx_ts_feed_t ts;
76: dmx_section_feed_t sec;
77: dmx_pes_feed_t pes;
78: } feed;
79:
80: union {
81: dmx_ts_cb ts;
82: dmx_section_cb sec;
83: dmx_pes_cb pes;
84: } cb;
85:
86: struct dvb_demux_s *demux;
87: int type;
88: int state;
89: u16 pid;
90: u8 *buffer;
91: int buffer_size;
92: int descramble;
93: int check_crc;
94:
95: struct timespec timeout;
96: dvb_demux_filter_t *filter;
97: int cb_length;
98:
99: int ts_type;
100: dmx_ts_pes_t pes_type;
101:
102: u8 secbuf[4096];
103: int secbufp;
104: int seclen;
105: int cc;
106:
107: u16 peslen;
108: } dvb_demux_feed_t;
109:
110: typedef struct dvb_demux_s {
111: dmx_demux_t dmx;
1.3 mocm 112: void *priv;
113: int filternum;
1.4 ! mocm 114: int feednum;
1.3 mocm 115: int (*start_feed)(dvb_demux_feed_t *);
116: int (*stop_feed)(dvb_demux_feed_t *);
117: int (*write_to_decoder)(dvb_demux_feed_t *, u8 *, size_t);
1.1 mocm 118:
1.3 mocm 119:
1.1 mocm 120: int users;
121: #define MAX_DVB_DEMUX_USERS 10
122: dvb_demux_filter_t *filter;
1.4 ! mocm 123: dvb_demux_feed_t *feed;
1.1 mocm 124:
125: struct list_head frontend_list;
126:
1.4 ! mocm 127: dvb_demux_feed_t *pesfilter[DMX_TS_PES_OTHER];
1.3 mocm 128: u16 pids[DMX_TS_PES_OTHER-1];
1.1 mocm 129: int playing;
130: int recording;
131:
132: dvb_demux_feed_t *pid2feed[0x2000];
133: u8 tsbuf[188];
134: int tsbufp;
135:
1.4 ! mocm 136: struct semaphore mutex;
1.1 mocm 137: } dvb_demux_t;
138:
139:
1.3 mocm 140: int DvbDmxInit(dvb_demux_t *dvbdemux);
1.1 mocm 141: int DvbDmxRelease(dvb_demux_t *dvbdemux);
1.3 mocm 142: void DvbDmxSWFilterPackets(dvb_demux_t *dvbdmx, const u8 *buf, int count);
1.1 mocm 143:
144: #endif /* _DVB_DEMUX_H_ */
LinuxTV legacy CVS <linuxtv.org/cvs>