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