Merge branch 'for-next' into for-linus
[linux-2.6-block.git] / drivers / media / dvb / dvb-core / dmxdev.h
CommitLineData
1da177e4
LT
1/*
2 * dmxdev.h
3 *
4 * Copyright (C) 2000 Ralph Metzler & Marcus Metzler
5 * for convergence integrated media GmbH
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2.1
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 *
21 */
22
23#ifndef _DMXDEV_H_
24#define _DMXDEV_H_
25
26#include <linux/types.h>
27#include <linux/spinlock.h>
28#include <linux/kernel.h>
29#include <linux/timer.h>
30#include <linux/wait.h>
31#include <linux/fs.h>
32#include <linux/string.h>
3593cab5 33#include <linux/mutex.h>
1da177e4
LT
34
35#include <linux/dvb/dmx.h>
36
37#include "dvbdev.h"
38#include "demux.h"
34731df2 39#include "dvb_ringbuffer.h"
1da177e4 40
bbad7dc5 41enum dmxdev_type {
1da177e4
LT
42 DMXDEV_TYPE_NONE,
43 DMXDEV_TYPE_SEC,
44 DMXDEV_TYPE_PES,
45};
46
47enum dmxdev_state {
48 DMXDEV_STATE_FREE,
49 DMXDEV_STATE_ALLOCATED,
50 DMXDEV_STATE_SET,
51 DMXDEV_STATE_GO,
52 DMXDEV_STATE_DONE,
53 DMXDEV_STATE_TIMEDOUT
54};
55
1cb662a3
AO
56struct dmxdev_feed {
57 u16 pid;
58 struct dmx_ts_feed *ts;
59 struct list_head next;
60};
61
1da177e4 62struct dmxdev_filter {
afd1a0c9
MCC
63 union {
64 struct dmx_section_filter *sec;
1da177e4
LT
65 } filter;
66
afd1a0c9 67 union {
1cb662a3
AO
68 /* list of TS and PES feeds (struct dmxdev_feed) */
69 struct list_head ts;
afd1a0c9 70 struct dmx_section_feed *sec;
1da177e4
LT
71 } feed;
72
afd1a0c9
MCC
73 union {
74 struct dmx_sct_filter_params sec;
75 struct dmx_pes_filter_params pes;
1da177e4
LT
76 } params;
77
bbad7dc5 78 enum dmxdev_type type;
afd1a0c9
MCC
79 enum dmxdev_state state;
80 struct dmxdev *dev;
34731df2 81 struct dvb_ringbuffer buffer;
1da177e4 82
3593cab5 83 struct mutex mutex;
1da177e4 84
afd1a0c9
MCC
85 /* only for sections */
86 struct timer_list timer;
87 int todo;
88 u8 secheader[3];
1da177e4
LT
89};
90
91
1da177e4
LT
92struct dmxdev {
93 struct dvb_device *dvbdev;
94 struct dvb_device *dvr_dvbdev;
95
afd1a0c9 96 struct dmxdev_filter *filter;
afd1a0c9 97 struct dmx_demux *demux;
1da177e4 98
afd1a0c9
MCC
99 int filternum;
100 int capabilities;
57861b43
MR
101
102 unsigned int exit:1;
1da177e4 103#define DMXDEV_CAP_DUPLEX 1
afd1a0c9 104 struct dmx_frontend *dvr_orig_fe;
1da177e4 105
34731df2 106 struct dvb_ringbuffer dvr_buffer;
1da177e4
LT
107#define DVR_BUFFER_SIZE (10*188*1024)
108
3593cab5 109 struct mutex mutex;
1da177e4
LT
110 spinlock_t lock;
111};
112
113
114int dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *);
115void dvb_dmxdev_release(struct dmxdev *dmxdev);
116
117#endif /* _DMXDEV_H_ */