blob: 14335f2d2e3b17657a87b18d8be523fa133252d9 [file] [log] [blame]
Markus Heiser5377d912016-06-30 15:18:56 +02001.. -*- coding: utf-8; mode: rst -*-
2
3.. _dmx_fcalls:
4
5********************
6Demux Function Calls
7********************
8
9
10.. _dmx_fopen:
11
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -030012DVB demux open()
13================
Markus Heiser5377d912016-06-30 15:18:56 +020014
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -030015Description
16-----------
Markus Heiser5377d912016-06-30 15:18:56 +020017
18This system call, used with a device name of /dev/dvb/adapter0/demux0,
19allocates a new filter and returns a handle which can be used for
20subsequent control of that filter. This call has to be made for each
21filter to be used, i.e. every returned file descriptor is a reference to
22a single filter. /dev/dvb/adapter0/dvr0 is a logical device to be used
23for retrieving Transport Streams for digital video recording. When
24reading from this device a transport stream containing the packets from
25all PES filters set in the corresponding demux device
26(/dev/dvb/adapter0/demux0) having the output set to DMX_OUT_TS_TAP. A
27recorded Transport Stream is replayed by writing to this device.
28
29The significance of blocking or non-blocking mode is described in the
30documentation for functions where there is a difference. It does not
31affect the semantics of the open() call itself. A device opened in
32blocking mode can later be put into non-blocking mode (and vice versa)
33using the F_SETFL command of the fcntl system call.
34
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -030035Synopsis
36--------
Markus Heiser5377d912016-06-30 15:18:56 +020037
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -030038.. c:function:: int open(const char *deviceName, int flags)
Markus Heiser5377d912016-06-30 15:18:56 +020039
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -030040Arguments
41----------
Markus Heiser5377d912016-06-30 15:18:56 +020042
43
44
45.. flat-table::
46 :header-rows: 0
47 :stub-columns: 0
48
49
50 - .. row 1
51
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -030052 - const char \*deviceName
Markus Heiser5377d912016-06-30 15:18:56 +020053
54 - Name of demux device.
55
56 - .. row 2
57
58 - int flags
59
60 - A bit-wise OR of the following flags:
61
62 - .. row 3
63
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030064 -
Markus Heiser5377d912016-06-30 15:18:56 +020065 - O_RDWR read/write access
66
67 - .. row 4
68
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030069 -
Markus Heiser5377d912016-06-30 15:18:56 +020070 - O_NONBLOCK open in non-blocking mode
71
72 - .. row 5
73
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030074 -
Markus Heiser5377d912016-06-30 15:18:56 +020075 - (blocking mode is the default)
76
77
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -030078Return Value
79------------
Markus Heiser5377d912016-06-30 15:18:56 +020080
81
82
83.. flat-table::
84 :header-rows: 0
85 :stub-columns: 0
86
87
88 - .. row 1
89
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030090 - ``ENODEV``
Markus Heiser5377d912016-06-30 15:18:56 +020091
92 - Device driver not loaded/available.
93
94 - .. row 2
95
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030096 - ``EINVAL``
Markus Heiser5377d912016-06-30 15:18:56 +020097
98 - Invalid argument.
99
100 - .. row 3
101
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300102 - ``EMFILE``
Markus Heiser5377d912016-06-30 15:18:56 +0200103
104 - Too many open files”, i.e. no more filters available.
105
106 - .. row 4
107
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300108 - ``ENOMEM``
Markus Heiser5377d912016-06-30 15:18:56 +0200109
110 - The driver failed to allocate enough memory.
111
112
113
114.. _dmx_fclose:
115
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300116DVB demux close()
117=================
Markus Heiser5377d912016-06-30 15:18:56 +0200118
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300119Description
120-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200121
122This system call deactivates and deallocates a filter that was
123previously allocated via the open() call.
124
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300125Synopsis
126--------
Markus Heiser5377d912016-06-30 15:18:56 +0200127
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300128.. c:function:: int close(int fd)
Markus Heiser5377d912016-06-30 15:18:56 +0200129
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300130Arguments
131----------
Markus Heiser5377d912016-06-30 15:18:56 +0200132
133
134
135.. flat-table::
136 :header-rows: 0
137 :stub-columns: 0
138
139
140 - .. row 1
141
142 - int fd
143
144 - File descriptor returned by a previous call to open().
145
146
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300147Return Value
148------------
Markus Heiser5377d912016-06-30 15:18:56 +0200149
150
151
152.. flat-table::
153 :header-rows: 0
154 :stub-columns: 0
155
156
157 - .. row 1
158
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300159 - ``EBADF``
Markus Heiser5377d912016-06-30 15:18:56 +0200160
161 - fd is not a valid open file descriptor.
162
163
164
165.. _dmx_fread:
166
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300167DVB demux read()
168================
Markus Heiser5377d912016-06-30 15:18:56 +0200169
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300170Description
171-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200172
173This system call returns filtered data, which might be section or PES
174data. The filtered data is transferred from the drivers internal
175circular buffer to buf. The maximum amount of data to be transferred is
176implied by count.
177
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300178Synopsis
179--------
Markus Heiser5377d912016-06-30 15:18:56 +0200180
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300181.. c:function:: size_t read(int fd, void *buf, size_t count)
Markus Heiser5377d912016-06-30 15:18:56 +0200182
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300183Arguments
184----------
Markus Heiser5377d912016-06-30 15:18:56 +0200185
186
187
188.. flat-table::
189 :header-rows: 0
190 :stub-columns: 0
191
192
193 - .. row 1
194
195 - int fd
196
197 - File descriptor returned by a previous call to open().
198
199 - .. row 2
200
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300201 - void \*buf
Markus Heiser5377d912016-06-30 15:18:56 +0200202
203 - Pointer to the buffer to be used for returned filtered data.
204
205 - .. row 3
206
207 - size_t count
208
209 - Size of buf.
210
211
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300212Return Value
213------------
Markus Heiser5377d912016-06-30 15:18:56 +0200214
215
216
217.. flat-table::
218 :header-rows: 0
219 :stub-columns: 0
220
221
222 - .. row 1
223
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300224 - ``EWOULDBLOCK``
Markus Heiser5377d912016-06-30 15:18:56 +0200225
226 - No data to return and O_NONBLOCK was specified.
227
228 - .. row 2
229
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300230 - ``EBADF``
Markus Heiser5377d912016-06-30 15:18:56 +0200231
232 - fd is not a valid open file descriptor.
233
234 - .. row 3
235
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300236 - ``ECRC``
Markus Heiser5377d912016-06-30 15:18:56 +0200237
238 - Last section had a CRC error - no data returned. The buffer is
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300239 flushed.
Markus Heiser5377d912016-06-30 15:18:56 +0200240
241 - .. row 4
242
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300243 - ``EOVERFLOW``
Markus Heiser5377d912016-06-30 15:18:56 +0200244
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300245 -
Markus Heiser5377d912016-06-30 15:18:56 +0200246
247 - .. row 5
248
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300249 -
Markus Heiser5377d912016-06-30 15:18:56 +0200250 - The filtered data was not read from the buffer in due time,
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300251 resulting in non-read data being lost. The buffer is flushed.
Markus Heiser5377d912016-06-30 15:18:56 +0200252
253 - .. row 6
254
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300255 - ``ETIMEDOUT``
Markus Heiser5377d912016-06-30 15:18:56 +0200256
257 - The section was not loaded within the stated timeout period. See
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300258 ioctl DMX_SET_FILTER for how to set a timeout.
Markus Heiser5377d912016-06-30 15:18:56 +0200259
260 - .. row 7
261
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300262 - ``EFAULT``
Markus Heiser5377d912016-06-30 15:18:56 +0200263
264 - The driver failed to write to the callers buffer due to an invalid
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300265 \*buf pointer.
Markus Heiser5377d912016-06-30 15:18:56 +0200266
267
268
269.. _dmx_fwrite:
270
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300271DVB demux write()
272=================
Markus Heiser5377d912016-06-30 15:18:56 +0200273
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300274Description
275-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200276
277This system call is only provided by the logical device
278/dev/dvb/adapter0/dvr0, associated with the physical demux device that
279provides the actual DVR functionality. It is used for replay of a
280digitally recorded Transport Stream. Matching filters have to be defined
281in the corresponding physical demux device, /dev/dvb/adapter0/demux0.
282The amount of data to be transferred is implied by count.
283
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300284Synopsis
285--------
Markus Heiser5377d912016-06-30 15:18:56 +0200286
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300287.. c:function:: ssize_t write(int fd, const void *buf, size_t count)
Markus Heiser5377d912016-06-30 15:18:56 +0200288
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300289Arguments
290----------
Markus Heiser5377d912016-06-30 15:18:56 +0200291
292
293
294.. flat-table::
295 :header-rows: 0
296 :stub-columns: 0
297
298
299 - .. row 1
300
301 - int fd
302
303 - File descriptor returned by a previous call to open().
304
305 - .. row 2
306
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300307 - void \*buf
Markus Heiser5377d912016-06-30 15:18:56 +0200308
309 - Pointer to the buffer containing the Transport Stream.
310
311 - .. row 3
312
313 - size_t count
314
315 - Size of buf.
316
317
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300318Return Value
319------------
Markus Heiser5377d912016-06-30 15:18:56 +0200320
321
322
323.. flat-table::
324 :header-rows: 0
325 :stub-columns: 0
326
327
328 - .. row 1
329
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300330 - ``EWOULDBLOCK``
Markus Heiser5377d912016-06-30 15:18:56 +0200331
332 - No data was written. This might happen if O_NONBLOCK was
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300333 specified and there is no more buffer space available (if
334 O_NONBLOCK is not specified the function will block until buffer
335 space is available).
Markus Heiser5377d912016-06-30 15:18:56 +0200336
337 - .. row 2
338
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300339 - ``EBUSY``
Markus Heiser5377d912016-06-30 15:18:56 +0200340
341 - This error code indicates that there are conflicting requests. The
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300342 corresponding demux device is setup to receive data from the
343 front- end. Make sure that these filters are stopped and that the
344 filters with input set to DMX_IN_DVR are started.
Markus Heiser5377d912016-06-30 15:18:56 +0200345
346 - .. row 3
347
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300348 - ``EBADF``
Markus Heiser5377d912016-06-30 15:18:56 +0200349
350 - fd is not a valid open file descriptor.
351
352
353
354.. _DMX_START:
355
356DMX_START
357=========
358
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300359Description
360-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200361
362This ioctl call is used to start the actual filtering operation defined
363via the ioctl calls DMX_SET_FILTER or DMX_SET_PES_FILTER.
364
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300365Synopsis
366--------
Markus Heiser5377d912016-06-30 15:18:56 +0200367
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300368.. c:function:: int ioctl( int fd, int request = DMX_START)
Markus Heiser5377d912016-06-30 15:18:56 +0200369
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300370Arguments
371----------
Markus Heiser5377d912016-06-30 15:18:56 +0200372
373
374
375.. flat-table::
376 :header-rows: 0
377 :stub-columns: 0
378
379
380 - .. row 1
381
382 - int fd
383
384 - File descriptor returned by a previous call to open().
385
386 - .. row 2
387
388 - int request
389
390 - Equals DMX_START for this command.
391
392
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300393Return Value
394------------
Markus Heiser5377d912016-06-30 15:18:56 +0200395
396On success 0 is returned, on error -1 and the ``errno`` variable is set
397appropriately. The generic error codes are described at the
398:ref:`Generic Error Codes <gen-errors>` chapter.
399
400
401
402.. flat-table::
403 :header-rows: 0
404 :stub-columns: 0
405
406
407 - .. row 1
408
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300409 - ``EINVAL``
Markus Heiser5377d912016-06-30 15:18:56 +0200410
411 - Invalid argument, i.e. no filtering parameters provided via the
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300412 DMX_SET_FILTER or DMX_SET_PES_FILTER functions.
Markus Heiser5377d912016-06-30 15:18:56 +0200413
414 - .. row 2
415
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300416 - ``EBUSY``
Markus Heiser5377d912016-06-30 15:18:56 +0200417
418 - This error code indicates that there are conflicting requests.
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300419 There are active filters filtering data from another input source.
420 Make sure that these filters are stopped before starting this
421 filter.
Markus Heiser5377d912016-06-30 15:18:56 +0200422
423
424
425.. _DMX_STOP:
426
427DMX_STOP
428========
429
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300430Description
431-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200432
433This ioctl call is used to stop the actual filtering operation defined
434via the ioctl calls DMX_SET_FILTER or DMX_SET_PES_FILTER and
435started via the DMX_START command.
436
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300437Synopsis
438--------
Markus Heiser5377d912016-06-30 15:18:56 +0200439
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300440.. c:function:: int ioctl( int fd, int request = DMX_STOP)
Markus Heiser5377d912016-06-30 15:18:56 +0200441
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300442Arguments
443----------
Markus Heiser5377d912016-06-30 15:18:56 +0200444
445
446
447.. flat-table::
448 :header-rows: 0
449 :stub-columns: 0
450
451
452 - .. row 1
453
454 - int fd
455
456 - File descriptor returned by a previous call to open().
457
458 - .. row 2
459
460 - int request
461
462 - Equals DMX_STOP for this command.
463
464
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300465Return Value
466------------
Markus Heiser5377d912016-06-30 15:18:56 +0200467
468On success 0 is returned, on error -1 and the ``errno`` variable is set
469appropriately. The generic error codes are described at the
470:ref:`Generic Error Codes <gen-errors>` chapter.
471
472
473.. _DMX_SET_FILTER:
474
475DMX_SET_FILTER
476==============
477
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300478Description
479-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200480
481This ioctl call sets up a filter according to the filter and mask
482parameters provided. A timeout may be defined stating number of seconds
483to wait for a section to be loaded. A value of 0 means that no timeout
484should be applied. Finally there is a flag field where it is possible to
485state whether a section should be CRC-checked, whether the filter should
486be a one-shot filter, i.e. if the filtering operation should be
487stopped after the first section is received, and whether the filtering
488operation should be started immediately (without waiting for a
489DMX_START ioctl call). If a filter was previously set-up, this filter
490will be canceled, and the receive buffer will be flushed.
491
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300492Synopsis
493--------
Markus Heiser5377d912016-06-30 15:18:56 +0200494
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300495.. c:function:: int ioctl( int fd, int request = DMX_SET_FILTER, struct dmx_sct_filter_params *params)
Markus Heiser5377d912016-06-30 15:18:56 +0200496
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300497Arguments
498----------
Markus Heiser5377d912016-06-30 15:18:56 +0200499
500
501
502.. flat-table::
503 :header-rows: 0
504 :stub-columns: 0
505
506
507 - .. row 1
508
509 - int fd
510
511 - File descriptor returned by a previous call to open().
512
513 - .. row 2
514
515 - int request
516
517 - Equals DMX_SET_FILTER for this command.
518
519 - .. row 3
520
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300521 - struct dmx_sct_filter_params \*params
Markus Heiser5377d912016-06-30 15:18:56 +0200522
523 - Pointer to structure containing filter parameters.
524
525
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300526Return Value
527------------
Markus Heiser5377d912016-06-30 15:18:56 +0200528
529On success 0 is returned, on error -1 and the ``errno`` variable is set
530appropriately. The generic error codes are described at the
531:ref:`Generic Error Codes <gen-errors>` chapter.
532
533
534.. _DMX_SET_PES_FILTER:
535
536DMX_SET_PES_FILTER
537==================
538
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300539Description
540-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200541
542This ioctl call sets up a PES filter according to the parameters
543provided. By a PES filter is meant a filter that is based just on the
544packet identifier (PID), i.e. no PES header or payload filtering
545capability is supported.
546
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300547Synopsis
548--------
Markus Heiser5377d912016-06-30 15:18:56 +0200549
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300550.. c:function:: int ioctl( int fd, int request = DMX_SET_PES_FILTER, struct dmx_pes_filter_params *params)
Markus Heiser5377d912016-06-30 15:18:56 +0200551
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300552Arguments
553----------
Markus Heiser5377d912016-06-30 15:18:56 +0200554
555
556
557.. flat-table::
558 :header-rows: 0
559 :stub-columns: 0
560
561
562 - .. row 1
563
564 - int fd
565
566 - File descriptor returned by a previous call to open().
567
568 - .. row 2
569
570 - int request
571
572 - Equals DMX_SET_PES_FILTER for this command.
573
574 - .. row 3
575
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300576 - struct dmx_pes_filter_params \*params
Markus Heiser5377d912016-06-30 15:18:56 +0200577
578 - Pointer to structure containing filter parameters.
579
580
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300581Return Value
582------------
Markus Heiser5377d912016-06-30 15:18:56 +0200583
584On success 0 is returned, on error -1 and the ``errno`` variable is set
585appropriately. The generic error codes are described at the
586:ref:`Generic Error Codes <gen-errors>` chapter.
587
588
589
590.. flat-table::
591 :header-rows: 0
592 :stub-columns: 0
593
594
595 - .. row 1
596
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300597 - ``EBUSY``
Markus Heiser5377d912016-06-30 15:18:56 +0200598
599 - This error code indicates that there are conflicting requests.
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300600 There are active filters filtering data from another input source.
601 Make sure that these filters are stopped before starting this
602 filter.
Markus Heiser5377d912016-06-30 15:18:56 +0200603
604
605
606.. _DMX_SET_BUFFER_SIZE:
607
608DMX_SET_BUFFER_SIZE
609===================
610
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300611Description
612-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200613
614This ioctl call is used to set the size of the circular buffer used for
615filtered data. The default size is two maximum sized sections, i.e. if
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300616this function is not called a buffer size of 2 \* 4096 bytes will be
Markus Heiser5377d912016-06-30 15:18:56 +0200617used.
618
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300619Synopsis
620--------
Markus Heiser5377d912016-06-30 15:18:56 +0200621
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300622.. c:function:: int ioctl( int fd, int request = DMX_SET_BUFFER_SIZE, unsigned long size)
Markus Heiser5377d912016-06-30 15:18:56 +0200623
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300624Arguments
625----------
Markus Heiser5377d912016-06-30 15:18:56 +0200626
627
628
629.. flat-table::
630 :header-rows: 0
631 :stub-columns: 0
632
633
634 - .. row 1
635
636 - int fd
637
638 - File descriptor returned by a previous call to open().
639
640 - .. row 2
641
642 - int request
643
644 - Equals DMX_SET_BUFFER_SIZE for this command.
645
646 - .. row 3
647
648 - unsigned long size
649
650 - Size of circular buffer.
651
652
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300653Return Value
654------------
Markus Heiser5377d912016-06-30 15:18:56 +0200655
656On success 0 is returned, on error -1 and the ``errno`` variable is set
657appropriately. The generic error codes are described at the
658:ref:`Generic Error Codes <gen-errors>` chapter.
659
660
661.. _DMX_GET_EVENT:
662
663DMX_GET_EVENT
664=============
665
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300666Description
667-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200668
669This ioctl call returns an event if available. If an event is not
670available, the behavior depends on whether the device is in blocking or
671non-blocking mode. In the latter case, the call fails immediately with
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300672errno set to ``EWOULDBLOCK``. In the former case, the call blocks until an
Markus Heiser5377d912016-06-30 15:18:56 +0200673event becomes available.
674
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300675Synopsis
676--------
Markus Heiser5377d912016-06-30 15:18:56 +0200677
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300678.. c:function:: int ioctl( int fd, int request = DMX_GET_EVENT, struct dmx_event *ev)
Markus Heiser5377d912016-06-30 15:18:56 +0200679
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300680Arguments
681----------
Markus Heiser5377d912016-06-30 15:18:56 +0200682
683
684
685.. flat-table::
686 :header-rows: 0
687 :stub-columns: 0
688
689
690 - .. row 1
691
692 - int fd
693
694 - File descriptor returned by a previous call to open().
695
696 - .. row 2
697
698 - int request
699
700 - Equals DMX_GET_EVENT for this command.
701
702 - .. row 3
703
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300704 - struct dmx_event \*ev
Markus Heiser5377d912016-06-30 15:18:56 +0200705
706 - Pointer to the location where the event is to be stored.
707
708
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300709Return Value
710------------
Markus Heiser5377d912016-06-30 15:18:56 +0200711
712On success 0 is returned, on error -1 and the ``errno`` variable is set
713appropriately. The generic error codes are described at the
714:ref:`Generic Error Codes <gen-errors>` chapter.
715
716
717
718.. flat-table::
719 :header-rows: 0
720 :stub-columns: 0
721
722
723 - .. row 1
724
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300725 - ``EWOULDBLOCK``
Markus Heiser5377d912016-06-30 15:18:56 +0200726
727 - There is no event pending, and the device is in non-blocking mode.
728
729
730
731.. _DMX_GET_STC:
732
733DMX_GET_STC
734===========
735
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300736Description
737-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200738
739This ioctl call returns the current value of the system time counter
740(which is driven by a PES filter of type DMX_PES_PCR). Some hardware
741supports more than one STC, so you must specify which one by setting the
742num field of stc before the ioctl (range 0...n). The result is returned
743in form of a ratio with a 64 bit numerator and a 32 bit denominator, so
744the real 90kHz STC value is stc->stc / stc->base .
745
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300746Synopsis
747--------
Markus Heiser5377d912016-06-30 15:18:56 +0200748
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300749.. c:function:: int ioctl( int fd, int request = DMX_GET_STC, struct dmx_stc *stc)
Markus Heiser5377d912016-06-30 15:18:56 +0200750
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300751Arguments
752----------
Markus Heiser5377d912016-06-30 15:18:56 +0200753
754
755
756.. flat-table::
757 :header-rows: 0
758 :stub-columns: 0
759
760
761 - .. row 1
762
763 - int fd
764
765 - File descriptor returned by a previous call to open().
766
767 - .. row 2
768
769 - int request
770
771 - Equals DMX_GET_STC for this command.
772
773 - .. row 3
774
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300775 - struct dmx_stc \*stc
Markus Heiser5377d912016-06-30 15:18:56 +0200776
777 - Pointer to the location where the stc is to be stored.
778
779
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300780Return Value
781------------
Markus Heiser5377d912016-06-30 15:18:56 +0200782
783On success 0 is returned, on error -1 and the ``errno`` variable is set
784appropriately. The generic error codes are described at the
785:ref:`Generic Error Codes <gen-errors>` chapter.
786
787
788
789.. flat-table::
790 :header-rows: 0
791 :stub-columns: 0
792
793
794 - .. row 1
795
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -0300796 - ``EINVAL``
Markus Heiser5377d912016-06-30 15:18:56 +0200797
798 - Invalid stc number.
799
800
801
802.. _DMX_GET_PES_PIDS:
803
804DMX_GET_PES_PIDS
805================
806
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300807Description
808-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200809
810This ioctl is undocumented. Documentation is welcome.
811
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300812Synopsis
813--------
Markus Heiser5377d912016-06-30 15:18:56 +0200814
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300815.. c:function:: int ioctl(fd, int request = DMX_GET_PES_PIDS, __u16[5])
Markus Heiser5377d912016-06-30 15:18:56 +0200816
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300817Arguments
818----------
Markus Heiser5377d912016-06-30 15:18:56 +0200819
820
821
822.. flat-table::
823 :header-rows: 0
824 :stub-columns: 0
825
826
827 - .. row 1
828
829 - int fd
830
831 - File descriptor returned by a previous call to open().
832
833 - .. row 2
834
835 - int request
836
837 - Equals DMX_GET_PES_PIDS for this command.
838
839 - .. row 3
840
841 - __u16[5]
842
843 - Undocumented.
844
845
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300846Return Value
847------------
Markus Heiser5377d912016-06-30 15:18:56 +0200848
849On success 0 is returned, on error -1 and the ``errno`` variable is set
850appropriately. The generic error codes are described at the
851:ref:`Generic Error Codes <gen-errors>` chapter.
852
853
854.. _DMX_GET_CAPS:
855
856DMX_GET_CAPS
857============
858
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300859Description
860-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200861
862This ioctl is undocumented. Documentation is welcome.
863
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300864Synopsis
865--------
Markus Heiser5377d912016-06-30 15:18:56 +0200866
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300867.. c:function:: int ioctl(fd, int request = DMX_GET_CAPS, dmx_caps_t *)
Markus Heiser5377d912016-06-30 15:18:56 +0200868
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300869Arguments
870----------
Markus Heiser5377d912016-06-30 15:18:56 +0200871
872
873
874.. flat-table::
875 :header-rows: 0
876 :stub-columns: 0
877
878
879 - .. row 1
880
881 - int fd
882
883 - File descriptor returned by a previous call to open().
884
885 - .. row 2
886
887 - int request
888
889 - Equals DMX_GET_CAPS for this command.
890
891 - .. row 3
892
893 - dmx_caps_t *
894
895 - Undocumented.
896
897
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300898Return Value
899------------
Markus Heiser5377d912016-06-30 15:18:56 +0200900
901On success 0 is returned, on error -1 and the ``errno`` variable is set
902appropriately. The generic error codes are described at the
903:ref:`Generic Error Codes <gen-errors>` chapter.
904
905
906.. _DMX_SET_SOURCE:
907
908DMX_SET_SOURCE
909==============
910
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300911Description
912-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200913
914This ioctl is undocumented. Documentation is welcome.
915
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300916Synopsis
917--------
Markus Heiser5377d912016-06-30 15:18:56 +0200918
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300919.. c:function:: int ioctl(fd, int request = DMX_SET_SOURCE, dmx_source_t *)
Markus Heiser5377d912016-06-30 15:18:56 +0200920
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300921Arguments
922----------
Markus Heiser5377d912016-06-30 15:18:56 +0200923
924
925
926.. flat-table::
927 :header-rows: 0
928 :stub-columns: 0
929
930
931 - .. row 1
932
933 - int fd
934
935 - File descriptor returned by a previous call to open().
936
937 - .. row 2
938
939 - int request
940
941 - Equals DMX_SET_SOURCE for this command.
942
943 - .. row 3
944
945 - dmx_source_t *
946
947 - Undocumented.
948
949
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300950Return Value
951------------
Markus Heiser5377d912016-06-30 15:18:56 +0200952
953On success 0 is returned, on error -1 and the ``errno`` variable is set
954appropriately. The generic error codes are described at the
955:ref:`Generic Error Codes <gen-errors>` chapter.
956
957
958.. _DMX_ADD_PID:
959
960DMX_ADD_PID
961===========
962
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300963Description
964-----------
Markus Heiser5377d912016-06-30 15:18:56 +0200965
966This ioctl call allows to add multiple PIDs to a transport stream filter
967previously set up with DMX_SET_PES_FILTER and output equal to
968DMX_OUT_TSDEMUX_TAP.
969
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300970Synopsis
971--------
Markus Heiser5377d912016-06-30 15:18:56 +0200972
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300973.. c:function:: int ioctl(fd, int request = DMX_ADD_PID, __u16 *)
Markus Heiser5377d912016-06-30 15:18:56 +0200974
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -0300975Arguments
976----------
Markus Heiser5377d912016-06-30 15:18:56 +0200977
978
979
980.. flat-table::
981 :header-rows: 0
982 :stub-columns: 0
983
984
985 - .. row 1
986
987 - int fd
988
989 - File descriptor returned by a previous call to open().
990
991 - .. row 2
992
993 - int request
994
995 - Equals DMX_ADD_PID for this command.
996
997 - .. row 3
998
999 - __u16 *
1000
1001 - PID number to be filtered.
1002
1003
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -03001004Return Value
1005------------
Markus Heiser5377d912016-06-30 15:18:56 +02001006
1007On success 0 is returned, on error -1 and the ``errno`` variable is set
1008appropriately. The generic error codes are described at the
1009:ref:`Generic Error Codes <gen-errors>` chapter.
1010
1011
1012.. _DMX_REMOVE_PID:
1013
1014DMX_REMOVE_PID
1015==============
1016
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -03001017Description
1018-----------
Markus Heiser5377d912016-06-30 15:18:56 +02001019
1020This ioctl call allows to remove a PID when multiple PIDs are set on a
1021transport stream filter, e. g. a filter previously set up with output
1022equal to DMX_OUT_TSDEMUX_TAP, created via either
1023DMX_SET_PES_FILTER or DMX_ADD_PID.
1024
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -03001025Synopsis
1026--------
Markus Heiser5377d912016-06-30 15:18:56 +02001027
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -03001028.. c:function:: int ioctl(fd, int request = DMX_REMOVE_PID, __u16 *)
Markus Heiser5377d912016-06-30 15:18:56 +02001029
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -03001030Arguments
1031----------
Markus Heiser5377d912016-06-30 15:18:56 +02001032
1033
1034
1035.. flat-table::
1036 :header-rows: 0
1037 :stub-columns: 0
1038
1039
1040 - .. row 1
1041
1042 - int fd
1043
1044 - File descriptor returned by a previous call to open().
1045
1046 - .. row 2
1047
1048 - int request
1049
1050 - Equals DMX_REMOVE_PID for this command.
1051
1052 - .. row 3
1053
1054 - __u16 *
1055
1056 - PID of the PES filter to be removed.
1057
1058
Mauro Carvalho Chehab94fff0dc2016-07-04 11:29:35 -03001059Return Value
1060------------
Markus Heiser5377d912016-06-30 15:18:56 +02001061
1062On success 0 is returned, on error -1 and the ``errno`` variable is set
1063appropriately. The generic error codes are described at the
1064:ref:`Generic Error Codes <gen-errors>` chapter.