1<programlisting>
2/*
3 * dmx.h
4 *
5 * Copyright (C) 2000 Marcus Metzler &lt;marcus@convergence.de&gt;
6 *                  &amp; Ralph  Metzler &lt;ralph@convergence.de&gt;
7 *                    for convergence integrated media GmbH
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 *
23 */
24
25#ifndef _UAPI_DVBDMX_H_
26#define _UAPI_DVBDMX_H_
27
28#include &lt;linux/types.h&gt;
29#ifndef __KERNEL__
30#include &lt;time.h&gt;
31#endif
32
33
34#define DMX_FILTER_SIZE 16
35
36typedef enum
37{
38        DMX_OUT_DECODER, /* Streaming directly to decoder. */
39        DMX_OUT_TAP,     /* Output going to a memory buffer */
40                         /* (to be retrieved via the read command).*/
41        DMX_OUT_TS_TAP,  /* Output multiplexed into a new TS  */
42                         /* (to be retrieved by reading from the */
43                         /* logical DVR device).                 */
44        DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
45} <link linkend="dmx-output-t">dmx_output_t</link>;
46
47
48typedef enum
49{
50        DMX_IN_FRONTEND, /* Input from a front-end device.  */
51        DMX_IN_DVR       /* Input from the logical DVR device.  */
52} <link linkend="dmx-input-t">dmx_input_t</link>;
53
54
55typedef enum dmx_ts_pes
56{
57        DMX_PES_AUDIO0,
58        DMX_PES_VIDEO0,
59        DMX_PES_TELETEXT0,
60        DMX_PES_SUBTITLE0,
61        DMX_PES_PCR0,
62
63        DMX_PES_AUDIO1,
64        DMX_PES_VIDEO1,
65        DMX_PES_TELETEXT1,
66        DMX_PES_SUBTITLE1,
67        DMX_PES_PCR1,
68
69        DMX_PES_AUDIO2,
70        DMX_PES_VIDEO2,
71        DMX_PES_TELETEXT2,
72        DMX_PES_SUBTITLE2,
73        DMX_PES_PCR2,
74
75        DMX_PES_AUDIO3,
76        DMX_PES_VIDEO3,
77        DMX_PES_TELETEXT3,
78        DMX_PES_SUBTITLE3,
79        DMX_PES_PCR3,
80
81        DMX_PES_OTHER
82} <link linkend="dmx-pes-type-t">dmx_pes_type_t</link>;
83
84#define DMX_PES_AUDIO    DMX_PES_AUDIO0
85#define DMX_PES_VIDEO    DMX_PES_VIDEO0
86#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
87#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
88#define DMX_PES_PCR      DMX_PES_PCR0
89
90
91typedef struct dmx_filter
92{
93        __u8  filter[DMX_FILTER_SIZE];
94        __u8  mask[DMX_FILTER_SIZE];
95        __u8  mode[DMX_FILTER_SIZE];
96} <link linkend="dmx-filter">dmx_filter_t</link>;
97
98
99struct dmx_sct_filter_params
100{
101        __u16          pid;
102        dmx_filter_t   filter;
103        __u32          timeout;
104        __u32          flags;
105#define DMX_CHECK_CRC       1
106#define DMX_ONESHOT         2
107#define DMX_IMMEDIATE_START 4
108#define DMX_KERNEL_CLIENT   0x8000
109};
110
111
112struct dmx_pes_filter_params
113{
114        __u16          pid;
115        dmx_input_t    input;
116        dmx_output_t   output;
117        dmx_pes_type_t pes_type;
118        __u32          flags;
119};
120
121typedef struct <link linkend="dmx-caps">dmx_caps</link> {
122        __u32 caps;
123        int num_decoders;
124} <link linkend="dmx-caps">dmx_caps_t</link>;
125
126typedef enum {
127        DMX_SOURCE_FRONT0 = 0,
128        DMX_SOURCE_FRONT1,
129        DMX_SOURCE_FRONT2,
130        DMX_SOURCE_FRONT3,
131        DMX_SOURCE_DVR0   = 16,
132        DMX_SOURCE_DVR1,
133        DMX_SOURCE_DVR2,
134        DMX_SOURCE_DVR3
135} <link linkend="dmx-source-t">dmx_source_t</link>;
136
137struct <link linkend="dmx-stc">dmx_stc</link> {
138        unsigned int num;       /* input : which STC? 0..N */
139        unsigned int base;      /* output: divisor for stc to get 90 kHz clock */
140        __u64 stc;              /* output: stc in 'base'*90 kHz units */
141};
142
143
144#define <link linkend="DMX_START">DMX_START</link>                _IO('o', 41)
145#define <link linkend="DMX_STOP">DMX_STOP</link>                 _IO('o', 42)
146#define <link linkend="DMX_SET_FILTER">DMX_SET_FILTER</link>           _IOW('o', 43, struct dmx_sct_filter_params)
147#define <link linkend="DMX_SET_PES_FILTER">DMX_SET_PES_FILTER</link>       _IOW('o', 44, struct dmx_pes_filter_params)
148#define <link linkend="DMX_SET_BUFFER_SIZE">DMX_SET_BUFFER_SIZE</link>      _IO('o', 45)
149#define <link linkend="DMX_GET_PES_PIDS">DMX_GET_PES_PIDS</link>         _IOR('o', 47, __u16[5])
150#define <link linkend="DMX_GET_CAPS">DMX_GET_CAPS</link>             _IOR('o', 48, dmx_caps_t)
151#define <link linkend="DMX_SET_SOURCE">DMX_SET_SOURCE</link>           _IOW('o', 49, dmx_source_t)
152#define <link linkend="DMX_GET_STC">DMX_GET_STC</link>              _IOWR('o', 50, struct dmx_stc)
153#define <link linkend="DMX_ADD_PID">DMX_ADD_PID</link>              _IOW('o', 51, __u16)
154#define <link linkend="DMX_REMOVE_PID">DMX_REMOVE_PID</link>           _IOW('o', 52, __u16)
155
156#endif /* _UAPI_DVBDMX_H_ */
157</programlisting>
158