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
36enum dmx_output
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};
46
47typedef enum dmx_output dmx_output_t;
48
49typedef enum dmx_input
50{
51        DMX_IN_FRONTEND, /* Input from a front-end device.  */
52        DMX_IN_DVR       /* Input from the logical DVR device.  */
53} <link linkend="dmx-input-t">dmx_input_t</link>;
54
55
56typedef enum dmx_ts_pes
57{
58        DMX_PES_AUDIO0,
59        DMX_PES_VIDEO0,
60        DMX_PES_TELETEXT0,
61        DMX_PES_SUBTITLE0,
62        DMX_PES_PCR0,
63
64        DMX_PES_AUDIO1,
65        DMX_PES_VIDEO1,
66        DMX_PES_TELETEXT1,
67        DMX_PES_SUBTITLE1,
68        DMX_PES_PCR1,
69
70        DMX_PES_AUDIO2,
71        DMX_PES_VIDEO2,
72        DMX_PES_TELETEXT2,
73        DMX_PES_SUBTITLE2,
74        DMX_PES_PCR2,
75
76        DMX_PES_AUDIO3,
77        DMX_PES_VIDEO3,
78        DMX_PES_TELETEXT3,
79        DMX_PES_SUBTITLE3,
80        DMX_PES_PCR3,
81
82        DMX_PES_OTHER
83} <link linkend="dmx-pes-type-t">dmx_pes_type_t</link>;
84
85#define DMX_PES_AUDIO    DMX_PES_AUDIO0
86#define DMX_PES_VIDEO    DMX_PES_VIDEO0
87#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
88#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
89#define DMX_PES_PCR      DMX_PES_PCR0
90
91
92typedef struct dmx_filter
93{
94        __u8  filter[DMX_FILTER_SIZE];
95        __u8  mask[DMX_FILTER_SIZE];
96        __u8  mode[DMX_FILTER_SIZE];
97} <link linkend="dmx-filter">dmx_filter_t</link>;
98
99
100struct dmx_sct_filter_params
101{
102        __u16          pid;
103        dmx_filter_t   filter;
104        __u32          timeout;
105        __u32          flags;
106#define DMX_CHECK_CRC       1
107#define DMX_ONESHOT         2
108#define DMX_IMMEDIATE_START 4
109#define DMX_KERNEL_CLIENT   0x8000
110};
111
112
113struct dmx_pes_filter_params
114{
115        __u16          pid;
116        dmx_input_t    input;
117        dmx_output_t   output;
118        dmx_pes_type_t pes_type;
119        __u32          flags;
120};
121
122typedef struct <link linkend="dmx-caps">dmx_caps</link> {
123        __u32 caps;
124        int num_decoders;
125} <link linkend="dmx-caps">dmx_caps_t</link>;
126
127typedef enum dmx_source {
128        DMX_SOURCE_FRONT0 = 0,
129        DMX_SOURCE_FRONT1,
130        DMX_SOURCE_FRONT2,
131        DMX_SOURCE_FRONT3,
132        DMX_SOURCE_DVR0   = 16,
133        DMX_SOURCE_DVR1,
134        DMX_SOURCE_DVR2,
135        DMX_SOURCE_DVR3
136} <link linkend="dmx-source-t">dmx_source_t</link>;
137
138struct <link linkend="dmx-stc">dmx_stc</link> {
139        unsigned int num;       /* input : which STC? 0..N */
140        unsigned int base;      /* output: divisor for stc to get 90 kHz clock */
141        __u64 stc;              /* output: stc in 'base'*90 kHz units */
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