blob: 19face8545babd4fa8eaca35a22998201af45331 [file] [log] [blame]
Mauro Carvalho Chehabafd1a0c2005-12-12 00:37:27 -08001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * 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 *
Hamad Kadmanyd432f712013-01-17 17:36:17 +02008 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Hamad Kadmany32cb9822012-05-10 08:47:44 +03009 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public License
12 * as published by the Free Software Foundation; either version 2.1
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 *
24 */
25
26#ifndef _DVBDMX_H_
27#define _DVBDMX_H_
28
Jaswinder Singh Rajputc86629c2009-01-30 19:55:32 +053029#include <linux/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070030#ifdef __KERNEL__
31#include <linux/time.h>
32#else
33#include <time.h>
34#endif
35
36
37#define DMX_FILTER_SIZE 16
38
Hamad Kadmany4f877942012-07-15 15:06:01 +030039/* Min recording chunk upon which event is generated */
40#define DMX_REC_BUFF_CHUNK_MIN_SIZE (100*188)
41
Hamad Kadmany168203b2013-01-28 15:22:46 +020042#define DMX_MAX_DECODER_BUFFER_NUM (32)
Gilad Broner526e57e2012-12-03 15:57:44 +020043
Linus Torvalds1da177e2005-04-16 15:20:36 -070044typedef enum
45{
46 DMX_OUT_DECODER, /* Streaming directly to decoder. */
47 DMX_OUT_TAP, /* Output going to a memory buffer */
Mauro Carvalho Chehab674434c2005-12-12 00:37:28 -080048 /* (to be retrieved via the read command).*/
Peter Hartleyb01cd932008-04-22 14:45:36 -030049 DMX_OUT_TS_TAP, /* Output multiplexed into a new TS */
Mauro Carvalho Chehab674434c2005-12-12 00:37:28 -080050 /* (to be retrieved by reading from the */
51 /* logical DVR device). */
Peter Hartleyb01cd932008-04-22 14:45:36 -030052 DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
Linus Torvalds1da177e2005-04-16 15:20:36 -070053} dmx_output_t;
54
55
56typedef enum
57{
58 DMX_IN_FRONTEND, /* Input from a front-end device. */
59 DMX_IN_DVR /* Input from the logical DVR device. */
60} dmx_input_t;
61
62
63typedef enum
64{
Mauro Carvalho Chehabafd1a0c2005-12-12 00:37:27 -080065 DMX_PES_AUDIO0,
Linus Torvalds1da177e2005-04-16 15:20:36 -070066 DMX_PES_VIDEO0,
67 DMX_PES_TELETEXT0,
68 DMX_PES_SUBTITLE0,
69 DMX_PES_PCR0,
70
Mauro Carvalho Chehabafd1a0c2005-12-12 00:37:27 -080071 DMX_PES_AUDIO1,
Linus Torvalds1da177e2005-04-16 15:20:36 -070072 DMX_PES_VIDEO1,
73 DMX_PES_TELETEXT1,
74 DMX_PES_SUBTITLE1,
75 DMX_PES_PCR1,
76
Mauro Carvalho Chehabafd1a0c2005-12-12 00:37:27 -080077 DMX_PES_AUDIO2,
Linus Torvalds1da177e2005-04-16 15:20:36 -070078 DMX_PES_VIDEO2,
79 DMX_PES_TELETEXT2,
80 DMX_PES_SUBTITLE2,
81 DMX_PES_PCR2,
82
Mauro Carvalho Chehabafd1a0c2005-12-12 00:37:27 -080083 DMX_PES_AUDIO3,
Linus Torvalds1da177e2005-04-16 15:20:36 -070084 DMX_PES_VIDEO3,
85 DMX_PES_TELETEXT3,
86 DMX_PES_SUBTITLE3,
87 DMX_PES_PCR3,
88
89 DMX_PES_OTHER
90} dmx_pes_type_t;
91
92#define DMX_PES_AUDIO DMX_PES_AUDIO0
93#define DMX_PES_VIDEO DMX_PES_VIDEO0
94#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
95#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
96#define DMX_PES_PCR DMX_PES_PCR0
97
98
Linus Torvalds1da177e2005-04-16 15:20:36 -070099typedef struct dmx_filter
100{
101 __u8 filter[DMX_FILTER_SIZE];
102 __u8 mask[DMX_FILTER_SIZE];
103 __u8 mode[DMX_FILTER_SIZE];
104} dmx_filter_t;
105
106
Liron Kuchd4cc3b02012-05-17 16:31:58 +0300107/* Filter flags */
108#define DMX_CHECK_CRC 0x01
109#define DMX_ONESHOT 0x02
110#define DMX_IMMEDIATE_START 0x04
111#define DMX_ENABLE_INDEXING 0x08
112#define DMX_KERNEL_CLIENT 0x8000
113
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114struct dmx_sct_filter_params
115{
116 __u16 pid;
117 dmx_filter_t filter;
118 __u32 timeout;
119 __u32 flags;
Liron Kuchd4cc3b02012-05-17 16:31:58 +0300120};
121
122
123/* Indexing: supported video standards */
124enum dmx_indexing_video_standard {
125 DMX_INDEXING_MPEG2,
126 DMX_INDEXING_H264,
127 DMX_INDEXING_VC1
128};
129
130/* Indexing: Supported video profiles */
131enum dmx_indexing_video_profile {
132 DMX_INDEXING_MPEG2_ANY,
133 DMX_INDEXING_H264_ANY,
134 DMX_INDEXING_VC1_ANY
135};
136
137/* Indexing: video configuration parameters */
138struct dmx_indexing_video_params {
139 enum dmx_indexing_video_standard standard;
140 enum dmx_indexing_video_profile profile;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141};
142
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143struct dmx_pes_filter_params
144{
145 __u16 pid;
146 dmx_input_t input;
147 dmx_output_t output;
148 dmx_pes_type_t pes_type;
149 __u32 flags;
Liron Kuchd4cc3b02012-05-17 16:31:58 +0300150
Hamad Kadmany4f877942012-07-15 15:06:01 +0300151 /*
152 * The following configures when the event
153 * DMX_EVENT_NEW_REC_CHUNK will be triggered.
154 * When new recorded data is received with size
155 * equal or larger than this value a new event
Gilad Bronera81f42e2013-04-07 16:38:47 +0300156 * will be triggered. This is relevant when
Hamad Kadmany4f877942012-07-15 15:06:01 +0300157 * output is DMX_OUT_TS_TAP or DMX_OUT_TSDEMUX_TAP,
158 * size must be at least DMX_REC_BUFF_CHUNK_MIN_SIZE
159 * and smaller than buffer size.
160 */
161 __u32 rec_chunk_size;
162
Liron Kuchd4cc3b02012-05-17 16:31:58 +0300163 struct dmx_indexing_video_params video_params;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164};
165
Hamad Kadmany32cb9822012-05-10 08:47:44 +0300166struct dmx_buffer_status {
167 /* size of buffer in bytes */
168 unsigned int size;
169
170 /* fullness of buffer in bytes */
171 unsigned int fullness;
172
173 /*
174 * How many bytes are free
175 * It's the same as: size-fullness-1
176 */
177 unsigned int free_bytes;
178
179 /* read pointer offset in bytes */
180 unsigned int read_offset;
181
182 /* write pointer offset in bytes */
183 unsigned int write_offset;
184
185 /* non-zero if data error occured */
186 int error;
187};
188
Hamad Kadmany4f877942012-07-15 15:06:01 +0300189/* Events associated with each demux filter */
190enum dmx_event {
191 /* New PES packet is ready to be consumed */
Hamad Kadmanya0a00f52013-03-19 10:11:45 +0200192 DMX_EVENT_NEW_PES = 0x00000001,
Hamad Kadmany4f877942012-07-15 15:06:01 +0300193
194 /* New section is ready to be consumed */
Hamad Kadmanya0a00f52013-03-19 10:11:45 +0200195 DMX_EVENT_NEW_SECTION = 0x00000002,
Hamad Kadmany4f877942012-07-15 15:06:01 +0300196
197 /* New recording chunk is ready to be consumed */
Hamad Kadmanya0a00f52013-03-19 10:11:45 +0200198 DMX_EVENT_NEW_REC_CHUNK = 0x00000004,
Hamad Kadmany4f877942012-07-15 15:06:01 +0300199
200 /* New PCR value is ready */
Hamad Kadmanya0a00f52013-03-19 10:11:45 +0200201 DMX_EVENT_NEW_PCR = 0x00000008,
Hamad Kadmany4f877942012-07-15 15:06:01 +0300202
203 /* Overflow */
Hamad Kadmanya0a00f52013-03-19 10:11:45 +0200204 DMX_EVENT_BUFFER_OVERFLOW = 0x00000010,
Hamad Kadmany4f877942012-07-15 15:06:01 +0300205
206 /* Section was dropped due to CRC error */
Hamad Kadmanya0a00f52013-03-19 10:11:45 +0200207 DMX_EVENT_SECTION_CRC_ERROR = 0x00000020,
Hamad Kadmany4f877942012-07-15 15:06:01 +0300208
209 /* End-of-stream, no more data from this filter */
Hamad Kadmanya0a00f52013-03-19 10:11:45 +0200210 DMX_EVENT_EOS = 0x00000040,
Liron Kuch41543b72012-11-26 13:27:22 +0200211
212 /* New Elementary Stream data is ready */
Gilad Bronera81f42e2013-04-07 16:38:47 +0300213 DMX_EVENT_NEW_ES_DATA = 0x00000080,
214
215 /* Data markers */
216 DMX_EVENT_MARKER = 0x00000100
217};
218
219enum dmx_oob_cmd {
220 /* End-of-stream, no more data from this filter */
221 DMX_OOB_CMD_EOS,
222
223 /* Data markers */
224 DMX_OOB_CMD_MARKER,
Hamad Kadmany4f877942012-07-15 15:06:01 +0300225};
226
227/* Flags passed in filter events */
228
229/* Continuity counter error was detected */
230#define DMX_FILTER_CC_ERROR 0x01
231
232/* Discontinuity indicator was set */
Liron Kuch41543b72012-11-26 13:27:22 +0200233#define DMX_FILTER_DISCONTINUITY_INDICATOR 0x02
Hamad Kadmany4f877942012-07-15 15:06:01 +0300234
235/* PES legnth in PES header is not correct */
236#define DMX_FILTER_PES_LENGTH_ERROR 0x04
237
238
239/* PES info associated with DMX_EVENT_NEW_PES event */
240struct dmx_pes_event_info {
241 /* Offset at which PES information starts */
242 __u32 base_offset;
243
244 /*
245 * Start offset at which PES data
246 * from the stream starts.
247 * Equal to base_offset if PES data
248 * starts from the beginning.
249 */
250 __u32 start_offset;
251
252 /* Total length holding the PES information */
253 __u32 total_length;
254
255 /* Actual length holding the PES data */
256 __u32 actual_length;
257
258 /* Local receiver timestamp in 27MHz */
259 __u64 stc;
260
261 /* Flags passed in filter events */
262 __u32 flags;
Hamad Kadmanyd432f712013-01-17 17:36:17 +0200263
264 /*
265 * Number of TS packets with Transport Error Indicator (TEI)
266 * found while constructing the PES.
267 */
268 __u32 transport_error_indicator_counter;
269
270 /* Number of continuity errors found while constructing the PES */
271 __u32 continuity_error_counter;
272
273 /* Total number of TS packets holding the PES */
274 __u32 ts_packets_num;
Hamad Kadmany4f877942012-07-15 15:06:01 +0300275};
276
277/* Section info associated with DMX_EVENT_NEW_SECTION event */
278struct dmx_section_event_info {
279 /* Offset at which section information starts */
280 __u32 base_offset;
281
282 /*
283 * Start offset at which section data
284 * from the stream starts.
285 * Equal to base_offset if section data
286 * starts from the beginning.
287 */
288 __u32 start_offset;
289
290 /* Total length holding the section information */
291 __u32 total_length;
292
293 /* Actual length holding the section data */
294 __u32 actual_length;
295
296 /* Flags passed in filter events */
297 __u32 flags;
298};
299
300/* Recording info associated with DMX_EVENT_NEW_REC_CHUNK event */
301struct dmx_rec_chunk_event_info {
302 /* Offset at which recording chunk starts */
303 __u32 offset;
304
305 /* Size of recording chunk in bytes */
306 __u32 size;
307};
308
309/* PCR info associated with DMX_EVENT_NEW_PCR event */
310struct dmx_pcr_event_info {
311 /* Local timestamp in 27MHz
312 * when PCR packet was received
313 */
314 __u64 stc;
315
316 /* PCR value in 27MHz */
317 __u64 pcr;
318
319 /* Flags passed in filter events */
320 __u32 flags;
321};
322
323/*
Liron Kuch41543b72012-11-26 13:27:22 +0200324 * Elementary stream data information associated
325 * with DMX_EVENT_NEW_ES_DATA event
326 */
327struct dmx_es_data_event_info {
328 /* Buffer user-space handle */
329 int buf_handle;
330
331 /*
332 * Cookie to provide when releasing the buffer
333 * using the DMX_RELEASE_DECODER_BUFFER ioctl command
334 */
335 int cookie;
336
337 /* Offset of data from the beginning of the buffer */
338 __u32 offset;
339
340 /* Length of data in buffer (in bytes) */
341 __u32 data_len;
342
343 /* Indication whether PTS value is valid */
344 int pts_valid;
345
346 /* PTS value associated with the buffer */
347 __u64 pts;
348
349 /* Indication whether DTS value is valid */
350 int dts_valid;
351
352 /* DTS value associated with the buffer */
353 __u64 dts;
354
355 /*
356 * Number of TS packets with Transport Error Indicator (TEI) set
357 * in the TS packet header since last reported event
358 */
359 __u32 transport_error_indicator_counter;
360
361 /* Number of continuity errors since last reported event */
362 __u32 continuity_error_counter;
363
364 /* Total number of TS packets processed since last reported event */
365 __u32 ts_packets_num;
366
367 /*
368 * Number of dropped bytes due to insufficient buffer space,
369 * since last reported event
370 */
371 __u32 ts_dropped_bytes;
372};
373
Gilad Bronera81f42e2013-04-07 16:38:47 +0300374/* Marker details associated with DMX_EVENT_MARKER event */
375struct dmx_marker_event_info {
376 /* Marker id */
377 __u64 id;
378};
379
Liron Kuch41543b72012-11-26 13:27:22 +0200380/*
Hamad Kadmany4f877942012-07-15 15:06:01 +0300381 * Filter's event returned through DMX_GET_EVENT.
382 * poll with POLLPRI would block until events are available.
383 */
384struct dmx_filter_event {
385 enum dmx_event type;
386
387 union {
388 struct dmx_pes_event_info pes;
389 struct dmx_section_event_info section;
390 struct dmx_rec_chunk_event_info recording_chunk;
391 struct dmx_pcr_event_info pcr;
Liron Kuch41543b72012-11-26 13:27:22 +0200392 struct dmx_es_data_event_info es_data;
Gilad Bronera81f42e2013-04-07 16:38:47 +0300393 struct dmx_marker_event_info marker;
Hamad Kadmany4f877942012-07-15 15:06:01 +0300394 } params;
395};
396
Hamad Kadmanyec6202d2012-09-20 07:58:57 +0300397/* Filter's buffer requirement returned in dmx_caps */
398struct dmx_buffer_requirement {
399 /* Buffer size alignment, 0 means no special requirement */
400 __u32 size_alignment;
401
402 /* Maximum buffer size allowed */
403 __u32 max_size;
Gilad Broner526e57e2012-12-03 15:57:44 +0200404
405 /* Maximum number of linear buffers handled by demux */
406 __u32 max_buffer_num;
407
408 /* Feature support bitmap as detailed below */
Hamad Kadmanyec6202d2012-09-20 07:58:57 +0300409 __u32 flags;
410
Gilad Broner526e57e2012-12-03 15:57:44 +0200411/* Buffer must be allocated as physically contiguous memory */
412#define DMX_BUFFER_CONTIGUOUS_MEM 0x1
Hamad Kadmanyec6202d2012-09-20 07:58:57 +0300413
414/* If the filter's data is decrypted, the buffer should be secured one */
415#define DMX_BUFFER_SECURED_IF_DECRYPTED 0x2
Gilad Broner526e57e2012-12-03 15:57:44 +0200416
417/* Buffer can be allocated externally */
418#define DMX_BUFFER_EXTERNAL_SUPPORT 0x4
419
420/* Buffer can be allocated internally */
421#define DMX_BUFFER_INTERNAL_SUPPORT 0x8
422
423/* Filter output can be output to a linear buffer group */
424#define DMX_BUFFER_LINEAR_GROUP_SUPPORT 0x10
Hamad Kadmanyec6202d2012-09-20 07:58:57 +0300425};
426
Gilad Bronera81f42e2013-04-07 16:38:47 +0300427/* Out-of-band (OOB) command */
428struct dmx_oob_command {
429 enum dmx_oob_cmd type;
430
431 union {
432 struct dmx_marker_event_info marker;
433 } params;
434};
435
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436typedef struct dmx_caps {
437 __u32 caps;
Hamad Kadmanyd2c325e2012-05-28 13:52:49 +0300438
439/* Indicates whether demux support playback from memory in pull mode */
440#define DMX_CAP_PULL_MODE 0x01
441
442/* Indicates whether demux support indexing of recorded video stream */
443#define DMX_CAP_VIDEO_INDEXING 0x02
444
445/* Indicates whether demux support sending data directly to video decoder */
446#define DMX_CAP_VIDEO_DECODER_DATA 0x04
447
448/* Indicates whether demux support sending data directly to audio decoder */
449#define DMX_CAP_AUDIO_DECODER_DATA 0x08
450
451/* Indicates whether demux support sending data directly to subtitle decoder */
452#define DMX_CAP_SUBTITLE_DECODER_DATA 0x10
453
454 /* Number of decoders demux can output data to */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455 int num_decoders;
Hamad Kadmanyd2c325e2012-05-28 13:52:49 +0300456
457 /* Number of demux devices */
458 int num_demux_devices;
459
460 /* Max number of PID filters */
461 int num_pid_filters;
462
463 /* Max number of section filters */
464 int num_section_filters;
465
466 /*
467 * Max number of section filters using same PID,
468 * 0 if not supported
469 */
470 int num_section_filters_per_pid;
471
472 /*
473 * Length of section filter, not including section
474 * length field (2 bytes).
475 */
476 int section_filter_length;
477
478 /* Max number of demod based input */
479 int num_demod_inputs;
480
481 /* Max number of memory based input */
482 int num_memory_inputs;
483
484 /* Overall bitrate from all inputs concurrently. Mbit/sec */
485 int max_bitrate;
486
487 /* Max bitrate from single demod input. Mbit/sec */
488 int demod_input_max_bitrate;
489
490 /* Max bitrate from single memory input. Mbit/sec */
491 int memory_input_max_bitrate;
Hamad Kadmanyec6202d2012-09-20 07:58:57 +0300492
493 struct dmx_buffer_requirement section;
494
495 /* For PES not sent to decoder */
496 struct dmx_buffer_requirement pes;
497
Gilad Broner526e57e2012-12-03 15:57:44 +0200498 /* For PES sent to decoder */
499 struct dmx_buffer_requirement decoder;
500
Hamad Kadmanyec6202d2012-09-20 07:58:57 +0300501 /* Recording buffer for recording of 188 bytes packets */
502 struct dmx_buffer_requirement recording_188_tsp;
503
504 /* Recording buffer for recording of 192 bytes packets */
505 struct dmx_buffer_requirement recording_192_tsp;
506
507 /* DVR input buffer for playback of 188 bytes packets */
508 struct dmx_buffer_requirement playback_188_tsp;
509
510 /* DVR input buffer for playback of 192 bytes packets */
511 struct dmx_buffer_requirement playback_192_tsp;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512} dmx_caps_t;
513
514typedef enum {
515 DMX_SOURCE_FRONT0 = 0,
516 DMX_SOURCE_FRONT1,
517 DMX_SOURCE_FRONT2,
518 DMX_SOURCE_FRONT3,
519 DMX_SOURCE_DVR0 = 16,
520 DMX_SOURCE_DVR1,
521 DMX_SOURCE_DVR2,
522 DMX_SOURCE_DVR3
523} dmx_source_t;
524
Hamad Kadmany32cb9822012-05-10 08:47:44 +0300525enum dmx_tsp_format_t {
526 DMX_TSP_FORMAT_188 = 0,
527 DMX_TSP_FORMAT_192_TAIL,
528 DMX_TSP_FORMAT_192_HEAD,
529 DMX_TSP_FORMAT_204,
530};
531
532enum dmx_playback_mode_t {
533 /*
534 * In push mode, if one of output buffers
535 * is full, the buffer would overflow
536 * and demux continue processing incoming stream.
537 * This is the default mode. When playing from frontend,
538 * this is the only mode that is allowed.
539 */
540 DMX_PB_MODE_PUSH = 0,
541
542 /*
543 * In pull mode, if one of output buffers
544 * is full, demux stalls waiting for free space,
545 * this would cause DVR input buffer fullness
546 * to accumulate.
547 * This mode is possible only when playing
548 * from DVR.
549 */
550 DMX_PB_MODE_PULL,
551};
552
Linus Torvalds1da177e2005-04-16 15:20:36 -0700553struct dmx_stc {
Gilad Broner526e57e2012-12-03 15:57:44 +0200554 unsigned int num; /* input : which STC? 0..N */
555 unsigned int base; /* output: divisor for stc to get 90 kHz clock */
556 __u64 stc; /* output: stc in 'base'*90 kHz units */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700557};
558
Hamad Kadmanyec6202d2012-09-20 07:58:57 +0300559enum dmx_buffer_mode {
560 /*
561 * demux buffers are allocated internally
562 * by the demux driver. This is the default mode.
563 * DMX_SET_BUFFER_SIZE can be used to set the size of
564 * this buffer.
565 */
566 DMX_BUFFER_MODE_INTERNAL,
567
568 /*
569 * demux buffers are allocated externally and provided
570 * to demux through DMX_SET_BUFFER.
571 * When this mode is used DMX_SET_BUFFER_SIZE and
572 * mmap are prohibited.
573 */
574 DMX_BUFFER_MODE_EXTERNAL,
575};
576
577struct dmx_buffer {
578 unsigned int size;
579 int handle;
580};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700581
Gilad Broner526e57e2012-12-03 15:57:44 +0200582struct dmx_decoder_buffers {
583 /*
584 * Specify if linear buffer support is requested. If set, buffers_num
585 * must be greater than 1
586 */
587 int is_linear;
588
589 /*
590 * Specify number of external buffers allocated by user.
591 * If set to 0 means internal buffer allocation is requested
592 */
593 __u32 buffers_num;
594
595 /* Specify buffer size, either external or internal */
596 __u32 buffers_size;
597
598 /* Array of externally allocated buffer handles */
599 int handles[DMX_MAX_DECODER_BUFFER_NUM];
600};
601
Hamad Kadmany168203b2013-01-28 15:22:46 +0200602struct dmx_secure_mode {
603 /*
604 * Specifies whether secure mode should be set or not for the filter's
605 * pid. Note that DMX_OUT_TSDEMUX_TAP filters can have more than 1 pid
606 */
607 int is_secured;
608
609 /* PID to associate with key ladder id */
610 __u16 pid;
611
612 /* key ladder information to associate with the specified pid */
613 __u32 key_ladder_id;
614};
615
Hamad Kadmanya0a00f52013-03-19 10:11:45 +0200616struct dmx_events_mask {
617 /*
618 * Bitmask of events to be disabled (dmx_event).
619 * Disabled events will not be notified to the user.
620 * By default all events are enabled except for
621 * DMX_EVENT_NEW_ES_DATA.
622 * Overflow event can't be disabled.
623 */
624 __u32 disable_mask;
625
626 /*
627 * Bitmask of events that will not wake-up the user
628 * when user calls poll with POLLPRI flag.
629 * Events that are used as wake-up source should not be
630 * disabled in disable_mask or they would not be used
631 * as a wake-up source.
632 * By default all enabled events are set as wake-up events.
633 * Overflow event can't be disabled as a wake-up source.
634 */
635 __u32 no_wakeup_mask;
636
637 /*
638 * Number of ready wake-up events which will trigger
639 * a wake-up when user calls poll with POLLPRI flag.
640 * Default is set to 1.
641 */
642 __u32 wakeup_threshold;
643};
644
Linus Torvalds1da177e2005-04-16 15:20:36 -0700645#define DMX_START _IO('o', 41)
646#define DMX_STOP _IO('o', 42)
647#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
648#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
649#define DMX_SET_BUFFER_SIZE _IO('o', 45)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700650#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
651#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
652#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
653#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
Andreas Oberritter1cb662a2009-07-14 20:28:50 -0300654#define DMX_ADD_PID _IOW('o', 51, __u16)
655#define DMX_REMOVE_PID _IOW('o', 52, __u16)
Hamad Kadmany32cb9822012-05-10 08:47:44 +0300656#define DMX_SET_TS_PACKET_FORMAT _IOW('o', 53, enum dmx_tsp_format_t)
657#define DMX_SET_TS_OUT_FORMAT _IOW('o', 54, enum dmx_tsp_format_t)
658#define DMX_SET_DECODER_BUFFER_SIZE _IO('o', 55)
659#define DMX_GET_BUFFER_STATUS _IOR('o', 56, struct dmx_buffer_status)
660#define DMX_RELEASE_DATA _IO('o', 57)
661#define DMX_FEED_DATA _IO('o', 58)
662#define DMX_SET_PLAYBACK_MODE _IOW('o', 59, enum dmx_playback_mode_t)
Liron Kuch41543b72012-11-26 13:27:22 +0200663#define DMX_GET_EVENT _IOR('o', 60, struct dmx_filter_event)
664#define DMX_SET_BUFFER_MODE _IOW('o', 61, enum dmx_buffer_mode)
665#define DMX_SET_BUFFER _IOW('o', 62, struct dmx_buffer)
Gilad Broner526e57e2012-12-03 15:57:44 +0200666#define DMX_SET_DECODER_BUFFER _IOW('o', 63, struct dmx_decoder_buffers)
Liron Kuch41543b72012-11-26 13:27:22 +0200667#define DMX_REUSE_DECODER_BUFFER _IO('o', 64)
Hamad Kadmany168203b2013-01-28 15:22:46 +0200668#define DMX_SET_SECURE_MODE _IOW('o', 65, struct dmx_secure_mode)
Hamad Kadmanya0a00f52013-03-19 10:11:45 +0200669#define DMX_SET_EVENTS_MASK _IOW('o', 66, struct dmx_events_mask)
670#define DMX_GET_EVENTS_MASK _IOR('o', 67, struct dmx_events_mask)
Gilad Bronera81f42e2013-04-07 16:38:47 +0300671#define DMX_PUSH_OOB_COMMAND _IOW('o', 68, struct dmx_oob_command)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700672
673#endif /*_DVBDMX_H_*/