]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/media/dvb-core/dmxdev.h
Merge branches 'for-4.11/upstream-fixes', 'for-4.12/accutouch', 'for-4.12/cp2112...
[mirror_ubuntu-artful-kernel.git] / drivers / media / 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 *
1da177e4
LT
17 */
18
19#ifndef _DMXDEV_H_
20#define _DMXDEV_H_
21
22#include <linux/types.h>
23#include <linux/spinlock.h>
24#include <linux/kernel.h>
b2409b65 25#include <linux/time.h>
1da177e4
LT
26#include <linux/timer.h>
27#include <linux/wait.h>
28#include <linux/fs.h>
29#include <linux/string.h>
3593cab5 30#include <linux/mutex.h>
5a0e3ad6 31#include <linux/slab.h>
1da177e4
LT
32
33#include <linux/dvb/dmx.h>
34
35#include "dvbdev.h"
36#include "demux.h"
34731df2 37#include "dvb_ringbuffer.h"
1da177e4 38
bbad7dc5 39enum dmxdev_type {
1da177e4
LT
40 DMXDEV_TYPE_NONE,
41 DMXDEV_TYPE_SEC,
42 DMXDEV_TYPE_PES,
43};
44
45enum dmxdev_state {
46 DMXDEV_STATE_FREE,
47 DMXDEV_STATE_ALLOCATED,
48 DMXDEV_STATE_SET,
49 DMXDEV_STATE_GO,
50 DMXDEV_STATE_DONE,
51 DMXDEV_STATE_TIMEDOUT
52};
53
1cb662a3
AO
54struct dmxdev_feed {
55 u16 pid;
56 struct dmx_ts_feed *ts;
57 struct list_head next;
58};
59
1da177e4 60struct dmxdev_filter {
afd1a0c9
MCC
61 union {
62 struct dmx_section_filter *sec;
1da177e4
LT
63 } filter;
64
afd1a0c9 65 union {
1cb662a3
AO
66 /* list of TS and PES feeds (struct dmxdev_feed) */
67 struct list_head ts;
afd1a0c9 68 struct dmx_section_feed *sec;
1da177e4
LT
69 } feed;
70
afd1a0c9
MCC
71 union {
72 struct dmx_sct_filter_params sec;
73 struct dmx_pes_filter_params pes;
1da177e4
LT
74 } params;
75
bbad7dc5 76 enum dmxdev_type type;
afd1a0c9
MCC
77 enum dmxdev_state state;
78 struct dmxdev *dev;
34731df2 79 struct dvb_ringbuffer buffer;
1da177e4 80
3593cab5 81 struct mutex mutex;
1da177e4 82
afd1a0c9
MCC
83 /* only for sections */
84 struct timer_list timer;
85 int todo;
86 u8 secheader[3];
1da177e4
LT
87};
88
89
1da177e4
LT
90struct dmxdev {
91 struct dvb_device *dvbdev;
92 struct dvb_device *dvr_dvbdev;
93
afd1a0c9 94 struct dmxdev_filter *filter;
afd1a0c9 95 struct dmx_demux *demux;
1da177e4 96
afd1a0c9
MCC
97 int filternum;
98 int capabilities;
57861b43
MR
99
100 unsigned int exit:1;
1da177e4 101#define DMXDEV_CAP_DUPLEX 1
afd1a0c9 102 struct dmx_frontend *dvr_orig_fe;
1da177e4 103
34731df2 104 struct dvb_ringbuffer dvr_buffer;
1da177e4
LT
105#define DVR_BUFFER_SIZE (10*188*1024)
106
3593cab5 107 struct mutex mutex;
1da177e4
LT
108 spinlock_t lock;
109};
110
111
112int dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *);
113void dvb_dmxdev_release(struct dmxdev *dmxdev);
114
115#endif /* _DMXDEV_H_ */