Greg Kroah-Hartman | e2be04c | 2017-11-01 15:09:13 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */ |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 2 | /* |
| 3 | * dmx.h |
| 4 | * |
| 5 | * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de> |
| 6 | * & Ralph Metzler <ralph@convergence.de> |
| 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 <linux/types.h> |
| 29 | #ifndef __KERNEL__ |
| 30 | #include <time.h> |
| 31 | #endif |
| 32 | |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 33 | #define DMX_FILTER_SIZE 16 |
| 34 | |
Mauro Carvalho Chehab | bb98e6d | 2017-08-31 12:28:52 -0400 | [diff] [blame] | 35 | /** |
| 36 | * enum dmx_output - Output for the demux. |
| 37 | * |
| 38 | * @DMX_OUT_DECODER: |
| 39 | * Streaming directly to decoder. |
| 40 | * @DMX_OUT_TAP: |
| 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 |
| 43 | * is called. |
| 44 | * @DMX_OUT_TS_TAP: |
| 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. |
| 51 | */ |
| 52 | enum dmx_output { |
| 53 | DMX_OUT_DECODER, |
| 54 | DMX_OUT_TAP, |
| 55 | DMX_OUT_TS_TAP, |
| 56 | DMX_OUT_TSDEMUX_TAP |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame] | 57 | }; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 58 | |
| 59 | |
Mauro Carvalho Chehab | bb98e6d | 2017-08-31 12:28:52 -0400 | [diff] [blame] | 60 | /** |
| 61 | * enum dmx_input - Input from the demux. |
| 62 | * |
| 63 | * @DMX_IN_FRONTEND: Input from a front-end device. |
| 64 | * @DMX_IN_DVR: Input from the logical DVR device. |
| 65 | */ |
| 66 | enum dmx_input { |
| 67 | DMX_IN_FRONTEND, |
| 68 | DMX_IN_DVR |
| 69 | }; |
| 70 | |
| 71 | /** |
| 72 | * enum dmx_ts_pes - type of the PES filter. |
| 73 | * |
| 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. |
| 80 | * |
| 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. |
| 86 | * |
| 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. |
| 92 | * |
| 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. |
| 98 | * |
| 99 | * @DMX_PES_OTHER: any other PID. |
| 100 | */ |
| 101 | |
| 102 | enum dmx_ts_pes { |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 103 | DMX_PES_AUDIO0, |
| 104 | DMX_PES_VIDEO0, |
| 105 | DMX_PES_TELETEXT0, |
| 106 | DMX_PES_SUBTITLE0, |
| 107 | DMX_PES_PCR0, |
| 108 | |
| 109 | DMX_PES_AUDIO1, |
| 110 | DMX_PES_VIDEO1, |
| 111 | DMX_PES_TELETEXT1, |
| 112 | DMX_PES_SUBTITLE1, |
| 113 | DMX_PES_PCR1, |
| 114 | |
| 115 | DMX_PES_AUDIO2, |
| 116 | DMX_PES_VIDEO2, |
| 117 | DMX_PES_TELETEXT2, |
| 118 | DMX_PES_SUBTITLE2, |
| 119 | DMX_PES_PCR2, |
| 120 | |
| 121 | DMX_PES_AUDIO3, |
| 122 | DMX_PES_VIDEO3, |
| 123 | DMX_PES_TELETEXT3, |
| 124 | DMX_PES_SUBTITLE3, |
| 125 | DMX_PES_PCR3, |
| 126 | |
| 127 | DMX_PES_OTHER |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame] | 128 | }; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 129 | |
| 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 |
| 135 | |
| 136 | |
Mauro Carvalho Chehab | bb98e6d | 2017-08-31 12:28:52 -0400 | [diff] [blame] | 137 | |
| 138 | /** |
| 139 | * struct dmx_filter - Specifies a section header filter. |
| 140 | * |
| 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. |
| 145 | * |
| 146 | * Note: All arrays in this struct have a size of DMX_FILTER_SIZE (16 bytes). |
| 147 | */ |
| 148 | struct dmx_filter { |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 149 | __u8 filter[DMX_FILTER_SIZE]; |
| 150 | __u8 mask[DMX_FILTER_SIZE]; |
| 151 | __u8 mode[DMX_FILTER_SIZE]; |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame] | 152 | }; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 153 | |
Mauro Carvalho Chehab | bb98e6d | 2017-08-31 12:28:52 -0400 | [diff] [blame] | 154 | /** |
| 155 | * struct dmx_sct_filter_params - Specifies a section filter. |
| 156 | * |
| 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. |
| 161 | * |
| 162 | * Carries the configuration for a MPEG-TS section filter. |
| 163 | * |
| 164 | * The @flags can be: |
| 165 | * |
| 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 |
| 170 | * :ref:`DMX_START`. |
| 171 | */ |
| 172 | struct dmx_sct_filter_params { |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame] | 173 | __u16 pid; |
| 174 | struct dmx_filter filter; |
| 175 | __u32 timeout; |
| 176 | __u32 flags; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 177 | #define DMX_CHECK_CRC 1 |
| 178 | #define DMX_ONESHOT 2 |
| 179 | #define DMX_IMMEDIATE_START 4 |
chuangcheng peng | 62fb9f9 | 2022-08-11 19:32:43 +0800 | [diff] [blame^] | 180 | /* amlogic define */ |
| 181 | #define DMX_USE_SWFILTER 0x100 |
| 182 | |
| 183 | /*bit 8~15 for mem sec_level*/ |
| 184 | #define DMX_MEM_SEC_LEVEL1 (1 << 10) |
| 185 | #define DMX_MEM_SEC_LEVEL2 (2 << 10) |
| 186 | #define DMX_MEM_SEC_LEVEL3 (3 << 10) |
| 187 | #define DMX_MEM_SEC_LEVEL4 (4 << 10) |
| 188 | #define DMX_MEM_SEC_LEVEL5 (5 << 10) |
| 189 | #define DMX_MEM_SEC_LEVEL6 (6 << 10) |
| 190 | #define DMX_MEM_SEC_LEVEL7 (7 << 10) |
| 191 | /* amlogic define end */ |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 192 | }; |
| 193 | |
chuangcheng peng | 62fb9f9 | 2022-08-11 19:32:43 +0800 | [diff] [blame^] | 194 | /*amlogic define*/ |
| 195 | enum dmx_input_source { |
| 196 | INPUT_DEMOD, |
| 197 | INPUT_LOCAL, |
| 198 | INPUT_LOCAL_SEC |
| 199 | }; |
| 200 | |
| 201 | /** |
| 202 | * struct dmx_non_sec_es_header - non-sec Elementary Stream (ES) Header |
| 203 | * |
| 204 | * @pts_dts_flag:[1:0], 01:pts valid, 10:dts valid |
| 205 | * @pts: pts value |
| 206 | * @dts: dts value |
| 207 | * @len: data len |
| 208 | */ |
| 209 | struct dmx_non_sec_es_header { |
| 210 | __u8 pts_dts_flag; |
| 211 | __u64 pts; |
| 212 | __u64 dts; |
| 213 | __u32 len; |
| 214 | }; |
| 215 | |
| 216 | /** |
| 217 | * struct dmx_sec_es_data - sec Elementary Stream (ES) |
| 218 | * |
| 219 | * @pts_dts_flag:[1:0], 01:pts valid, 10:dts valid |
| 220 | * @pts: pts value |
| 221 | * @dts: dts value |
| 222 | * @buf_start: buf start addr |
| 223 | * @buf_end: buf end addr |
| 224 | * @data_start: data start addr |
| 225 | * @data_end: data end addr |
| 226 | */ |
| 227 | struct dmx_sec_es_data { |
| 228 | __u8 pts_dts_flag; |
| 229 | __u64 pts; |
| 230 | __u64 dts; |
| 231 | __u32 buf_start; |
| 232 | __u32 buf_end; |
| 233 | __u32 data_start; |
| 234 | __u32 data_end; |
| 235 | }; |
| 236 | |
| 237 | struct dmx_sec_ts_data { |
| 238 | __u32 buf_start; |
| 239 | __u32 buf_end; |
| 240 | __u32 data_start; |
| 241 | __u32 data_end; |
| 242 | }; |
| 243 | |
| 244 | enum dmx_audio_format { |
| 245 | AUDIO_UNKNOWN = 0, /* unknown media */ |
| 246 | AUDIO_MPX = 1, /* mpeg audio MP2/MP3 */ |
| 247 | AUDIO_AC3 = 2, /* Dolby AC3/EAC3 */ |
| 248 | AUDIO_AAC_ADTS = 3, /* AAC-ADTS */ |
| 249 | AUDIO_AAC_LOAS = 4, /* AAC-LOAS */ |
| 250 | AUDIO_DTS = 5, /* DTS */ |
| 251 | AUDIO_MAX |
| 252 | }; |
| 253 | |
| 254 | struct dmx_mem_info { |
| 255 | __u32 dmx_total_size; |
| 256 | __u32 dmx_buf_phy_start; |
| 257 | __u32 dmx_free_size; |
| 258 | __u32 dvb_core_total_size; |
| 259 | __u32 dvb_core_free_size; |
| 260 | __u32 wp_offset; |
| 261 | __u64 newest_pts; |
| 262 | }; |
| 263 | |
| 264 | struct dmx_sec_mem { |
| 265 | __u32 buff; |
| 266 | __u32 size; |
| 267 | }; |
| 268 | |
| 269 | /* amlogic define end */ |
| 270 | |
Mauro Carvalho Chehab | bb98e6d | 2017-08-31 12:28:52 -0400 | [diff] [blame] | 271 | /** |
| 272 | * struct dmx_pes_filter_params - Specifies Packetized Elementary Stream (PES) |
| 273 | * filter parameters. |
| 274 | * |
| 275 | * @pid: PID to be filtered. |
| 276 | * @input: Demux input, as specified by &enum dmx_input. |
| 277 | * @output: Demux output, as specified by &enum dmx_output. |
| 278 | * @pes_type: Type of the pes filter, as specified by &enum dmx_pes_type. |
| 279 | * @flags: Demux PES flags. |
| 280 | */ |
Mauro Carvalho Chehab | e4faa09 | 2017-09-05 07:02:44 -0400 | [diff] [blame] | 281 | struct dmx_pes_filter_params { |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame] | 282 | __u16 pid; |
| 283 | enum dmx_input input; |
| 284 | enum dmx_output output; |
| 285 | enum dmx_ts_pes pes_type; |
| 286 | __u32 flags; |
chuangcheng peng | 62fb9f9 | 2022-08-11 19:32:43 +0800 | [diff] [blame^] | 287 | /*amlogic define*/ |
| 288 | /*bit 8~15 for mem sec_level*/ |
| 289 | #define DMX_MEM_SEC_LEVEL1 (1 << 10) |
| 290 | #define DMX_MEM_SEC_LEVEL2 (2 << 10) |
| 291 | #define DMX_MEM_SEC_LEVEL3 (3 << 10) |
| 292 | #define DMX_MEM_SEC_LEVEL4 (4 << 10) |
| 293 | #define DMX_MEM_SEC_LEVEL5 (5 << 10) |
| 294 | #define DMX_MEM_SEC_LEVEL6 (6 << 10) |
| 295 | #define DMX_MEM_SEC_LEVEL7 (7 << 10) |
| 296 | |
| 297 | /*bit 16~23 for output */ |
| 298 | #define DMX_ES_OUTPUT (1 << 16) |
| 299 | /*set raw mode, it will send the struct dmx_sec_es_data, not es data*/ |
| 300 | #define DMX_OUTPUT_RAW_MODE (1 << 17) |
| 301 | |
| 302 | /*24~31 one byte for audio type, dmx_audio_format_t*/ |
| 303 | #define DMX_AUDIO_FORMAT_BIT 24 |
| 304 | |
| 305 | /* amlogic define end */ |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 306 | }; |
| 307 | |
Mauro Carvalho Chehab | bb98e6d | 2017-08-31 12:28:52 -0400 | [diff] [blame] | 308 | /** |
| 309 | * struct dmx_stc - Stores System Time Counter (STC) information. |
| 310 | * |
| 311 | * @num: input data: number of the STC, from 0 to N. |
| 312 | * @base: output: divisor for STC to get 90 kHz clock. |
| 313 | * @stc: output: stc in @base * 90 kHz units. |
| 314 | */ |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 315 | struct dmx_stc { |
Mauro Carvalho Chehab | bb98e6d | 2017-08-31 12:28:52 -0400 | [diff] [blame] | 316 | unsigned int num; |
| 317 | unsigned int base; |
| 318 | __u64 stc; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 319 | }; |
| 320 | |
Satendra Singh Thakur | 57868ac | 2017-12-18 22:35:53 -0500 | [diff] [blame] | 321 | /** |
Mauro Carvalho Chehab | 9c171cd | 2018-02-09 05:51:19 -0500 | [diff] [blame] | 322 | * enum dmx_buffer_flags - DMX memory-mapped buffer flags |
| 323 | * |
| 324 | * @DMX_BUFFER_FLAG_HAD_CRC32_DISCARD: |
| 325 | * Indicates that the Kernel discarded one or more frames due to wrong |
| 326 | * CRC32 checksum. |
| 327 | * @DMX_BUFFER_FLAG_TEI: |
| 328 | * Indicates that the Kernel has detected a Transport Error indicator |
| 329 | * (TEI) on a filtered pid. |
| 330 | * @DMX_BUFFER_PKT_COUNTER_MISMATCH: |
| 331 | * Indicates that the Kernel has detected a packet counter mismatch |
| 332 | * on a filtered pid. |
| 333 | * @DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED: |
| 334 | * Indicates that the Kernel has detected one or more frame discontinuity. |
| 335 | * @DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR: |
| 336 | * Received at least one packet with a frame discontinuity indicator. |
| 337 | */ |
| 338 | |
| 339 | enum dmx_buffer_flags { |
| 340 | DMX_BUFFER_FLAG_HAD_CRC32_DISCARD = 1 << 0, |
| 341 | DMX_BUFFER_FLAG_TEI = 1 << 1, |
| 342 | DMX_BUFFER_PKT_COUNTER_MISMATCH = 1 << 2, |
| 343 | DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED = 1 << 3, |
| 344 | DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR = 1 << 4, |
| 345 | }; |
| 346 | |
| 347 | /** |
Satendra Singh Thakur | 57868ac | 2017-12-18 22:35:53 -0500 | [diff] [blame] | 348 | * struct dmx_buffer - dmx buffer info |
| 349 | * |
| 350 | * @index: id number of the buffer |
| 351 | * @bytesused: number of bytes occupied by data in the buffer (payload); |
| 352 | * @offset: for buffers with memory == DMX_MEMORY_MMAP; |
| 353 | * offset from the start of the device memory for this plane, |
| 354 | * (or a "cookie" that should be passed to mmap() as offset) |
| 355 | * @length: size in bytes of the buffer |
Mauro Carvalho Chehab | 9c171cd | 2018-02-09 05:51:19 -0500 | [diff] [blame] | 356 | * @flags: bit array of buffer flags as defined by &enum dmx_buffer_flags. |
| 357 | * Filled only at &DMX_DQBUF. |
| 358 | * @count: monotonic counter for filled buffers. Helps to identify |
| 359 | * data stream loses. Filled only at &DMX_DQBUF. |
Satendra Singh Thakur | 57868ac | 2017-12-18 22:35:53 -0500 | [diff] [blame] | 360 | * |
| 361 | * Contains data exchanged by application and driver using one of the streaming |
| 362 | * I/O methods. |
Mauro Carvalho Chehab | 9c171cd | 2018-02-09 05:51:19 -0500 | [diff] [blame] | 363 | * |
| 364 | * Please notice that, for &DMX_QBUF, only @index should be filled. |
| 365 | * On &DMX_DQBUF calls, all fields will be filled by the Kernel. |
Satendra Singh Thakur | 57868ac | 2017-12-18 22:35:53 -0500 | [diff] [blame] | 366 | */ |
| 367 | struct dmx_buffer { |
| 368 | __u32 index; |
| 369 | __u32 bytesused; |
| 370 | __u32 offset; |
| 371 | __u32 length; |
Mauro Carvalho Chehab | 9c171cd | 2018-02-09 05:51:19 -0500 | [diff] [blame] | 372 | __u32 flags; |
| 373 | __u32 count; |
Satendra Singh Thakur | 57868ac | 2017-12-18 22:35:53 -0500 | [diff] [blame] | 374 | }; |
| 375 | |
| 376 | /** |
| 377 | * struct dmx_requestbuffers - request dmx buffer information |
| 378 | * |
| 379 | * @count: number of requested buffers, |
| 380 | * @size: size in bytes of the requested buffer |
| 381 | * |
| 382 | * Contains data used for requesting a dmx buffer. |
| 383 | * All reserved fields must be set to zero. |
| 384 | */ |
| 385 | struct dmx_requestbuffers { |
| 386 | __u32 count; |
| 387 | __u32 size; |
Satendra Singh Thakur | 57868ac | 2017-12-18 22:35:53 -0500 | [diff] [blame] | 388 | }; |
| 389 | |
| 390 | /** |
| 391 | * struct dmx_exportbuffer - export of dmx buffer as DMABUF file descriptor |
| 392 | * |
| 393 | * @index: id number of the buffer |
| 394 | * @flags: flags for newly created file, currently only O_CLOEXEC is |
| 395 | * supported, refer to manual of open syscall for more details |
| 396 | * @fd: file descriptor associated with DMABUF (set by driver) |
| 397 | * |
| 398 | * Contains data used for exporting a dmx buffer as DMABUF file descriptor. |
| 399 | * The buffer is identified by a 'cookie' returned by DMX_QUERYBUF |
| 400 | * (identical to the cookie used to mmap() the buffer to userspace). All |
| 401 | * reserved fields must be set to zero. The field reserved0 is expected to |
| 402 | * become a structure 'type' allowing an alternative layout of the structure |
| 403 | * content. Therefore this field should not be used for any other extensions. |
| 404 | */ |
| 405 | struct dmx_exportbuffer { |
| 406 | __u32 index; |
| 407 | __u32 flags; |
| 408 | __s32 fd; |
Satendra Singh Thakur | 57868ac | 2017-12-18 22:35:53 -0500 | [diff] [blame] | 409 | }; |
| 410 | |
chuangcheng peng | 62fb9f9 | 2022-08-11 19:32:43 +0800 | [diff] [blame^] | 411 | /* amlogic define */ |
| 412 | enum { |
| 413 | DMA_0 = 0, |
| 414 | DMA_1, |
| 415 | DMA_2, |
| 416 | DMA_3, |
| 417 | DMA_4, |
| 418 | DMA_5, |
| 419 | DMA_6, |
| 420 | DMA_7, |
| 421 | FRONTEND_TS0 = 32, |
| 422 | FRONTEND_TS1, |
| 423 | FRONTEND_TS2, |
| 424 | FRONTEND_TS3, |
| 425 | FRONTEND_TS4, |
| 426 | FRONTEND_TS5, |
| 427 | FRONTEND_TS6, |
| 428 | FRONTEND_TS7, |
| 429 | DMA_0_1 = 64, |
| 430 | DMA_1_1, |
| 431 | DMA_2_1, |
| 432 | DMA_3_1, |
| 433 | DMA_4_1, |
| 434 | DMA_5_1, |
| 435 | DMA_6_1, |
| 436 | DMA_7_1, |
| 437 | FRONTEND_TS0_1 = 96, |
| 438 | FRONTEND_TS1_1, |
| 439 | FRONTEND_TS2_1, |
| 440 | FRONTEND_TS3_1, |
| 441 | FRONTEND_TS4_1, |
| 442 | FRONTEND_TS5_1, |
| 443 | FRONTEND_TS6_1, |
| 444 | FRONTEND_TS7_1, |
| 445 | }; |
| 446 | |
| 447 | /*define filter mem_info type*/ |
| 448 | enum { |
| 449 | DMX_VIDEO_TYPE = 0, |
| 450 | DMX_AUDIO_TYPE, |
| 451 | DMX_SUBTITLE_TYPE, |
| 452 | DMX_TELETEXT_TYPE, |
| 453 | DMX_SECTION_TYPE, |
| 454 | }; |
| 455 | |
| 456 | struct filter_mem_info { |
| 457 | __u32 type; |
| 458 | __u32 pid; |
| 459 | struct dmx_mem_info filter_info; |
| 460 | }; |
| 461 | |
| 462 | struct dmx_filter_mem_info { |
| 463 | __u32 filter_num; |
| 464 | struct filter_mem_info info[40]; |
| 465 | }; |
| 466 | |
| 467 | struct dvr_mem_info { |
| 468 | __u32 wp_offset; |
| 469 | }; |
| 470 | |
| 471 | struct decoder_mem_info { |
| 472 | __u32 rp_phy; |
| 473 | }; |
| 474 | |
| 475 | /* amlogic define end */ |
| 476 | |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 477 | #define DMX_START _IO('o', 41) |
| 478 | #define DMX_STOP _IO('o', 42) |
| 479 | #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) |
| 480 | #define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params) |
| 481 | #define DMX_SET_BUFFER_SIZE _IO('o', 45) |
| 482 | #define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5]) |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 483 | #define DMX_GET_STC _IOWR('o', 50, struct dmx_stc) |
| 484 | #define DMX_ADD_PID _IOW('o', 51, __u16) |
| 485 | #define DMX_REMOVE_PID _IOW('o', 52, __u16) |
Mauro Carvalho Chehab | e4faa09 | 2017-09-05 07:02:44 -0400 | [diff] [blame] | 486 | #if !defined(__KERNEL__) |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame] | 487 | |
| 488 | /* This is needed for legacy userspace support */ |
| 489 | typedef enum dmx_output dmx_output_t; |
| 490 | typedef enum dmx_input dmx_input_t; |
| 491 | typedef enum dmx_ts_pes dmx_pes_type_t; |
| 492 | typedef struct dmx_filter dmx_filter_t; |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame] | 493 | |
| 494 | #endif |
| 495 | |
Satendra Singh Thakur | 57868ac | 2017-12-18 22:35:53 -0500 | [diff] [blame] | 496 | #define DMX_REQBUFS _IOWR('o', 60, struct dmx_requestbuffers) |
| 497 | #define DMX_QUERYBUF _IOWR('o', 61, struct dmx_buffer) |
| 498 | #define DMX_EXPBUF _IOWR('o', 62, struct dmx_exportbuffer) |
| 499 | #define DMX_QBUF _IOWR('o', 63, struct dmx_buffer) |
| 500 | #define DMX_DQBUF _IOWR('o', 64, struct dmx_buffer) |
| 501 | |
chuangcheng peng | 62fb9f9 | 2022-08-11 19:32:43 +0800 | [diff] [blame^] | 502 | /* amlogic define */ |
| 503 | #define DMX_SET_INPUT _IO('o', 80) |
| 504 | #define DMX_GET_MEM_INFO _IOR('o', 81, struct dmx_mem_info) |
| 505 | #define DMX_SET_HW_SOURCE _IO('o', 82) |
| 506 | #define DMX_GET_HW_SOURCE _IOR('o', 83, int) |
| 507 | #define DMX_GET_FILTER_MEM_INFO _IOR('o', 84, struct dmx_filter_mem_info) |
| 508 | /*just for dvr sec mem, please call before DMX_SET_PES_FILTER*/ |
| 509 | #define DMX_SET_SEC_MEM _IOW('o', 85, struct dmx_sec_mem) |
| 510 | #define DMX_GET_DVR_MEM _IOR('o', 86, struct dvr_mem_info) |
| 511 | #define DMX_REMAP_PID _IOR('o', 87, __u16[2]) |
| 512 | #define DMX_SET_DECODE_INFO _IOW('o', 88, struct decoder_mem_info) |
| 513 | /* amlogic define end */ |
Satendra Singh Thakur | 57868ac | 2017-12-18 22:35:53 -0500 | [diff] [blame] | 514 | #endif /* _DVBDMX_H_ */ |