Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * dvb_demux.h: DVB kernel demux API |
| 3 | * |
| 4 | * Copyright (C) 2000-2001 Marcus Metzler & Ralph Metzler |
| 5 | * for convergence integrated media GmbH |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public License |
| 9 | * as published by the Free Software Foundation; either version 2.1 |
| 10 | * of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | */ |
| 18 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #ifndef _DVB_DEMUX_H_ |
| 20 | #define _DVB_DEMUX_H_ |
| 21 | |
| 22 | #include <linux/time.h> |
| 23 | #include <linux/timer.h> |
| 24 | #include <linux/spinlock.h> |
Ingo Molnar | 3593cab | 2006-02-07 06:49:14 -0200 | [diff] [blame] | 25 | #include <linux/mutex.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
Mauro Carvalho Chehab | fada193 | 2017-12-28 13:03:51 -0500 | [diff] [blame] | 27 | #include <media/demux.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
Mauro Carvalho Chehab | 0463625 | 2017-09-19 17:43:49 -0400 | [diff] [blame] | 29 | /** |
| 30 | * enum dvb_dmx_filter_type - type of demux feed. |
| 31 | * |
| 32 | * @DMX_TYPE_TS: feed is in TS mode. |
| 33 | * @DMX_TYPE_SEC: feed is in Section mode. |
| 34 | */ |
| 35 | enum dvb_dmx_filter_type { |
| 36 | DMX_TYPE_TS, |
| 37 | DMX_TYPE_SEC, |
| 38 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
Mauro Carvalho Chehab | 999f3d2 | 2017-09-19 17:44:07 -0400 | [diff] [blame] | 40 | /** |
| 41 | * enum dvb_dmx_state - state machine for a demux filter. |
| 42 | * |
| 43 | * @DMX_STATE_FREE: indicates that the filter is freed. |
| 44 | * @DMX_STATE_ALLOCATED: indicates that the filter was allocated |
| 45 | * to be used. |
| 46 | * @DMX_STATE_READY: indicates that the filter is ready |
| 47 | * to be used. |
| 48 | * @DMX_STATE_GO: indicates that the filter is running. |
| 49 | */ |
| 50 | enum dvb_dmx_state { |
| 51 | DMX_STATE_FREE, |
| 52 | DMX_STATE_ALLOCATED, |
| 53 | DMX_STATE_READY, |
| 54 | DMX_STATE_GO, |
| 55 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
| 57 | #define DVB_DEMUX_MASK_MAX 18 |
| 58 | |
Abylay Ospan | 0d83463 | 2009-06-06 09:31:34 -0300 | [diff] [blame] | 59 | #define MAX_PID 0x1fff |
| 60 | |
Abylay Ospan | 26b9d6c | 2009-11-01 18:46:53 -0300 | [diff] [blame] | 61 | #define SPEED_PKTS_INTERVAL 50000 |
| 62 | |
Mauro Carvalho Chehab | e5c4be8 | 2017-09-19 19:04:08 -0400 | [diff] [blame] | 63 | /** |
| 64 | * struct dvb_demux_filter - Describes a DVB demux section filter. |
| 65 | * |
| 66 | * @filter: Section filter as defined by &struct dmx_section_filter. |
| 67 | * @maskandmode: logical ``and`` bit mask. |
| 68 | * @maskandnotmode: logical ``and not`` bit mask. |
| 69 | * @doneq: flag that indicates when a filter is ready. |
| 70 | * @next: pointer to the next section filter. |
| 71 | * @feed: &struct dvb_demux_feed pointer. |
| 72 | * @index: index of the used demux filter. |
| 73 | * @state: state of the filter as described by &enum dvb_dmx_state. |
| 74 | * @type: type of the filter as described |
| 75 | * by &enum dvb_dmx_filter_type. |
| 76 | */ |
| 77 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | struct dvb_demux_filter { |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 79 | struct dmx_section_filter filter; |
| 80 | u8 maskandmode[DMX_MAX_FILTER_SIZE]; |
| 81 | u8 maskandnotmode[DMX_MAX_FILTER_SIZE]; |
Mauro Carvalho Chehab | 392cc7a | 2017-09-19 18:10:13 -0400 | [diff] [blame] | 82 | bool doneq; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 84 | struct dvb_demux_filter *next; |
| 85 | struct dvb_demux_feed *feed; |
| 86 | int index; |
Mauro Carvalho Chehab | 999f3d2 | 2017-09-19 17:44:07 -0400 | [diff] [blame] | 87 | enum dvb_dmx_state state; |
Mauro Carvalho Chehab | 0463625 | 2017-09-19 17:43:49 -0400 | [diff] [blame] | 88 | enum dvb_dmx_filter_type type; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | |
Mauro Carvalho Chehab | e5c4be8 | 2017-09-19 19:04:08 -0400 | [diff] [blame] | 90 | /* private: used only by av7110 */ |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 91 | u16 hw_handle; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | }; |
| 93 | |
Mauro Carvalho Chehab | e5c4be8 | 2017-09-19 19:04:08 -0400 | [diff] [blame] | 94 | /** |
| 95 | * struct dvb_demux_feed - describes a DVB field |
| 96 | * |
Mauro Carvalho Chehab | 8db044b | 2017-09-27 09:04:04 -0400 | [diff] [blame] | 97 | * @feed: a union describing a digital TV feed. |
| 98 | * Depending on the feed type, it can be either |
| 99 | * @feed.ts or @feed.sec. |
| 100 | * @feed.ts: a &struct dmx_ts_feed pointer. |
| 101 | * For TS feed only. |
| 102 | * @feed.sec: a &struct dmx_section_feed pointer. |
| 103 | * For section feed only. |
| 104 | * @cb: a union describing digital TV callbacks. |
| 105 | * Depending on the feed type, it can be either |
| 106 | * @cb.ts or @cb.sec. |
| 107 | * @cb.ts: a dmx_ts_cb() calback function pointer. |
| 108 | * For TS feed only. |
| 109 | * @cb.sec: a dmx_section_cb() callback function pointer. |
| 110 | * For section feed only. |
Mauro Carvalho Chehab | e5c4be8 | 2017-09-19 19:04:08 -0400 | [diff] [blame] | 111 | * @demux: pointer to &struct dvb_demux. |
Mauro Carvalho Chehab | 198688c | 2017-09-19 19:11:22 -0400 | [diff] [blame] | 112 | * @priv: private data that can optionally be used by a DVB driver. |
Mauro Carvalho Chehab | e5c4be8 | 2017-09-19 19:04:08 -0400 | [diff] [blame] | 113 | * @type: type of the filter, as defined by &enum dvb_dmx_filter_type. |
| 114 | * @state: state of the filter as defined by &enum dvb_dmx_state. |
| 115 | * @pid: PID to be filtered. |
| 116 | * @timeout: feed timeout. |
| 117 | * @filter: pointer to &struct dvb_demux_filter. |
Mauro Carvalho Chehab | fdbeb96 | 2018-02-09 07:30:46 -0500 | [diff] [blame] | 118 | * @buffer_flags: Buffer flags used to report discontinuity users via DVB |
| 119 | * memory mapped API, as defined by &enum dmx_buffer_flags. |
Mauro Carvalho Chehab | e5c4be8 | 2017-09-19 19:04:08 -0400 | [diff] [blame] | 120 | * @ts_type: type of TS, as defined by &enum ts_filter_type. |
| 121 | * @pes_type: type of PES, as defined by &enum dmx_ts_pes. |
| 122 | * @cc: MPEG-TS packet continuity counter |
| 123 | * @pusi_seen: if true, indicates that a discontinuity was detected. |
| 124 | * it is used to prevent feeding of garbage from previous section. |
| 125 | * @peslen: length of the PES (Packet Elementary Stream). |
| 126 | * @list_head: head for the list of digital TV demux feeds. |
| 127 | * @index: a unique index for each feed. Can be used as hardware |
| 128 | * pid filter index. |
Mauro Carvalho Chehab | e5c4be8 | 2017-09-19 19:04:08 -0400 | [diff] [blame] | 129 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | struct dvb_demux_feed { |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 131 | union { |
| 132 | struct dmx_ts_feed ts; |
| 133 | struct dmx_section_feed sec; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | } feed; |
| 135 | |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 136 | union { |
| 137 | dmx_ts_cb ts; |
| 138 | dmx_section_cb sec; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | } cb; |
| 140 | |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 141 | struct dvb_demux *demux; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 142 | void *priv; |
Mauro Carvalho Chehab | 0463625 | 2017-09-19 17:43:49 -0400 | [diff] [blame] | 143 | enum dvb_dmx_filter_type type; |
Mauro Carvalho Chehab | 999f3d2 | 2017-09-19 17:44:07 -0400 | [diff] [blame] | 144 | enum dvb_dmx_state state; |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 145 | u16 pid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | |
Arnd Bergmann | e95be15 | 2016-06-17 17:46:28 -0300 | [diff] [blame] | 147 | ktime_t timeout; |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 148 | struct dvb_demux_filter *filter; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 149 | |
Mauro Carvalho Chehab | fdbeb96 | 2018-02-09 07:30:46 -0500 | [diff] [blame] | 150 | u32 buffer_flags; |
| 151 | |
Mauro Carvalho Chehab | 4bc8525 | 2017-09-19 19:01:09 -0400 | [diff] [blame] | 152 | enum ts_filter_type ts_type; |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 153 | enum dmx_ts_pes pes_type; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 155 | int cc; |
Mauro Carvalho Chehab | e5c4be8 | 2017-09-19 19:04:08 -0400 | [diff] [blame] | 156 | bool pusi_seen; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 158 | u16 peslen; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 159 | |
| 160 | struct list_head list_head; |
Mauro Carvalho Chehab | e5c4be8 | 2017-09-19 19:04:08 -0400 | [diff] [blame] | 161 | unsigned int index; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | }; |
| 163 | |
Mauro Carvalho Chehab | 198688c | 2017-09-19 19:11:22 -0400 | [diff] [blame] | 164 | /** |
| 165 | * struct dvb_demux - represents a digital TV demux |
| 166 | * @dmx: embedded &struct dmx_demux with demux capabilities |
| 167 | * and callbacks. |
| 168 | * @priv: private data that can optionally be used by |
| 169 | * a DVB driver. |
| 170 | * @filternum: maximum amount of DVB filters. |
| 171 | * @feednum: maximum amount of DVB feeds. |
| 172 | * @start_feed: callback routine to be called in order to start |
| 173 | * a DVB feed. |
| 174 | * @stop_feed: callback routine to be called in order to stop |
| 175 | * a DVB feed. |
| 176 | * @write_to_decoder: callback routine to be called if the feed is TS and |
| 177 | * it is routed to an A/V decoder, when a new TS packet |
| 178 | * is received. |
| 179 | * Used only on av7110-av.c. |
| 180 | * @check_crc32: callback routine to check CRC. If not initialized, |
| 181 | * dvb_demux will use an internal one. |
| 182 | * @memcopy: callback routine to memcopy received data. |
| 183 | * If not initialized, dvb_demux will default to memcpy(). |
| 184 | * @users: counter for the number of demux opened file descriptors. |
| 185 | * Currently, it is limited to 10 users. |
| 186 | * @filter: pointer to &struct dvb_demux_filter. |
| 187 | * @feed: pointer to &struct dvb_demux_feed. |
| 188 | * @frontend_list: &struct list_head with frontends used by the demux. |
| 189 | * @pesfilter: array of &struct dvb_demux_feed with the PES types |
| 190 | * that will be filtered. |
| 191 | * @pids: list of filtered program IDs. |
| 192 | * @feed_list: &struct list_head with feeds. |
| 193 | * @tsbuf: temporary buffer used internally to store TS packets. |
| 194 | * @tsbufp: temporary buffer index used internally. |
| 195 | * @mutex: pointer to &struct mutex used to protect feed set |
| 196 | * logic. |
| 197 | * @lock: pointer to &spinlock_t, used to protect buffer handling. |
| 198 | * @cnt_storage: buffer used for TS/TEI continuity check. |
| 199 | * @speed_last_time: &ktime_t used for TS speed check. |
| 200 | * @speed_pkts_cnt: packets count used for TS speed check. |
| 201 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 202 | struct dvb_demux { |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 203 | struct dmx_demux dmx; |
| 204 | void *priv; |
| 205 | int filternum; |
| 206 | int feednum; |
| 207 | int (*start_feed)(struct dvb_demux_feed *feed); |
| 208 | int (*stop_feed)(struct dvb_demux_feed *feed); |
| 209 | int (*write_to_decoder)(struct dvb_demux_feed *feed, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | const u8 *buf, size_t len); |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 211 | u32 (*check_crc32)(struct dvb_demux_feed *feed, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | const u8 *buf, size_t len); |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 213 | void (*memcopy)(struct dvb_demux_feed *feed, u8 *dst, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 214 | const u8 *src, size_t len); |
| 215 | |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 216 | int users; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | #define MAX_DVB_DEMUX_USERS 10 |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 218 | struct dvb_demux_filter *filter; |
| 219 | struct dvb_demux_feed *feed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 221 | struct list_head frontend_list; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 222 | |
Mauro Carvalho Chehab | fde04ab | 2013-04-04 13:25:30 -0300 | [diff] [blame] | 223 | struct dvb_demux_feed *pesfilter[DMX_PES_OTHER]; |
| 224 | u16 pids[DMX_PES_OTHER]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | |
| 226 | #define DMX_MAX_PID 0x2000 |
| 227 | struct list_head feed_list; |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 228 | u8 tsbuf[204]; |
| 229 | int tsbufp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | |
Ingo Molnar | 3593cab | 2006-02-07 06:49:14 -0200 | [diff] [blame] | 231 | struct mutex mutex; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 232 | spinlock_t lock; |
Abylay Ospan | 0d83463 | 2009-06-06 09:31:34 -0300 | [diff] [blame] | 233 | |
| 234 | uint8_t *cnt_storage; /* for TS continuity check */ |
Abylay Ospan | 26b9d6c | 2009-11-01 18:46:53 -0300 | [diff] [blame] | 235 | |
Arnd Bergmann | e95be15 | 2016-06-17 17:46:28 -0300 | [diff] [blame] | 236 | ktime_t speed_last_time; /* for TS speed check */ |
Abylay Ospan | 26b9d6c | 2009-11-01 18:46:53 -0300 | [diff] [blame] | 237 | uint32_t speed_pkts_cnt; /* for TS speed check */ |
Mauro Carvalho Chehab | 198688c | 2017-09-19 19:11:22 -0400 | [diff] [blame] | 238 | |
| 239 | /* private: used only on av7110 */ |
| 240 | int playing; |
| 241 | int recording; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 242 | }; |
| 243 | |
Mauro Carvalho Chehab | 6128a68 | 2017-09-20 09:08:20 -0400 | [diff] [blame] | 244 | /** |
| 245 | * dvb_dmx_init - initialize a digital TV demux struct. |
| 246 | * |
| 247 | * @demux: &struct dvb_demux to be initialized. |
| 248 | * |
| 249 | * Before being able to register a digital TV demux struct, drivers |
| 250 | * should call this routine. On its typical usage, some fields should |
| 251 | * be initialized at the driver before calling it. |
| 252 | * |
| 253 | * A typical usecase is:: |
| 254 | * |
| 255 | * dvb->demux.dmx.capabilities = |
| 256 | * DMX_TS_FILTERING | DMX_SECTION_FILTERING | |
| 257 | * DMX_MEMORY_BASED_FILTERING; |
| 258 | * dvb->demux.priv = dvb; |
| 259 | * dvb->demux.filternum = 256; |
| 260 | * dvb->demux.feednum = 256; |
| 261 | * dvb->demux.start_feed = driver_start_feed; |
| 262 | * dvb->demux.stop_feed = driver_stop_feed; |
| 263 | * ret = dvb_dmx_init(&dvb->demux); |
| 264 | * if (ret < 0) |
| 265 | * return ret; |
| 266 | */ |
| 267 | int dvb_dmx_init(struct dvb_demux *demux); |
| 268 | |
| 269 | /** |
| 270 | * dvb_dmx_release - releases a digital TV demux internal buffers. |
| 271 | * |
| 272 | * @demux: &struct dvb_demux to be released. |
| 273 | * |
| 274 | * The DVB core internally allocates data at @demux. This routine |
| 275 | * releases those data. Please notice that the struct itelf is not |
| 276 | * released, as it can be embedded on other structs. |
| 277 | */ |
| 278 | void dvb_dmx_release(struct dvb_demux *demux); |
| 279 | |
| 280 | /** |
| 281 | * dvb_dmx_swfilter_packets - use dvb software filter for a buffer with |
| 282 | * multiple MPEG-TS packets with 188 bytes each. |
| 283 | * |
| 284 | * @demux: pointer to &struct dvb_demux |
| 285 | * @buf: buffer with data to be filtered |
| 286 | * @count: number of MPEG-TS packets with size of 188. |
| 287 | * |
| 288 | * The routine will discard a DVB packet that don't start with 0x47. |
| 289 | * |
| 290 | * Use this routine if the DVB demux fills MPEG-TS buffers that are |
| 291 | * already aligned. |
| 292 | * |
| 293 | * NOTE: The @buf size should have size equal to ``count * 188``. |
| 294 | */ |
| 295 | void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf, |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 296 | size_t count); |
Mauro Carvalho Chehab | 6128a68 | 2017-09-20 09:08:20 -0400 | [diff] [blame] | 297 | |
| 298 | /** |
| 299 | * dvb_dmx_swfilter - use dvb software filter for a buffer with |
| 300 | * multiple MPEG-TS packets with 188 bytes each. |
| 301 | * |
| 302 | * @demux: pointer to &struct dvb_demux |
| 303 | * @buf: buffer with data to be filtered |
| 304 | * @count: number of MPEG-TS packets with size of 188. |
| 305 | * |
| 306 | * If a DVB packet doesn't start with 0x47, it will seek for the first |
| 307 | * byte that starts with 0x47. |
| 308 | * |
| 309 | * Use this routine if the DVB demux fill buffers that may not start with |
| 310 | * a packet start mark (0x47). |
| 311 | * |
| 312 | * NOTE: The @buf size should have size equal to ``count * 188``. |
| 313 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 314 | void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count); |
Mauro Carvalho Chehab | 6128a68 | 2017-09-20 09:08:20 -0400 | [diff] [blame] | 315 | |
| 316 | /** |
| 317 | * dvb_dmx_swfilter_204 - use dvb software filter for a buffer with |
| 318 | * multiple MPEG-TS packets with 204 bytes each. |
| 319 | * |
| 320 | * @demux: pointer to &struct dvb_demux |
| 321 | * @buf: buffer with data to be filtered |
| 322 | * @count: number of MPEG-TS packets with size of 204. |
| 323 | * |
| 324 | * If a DVB packet doesn't start with 0x47, it will seek for the first |
| 325 | * byte that starts with 0x47. |
| 326 | * |
| 327 | * Use this routine if the DVB demux fill buffers that may not start with |
| 328 | * a packet start mark (0x47). |
| 329 | * |
| 330 | * NOTE: The @buf size should have size equal to ``count * 204``. |
| 331 | */ |
Andreas Oberritter | dad4a73 | 2005-09-09 13:02:26 -0700 | [diff] [blame] | 332 | void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, |
| 333 | size_t count); |
Mauro Carvalho Chehab | 6128a68 | 2017-09-20 09:08:20 -0400 | [diff] [blame] | 334 | |
| 335 | /** |
| 336 | * dvb_dmx_swfilter_raw - make the raw data available to userspace without |
| 337 | * filtering |
| 338 | * |
| 339 | * @demux: pointer to &struct dvb_demux |
| 340 | * @buf: buffer with data |
| 341 | * @count: number of packets to be passed. The actual size of each packet |
| 342 | * depends on the &dvb_demux->feed->cb.ts logic. |
| 343 | * |
| 344 | * Use it if the driver needs to deliver the raw payload to userspace without |
| 345 | * passing through the kernel demux. That is meant to support some |
| 346 | * delivery systems that aren't based on MPEG-TS. |
| 347 | * |
| 348 | * This function relies on &dvb_demux->feed->cb.ts to actually handle the |
| 349 | * buffer. |
| 350 | */ |
Michael Krufky | 8e15670 | 2011-08-27 18:46:37 -0300 | [diff] [blame] | 351 | void dvb_dmx_swfilter_raw(struct dvb_demux *demux, const u8 *buf, |
| 352 | size_t count); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 353 | |
| 354 | #endif /* _DVB_DEMUX_H_ */ |