David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 1 | /* |
| 2 | * dmx.h |
| 3 | * |
| 4 | * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de> |
| 5 | * & Ralph Metzler <ralph@convergence.de> |
| 6 | * for convergence integrated media GmbH |
| 7 | * |
| 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. |
| 12 | * |
| 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. |
| 17 | * |
| 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. |
| 21 | * |
| 22 | */ |
| 23 | |
| 24 | #ifndef _UAPI_DVBDMX_H_ |
| 25 | #define _UAPI_DVBDMX_H_ |
| 26 | |
| 27 | #include <linux/types.h> |
| 28 | #ifndef __KERNEL__ |
| 29 | #include <time.h> |
| 30 | #endif |
| 31 | |
| 32 | |
| 33 | #define DMX_FILTER_SIZE 16 |
| 34 | |
Mauro Carvalho Chehab | 6eab804 | 2015-06-07 19:29:43 -0300 | [diff] [blame] | 35 | enum dmx_output |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 36 | { |
| 37 | DMX_OUT_DECODER, /* Streaming directly to decoder. */ |
| 38 | DMX_OUT_TAP, /* Output going to a memory buffer */ |
| 39 | /* (to be retrieved via the read command).*/ |
| 40 | DMX_OUT_TS_TAP, /* Output multiplexed into a new TS */ |
| 41 | /* (to be retrieved by reading from the */ |
| 42 | /* logical DVR device). */ |
| 43 | DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */ |
Mauro Carvalho Chehab | 6eab804 | 2015-06-07 19:29:43 -0300 | [diff] [blame] | 44 | }; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 45 | |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 46 | enum dmx_input |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 47 | { |
| 48 | DMX_IN_FRONTEND, /* Input from a front-end device. */ |
| 49 | DMX_IN_DVR /* Input from the logical DVR device. */ |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 50 | }; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 51 | |
| 52 | |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 53 | enum dmx_ts_pes |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 54 | { |
| 55 | DMX_PES_AUDIO0, |
| 56 | DMX_PES_VIDEO0, |
| 57 | DMX_PES_TELETEXT0, |
| 58 | DMX_PES_SUBTITLE0, |
| 59 | DMX_PES_PCR0, |
| 60 | |
| 61 | DMX_PES_AUDIO1, |
| 62 | DMX_PES_VIDEO1, |
| 63 | DMX_PES_TELETEXT1, |
| 64 | DMX_PES_SUBTITLE1, |
| 65 | DMX_PES_PCR1, |
| 66 | |
| 67 | DMX_PES_AUDIO2, |
| 68 | DMX_PES_VIDEO2, |
| 69 | DMX_PES_TELETEXT2, |
| 70 | DMX_PES_SUBTITLE2, |
| 71 | DMX_PES_PCR2, |
| 72 | |
| 73 | DMX_PES_AUDIO3, |
| 74 | DMX_PES_VIDEO3, |
| 75 | DMX_PES_TELETEXT3, |
| 76 | DMX_PES_SUBTITLE3, |
| 77 | DMX_PES_PCR3, |
| 78 | |
| 79 | DMX_PES_OTHER |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 80 | }; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 81 | |
| 82 | #define DMX_PES_AUDIO DMX_PES_AUDIO0 |
| 83 | #define DMX_PES_VIDEO DMX_PES_VIDEO0 |
| 84 | #define DMX_PES_TELETEXT DMX_PES_TELETEXT0 |
| 85 | #define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0 |
| 86 | #define DMX_PES_PCR DMX_PES_PCR0 |
| 87 | |
| 88 | |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 89 | struct dmx_filter |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 90 | { |
| 91 | __u8 filter[DMX_FILTER_SIZE]; |
| 92 | __u8 mask[DMX_FILTER_SIZE]; |
| 93 | __u8 mode[DMX_FILTER_SIZE]; |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 94 | }; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 95 | |
| 96 | |
| 97 | struct dmx_sct_filter_params |
| 98 | { |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 99 | __u16 pid; |
| 100 | struct dmx_filter filter; |
| 101 | __u32 timeout; |
| 102 | __u32 flags; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 103 | #define DMX_CHECK_CRC 1 |
| 104 | #define DMX_ONESHOT 2 |
| 105 | #define DMX_IMMEDIATE_START 4 |
| 106 | #define DMX_KERNEL_CLIENT 0x8000 |
| 107 | }; |
| 108 | |
| 109 | |
| 110 | struct dmx_pes_filter_params |
| 111 | { |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 112 | __u16 pid; |
| 113 | enum dmx_input input; |
| 114 | enum dmx_output output; |
| 115 | enum dmx_ts_pes pes_type; |
| 116 | __u32 flags; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 117 | }; |
| 118 | |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 119 | struct dmx_caps { |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 120 | __u32 caps; |
| 121 | int num_decoders; |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 122 | }; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 123 | |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 124 | enum dmx_source { |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 125 | DMX_SOURCE_FRONT0 = 0, |
| 126 | DMX_SOURCE_FRONT1, |
| 127 | DMX_SOURCE_FRONT2, |
| 128 | DMX_SOURCE_FRONT3, |
| 129 | DMX_SOURCE_DVR0 = 16, |
| 130 | DMX_SOURCE_DVR1, |
| 131 | DMX_SOURCE_DVR2, |
| 132 | DMX_SOURCE_DVR3 |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 133 | }; |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 134 | |
| 135 | struct dmx_stc { |
| 136 | unsigned int num; /* input : which STC? 0..N */ |
| 137 | unsigned int base; /* output: divisor for stc to get 90 kHz clock */ |
| 138 | __u64 stc; /* output: stc in 'base'*90 kHz units */ |
| 139 | }; |
| 140 | |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 141 | #define DMX_START _IO('o', 41) |
| 142 | #define DMX_STOP _IO('o', 42) |
| 143 | #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) |
| 144 | #define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params) |
| 145 | #define DMX_SET_BUFFER_SIZE _IO('o', 45) |
| 146 | #define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5]) |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 147 | #define DMX_GET_CAPS _IOR('o', 48, struct dmx_caps) |
| 148 | #define DMX_SET_SOURCE _IOW('o', 49, enum dmx_source) |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 149 | #define DMX_GET_STC _IOWR('o', 50, struct dmx_stc) |
| 150 | #define DMX_ADD_PID _IOW('o', 51, __u16) |
| 151 | #define DMX_REMOVE_PID _IOW('o', 52, __u16) |
| 152 | |
Mauro Carvalho Chehab | 3256b36 | 2017-09-01 06:09:14 -0400 | [diff] [blame^] | 153 | #if !defined (__KERNEL__) |
| 154 | |
| 155 | /* This is needed for legacy userspace support */ |
| 156 | typedef enum dmx_output dmx_output_t; |
| 157 | typedef enum dmx_input dmx_input_t; |
| 158 | typedef enum dmx_ts_pes dmx_pes_type_t; |
| 159 | typedef struct dmx_filter dmx_filter_t; |
| 160 | typedef struct dmx_caps dmx_caps_t; |
| 161 | typedef enum dmx_source dmx_source_t; |
| 162 | |
| 163 | #endif |
| 164 | |
David Howells | c57fd02 | 2012-10-09 09:48:42 +0100 | [diff] [blame] | 165 | #endif /* _UAPI_DVBDMX_H_ */ |