4 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
5 * & Ralph Metzler <ralph@convergence.de>
6 * for convergence integrated media GmbH
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.
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.
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.
24 #ifndef _UAPI_DVBDMX_H_
25 #define _UAPI_DVBDMX_H_
27 #include <linux/types.h>
33 #define DMX_FILTER_SIZE 16
36 * enum dmx_output - Output for the demux.
39 * Streaming directly to decoder.
41 * Output going to a memory buffer (to be retrieved via the read command).
42 * Delivers the stream output to the demux device on which the ioctl
45 * Output multiplexed into a new TS (to be retrieved by reading from the
46 * logical DVR device). Routes output to the logical DVR device
47 * ``/dev/dvb/adapter?/dvr?``, which delivers a TS multiplexed from all
48 * filters for which @DMX_OUT_TS_TAP was specified.
49 * @DMX_OUT_TSDEMUX_TAP:
50 * Like @DMX_OUT_TS_TAP but retrieved from the DMX device.
61 * enum dmx_input - Input from the demux.
63 * @DMX_IN_FRONTEND: Input from a front-end device.
64 * @DMX_IN_DVR: Input from the logical DVR device.
72 * enum dmx_ts_pes - type of the PES filter.
74 * @DMX_PES_AUDIO0: first audio PID. Also referred as @DMX_PES_AUDIO.
75 * @DMX_PES_VIDEO0: first video PID. Also referred as @DMX_PES_VIDEO.
76 * @DMX_PES_TELETEXT0: first teletext PID. Also referred as @DMX_PES_TELETEXT.
77 * @DMX_PES_SUBTITLE0: first subtitle PID. Also referred as @DMX_PES_SUBTITLE.
78 * @DMX_PES_PCR0: first Program Clock Reference PID.
79 * Also referred as @DMX_PES_PCR.
81 * @DMX_PES_AUDIO1: second audio PID.
82 * @DMX_PES_VIDEO1: second video PID.
83 * @DMX_PES_TELETEXT1: second teletext PID.
84 * @DMX_PES_SUBTITLE1: second subtitle PID.
85 * @DMX_PES_PCR1: second Program Clock Reference PID.
87 * @DMX_PES_AUDIO2: third audio PID.
88 * @DMX_PES_VIDEO2: third video PID.
89 * @DMX_PES_TELETEXT2: third teletext PID.
90 * @DMX_PES_SUBTITLE2: third subtitle PID.
91 * @DMX_PES_PCR2: third Program Clock Reference PID.
93 * @DMX_PES_AUDIO3: fourth audio PID.
94 * @DMX_PES_VIDEO3: fourth video PID.
95 * @DMX_PES_TELETEXT3: fourth teletext PID.
96 * @DMX_PES_SUBTITLE3: fourth subtitle PID.
97 * @DMX_PES_PCR3: fourth Program Clock Reference PID.
99 * @DMX_PES_OTHER: any other PID.
130 #define DMX_PES_AUDIO DMX_PES_AUDIO0
131 #define DMX_PES_VIDEO DMX_PES_VIDEO0
132 #define DMX_PES_TELETEXT DMX_PES_TELETEXT0
133 #define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
134 #define DMX_PES_PCR DMX_PES_PCR0
139 * struct dmx_filter - Specifies a section header filter.
141 * @filter: bit array with bits to be matched at the section header.
142 * @mask: bits that are valid at the filter bit array.
143 * @mode: mode of match: if bit is zero, it will match if equal (positive
144 * match); if bit is one, it will match if the bit is negated.
146 * Note: All arrays in this struct have a size of DMX_FILTER_SIZE (16 bytes).
149 __u8 filter[DMX_FILTER_SIZE];
150 __u8 mask[DMX_FILTER_SIZE];
151 __u8 mode[DMX_FILTER_SIZE];
155 * struct dmx_sct_filter_params - Specifies a section filter.
157 * @pid: PID to be filtered.
158 * @filter: section header filter, as defined by &struct dmx_filter.
159 * @timeout: maximum time to filter, in milliseconds.
160 * @flags: extra flags for the section filter.
162 * Carries the configuration for a MPEG-TS section filter.
166 * - %DMX_CHECK_CRC - only deliver sections where the CRC check succeeded;
167 * - %DMX_ONESHOT - disable the section filter after one section
168 * has been delivered;
169 * - %DMX_IMMEDIATE_START - Start filter immediately without requiring a
172 struct dmx_sct_filter_params {
174 struct dmx_filter filter;
177 #define DMX_CHECK_CRC 1
178 #define DMX_ONESHOT 2
179 #define DMX_IMMEDIATE_START 4
183 * struct dmx_pes_filter_params - Specifies Packetized Elementary Stream (PES)
186 * @pid: PID to be filtered.
187 * @input: Demux input, as specified by &enum dmx_input.
188 * @output: Demux output, as specified by &enum dmx_output.
189 * @pes_type: Type of the pes filter, as specified by &enum dmx_pes_type.
190 * @flags: Demux PES flags.
192 struct dmx_pes_filter_params {
194 enum dmx_input input;
195 enum dmx_output output;
196 enum dmx_ts_pes pes_type;
201 * struct dmx_stc - Stores System Time Counter (STC) information.
203 * @num: input data: number of the STC, from 0 to N.
204 * @base: output: divisor for STC to get 90 kHz clock.
205 * @stc: output: stc in @base * 90 kHz units.
213 #define DMX_START _IO('o', 41)
214 #define DMX_STOP _IO('o', 42)
215 #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
216 #define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
217 #define DMX_SET_BUFFER_SIZE _IO('o', 45)
218 #define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
219 #define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
220 #define DMX_ADD_PID _IOW('o', 51, __u16)
221 #define DMX_REMOVE_PID _IOW('o', 52, __u16)
223 #if !defined(__KERNEL__)
225 /* This is needed for legacy userspace support */
226 typedef enum dmx_output dmx_output_t;
227 typedef enum dmx_input dmx_input_t;
228 typedef enum dmx_ts_pes dmx_pes_type_t;
229 typedef struct dmx_filter dmx_filter_t;
233 #endif /* _UAPI_DVBDMX_H_ */