aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook/dvb
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-09-13 21:16:04 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-18 22:47:55 -0400
commit8e080c2e6cadada82a6b520e0c23a1cb974822d5 (patch)
tree991450ff1abba98e5313906478c33816a202ccab /Documentation/DocBook/dvb
parentf4e96deb4513d044653027d4921fd7592195503a (diff)
V4L/DVB (12761): DocBook: add media API specs
The V4L and DVB API's are there for a long time. however, up to now, no efforts were done to merge them to kernel DocBook. This patch adds the current versions of the specs as an unique compendium. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/DocBook/dvb')
-rw-r--r--Documentation/DocBook/dvb/audio.xml1473
-rw-r--r--Documentation/DocBook/dvb/ca.xml221
-rw-r--r--Documentation/DocBook/dvb/demux.xml973
-rw-r--r--Documentation/DocBook/dvb/dvbapi.xml79
-rw-r--r--Documentation/DocBook/dvb/dvbstb.pdfbin0 -> 1881 bytes
-rw-r--r--Documentation/DocBook/dvb/dvbstb.pngbin0 -> 22655 bytes
-rw-r--r--Documentation/DocBook/dvb/examples.xml365
-rw-r--r--Documentation/DocBook/dvb/frontend.xml1765
-rw-r--r--Documentation/DocBook/dvb/intro.xml191
-rw-r--r--Documentation/DocBook/dvb/kdapi.xml2309
-rw-r--r--Documentation/DocBook/dvb/net.xml12
-rw-r--r--Documentation/DocBook/dvb/video.xml1971
12 files changed, 9359 insertions, 0 deletions
diff --git a/Documentation/DocBook/dvb/audio.xml b/Documentation/DocBook/dvb/audio.xml
new file mode 100644
index 000000000000..eeb96b8a0864
--- /dev/null
+++ b/Documentation/DocBook/dvb/audio.xml
@@ -0,0 +1,1473 @@
1<title>DVB Audio Device</title>
2<para>The DVB audio device controls the MPEG2 audio decoder of the DVB hardware. It
3can be accessed through <emphasis role="tt">/dev/dvb/adapter0/audio0</emphasis>. Data types and and
4ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/video.h</emphasis> in your
5application.
6</para>
7<para>Please note that some DVB cards don&#8217;t have their own MPEG decoder, which results in
8the omission of the audio and video device.
9</para>
10
11<section id="audio_data_types">
12<title>Audio Data Types</title>
13<para>This section describes the structures, data types and defines used when talking to the
14audio device.
15</para>
16
17<section id="audio_stream_source_t">
18<title>audio_stream_source_t</title>
19<para>The audio stream source is set through the AUDIO_SELECT_SOURCE call and can take
20the following values, depending on whether we are replaying from an internal (demux) or
21external (user write) source.
22</para>
23<programlisting>
24 typedef enum {
25 AUDIO_SOURCE_DEMUX,
26 AUDIO_SOURCE_MEMORY
27 } audio_stream_source_t;
28</programlisting>
29<para>AUDIO_SOURCE_DEMUX selects the demultiplexer (fed either by the frontend or the
30DVR device) as the source of the video stream. If AUDIO_SOURCE_MEMORY
31is selected the stream comes from the application through the <emphasis role="tt">write()</emphasis> system
32call.
33</para>
34
35</section>
36<section id="audio_play_state_t">
37<title>audio_play_state_t</title>
38<para>The following values can be returned by the AUDIO_GET_STATUS call representing the
39state of audio playback.
40</para>
41<programlisting>
42 typedef enum {
43 AUDIO_STOPPED,
44 AUDIO_PLAYING,
45 AUDIO_PAUSED
46 } audio_play_state_t;
47</programlisting>
48
49</section>
50<section id="audio_channel_select_t">
51<title>audio_channel_select_t</title>
52<para>The audio channel selected via AUDIO_CHANNEL_SELECT is determined by the
53following values.
54</para>
55<programlisting>
56 typedef enum {
57 AUDIO_STEREO,
58 AUDIO_MONO_LEFT,
59 AUDIO_MONO_RIGHT,
60 } audio_channel_select_t;
61</programlisting>
62
63</section>
64<section id="struct_audio_status">
65<title>struct audio_status</title>
66<para>The AUDIO_GET_STATUS call returns the following structure informing about various
67states of the playback operation.
68</para>
69<programlisting>
70 typedef struct audio_status {
71 boolean AV_sync_state;
72 boolean mute_state;
73 audio_play_state_t play_state;
74 audio_stream_source_t stream_source;
75 audio_channel_select_t channel_select;
76 boolean bypass_mode;
77 } audio_status_t;
78</programlisting>
79
80</section>
81<section id="struct_audio_mixer">
82<title>struct audio_mixer</title>
83<para>The following structure is used by the AUDIO_SET_MIXER call to set the audio
84volume.
85</para>
86<programlisting>
87 typedef struct audio_mixer {
88 unsigned int volume_left;
89 unsigned int volume_right;
90 } audio_mixer_t;
91</programlisting>
92
93</section>
94<section id="audio_encodings">
95<title>audio encodings</title>
96<para>A call to AUDIO_GET_CAPABILITIES returns an unsigned integer with the following
97bits set according to the hardwares capabilities.
98</para>
99<programlisting>
100 #define AUDIO_CAP_DTS 1
101 #define AUDIO_CAP_LPCM 2
102 #define AUDIO_CAP_MP1 4
103 #define AUDIO_CAP_MP2 8
104 #define AUDIO_CAP_MP3 16
105 #define AUDIO_CAP_AAC 32
106 #define AUDIO_CAP_OGG 64
107 #define AUDIO_CAP_SDDS 128
108 #define AUDIO_CAP_AC3 256
109</programlisting>
110
111</section>
112<section id="struct_audio_karaoke">
113<title>struct audio_karaoke</title>
114<para>The ioctl AUDIO_SET_KARAOKE uses the following format:
115</para>
116<programlisting>
117 typedef
118 struct audio_karaoke{
119 int vocal1;
120 int vocal2;
121 int melody;
122 } audio_karaoke_t;
123</programlisting>
124<para>If Vocal1 or Vocal2 are non-zero, they get mixed into left and right t at 70% each. If both,
125Vocal1 and Vocal2 are non-zero, Vocal1 gets mixed into the left channel and Vocal2 into the
126right channel at 100% each. Ff Melody is non-zero, the melody channel gets mixed into left
127and right.
128</para>
129
130</section>
131<section id="audio_attributes">
132<title>audio attributes</title>
133<para>The following attributes can be set by a call to AUDIO_SET_ATTRIBUTES:
134</para>
135<programlisting>
136 typedef uint16_t audio_attributes_t;
137 /&#x22C6; bits: descr. &#x22C6;/
138 /&#x22C6; 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, &#x22C6;/
139 /&#x22C6; 12 multichannel extension &#x22C6;/
140 /&#x22C6; 11-10 audio type (0=not spec, 1=language included) &#x22C6;/
141 /&#x22C6; 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) &#x22C6;/
142 /&#x22C6; 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, &#x22C6;/
143 /&#x22C6; 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) &#x22C6;/
144 /&#x22C6; 2- 0 number of audio channels (n+1 channels) &#x22C6;/
145</programlisting>
146 </section></section>
147<section id="audio_function_calls">
148<title>Audio Function Calls</title>
149
150
151<section id="audio_fopen">
152<title>open()</title>
153<para>DESCRIPTION
154</para>
155<informaltable><tgroup cols="1"><tbody><row><entry
156 align="char">
157<para>This system call opens a named audio device (e.g. /dev/dvb/adapter0/audio0)
158 for subsequent use. When an open() call has succeeded, the device will be ready
159 for use. The significance of blocking or non-blocking mode is described in the
160 documentation for functions where there is a difference. It does not affect the
161 semantics of the open() call itself. A device opened in blocking mode can later
162 be put into non-blocking mode (and vice versa) using the F_SETFL command
163 of the fcntl system call. This is a standard system call, documented in the Linux
164 manual page for fcntl. Only one user can open the Audio Device in O_RDWR
165 mode. All other attempts to open the device in this mode will fail, and an error
166 code will be returned. If the Audio Device is opened in O_RDONLY mode, the
167 only ioctl call that can be used is AUDIO_GET_STATUS. All other call will
168 return with an error code.</para>
169</entry>
170 </row></tbody></tgroup></informaltable>
171<para>SYNOPSIS
172</para>
173<informaltable><tgroup cols="1"><tbody><row><entry
174 align="char">
175<para>int open(const char &#x22C6;deviceName, int flags);</para>
176</entry>
177 </row></tbody></tgroup></informaltable>
178<para>PARAMETERS
179</para>
180<informaltable><tgroup cols="2"><tbody><row><entry
181 align="char">
182<para>const char
183 *deviceName</para>
184</entry><entry
185 align="char">
186<para>Name of specific audio device.</para>
187</entry>
188 </row><row><entry
189 align="char">
190<para>int flags</para>
191</entry><entry
192 align="char">
193<para>A bit-wise OR of the following flags:</para>
194</entry>
195 </row><row><entry
196 align="char">
197</entry><entry
198 align="char">
199<para>O_RDONLY read-only access</para>
200</entry>
201 </row><row><entry
202 align="char">
203</entry><entry
204 align="char">
205<para>O_RDWR read/write access</para>
206</entry>
207 </row><row><entry
208 align="char">
209</entry><entry
210 align="char">
211<para>O_NONBLOCK open in non-blocking mode</para>
212</entry>
213 </row><row><entry
214 align="char">
215</entry><entry
216 align="char">
217<para>(blocking mode is the default)</para>
218</entry>
219 </row></tbody></tgroup></informaltable>
220<para>ERRORS
221</para>
222<informaltable><tgroup cols="2"><tbody><row><entry
223 align="char">
224<para>ENODEV</para>
225</entry><entry
226 align="char">
227<para>Device driver not loaded/available.</para>
228</entry>
229 </row><row><entry
230 align="char">
231<para>EINTERNAL</para>
232</entry><entry
233 align="char">
234<para>Internal error.</para>
235</entry>
236 </row><row><entry
237 align="char">
238<para>EBUSY</para>
239</entry><entry
240 align="char">
241<para>Device or resource busy.</para>
242</entry>
243 </row><row><entry
244 align="char">
245<para>EINVAL</para>
246</entry><entry
247 align="char">
248<para>Invalid argument.</para>
249</entry>
250 </row></tbody></tgroup></informaltable>
251
252</section>
253<section id="audio_fclose">
254<title>close()</title>
255<para>DESCRIPTION
256</para>
257<informaltable><tgroup cols="1"><tbody><row><entry
258 align="char">
259<para>This system call closes a previously opened audio device.</para>
260</entry>
261 </row></tbody></tgroup></informaltable>
262<para>SYNOPSIS
263</para>
264<informaltable><tgroup cols="1"><tbody><row><entry
265 align="char">
266<para>int close(int fd);</para>
267</entry>
268 </row></tbody></tgroup></informaltable>
269<para>PARAMETERS
270</para>
271<informaltable><tgroup cols="2"><tbody><row><entry
272 align="char">
273<para>int fd</para>
274</entry><entry
275 align="char">
276<para>File descriptor returned by a previous call to open().</para>
277</entry>
278 </row></tbody></tgroup></informaltable>
279<para>ERRORS
280</para>
281<informaltable><tgroup cols="2"><tbody><row><entry
282 align="char">
283<para>EBADF</para>
284</entry><entry
285 align="char">
286<para>fd is not a valid open file descriptor.</para>
287</entry>
288 </row></tbody></tgroup></informaltable>
289
290</section>
291<section id="audio_fwrite">
292<title>write()</title>
293<para>DESCRIPTION
294</para>
295<informaltable><tgroup cols="1"><tbody><row><entry
296 align="char">
297<para>This system call can only be used if AUDIO_SOURCE_MEMORY is selected
298 in the ioctl call AUDIO_SELECT_SOURCE. The data provided shall be in
299 PES format. If O_NONBLOCK is not specified the function will block until
300 buffer space is available. The amount of data to be transferred is implied by
301 count.</para>
302</entry>
303 </row></tbody></tgroup></informaltable>
304<para>SYNOPSIS
305</para>
306<informaltable><tgroup cols="1"><tbody><row><entry
307 align="char">
308<para>size_t write(int fd, const void &#x22C6;buf, size_t count);</para>
309</entry>
310 </row></tbody></tgroup></informaltable>
311<para>PARAMETERS
312</para>
313<informaltable><tgroup cols="2"><tbody><row><entry
314 align="char">
315<para>int fd</para>
316</entry><entry
317 align="char">
318<para>File descriptor returned by a previous call to open().</para>
319</entry>
320 </row><row><entry
321 align="char">
322<para>void *buf</para>
323</entry><entry
324 align="char">
325<para>Pointer to the buffer containing the PES data.</para>
326</entry>
327 </row><row><entry
328 align="char">
329<para>size_t count</para>
330</entry><entry
331 align="char">
332<para>Size of buf.</para>
333</entry>
334 </row></tbody></tgroup></informaltable>
335<para>ERRORS
336</para>
337<informaltable><tgroup cols="2"><tbody><row><entry
338 align="char">
339<para>EPERM</para>
340</entry><entry
341 align="char">
342<para>Mode AUDIO_SOURCE_MEMORY not selected.</para>
343</entry>
344 </row><row><entry
345 align="char">
346<para>ENOMEM</para>
347</entry><entry
348 align="char">
349<para>Attempted to write more data than the internal buffer can
350 hold.</para>
351</entry>
352 </row><row><entry
353 align="char">
354<para>EBADF</para>
355</entry><entry
356 align="char">
357<para>fd is not a valid open file descriptor.</para>
358</entry>
359 </row></tbody></tgroup></informaltable>
360
361</section><section
362role="subsection"><title>AUDIO_STOP</title>
363<para>DESCRIPTION
364</para>
365<informaltable><tgroup cols="1"><tbody><row><entry
366 align="char">
367<para>This ioctl call asks the Audio Device to stop playing the current stream.</para>
368</entry>
369 </row></tbody></tgroup></informaltable>
370<para>SYNOPSIS
371</para>
372<informaltable><tgroup cols="1"><tbody><row><entry
373 align="char">
374<para>int ioctl(int fd, int request = AUDIO_STOP);</para>
375</entry>
376 </row></tbody></tgroup></informaltable>
377<para>PARAMETERS
378</para>
379<informaltable><tgroup cols="2"><tbody><row><entry
380 align="char">
381<para>int fd</para>
382</entry><entry
383 align="char">
384<para>File descriptor returned by a previous call to open().</para>
385</entry>
386 </row><row><entry
387 align="char">
388<para>int request</para>
389</entry><entry
390 align="char">
391<para>Equals AUDIO_STOP for this command.</para>
392</entry>
393 </row></tbody></tgroup></informaltable>
394<para>ERRORS
395</para>
396<informaltable><tgroup cols="2"><tbody><row><entry
397 align="char">
398<para>EBADF</para>
399</entry><entry
400 align="char">
401<para>fd is not a valid open file descriptor</para>
402</entry>
403 </row><row><entry
404 align="char">
405<para>EINTERNAL</para>
406</entry><entry
407 align="char">
408<para>Internal error.</para>
409</entry>
410 </row></tbody></tgroup></informaltable>
411
412</section><section
413role="subsection"><title>AUDIO_PLAY</title>
414<para>DESCRIPTION
415</para>
416<informaltable><tgroup cols="1"><tbody><row><entry
417 align="char">
418<para>This ioctl call asks the Audio Device to start playing an audio stream from the
419 selected source.</para>
420</entry>
421 </row></tbody></tgroup></informaltable>
422<para>SYNOPSIS
423</para>
424<informaltable><tgroup cols="1"><tbody><row><entry
425 align="char">
426<para>int ioctl(int fd, int request = AUDIO_PLAY);</para>
427</entry>
428 </row></tbody></tgroup></informaltable>
429<para>PARAMETERS
430</para>
431<informaltable><tgroup cols="2"><tbody><row><entry
432 align="char">
433<para>int fd</para>
434</entry><entry
435 align="char">
436<para>File descriptor returned by a previous call to open().</para>
437</entry>
438 </row><row><entry
439 align="char">
440<para>int request</para>
441</entry><entry
442 align="char">
443<para>Equals AUDIO_PLAY for this command.</para>
444</entry>
445 </row></tbody></tgroup></informaltable>
446<para>ERRORS
447</para>
448<informaltable><tgroup cols="2"><tbody><row><entry
449 align="char">
450<para>EBADF</para>
451</entry><entry
452 align="char">
453<para>fd is not a valid open file descriptor</para>
454</entry>
455 </row><row><entry
456 align="char">
457<para>EINTERNAL</para>
458</entry><entry
459 align="char">
460<para>Internal error.</para>
461</entry>
462 </row></tbody></tgroup></informaltable>
463
464</section><section
465role="subsection"><title>AUDIO_PAUSE</title>
466<para>DESCRIPTION
467</para>
468<informaltable><tgroup cols="1"><tbody><row><entry
469 align="char">
470<para>This ioctl call suspends the audio stream being played. Decoding and playing
471 are paused. It is then possible to restart again decoding and playing process of
472 the audio stream using AUDIO_CONTINUE command.</para>
473</entry>
474 </row><row><entry
475 align="char">
476<para>If AUDIO_SOURCE_MEMORY is selected in the ioctl call
477 AUDIO_SELECT_SOURCE, the DVB-subsystem will not decode (consume)
478 any more data until the ioctl call AUDIO_CONTINUE or AUDIO_PLAY is
479 performed.</para>
480</entry>
481 </row></tbody></tgroup></informaltable>
482<para>SYNOPSIS
483</para>
484<informaltable><tgroup cols="1"><tbody><row><entry
485 align="char">
486<para>int ioctl(int fd, int request = AUDIO_PAUSE);</para>
487</entry>
488 </row></tbody></tgroup></informaltable>
489<para>PARAMETERS
490</para>
491<informaltable><tgroup cols="2"><tbody><row><entry
492 align="char">
493<para>int fd</para>
494</entry><entry
495 align="char">
496<para>File descriptor returned by a previous call to open().</para>
497</entry>
498 </row><row><entry
499 align="char">
500<para>int request</para>
501</entry><entry
502 align="char">
503<para>Equals AUDIO_PAUSE for this command.</para>
504</entry>
505 </row></tbody></tgroup></informaltable>
506<para>ERRORS
507</para>
508<informaltable><tgroup cols="2"><tbody><row><entry
509 align="char">
510<para>EBADF</para>
511</entry><entry
512 align="char">
513<para>fd is not a valid open file descriptor.</para>
514</entry>
515 </row><row><entry
516 align="char">
517<para>EINTERNAL</para>
518</entry><entry
519 align="char">
520<para>Internal error.</para>
521</entry>
522 </row></tbody></tgroup></informaltable>
523
524</section><section
525role="subsection"><title>AUDIO_SELECT_SOURCE</title>
526<para>DESCRIPTION
527</para>
528<informaltable><tgroup cols="1"><tbody><row><entry
529 align="char">
530<para>This ioctl call informs the audio device which source shall be used
531 for the input data. The possible sources are demux or memory. If
532 AUDIO_SOURCE_MEMORY is selected, the data is fed to the Audio Device
533 through the write command.</para>
534</entry>
535 </row></tbody></tgroup></informaltable>
536<para>SYNOPSIS
537</para>
538<informaltable><tgroup cols="1"><tbody><row><entry
539 align="char">
540<para>int ioctl(int fd, int request = AUDIO_SELECT_SOURCE,
541 audio_stream_source_t source);</para>
542</entry>
543 </row></tbody></tgroup></informaltable>
544<para>PARAMETERS
545</para>
546<informaltable><tgroup cols="2"><tbody><row><entry
547 align="char">
548<para>int fd</para>
549</entry><entry
550 align="char">
551<para>File descriptor returned by a previous call to open().</para>
552</entry>
553 </row><row><entry
554 align="char">
555<para>int request</para>
556</entry><entry
557 align="char">
558<para>Equals AUDIO_SELECT_SOURCE for this command.</para>
559</entry>
560 </row><row><entry
561 align="char">
562<para>audio_stream_source_t
563 source</para>
564</entry><entry
565 align="char">
566<para>Indicates the source that shall be used for the Audio
567 stream.</para>
568</entry>
569 </row></tbody></tgroup></informaltable>
570<para>ERRORS
571</para>
572<informaltable><tgroup cols="2"><tbody><row><entry
573 align="char">
574<para>EBADF</para>
575</entry><entry
576 align="char">
577<para>fd is not a valid open file descriptor.</para>
578</entry>
579 </row><row><entry
580 align="char">
581<para>EINTERNAL</para>
582</entry><entry
583 align="char">
584<para>Internal error.</para>
585</entry>
586 </row><row><entry
587 align="char">
588<para>EINVAL</para>
589</entry><entry
590 align="char">
591<para>Illegal input parameter.</para>
592</entry>
593 </row></tbody></tgroup></informaltable>
594
595</section><section
596role="subsection"><title>AUDIO_SET_MUTE</title>
597<para>DESCRIPTION
598</para>
599<informaltable><tgroup cols="1"><tbody><row><entry
600 align="char">
601<para>This ioctl call asks the audio device to mute the stream that is currently being
602 played.</para>
603</entry>
604 </row></tbody></tgroup></informaltable>
605<para>SYNOPSIS
606</para>
607<informaltable><tgroup cols="1"><tbody><row><entry
608 align="char">
609<para>int ioctl(int fd, int request = AUDIO_SET_MUTE,
610 boolean state);</para>
611</entry>
612 </row></tbody></tgroup></informaltable>
613<para>PARAMETERS
614</para>
615<informaltable><tgroup cols="2"><tbody><row><entry
616 align="char">
617<para>int fd</para>
618</entry><entry
619 align="char">
620<para>File descriptor returned by a previous call to open().</para>
621</entry>
622 </row><row><entry
623 align="char">
624<para>int request</para>
625</entry><entry
626 align="char">
627<para>Equals AUDIO_SET_MUTE for this command.</para>
628</entry>
629 </row><row><entry
630 align="char">
631<para>boolean state</para>
632</entry><entry
633 align="char">
634<para>Indicates if audio device shall mute or not.</para>
635</entry>
636 </row><row><entry
637 align="char">
638</entry><entry
639 align="char">
640<para>TRUE Audio Mute</para>
641</entry>
642 </row><row><entry
643 align="char">
644</entry><entry
645 align="char">
646<para>FALSE Audio Un-mute</para>
647</entry>
648 </row></tbody></tgroup></informaltable>
649<para>ERRORS
650</para>
651<informaltable><tgroup cols="2"><tbody><row><entry
652 align="char">
653<para>EBADF</para>
654</entry><entry
655 align="char">
656<para>fd is not a valid open file descriptor.</para>
657</entry>
658 </row><row><entry
659 align="char">
660<para>EINTERNAL</para>
661</entry><entry
662 align="char">
663<para>Internal error.</para>
664</entry>
665 </row><row><entry
666 align="char">
667<para>EINVAL</para>
668</entry><entry
669 align="char">
670<para>Illegal input parameter.</para>
671</entry>
672 </row></tbody></tgroup></informaltable>
673
674</section><section
675role="subsection"><title>AUDIO_SET_AV_SYNC</title>
676<para>DESCRIPTION
677</para>
678<informaltable><tgroup cols="1"><tbody><row><entry
679 align="char">
680<para>This ioctl call asks the Audio Device to turn ON or OFF A/V synchronization.</para>
681</entry>
682 </row></tbody></tgroup></informaltable>
683<para>SYNOPSIS
684</para>
685<informaltable><tgroup cols="1"><tbody><row><entry
686 align="char">
687<para>int ioctl(int fd, int request = AUDIO_SET_AV_SYNC,
688 boolean state);</para>
689</entry>
690 </row></tbody></tgroup></informaltable>
691<para>PARAMETERS
692</para>
693<informaltable><tgroup cols="2"><tbody><row><entry
694 align="char">
695<para>int fd</para>
696</entry><entry
697 align="char">
698<para>File descriptor returned by a previous call to open().</para>
699</entry>
700 </row><row><entry
701 align="char">
702<para>int request</para>
703</entry><entry
704 align="char">
705<para>Equals AUDIO_AV_SYNC for this command.</para>
706</entry>
707 </row><row><entry
708 align="char">
709<para>boolean state</para>
710</entry><entry
711 align="char">
712<para>Tells the DVB subsystem if A/V synchronization shall be
713 ON or OFF.</para>
714</entry>
715 </row><row><entry
716 align="char">
717</entry><entry
718 align="char">
719<para>TRUE AV-sync ON</para>
720</entry>
721 </row><row><entry
722 align="char">
723</entry><entry
724 align="char">
725<para>FALSE AV-sync OFF</para>
726</entry>
727 </row></tbody></tgroup></informaltable>
728<para>ERRORS
729</para>
730<informaltable><tgroup cols="2"><tbody><row><entry
731 align="char">
732<para>EBADF</para>
733</entry><entry
734 align="char">
735<para>fd is not a valid open file descriptor.</para>
736</entry>
737 </row><row><entry
738 align="char">
739<para>EINTERNAL</para>
740</entry><entry
741 align="char">
742<para>Internal error.</para>
743</entry>
744 </row><row><entry
745 align="char">
746<para>EINVAL</para>
747</entry><entry
748 align="char">
749<para>Illegal input parameter.</para>
750</entry>
751 </row></tbody></tgroup></informaltable>
752
753</section><section
754role="subsection"><title>AUDIO_SET_BYPASS_MODE</title>
755<para>DESCRIPTION
756</para>
757<informaltable><tgroup cols="1"><tbody><row><entry
758 align="char">
759<para>This ioctl call asks the Audio Device to bypass the Audio decoder and forward
760 the stream without decoding. This mode shall be used if streams that can&#8217;t be
761 handled by the DVB system shall be decoded. Dolby DigitalTM streams are
762 automatically forwarded by the DVB subsystem if the hardware can handle it.</para>
763</entry>
764 </row></tbody></tgroup></informaltable>
765<para>SYNOPSIS
766</para>
767<informaltable><tgroup cols="1"><tbody><row><entry
768 align="char">
769<para>int ioctl(int fd, int request =
770 AUDIO_SET_BYPASS_MODE, boolean mode);</para>
771</entry>
772 </row></tbody></tgroup></informaltable>
773<para>PARAMETERS
774</para>
775<informaltable><tgroup cols="2"><tbody><row><entry
776 align="char">
777<para>int fd</para>
778</entry><entry
779 align="char">
780<para>File descriptor returned by a previous call to open().</para>
781</entry>
782 </row><row><entry
783 align="char">
784<para>int request</para>
785</entry><entry
786 align="char">
787<para>Equals AUDIO_SET_BYPASS_MODE for this
788 command.</para>
789</entry>
790 </row><row><entry
791 align="char">
792<para>boolean mode</para>
793</entry><entry
794 align="char">
795<para>Enables or disables the decoding of the current Audio
796 stream in the DVB subsystem.</para>
797</entry>
798 </row><row><entry
799 align="char">
800</entry><entry
801 align="char">
802<para>TRUE Bypass is disabled</para>
803</entry>
804 </row><row><entry
805 align="char">
806</entry><entry
807 align="char">
808<para>FALSE Bypass is enabled</para>
809</entry>
810 </row></tbody></tgroup></informaltable>
811<para>ERRORS
812</para>
813<informaltable><tgroup cols="2"><tbody><row><entry
814 align="char">
815<para>EBADF</para>
816</entry><entry
817 align="char">
818<para>fd is not a valid open file descriptor.</para>
819</entry>
820 </row><row><entry
821 align="char">
822<para>EINTERNAL</para>
823</entry><entry
824 align="char">
825<para>Internal error.</para>
826</entry>
827 </row><row><entry
828 align="char">
829<para>EINVAL</para>
830</entry><entry
831 align="char">
832<para>Illegal input parameter.</para>
833</entry>
834 </row></tbody></tgroup></informaltable>
835
836</section><section
837role="subsection"><title>AUDIO_CHANNEL_SELECT</title>
838<para>DESCRIPTION
839</para>
840<informaltable><tgroup cols="1"><tbody><row><entry
841 align="char">
842<para>This ioctl call asks the Audio Device to select the requested channel if possible.</para>
843</entry>
844 </row></tbody></tgroup></informaltable>
845<para>SYNOPSIS
846</para>
847<informaltable><tgroup cols="1"><tbody><row><entry
848 align="char">
849<para>int ioctl(int fd, int request =
850 AUDIO_CHANNEL_SELECT, audio_channel_select_t);</para>
851</entry>
852 </row></tbody></tgroup></informaltable>
853<para>PARAMETERS
854</para>
855<informaltable><tgroup cols="2"><tbody><row><entry
856 align="char">
857<para>int fd</para>
858</entry><entry
859 align="char">
860<para>File descriptor returned by a previous call to open().</para>
861</entry>
862 </row><row><entry
863 align="char">
864<para>int request</para>
865</entry><entry
866 align="char">
867<para>Equals AUDIO_CHANNEL_SELECT for this
868 command.</para>
869</entry>
870 </row><row><entry
871 align="char">
872<para>audio_channel_select_t
873 ch</para>
874</entry><entry
875 align="char">
876<para>Select the output format of the audio (mono left/right,
877 stereo).</para>
878</entry>
879 </row></tbody></tgroup></informaltable>
880<para>ERRORS
881</para>
882<informaltable><tgroup cols="2"><tbody><row><entry
883 align="char">
884<para>EBADF</para>
885</entry><entry
886 align="char">
887<para>fd is not a valid open file descriptor.</para>
888</entry>
889 </row><row><entry
890 align="char">
891<para>EINTERNAL</para>
892</entry><entry
893 align="char">
894<para>Internal error.</para>
895</entry>
896 </row><row><entry
897 align="char">
898<para>EINVAL</para>
899</entry><entry
900 align="char">
901<para>Illegal input parameter ch.</para>
902</entry>
903 </row></tbody></tgroup></informaltable>
904
905</section><section
906role="subsection"><title>AUDIO_GET_STATUS</title>
907<para>DESCRIPTION
908</para>
909<informaltable><tgroup cols="1"><tbody><row><entry
910 align="char">
911<para>This ioctl call asks the Audio Device to return the current state of the Audio
912 Device.</para>
913</entry>
914 </row></tbody></tgroup></informaltable>
915<para>SYNOPSIS
916</para>
917<informaltable><tgroup cols="1"><tbody><row><entry
918 align="char">
919<para>int ioctl(int fd, int request = AUDIO_GET_STATUS,
920 struct audio_status &#x22C6;status);</para>
921</entry>
922 </row></tbody></tgroup></informaltable>
923<para>PARAMETERS
924</para>
925<informaltable><tgroup cols="2"><tbody><row><entry
926 align="char">
927<para>int fd</para>
928</entry><entry
929 align="char">
930<para>File descriptor returned by a previous call to open().</para>
931</entry>
932 </row><row><entry
933 align="char">
934<para>int request</para>
935</entry><entry
936 align="char">
937<para>Equals AUDIO_GET_STATUS for this command.</para>
938</entry>
939 </row><row><entry
940 align="char">
941<para>struct audio_status
942 *status</para>
943</entry><entry
944 align="char">
945<para>Returns the current state of Audio Device.</para>
946</entry>
947 </row></tbody></tgroup></informaltable>
948<para>ERRORS
949</para>
950<informaltable><tgroup cols="2"><tbody><row><entry
951 align="char">
952<para>EBADF</para>
953</entry><entry
954 align="char">
955<para>fd is not a valid open file descriptor.</para>
956</entry>
957 </row><row><entry
958 align="char">
959<para>EINTERNAL</para>
960</entry><entry
961 align="char">
962<para>Internal error.</para>
963</entry>
964 </row><row><entry
965 align="char">
966<para>EFAULT</para>
967</entry><entry
968 align="char">
969<para>status points to invalid address.</para>
970</entry>
971 </row></tbody></tgroup></informaltable>
972
973</section><section
974role="subsection"><title>AUDIO_GET_CAPABILITIES</title>
975<para>DESCRIPTION
976</para>
977<informaltable><tgroup cols="1"><tbody><row><entry
978 align="char">
979<para>This ioctl call asks the Audio Device to tell us about the decoding capabilities
980 of the audio hardware.</para>
981</entry>
982 </row></tbody></tgroup></informaltable>
983<para>SYNOPSIS
984</para>
985<informaltable><tgroup cols="1"><tbody><row><entry
986 align="char">
987<para>int ioctl(int fd, int request =
988 AUDIO_GET_CAPABILITIES, unsigned int &#x22C6;cap);</para>
989</entry>
990 </row></tbody></tgroup></informaltable>
991<para>PARAMETERS
992</para>
993<informaltable><tgroup cols="2"><tbody><row><entry
994 align="char">
995<para>int fd</para>
996</entry><entry
997 align="char">
998<para>File descriptor returned by a previous call to open().</para>
999</entry>
1000 </row><row><entry
1001 align="char">
1002<para>int request</para>
1003</entry><entry
1004 align="char">
1005<para>Equals AUDIO_GET_CAPABILITIES for this
1006 command.</para>
1007</entry>
1008 </row><row><entry
1009 align="char">
1010<para>unsigned int *cap</para>
1011</entry><entry
1012 align="char">
1013<para>Returns a bit array of supported sound formats.</para>
1014</entry>
1015 </row></tbody></tgroup></informaltable>
1016<para>ERRORS
1017</para>
1018<informaltable><tgroup cols="2"><tbody><row><entry
1019 align="char">
1020<para>EBADF</para>
1021</entry><entry
1022 align="char">
1023<para>fd is not a valid open file descriptor.</para>
1024</entry>
1025 </row><row><entry
1026 align="char">
1027<para>EINTERNAL</para>
1028</entry><entry
1029 align="char">
1030<para>Internal error.</para>
1031</entry>
1032 </row><row><entry
1033 align="char">
1034<para>EFAULT</para>
1035</entry><entry
1036 align="char">
1037<para>cap points to an invalid address.</para>
1038</entry>
1039 </row></tbody></tgroup></informaltable>
1040
1041</section><section
1042role="subsection"><title>AUDIO_CLEAR_BUFFER</title>
1043<para>DESCRIPTION
1044</para>
1045<informaltable><tgroup cols="1"><tbody><row><entry
1046 align="char">
1047<para>This ioctl call asks the Audio Device to clear all software and hardware buffers
1048 of the audio decoder device.</para>
1049</entry>
1050 </row></tbody></tgroup></informaltable>
1051<para>SYNOPSIS
1052</para>
1053<informaltable><tgroup cols="1"><tbody><row><entry
1054 align="char">
1055<para>int ioctl(int fd, int request = AUDIO_CLEAR_BUFFER);</para>
1056</entry>
1057 </row></tbody></tgroup></informaltable>
1058<para>PARAMETERS
1059</para>
1060<informaltable><tgroup cols="2"><tbody><row><entry
1061 align="char">
1062<para>int fd</para>
1063</entry><entry
1064 align="char">
1065<para>File descriptor returned by a previous call to open().</para>
1066</entry>
1067 </row><row><entry
1068 align="char">
1069<para>int request</para>
1070</entry><entry
1071 align="char">
1072<para>Equals AUDIO_CLEAR_BUFFER for this command.</para>
1073</entry>
1074 </row></tbody></tgroup></informaltable>
1075<para>ERRORS
1076</para>
1077<informaltable><tgroup cols="2"><tbody><row><entry
1078 align="char">
1079<para>EBADF</para>
1080</entry><entry
1081 align="char">
1082<para>fd is not a valid open file descriptor.</para>
1083</entry>
1084 </row><row><entry
1085 align="char">
1086<para>EINTERNAL</para>
1087</entry><entry
1088 align="char">
1089<para>Internal error.</para>
1090</entry>
1091 </row></tbody></tgroup></informaltable>
1092
1093</section><section
1094role="subsection"><title>AUDIO_SET_ID</title>
1095<para>DESCRIPTION
1096</para>
1097<informaltable><tgroup cols="1"><tbody><row><entry
1098 align="char">
1099<para>This ioctl selects which sub-stream is to be decoded if a program or system
1100 stream is sent to the video device. If no audio stream type is set the id has to be
1101 in [0xC0,0xDF] for MPEG sound, in [0x80,0x87] for AC3 and in [0xA0,0xA7]
1102 for LPCM. More specifications may follow for other stream types. If the stream
1103 type is set the id just specifies the substream id of the audio stream and only
1104 the first 5 bits are recognized.</para>
1105</entry>
1106 </row></tbody></tgroup></informaltable>
1107<para>SYNOPSIS
1108</para>
1109<informaltable><tgroup cols="1"><tbody><row><entry
1110 align="char">
1111<para>int ioctl(int fd, int request = AUDIO_SET_ID, int
1112 id);</para>
1113</entry>
1114 </row></tbody></tgroup></informaltable>
1115<para>PARAMETERS
1116</para>
1117<informaltable><tgroup cols="2"><tbody><row><entry
1118 align="char">
1119<para>int fd</para>
1120</entry><entry
1121 align="char">
1122<para>File descriptor returned by a previous call to open().</para>
1123</entry>
1124 </row><row><entry
1125 align="char">
1126<para>int request</para>
1127</entry><entry
1128 align="char">
1129<para>Equals AUDIO_SET_ID for this command.</para>
1130</entry>
1131 </row><row><entry
1132 align="char">
1133<para>int id</para>
1134</entry><entry
1135 align="char">
1136<para>audio sub-stream id</para>
1137</entry>
1138 </row></tbody></tgroup></informaltable>
1139<para>ERRORS
1140</para>
1141<informaltable><tgroup cols="2"><tbody><row><entry
1142 align="char">
1143<para>EBADF</para>
1144</entry><entry
1145 align="char">
1146<para>fd is not a valid open file descriptor.</para>
1147</entry>
1148 </row><row><entry
1149 align="char">
1150<para>EINTERNAL</para>
1151</entry><entry
1152 align="char">
1153<para>Internal error.</para>
1154</entry>
1155 </row><row><entry
1156 align="char">
1157<para>EINVAL</para>
1158</entry><entry
1159 align="char">
1160<para>Invalid sub-stream id.</para>
1161</entry>
1162 </row></tbody></tgroup></informaltable>
1163
1164</section><section
1165role="subsection"><title>AUDIO_SET_MIXER</title>
1166<para>DESCRIPTION
1167</para>
1168<informaltable><tgroup cols="1"><tbody><row><entry
1169 align="char">
1170<para>This ioctl lets you adjust the mixer settings of the audio decoder.</para>
1171</entry>
1172 </row></tbody></tgroup></informaltable>
1173<para>SYNOPSIS
1174</para>
1175<informaltable><tgroup cols="1"><tbody><row><entry
1176 align="char">
1177<para>int ioctl(int fd, int request = AUDIO_SET_MIXER,
1178 audio_mixer_t &#x22C6;mix);</para>
1179</entry>
1180 </row></tbody></tgroup></informaltable>
1181<para>PARAMETERS
1182</para>
1183<informaltable><tgroup cols="2"><tbody><row><entry
1184 align="char">
1185<para>int fd</para>
1186</entry><entry
1187 align="char">
1188<para>File descriptor returned by a previous call to open().</para>
1189</entry>
1190 </row><row><entry
1191 align="char">
1192<para>int request</para>
1193</entry><entry
1194 align="char">
1195<para>Equals AUDIO_SET_ID for this command.</para>
1196</entry>
1197 </row><row><entry
1198 align="char">
1199<para>audio_mixer_t *mix</para>
1200</entry><entry
1201 align="char">
1202<para>mixer settings.</para>
1203</entry>
1204 </row></tbody></tgroup></informaltable>
1205<para>ERRORS
1206</para>
1207<informaltable><tgroup cols="2"><tbody><row><entry
1208 align="char">
1209<para>EBADF</para>
1210</entry><entry
1211 align="char">
1212<para>fd is not a valid open file descriptor.</para>
1213</entry>
1214 </row><row><entry
1215 align="char">
1216<para>EINTERNAL</para>
1217</entry><entry
1218 align="char">
1219<para>Internal error.</para>
1220</entry>
1221 </row><row><entry
1222 align="char">
1223<para>EFAULT</para>
1224</entry><entry
1225 align="char">
1226<para>mix points to an invalid address.</para>
1227</entry>
1228 </row></tbody></tgroup></informaltable>
1229
1230</section><section
1231role="subsection"><title>AUDIO_SET_STREAMTYPE</title>
1232<para>DESCRIPTION
1233</para>
1234<informaltable><tgroup cols="1"><tbody><row><entry
1235 align="char">
1236<para>This ioctl tells the driver which kind of audio stream to expect. This is useful
1237 if the stream offers several audio sub-streams like LPCM and AC3.</para>
1238</entry>
1239 </row></tbody></tgroup></informaltable>
1240<para>SYNOPSIS
1241</para>
1242<informaltable><tgroup cols="1"><tbody><row><entry
1243 align="char">
1244<para>int ioctl(fd, int request = AUDIO_SET_STREAMTYPE,
1245 int type);</para>
1246</entry>
1247 </row></tbody></tgroup></informaltable>
1248<para>PARAMETERS
1249</para>
1250<informaltable><tgroup cols="2"><tbody><row><entry
1251 align="char">
1252<para>int fd</para>
1253</entry><entry
1254 align="char">
1255<para>File descriptor returned by a previous call to open().</para>
1256</entry>
1257 </row><row><entry
1258 align="char">
1259<para>int request</para>
1260</entry><entry
1261 align="char">
1262<para>Equals AUDIO_SET_STREAMTYPE for this
1263 command.</para>
1264</entry>
1265 </row><row><entry
1266 align="char">
1267<para>int type</para>
1268</entry><entry
1269 align="char">
1270<para>stream type</para>
1271</entry>
1272 </row></tbody></tgroup></informaltable>
1273<para>ERRORS
1274</para>
1275<informaltable><tgroup cols="2"><tbody><row><entry
1276 align="char">
1277<para>EBADF</para>
1278</entry><entry
1279 align="char">
1280<para>fd is not a valid open file descriptor</para>
1281</entry>
1282 </row><row><entry
1283 align="char">
1284<para>EINVAL</para>
1285</entry><entry
1286 align="char">
1287<para>type is not a valid or supported stream type.</para>
1288</entry>
1289 </row></tbody></tgroup></informaltable>
1290
1291</section><section
1292role="subsection"><title>AUDIO_SET_EXT_ID</title>
1293<para>DESCRIPTION
1294</para>
1295<informaltable><tgroup cols="1"><tbody><row><entry
1296 align="char">
1297<para>This ioctl can be used to set the extension id for MPEG streams in DVD
1298 playback. Only the first 3 bits are recognized.</para>
1299</entry>
1300 </row></tbody></tgroup></informaltable>
1301<para>SYNOPSIS
1302</para>
1303<informaltable><tgroup cols="1"><tbody><row><entry
1304 align="char">
1305<para>int ioctl(fd, int request = AUDIO_SET_EXT_ID, int
1306 id);</para>
1307</entry>
1308 </row></tbody></tgroup></informaltable>
1309<para>PARAMETERS
1310</para>
1311<informaltable><tgroup cols="2"><tbody><row><entry
1312 align="char">
1313<para>int fd</para>
1314</entry><entry
1315 align="char">
1316<para>File descriptor returned by a previous call to open().</para>
1317</entry>
1318 </row><row><entry
1319 align="char">
1320<para>int request</para>
1321</entry><entry
1322 align="char">
1323<para>Equals AUDIO_SET_EXT_ID for this command.</para>
1324</entry>
1325 </row><row><entry
1326 align="char">
1327<para>int id</para>
1328</entry><entry
1329 align="char">
1330<para>audio sub_stream_id</para>
1331</entry>
1332 </row></tbody></tgroup></informaltable>
1333<para>ERRORS
1334</para>
1335<informaltable><tgroup cols="2"><tbody><row><entry
1336 align="char">
1337<para>EBADF</para>
1338</entry><entry
1339 align="char">
1340<para>fd is not a valid open file descriptor</para>
1341</entry>
1342 </row><row><entry
1343 align="char">
1344<para>EINVAL</para>
1345</entry><entry
1346 align="char">
1347<para>id is not a valid id.</para>
1348</entry>
1349 </row></tbody></tgroup></informaltable>
1350
1351</section><section
1352role="subsection"><title>AUDIO_SET_ATTRIBUTES</title>
1353<para>DESCRIPTION
1354</para>
1355<informaltable><tgroup cols="1"><tbody><row><entry
1356 align="char">
1357<para>This ioctl is intended for DVD playback and allows you to set certain
1358 information about the audio stream.</para>
1359</entry>
1360 </row></tbody></tgroup></informaltable>
1361<para>SYNOPSIS
1362</para>
1363<informaltable><tgroup cols="1"><tbody><row><entry
1364 align="char">
1365<para>int ioctl(fd, int request = AUDIO_SET_ATTRIBUTES,
1366 audio_attributes_t attr );</para>
1367</entry>
1368 </row></tbody></tgroup></informaltable>
1369<para>PARAMETERS
1370</para>
1371<informaltable><tgroup cols="2"><tbody><row><entry
1372 align="char">
1373<para>int fd</para>
1374</entry><entry
1375 align="char">
1376<para>File descriptor returned by a previous call to open().</para>
1377</entry>
1378 </row><row><entry
1379 align="char">
1380<para>int request</para>
1381</entry><entry
1382 align="char">
1383<para>Equals AUDIO_SET_ATTRIBUTES for this command.</para>
1384</entry>
1385 </row><row><entry
1386 align="char">
1387<para>audio_attributes_t
1388 attr</para>
1389</entry><entry
1390 align="char">
1391<para>audio attributes according to section ??</para>
1392</entry>
1393 </row></tbody></tgroup></informaltable>
1394<para>ERRORS
1395</para>
1396<informaltable><tgroup cols="2"><tbody><row><entry
1397 align="char">
1398<para>EBADF</para>
1399</entry><entry
1400 align="char">
1401<para>fd is not a valid open file descriptor</para>
1402</entry>
1403 </row><row><entry
1404 align="char">
1405<para>EINVAL</para>
1406</entry><entry
1407 align="char">
1408<para>attr is not a valid or supported attribute setting.</para>
1409</entry>
1410 </row></tbody></tgroup></informaltable>
1411
1412</section><section
1413role="subsection"><title>AUDIO_SET_KARAOKE</title>
1414<para>DESCRIPTION
1415</para>
1416<informaltable><tgroup cols="1"><tbody><row><entry
1417 align="char">
1418<para>This ioctl allows one to set the mixer settings for a karaoke DVD.</para>
1419</entry>
1420 </row></tbody></tgroup></informaltable>
1421<para>SYNOPSIS
1422</para>
1423<informaltable><tgroup cols="1"><tbody><row><entry
1424 align="char">
1425<para>int ioctl(fd, int request = AUDIO_SET_STREAMTYPE,
1426 audio_karaoke_t &#x22C6;karaoke);</para>
1427</entry>
1428 </row></tbody></tgroup></informaltable>
1429<para>PARAMETERS
1430</para>
1431<informaltable><tgroup cols="2"><tbody><row><entry
1432 align="char">
1433<para>int fd</para>
1434</entry><entry
1435 align="char">
1436<para>File descriptor returned by a previous call to open().</para>
1437</entry>
1438 </row><row><entry
1439 align="char">
1440<para>int request</para>
1441</entry><entry
1442 align="char">
1443<para>Equals AUDIO_SET_STREAMTYPE for this
1444 command.</para>
1445</entry>
1446 </row><row><entry
1447 align="char">
1448<para>audio_karaoke_t
1449 *karaoke</para>
1450</entry><entry
1451 align="char">
1452<para>karaoke settings according to section ??.</para>
1453</entry>
1454 </row></tbody></tgroup></informaltable>
1455<para>ERRORS
1456</para>
1457<informaltable><tgroup cols="2"><tbody><row><entry
1458 align="char">
1459<para>EBADF</para>
1460</entry><entry
1461 align="char">
1462<para>fd is not a valid open file descriptor</para>
1463</entry>
1464 </row><row><entry
1465 align="char">
1466<para>EINVAL</para>
1467</entry><entry
1468 align="char">
1469<para>karaoke is not a valid or supported karaoke setting.</para>
1470</entry>
1471 </row></tbody></tgroup></informaltable>
1472 </section>
1473</section>
diff --git a/Documentation/DocBook/dvb/ca.xml b/Documentation/DocBook/dvb/ca.xml
new file mode 100644
index 000000000000..b1f1d2fad654
--- /dev/null
+++ b/Documentation/DocBook/dvb/ca.xml
@@ -0,0 +1,221 @@
1<title>DVB CA Device</title>
2<para>The DVB CA device controls the conditional access hardware. It can be accessed through
3<emphasis role="tt">/dev/dvb/adapter0/ca0</emphasis>. Data types and and ioctl definitions can be accessed by
4including <emphasis role="tt">linux/dvb/ca.h</emphasis> in your application.
5</para>
6
7<section id="ca_data_types">
8<title>CA Data Types</title>
9
10
11<section id="ca_slot_info_t">
12<title>ca_slot_info_t</title>
13 <programlisting>
14 /&#x22C6; slot interface types and info &#x22C6;/
15
16 typedef struct ca_slot_info_s {
17 int num; /&#x22C6; slot number &#x22C6;/
18
19 int type; /&#x22C6; CA interface this slot supports &#x22C6;/
20 #define CA_CI 1 /&#x22C6; CI high level interface &#x22C6;/
21 #define CA_CI_LINK 2 /&#x22C6; CI link layer level interface &#x22C6;/
22 #define CA_CI_PHYS 4 /&#x22C6; CI physical layer level interface &#x22C6;/
23 #define CA_SC 128 /&#x22C6; simple smart card interface &#x22C6;/
24
25 unsigned int flags;
26 #define CA_CI_MODULE_PRESENT 1 /&#x22C6; module (or card) inserted &#x22C6;/
27 #define CA_CI_MODULE_READY 2
28 } ca_slot_info_t;
29</programlisting>
30
31</section>
32<section id="ca_descr_info_t">
33<title>ca_descr_info_t</title>
34 <programlisting>
35 typedef struct ca_descr_info_s {
36 unsigned int num; /&#x22C6; number of available descramblers (keys) &#x22C6;/
37 unsigned int type; /&#x22C6; type of supported scrambling system &#x22C6;/
38 #define CA_ECD 1
39 #define CA_NDS 2
40 #define CA_DSS 4
41 } ca_descr_info_t;
42</programlisting>
43
44</section>
45<section id="ca_cap_t">
46<title>ca_cap_t</title>
47 <programlisting>
48 typedef struct ca_cap_s {
49 unsigned int slot_num; /&#x22C6; total number of CA card and module slots &#x22C6;/
50 unsigned int slot_type; /&#x22C6; OR of all supported types &#x22C6;/
51 unsigned int descr_num; /&#x22C6; total number of descrambler slots (keys) &#x22C6;/
52 unsigned int descr_type;/&#x22C6; OR of all supported types &#x22C6;/
53 } ca_cap_t;
54</programlisting>
55
56</section>
57<section id="ca_msg_t">
58<title>ca_msg_t</title>
59 <programlisting>
60 /&#x22C6; a message to/from a CI-CAM &#x22C6;/
61 typedef struct ca_msg_s {
62 unsigned int index;
63 unsigned int type;
64 unsigned int length;
65 unsigned char msg[256];
66 } ca_msg_t;
67</programlisting>
68
69</section>
70<section id="ca_descr_t">
71<title>ca_descr_t</title>
72 <programlisting>
73 typedef struct ca_descr_s {
74 unsigned int index;
75 unsigned int parity;
76 unsigned char cw[8];
77 } ca_descr_t;
78</programlisting>
79 </section></section>
80<section id="ca_function_calls">
81<title>CA Function Calls</title>
82
83
84<section id="ca_fopen">
85<title>open()</title>
86<para>DESCRIPTION
87</para>
88<informaltable><tgroup cols="1"><tbody><row><entry
89 align="char">
90<para>This system call opens a named ca device (e.g. /dev/ost/ca) for subsequent use.</para>
91<para>When an open() call has succeeded, the device will be ready for use.
92 The significance of blocking or non-blocking mode is described in the
93 documentation for functions where there is a difference. It does not affect the
94 semantics of the open() call itself. A device opened in blocking mode can later
95 be put into non-blocking mode (and vice versa) using the F_SETFL command
96 of the fcntl system call. This is a standard system call, documented in the Linux
97 manual page for fcntl. Only one user can open the CA Device in O_RDWR
98 mode. All other attempts to open the device in this mode will fail, and an error
99 code will be returned.</para>
100</entry>
101 </row></tbody></tgroup></informaltable>
102<para>SYNOPSIS
103</para>
104<informaltable><tgroup cols="1"><tbody><row><entry
105 align="char">
106<para>int open(const char &#x22C6;deviceName, int flags);</para>
107</entry>
108 </row></tbody></tgroup></informaltable>
109<para>PARAMETERS
110</para>
111<informaltable><tgroup cols="2"><tbody><row><entry
112 align="char">
113<para>const char
114 *deviceName</para>
115</entry><entry
116 align="char">
117<para>Name of specific video device.</para>
118</entry>
119 </row><row><entry
120 align="char">
121<para>int flags</para>
122</entry><entry
123 align="char">
124<para>A bit-wise OR of the following flags:</para>
125</entry>
126 </row><row><entry
127 align="char">
128</entry><entry
129 align="char">
130<para>O_RDONLY read-only access</para>
131</entry>
132 </row><row><entry
133 align="char">
134</entry><entry
135 align="char">
136<para>O_RDWR read/write access</para>
137</entry>
138 </row><row><entry
139 align="char">
140</entry><entry
141 align="char">
142<para>O_NONBLOCK open in non-blocking mode</para>
143</entry>
144 </row><row><entry
145 align="char">
146</entry><entry
147 align="char">
148<para>(blocking mode is the default)</para>
149</entry>
150 </row></tbody></tgroup></informaltable>
151<para>ERRORS
152</para>
153<informaltable><tgroup cols="2"><tbody><row><entry
154 align="char">
155<para>ENODEV</para>
156</entry><entry
157 align="char">
158<para>Device driver not loaded/available.</para>
159</entry>
160 </row><row><entry
161 align="char">
162<para>EINTERNAL</para>
163</entry><entry
164 align="char">
165<para>Internal error.</para>
166</entry>
167 </row><row><entry
168 align="char">
169<para>EBUSY</para>
170</entry><entry
171 align="char">
172<para>Device or resource busy.</para>
173</entry>
174 </row><row><entry
175 align="char">
176<para>EINVAL</para>
177</entry><entry
178 align="char">
179<para>Invalid argument.</para>
180</entry>
181 </row></tbody></tgroup></informaltable>
182
183</section>
184<section id="ca_fclose">
185<title>close()</title>
186<para>DESCRIPTION
187</para>
188<informaltable><tgroup cols="1"><tbody><row><entry
189 align="char">
190<para>This system call closes a previously opened audio device.</para>
191</entry>
192 </row></tbody></tgroup></informaltable>
193<para>SYNOPSIS
194</para>
195<informaltable><tgroup cols="1"><tbody><row><entry
196 align="char">
197<para>int close(int fd);</para>
198</entry>
199 </row></tbody></tgroup></informaltable>
200<para>PARAMETERS
201</para>
202<informaltable><tgroup cols="2"><tbody><row><entry
203 align="char">
204<para>int fd</para>
205</entry><entry
206 align="char">
207<para>File descriptor returned by a previous call to open().</para>
208</entry>
209 </row></tbody></tgroup></informaltable>
210<para>ERRORS
211</para>
212<informaltable><tgroup cols="2"><tbody><row><entry
213 align="char">
214<para>EBADF</para>
215</entry><entry
216 align="char">
217<para>fd is not a valid open file descriptor.</para>
218</entry>
219 </row></tbody></tgroup></informaltable>
220 </section>
221</section>
diff --git a/Documentation/DocBook/dvb/demux.xml b/Documentation/DocBook/dvb/demux.xml
new file mode 100644
index 000000000000..1b8c4e9835b9
--- /dev/null
+++ b/Documentation/DocBook/dvb/demux.xml
@@ -0,0 +1,973 @@
1<title>DVB Demux Device</title>
2
3<para>The DVB demux device controls the filters of the DVB hardware/software. It can be
4accessed through <emphasis role="tt">/dev/adapter0/demux0</emphasis>. Data types and and ioctl definitions can be
5accessed by including <emphasis role="tt">linux/dvb/dmx.h</emphasis> in your application.
6</para>
7<section id="dmx_types">
8<title>Demux Data Types</title>
9
10<section id="dmx_output_t">
11<title>dmx_output_t</title>
12 <programlisting>
13 typedef enum
14 {
15 DMX_OUT_DECODER,
16 DMX_OUT_TAP,
17 DMX_OUT_TS_TAP
18 } dmx_output_t;
19</programlisting>
20<para><emphasis role="tt">DMX_OUT_TAP</emphasis> delivers the stream output to the demux device on which the ioctl is
21called.
22</para>
23<para><emphasis role="tt">DMX_OUT_TS_TAP</emphasis> routes output to the logical DVR device <emphasis role="tt">/dev/dvb/adapter0/dvr0</emphasis>,
24which delivers a TS multiplexed from all filters for which <emphasis role="tt">DMX_OUT_TS_TAP</emphasis> was
25specified.
26</para>
27</section>
28
29<section id="dmx_input_t">
30<title>dmx_input_t</title>
31 <programlisting>
32 typedef enum
33 {
34 DMX_IN_FRONTEND,
35 DMX_IN_DVR
36 } dmx_input_t;
37</programlisting>
38</section>
39
40<section id="dmx_pes_type_t">
41<title>dmx_pes_type_t</title>
42 <programlisting>
43 typedef enum
44 {
45 DMX_PES_AUDIO,
46 DMX_PES_VIDEO,
47 DMX_PES_TELETEXT,
48 DMX_PES_SUBTITLE,
49 DMX_PES_PCR,
50 DMX_PES_OTHER
51 } dmx_pes_type_t;
52</programlisting>
53</section>
54
55<section id="dmx_event_t">
56<title>dmx_event_t</title>
57 <programlisting>
58 typedef enum
59 {
60 DMX_SCRAMBLING_EV,
61 DMX_FRONTEND_EV
62 } dmx_event_t;
63</programlisting>
64</section>
65
66<section id="dmx_scrambling_status_t">
67<title>dmx_scrambling_status_t</title>
68 <programlisting>
69 typedef enum
70 {
71 DMX_SCRAMBLING_OFF,
72 DMX_SCRAMBLING_ON
73 } dmx_scrambling_status_t;
74</programlisting>
75</section>
76
77<section id="dmx_filter">
78<title>struct dmx_filter</title>
79 <programlisting>
80 typedef struct dmx_filter
81 {
82 uint8_t filter[DMX_FILTER_SIZE];
83 uint8_t mask[DMX_FILTER_SIZE];
84 } dmx_filter_t;
85</programlisting>
86</section>
87
88<section id="dmx_sct_filter_params">
89<title>struct dmx_sct_filter_params</title>
90 <programlisting>
91 struct dmx_sct_filter_params
92 {
93 uint16_t pid;
94 dmx_filter_t filter;
95 uint32_t timeout;
96 uint32_t flags;
97 #define DMX_CHECK_CRC 1
98 #define DMX_ONESHOT 2
99 #define DMX_IMMEDIATE_START 4
100 };
101</programlisting>
102</section>
103
104<section id="dmx_pes_filter_params">
105<title>struct dmx_pes_filter_params</title>
106 <programlisting>
107 struct dmx_pes_filter_params
108 {
109 uint16_t pid;
110 dmx_input_t input;
111 dmx_output_t output;
112 dmx_pes_type_t pes_type;
113 uint32_t flags;
114 };
115</programlisting>
116</section>
117
118<section id="dmx_event">
119<title>struct dmx_event</title>
120 <programlisting>
121 struct dmx_event
122 {
123 dmx_event_t event;
124 time_t timeStamp;
125 union
126 {
127 dmx_scrambling_status_t scrambling;
128 } u;
129 };
130</programlisting>
131</section>
132
133<section id="dmx_stc">
134<title>struct dmx_stc</title>
135 <programlisting>
136 struct dmx_stc {
137 unsigned int num; /&#x22C6; input : which STC? 0..N &#x22C6;/
138 unsigned int base; /&#x22C6; output: divisor for stc to get 90 kHz clock &#x22C6;/
139 uint64_t stc; /&#x22C6; output: stc in 'base'&#x22C6;90 kHz units &#x22C6;/
140 };
141</programlisting>
142 </section>
143
144</section>
145
146<section id="dmx_fcalls">
147<title>Demux Function Calls</title>
148
149<section id="dmx_fopen">
150<title>open()</title>
151<para>DESCRIPTION
152</para>
153<informaltable><tgroup cols="1"><tbody><row><entry
154 align="char">
155<para>This system call, used with a device name of /dev/dvb/adapter0/demux0,
156 allocates a new filter and returns a handle which can be used for subsequent
157 control of that filter. This call has to be made for each filter to be used, i.e. every
158 returned file descriptor is a reference to a single filter. /dev/dvb/adapter0/dvr0
159 is a logical device to be used for retrieving Transport Streams for digital
160 video recording. When reading from this device a transport stream containing
161 the packets from all PES filters set in the corresponding demux device
162 (/dev/dvb/adapter0/demux0) having the output set to DMX_OUT_TS_TAP. A
163 recorded Transport Stream is replayed by writing to this device. </para>
164<para>The significance of blocking or non-blocking mode is described in the
165 documentation for functions where there is a difference. It does not affect the
166 semantics of the open() call itself. A device opened in blocking mode can later
167 be put into non-blocking mode (and vice versa) using the F_SETFL command
168 of the fcntl system call.</para>
169</entry>
170 </row></tbody></tgroup></informaltable>
171<para>SYNOPSIS
172</para>
173<informaltable><tgroup cols="1"><tbody><row><entry
174 align="char">
175<para>int open(const char &#x22C6;deviceName, int flags);</para>
176</entry>
177 </row></tbody></tgroup></informaltable>
178<para>PARAMETERS
179</para>
180<informaltable><tgroup cols="2"><tbody><row><entry
181 align="char">
182<para>const char
183 *deviceName</para>
184</entry><entry
185 align="char">
186<para>Name of demux device.</para>
187</entry>
188 </row><row><entry
189 align="char">
190<para>int flags</para>
191</entry><entry
192 align="char">
193<para>A bit-wise OR of the following flags:</para>
194</entry>
195 </row><row><entry
196 align="char">
197</entry><entry
198 align="char">
199<para>O_RDWR read/write access</para>
200</entry>
201 </row><row><entry
202 align="char">
203</entry><entry
204 align="char">
205<para>O_NONBLOCK open in non-blocking mode</para>
206</entry>
207 </row><row><entry
208 align="char">
209</entry><entry
210 align="char">
211<para>(blocking mode is the default)</para>
212</entry>
213 </row></tbody></tgroup></informaltable>
214<para>ERRORS
215</para>
216<informaltable><tgroup cols="2"><tbody><row><entry
217 align="char">
218<para>ENODEV</para>
219</entry><entry
220 align="char">
221<para>Device driver not loaded/available.</para>
222</entry>
223 </row><row><entry
224 align="char">
225<para>EINVAL</para>
226</entry><entry
227 align="char">
228<para>Invalid argument.</para>
229</entry>
230 </row><row><entry
231 align="char">
232<para>EMFILE</para>
233</entry><entry
234 align="char">
235<para>&#8220;Too many open files&#8221;, i.e. no more filters available.</para>
236</entry>
237 </row><row><entry
238 align="char">
239<para>ENOMEM</para>
240</entry><entry
241 align="char">
242<para>The driver failed to allocate enough memory.</para>
243</entry>
244 </row></tbody></tgroup></informaltable>
245</section>
246
247<section id="dmx_fclose">
248<title>close()</title>
249<para>DESCRIPTION
250</para>
251<informaltable><tgroup cols="1"><tbody><row><entry
252 align="char">
253<para>This system call deactivates and deallocates a filter that was previously
254 allocated via the open() call.</para>
255</entry>
256 </row></tbody></tgroup></informaltable>
257<para>SYNOPSIS
258</para>
259<informaltable><tgroup cols="1"><tbody><row><entry
260 align="char">
261<para>int close(int fd);</para>
262</entry>
263 </row></tbody></tgroup></informaltable>
264<para>PARAMETERS
265</para>
266<informaltable><tgroup cols="2"><tbody><row><entry
267 align="char">
268<para>int fd</para>
269</entry><entry
270 align="char">
271<para>File descriptor returned by a previous call to open().</para>
272</entry>
273 </row></tbody></tgroup></informaltable>
274<para>ERRORS
275</para>
276<informaltable><tgroup cols="2"><tbody><row><entry
277 align="char">
278<para>EBADF</para>
279</entry><entry
280 align="char">
281<para>fd is not a valid open file descriptor.</para>
282</entry>
283 </row></tbody></tgroup></informaltable>
284</section>
285
286<section id="dmx_fread">
287<title>read()</title>
288<para>DESCRIPTION
289</para>
290<informaltable><tgroup cols="1"><tbody><row><entry
291 align="char">
292<para>This system call returns filtered data, which might be section or PES data. The
293 filtered data is transferred from the driver&#8217;s internal circular buffer to buf. The
294 maximum amount of data to be transferred is implied by count.</para>
295</entry>
296 </row><row><entry
297 align="char">
298<para>When returning section data the driver always tries to return a complete single
299 section (even though buf would provide buffer space for more data). If the size
300 of the buffer is smaller than the section as much as possible will be returned,
301 and the remaining data will be provided in subsequent calls.</para>
302</entry>
303 </row><row><entry
304 align="char">
305<para>The size of the internal buffer is 2 * 4096 bytes (the size of two maximum
306 sized sections) by default. The size of this buffer may be changed by using the
307 DMX_SET_BUFFER_SIZE function. If the buffer is not large enough, or if
308 the read operations are not performed fast enough, this may result in a buffer
309 overflow error. In this case EOVERFLOW will be returned, and the circular
310 buffer will be emptied. This call is blocking if there is no data to return, i.e. the
311 process will be put to sleep waiting for data, unless the O_NONBLOCK flag
312 is specified.</para>
313</entry>
314 </row><row><entry
315 align="char">
316<para>Note that in order to be able to read, the filtering process has to be started
317 by defining either a section or a PES filter by means of the ioctl functions,
318 and then starting the filtering process via the DMX_START ioctl function
319 or by setting the DMX_IMMEDIATE_START flag. If the reading is done
320 from a logical DVR demux device, the data will constitute a Transport Stream
321 including the packets from all PES filters in the corresponding demux device
322 /dev/dvb/adapter0/demux0 having the output set to DMX_OUT_TS_TAP.</para>
323</entry>
324 </row></tbody></tgroup></informaltable>
325<para>SYNOPSIS
326</para>
327<informaltable><tgroup cols="1"><tbody><row><entry
328 align="char">
329<para>size_t read(int fd, void &#x22C6;buf, size_t count);</para>
330</entry>
331 </row></tbody></tgroup></informaltable>
332<para>PARAMETERS
333</para>
334<informaltable><tgroup cols="2"><tbody><row><entry
335 align="char">
336<para>int fd</para>
337</entry><entry
338 align="char">
339<para>File descriptor returned by a previous call to open().</para>
340</entry>
341 </row><row><entry
342 align="char">
343<para>void *buf</para>
344</entry><entry
345 align="char">
346<para>Pointer to the buffer to be used for returned filtered data.</para>
347</entry>
348 </row><row><entry
349 align="char">
350<para>size_t count</para>
351</entry><entry
352 align="char">
353<para>Size of buf.</para>
354</entry>
355 </row></tbody></tgroup></informaltable>
356<para>ERRORS
357</para>
358<informaltable><tgroup cols="2"><tbody><row><entry
359 align="char">
360<para>EWOULDBLOCK</para>
361</entry><entry
362 align="char">
363<para>No data to return and O_NONBLOCK was specified.</para>
364</entry>
365 </row><row><entry
366 align="char">
367<para>EBADF</para>
368</entry><entry
369 align="char">
370<para>fd is not a valid open file descriptor.</para>
371</entry>
372 </row><row><entry
373 align="char">
374<para>ECRC</para>
375</entry><entry
376 align="char">
377<para>Last section had a CRC error - no data returned. The
378 buffer is flushed.</para>
379</entry>
380 </row><row><entry
381 align="char">
382<para>EOVERFLOW</para>
383</entry><entry
384 align="char">
385</entry>
386 </row><row><entry
387 align="char">
388</entry><entry
389 align="char">
390<para>The filtered data was not read from the buffer in due
391 time, resulting in non-read data being lost. The buffer is
392 flushed.</para>
393</entry>
394 </row><row><entry
395 align="char">
396<para>ETIMEDOUT</para>
397</entry><entry
398 align="char">
399<para>The section was not loaded within the stated timeout
400 period. See ioctl DMX_SET_FILTER for how to set a
401 timeout.</para>
402</entry>
403 </row><row><entry
404 align="char">
405<para>EFAULT</para>
406</entry><entry
407 align="char">
408<para>The driver failed to write to the callers buffer due to an
409 invalid *buf pointer.</para>
410</entry>
411 </row></tbody></tgroup></informaltable>
412</section>
413
414<section id="dmx_fwrite">
415<title>write()</title>
416<para>DESCRIPTION
417</para>
418<informaltable><tgroup cols="1"><tbody><row><entry
419 align="char">
420<para>This system call is only provided by the logical device /dev/dvb/adapter0/dvr0,
421 associated with the physical demux device that provides the actual DVR
422 functionality. It is used for replay of a digitally recorded Transport Stream.
423 Matching filters have to be defined in the corresponding physical demux
424 device, /dev/dvb/adapter0/demux0. The amount of data to be transferred is
425 implied by count.</para>
426</entry>
427 </row></tbody></tgroup></informaltable>
428<para>SYNOPSIS
429</para>
430<informaltable><tgroup cols="1"><tbody><row><entry
431 align="char">
432<para>ssize_t write(int fd, const void &#x22C6;buf, size_t
433 count);</para>
434</entry>
435 </row></tbody></tgroup></informaltable>
436<para>PARAMETERS
437</para>
438<informaltable><tgroup cols="2"><tbody><row><entry
439 align="char">
440<para>int fd</para>
441</entry><entry
442 align="char">
443<para>File descriptor returned by a previous call to open().</para>
444</entry>
445 </row><row><entry
446 align="char">
447<para>void *buf</para>
448</entry><entry
449 align="char">
450<para>Pointer to the buffer containing the Transport Stream.</para>
451</entry>
452 </row><row><entry
453 align="char">
454<para>size_t count</para>
455</entry><entry
456 align="char">
457<para>Size of buf.</para>
458</entry>
459 </row></tbody></tgroup></informaltable>
460<para>ERRORS
461</para>
462<informaltable><tgroup cols="2"><tbody><row><entry
463 align="char">
464<para>EWOULDBLOCK</para>
465</entry><entry
466 align="char">
467<para>No data was written. This
468 might happen if O_NONBLOCK was specified and there
469 is no more buffer space available (if O_NONBLOCK is
470 not specified the function will block until buffer space is
471 available).</para>
472</entry>
473 </row><row><entry
474 align="char">
475<para>EBUSY</para>
476</entry><entry
477 align="char">
478<para>This error code indicates that there are conflicting
479 requests. The corresponding demux device is setup to
480 receive data from the front- end. Make sure that these
481 filters are stopped and that the filters with input set to
482 DMX_IN_DVR are started.</para>
483</entry>
484 </row><row><entry
485 align="char">
486<para>EBADF</para>
487</entry><entry
488 align="char">
489<para>fd is not a valid open file descriptor.</para>
490</entry>
491 </row></tbody></tgroup></informaltable>
492</section>
493
494<section id="dmx_start">
495<title>DMX_START</title>
496<para>DESCRIPTION
497</para>
498<informaltable><tgroup cols="1"><tbody><row><entry
499 align="char">
500<para>This ioctl call is used to start the actual filtering operation defined via the ioctl
501 calls DMX_SET_FILTER or DMX_SET_PES_FILTER.</para>
502</entry>
503 </row></tbody></tgroup></informaltable>
504<para>SYNOPSIS
505</para>
506<informaltable><tgroup cols="1"><tbody><row><entry
507 align="char">
508<para>int ioctl( int fd, int request = DMX_START);</para>
509</entry>
510 </row></tbody></tgroup></informaltable>
511<para>PARAMETERS
512</para>
513<informaltable><tgroup cols="2"><tbody><row><entry
514 align="char">
515<para>int fd</para>
516</entry><entry
517 align="char">
518<para>File descriptor returned by a previous call to open().</para>
519</entry>
520 </row><row><entry
521 align="char">
522<para>int request</para>
523</entry><entry
524 align="char">
525<para>Equals DMX_START for this command.</para>
526</entry>
527 </row></tbody></tgroup></informaltable>
528<para>ERRORS
529</para>
530<informaltable><tgroup cols="2"><tbody><row><entry
531 align="char">
532<para>EBADF</para>
533</entry><entry
534 align="char">
535<para>fd is not a valid file descriptor.</para>
536</entry>
537 </row><row><entry
538 align="char">
539<para>EINVAL</para>
540</entry><entry
541 align="char">
542<para>Invalid argument, i.e. no filtering parameters provided via
543 the DMX_SET_FILTER or DMX_SET_PES_FILTER
544 functions.</para>
545</entry>
546 </row><row><entry
547 align="char">
548<para>EBUSY</para>
549</entry><entry
550 align="char">
551<para>This error code indicates that there are conflicting
552 requests. There are active filters filtering data from
553 another input source. Make sure that these filters are
554 stopped before starting this filter.</para>
555</entry>
556 </row></tbody></tgroup></informaltable>
557</section>
558
559<section id="dmx_stop">
560<title>DMX_STOP</title>
561<para>DESCRIPTION
562</para>
563<informaltable><tgroup cols="1"><tbody><row><entry
564 align="char">
565<para>This ioctl call is used to stop the actual filtering operation defined via the
566 ioctl calls DMX_SET_FILTER or DMX_SET_PES_FILTER and started via
567 the DMX_START command.</para>
568</entry>
569 </row></tbody></tgroup></informaltable>
570<para>SYNOPSIS
571</para>
572<informaltable><tgroup cols="1"><tbody><row><entry
573 align="char">
574<para>int ioctl( int fd, int request = DMX_STOP);</para>
575</entry>
576 </row></tbody></tgroup></informaltable>
577<para>PARAMETERS
578</para>
579<informaltable><tgroup cols="2"><tbody><row><entry
580 align="char">
581<para>int fd</para>
582</entry><entry
583 align="char">
584<para>File descriptor returned by a previous call to open().</para>
585</entry>
586 </row><row><entry
587 align="char">
588<para>int request</para>
589</entry><entry
590 align="char">
591<para>Equals DMX_STOP for this command.</para>
592</entry>
593 </row></tbody></tgroup></informaltable>
594<para>ERRORS
595</para>
596<informaltable><tgroup cols="2"><tbody><row><entry
597 align="char">
598<para>EBADF</para>
599</entry><entry
600 align="char">
601<para>fd is not a valid file descriptor.</para>
602</entry>
603 </row></tbody></tgroup></informaltable>
604</section>
605
606<section id="dmx_set_filter">
607<title>DMX_SET_FILTER</title>
608<para>DESCRIPTION
609</para>
610<informaltable><tgroup cols="1"><tbody><row><entry
611 align="char">
612<para>This ioctl call sets up a filter according to the filter and mask parameters
613 provided. A timeout may be defined stating number of seconds to wait for a
614 section to be loaded. A value of 0 means that no timeout should be applied.
615 Finally there is a flag field where it is possible to state whether a section should
616 be CRC-checked, whether the filter should be a &#8221;one-shot&#8221; filter, i.e. if the
617 filtering operation should be stopped after the first section is received, and
618 whether the filtering operation should be started immediately (without waiting
619 for a DMX_START ioctl call). If a filter was previously set-up, this filter will
620 be canceled, and the receive buffer will be flushed.</para>
621</entry>
622 </row></tbody></tgroup></informaltable>
623<para>SYNOPSIS
624</para>
625<informaltable><tgroup cols="1"><tbody><row><entry
626 align="char">
627<para>int ioctl( int fd, int request = DMX_SET_FILTER,
628 struct dmx_sct_filter_params &#x22C6;params);</para>
629</entry>
630 </row></tbody></tgroup></informaltable>
631<para>PARAMETERS
632</para>
633<informaltable><tgroup cols="2"><tbody><row><entry
634 align="char">
635<para>int fd</para>
636</entry><entry
637 align="char">
638<para>File descriptor returned by a previous call to open().</para>
639</entry>
640 </row><row><entry
641 align="char">
642<para>int request</para>
643</entry><entry
644 align="char">
645<para>Equals DMX_SET_FILTER for this command.</para>
646</entry>
647 </row><row><entry
648 align="char">
649<para>struct
650 dmx_sct_filter_params
651 *params</para>
652</entry><entry
653 align="char">
654<para>Pointer to structure containing filter parameters.</para>
655</entry>
656 </row></tbody></tgroup></informaltable>
657<para>ERRORS
658</para>
659<informaltable><tgroup cols="2"><tbody><row><entry
660 align="char">
661<para>EBADF</para>
662</entry><entry
663 align="char">
664<para>fd is not a valid file descriptor.</para>
665</entry>
666 </row><row><entry
667 align="char">
668<para>EINVAL</para>
669</entry><entry
670 align="char">
671<para>Invalid argument.</para>
672</entry>
673 </row></tbody></tgroup></informaltable>
674</section>
675
676<section id="dmx_set_pes_filter">
677<title>DMX_SET_PES_FILTER</title>
678<para>DESCRIPTION
679</para>
680<informaltable><tgroup cols="1"><tbody><row><entry
681 align="char">
682<para>This ioctl call sets up a PES filter according to the parameters provided. By a
683 PES filter is meant a filter that is based just on the packet identifier (PID), i.e.
684 no PES header or payload filtering capability is supported.</para>
685</entry>
686 </row><row><entry
687 align="char">
688<para>The transport stream destination for the filtered output may be set. Also the
689 PES type may be stated in order to be able to e.g. direct a video stream directly
690 to the video decoder. Finally there is a flag field where it is possible to state
691 whether the filtering operation should be started immediately (without waiting
692 for a DMX_START ioctl call). If a filter was previously set-up, this filter will
693 be cancelled, and the receive buffer will be flushed.</para>
694</entry>
695 </row></tbody></tgroup></informaltable>
696<para>SYNOPSIS
697</para>
698<informaltable><tgroup cols="1"><tbody><row><entry
699 align="char">
700<para>int ioctl( int fd, int request = DMX_SET_PES_FILTER,
701 struct dmx_pes_filter_params &#x22C6;params);</para>
702</entry>
703 </row></tbody></tgroup></informaltable>
704<para>PARAMETERS
705</para>
706<informaltable><tgroup cols="2"><tbody><row><entry
707 align="char">
708<para>int fd</para>
709</entry><entry
710 align="char">
711<para>File descriptor returned by a previous call to open().</para>
712</entry>
713 </row><row><entry
714 align="char">
715<para>int request</para>
716</entry><entry
717 align="char">
718<para>Equals DMX_SET_PES_FILTER for this command.</para>
719</entry>
720 </row><row><entry
721 align="char">
722<para>struct
723 dmx_pes_filter_params
724 *params</para>
725</entry><entry
726 align="char">
727<para>Pointer to structure containing filter parameters.</para>
728</entry>
729 </row></tbody></tgroup></informaltable>
730<para>ERRORS
731</para>
732<informaltable><tgroup cols="2"><tbody><row><entry
733 align="char">
734<para>EBADF</para>
735</entry><entry
736 align="char">
737<para>fd is not a valid file descriptor.</para>
738</entry>
739 </row><row><entry
740 align="char">
741<para>EINVAL</para>
742</entry><entry
743 align="char">
744<para>Invalid argument.</para>
745</entry>
746 </row><row><entry
747 align="char">
748<para>EBUSY</para>
749</entry><entry
750 align="char">
751<para>This error code indicates that there are conflicting
752 requests. There are active filters filtering data from
753 another input source. Make sure that these filters are
754 stopped before starting this filter.</para>
755</entry>
756 </row></tbody></tgroup></informaltable>
757</section>
758
759<section id="dms_set_buffer_size">
760<title>DMX_SET_BUFFER_SIZE</title>
761<para>DESCRIPTION
762</para>
763<informaltable><tgroup cols="1"><tbody><row><entry
764 align="char">
765<para>This ioctl call is used to set the size of the circular buffer used for filtered data.
766 The default size is two maximum sized sections, i.e. if this function is not called
767 a buffer size of 2 * 4096 bytes will be used.</para>
768</entry>
769 </row></tbody></tgroup></informaltable>
770<para>SYNOPSIS
771</para>
772<informaltable><tgroup cols="1"><tbody><row><entry
773 align="char">
774<para>int ioctl( int fd, int request =
775 DMX_SET_BUFFER_SIZE, unsigned long size);</para>
776</entry>
777 </row></tbody></tgroup></informaltable>
778<para>PARAMETERS
779</para>
780<informaltable><tgroup cols="2"><tbody><row><entry
781 align="char">
782<para>int fd</para>
783</entry><entry
784 align="char">
785<para>File descriptor returned by a previous call to open().</para>
786</entry>
787 </row><row><entry
788 align="char">
789<para>int request</para>
790</entry><entry
791 align="char">
792<para>Equals DMX_SET_BUFFER_SIZE for this command.</para>
793</entry>
794 </row><row><entry
795 align="char">
796<para>unsigned long size</para>
797</entry><entry
798 align="char">
799<para>Size of circular buffer.</para>
800</entry>
801 </row></tbody></tgroup></informaltable>
802<para>ERRORS
803</para>
804<informaltable><tgroup cols="2"><tbody><row><entry
805 align="char">
806<para>EBADF</para>
807</entry><entry
808 align="char">
809<para>fd is not a valid file descriptor.</para>
810</entry>
811 </row><row><entry
812 align="char">
813<para>ENOMEM</para>
814</entry><entry
815 align="char">
816<para>The driver was not able to allocate a buffer of the
817 requested size.</para>
818</entry>
819 </row></tbody></tgroup></informaltable>
820</section>
821
822<section id="dmx_get_event">
823<title>DMX_GET_EVENT</title>
824<para>DESCRIPTION
825</para>
826<informaltable><tgroup cols="1"><tbody><row><entry
827 align="char">
828<para>This ioctl call returns an event if available. If an event is not available,
829 the behavior depends on whether the device is in blocking or non-blocking
830 mode. In the latter case, the call fails immediately with errno set to
831 EWOULDBLOCK. In the former case, the call blocks until an event becomes
832 available.</para>
833</entry>
834 </row><row><entry
835 align="char">
836<para>The standard Linux poll() and/or select() system calls can be used with the
837 device file descriptor to watch for new events. For select(), the file descriptor
838 should be included in the exceptfds argument, and for poll(), POLLPRI should
839 be specified as the wake-up condition. Only the latest event for each filter is
840 saved.</para>
841</entry>
842 </row></tbody></tgroup></informaltable>
843<para>SYNOPSIS
844</para>
845<informaltable><tgroup cols="1"><tbody><row><entry
846 align="char">
847<para>int ioctl( int fd, int request = DMX_GET_EVENT,
848 struct dmx_event &#x22C6;ev);</para>
849</entry>
850 </row></tbody></tgroup></informaltable>
851<para>PARAMETERS
852</para>
853<informaltable><tgroup cols="2"><tbody><row><entry
854 align="char">
855<para>int fd</para>
856</entry><entry
857 align="char">
858<para>File descriptor returned by a previous call to open().</para>
859</entry>
860 </row><row><entry
861 align="char">
862<para>int request</para>
863</entry><entry
864 align="char">
865<para>Equals DMX_GET_EVENT for this command.</para>
866</entry>
867 </row><row><entry
868 align="char">
869<para>struct dmx_event *ev</para>
870</entry><entry
871 align="char">
872<para>Pointer to the location where the event is to be stored.</para>
873</entry>
874 </row></tbody></tgroup></informaltable>
875<para>ERRORS
876</para>
877<informaltable><tgroup cols="2"><tbody><row><entry
878 align="char">
879<para>EBADF</para>
880</entry><entry
881 align="char">
882<para>fd is not a valid file descriptor.</para>
883</entry>
884 </row><row><entry
885 align="char">
886<para>EFAULT</para>
887</entry><entry
888 align="char">
889<para>ev points to an invalid address.</para>
890</entry>
891 </row><row><entry
892 align="char">
893<para>EWOULDBLOCK</para>
894</entry><entry
895 align="char">
896<para>There is no event pending, and the device is in
897 non-blocking mode.</para>
898</entry>
899 </row></tbody></tgroup></informaltable>
900</section>
901
902<section id="dmx_get_stc">
903<title>DMX_GET_STC</title>
904<para>DESCRIPTION
905</para>
906<informaltable><tgroup cols="1"><tbody><row><entry
907 align="char">
908<para>This ioctl call returns the current value of the system time counter (which is driven
909 by a PES filter of type DMX_PES_PCR). Some hardware supports more than one
910 STC, so you must specify which one by setting the num field of stc before the ioctl
911 (range 0...n). The result is returned in form of a ratio with a 64 bit numerator
912 and a 32 bit denominator, so the real 90kHz STC value is stc-&#x003E;stc /
913 stc-&#x003E;base
914 .</para>
915</entry>
916 </row></tbody></tgroup></informaltable>
917<para>SYNOPSIS
918</para>
919<informaltable><tgroup cols="1"><tbody><row><entry
920 align="char">
921<para>int ioctl( int fd, int request = DMX_GET_STC, struct
922 dmx_stc &#x22C6;stc);</para>
923</entry>
924 </row></tbody></tgroup></informaltable>
925<para>PARAMETERS
926</para>
927<informaltable><tgroup cols="2"><tbody><row><entry
928 align="char">
929<para>int fd</para>
930</entry><entry
931 align="char">
932<para>File descriptor returned by a previous call to open().</para>
933</entry>
934 </row><row><entry
935 align="char">
936<para>int request</para>
937</entry><entry
938 align="char">
939<para>Equals DMX_GET_STC for this command.</para>
940</entry>
941 </row><row><entry
942 align="char">
943<para>struct dmx_stc *stc</para>
944</entry><entry
945 align="char">
946<para>Pointer to the location where the stc is to be stored.</para>
947</entry>
948 </row></tbody></tgroup></informaltable>
949<para>ERRORS
950</para>
951<informaltable><tgroup cols="2"><tbody><row><entry
952 align="char">
953<para>EBADF</para>
954</entry><entry
955 align="char">
956<para>fd is not a valid file descriptor.</para>
957</entry>
958 </row><row><entry
959 align="char">
960<para>EFAULT</para>
961</entry><entry
962 align="char">
963<para>stc points to an invalid address.</para>
964</entry>
965 </row><row><entry
966 align="char">
967<para>EINVAL</para>
968</entry><entry
969 align="char">
970<para>Invalid stc number.</para>
971</entry>
972 </row></tbody></tgroup></informaltable>
973 </section></section>
diff --git a/Documentation/DocBook/dvb/dvbapi.xml b/Documentation/DocBook/dvb/dvbapi.xml
new file mode 100644
index 000000000000..d53ca4e98e84
--- /dev/null
+++ b/Documentation/DocBook/dvb/dvbapi.xml
@@ -0,0 +1,79 @@
1<partinfo>
2<authorgroup>
3<author>
4<firstname>Ralph</firstname>
5<surname>Metzler</surname>
6<othername role="mi">J. K.</othername>
7<affiliation><address><email>rjkm@metzlerbros.de</email></address></affiliation>
8</author>
9<author>
10<firstname>Marcus</firstname>
11<surname>Metzler</surname>
12<othername role="mi">O. C.</othername>
13<affiliation><address><email>rjkm@metzlerbros.de</email></address></affiliation>
14</author>
15<author>
16<firstname>Mauro</firstname>
17<surname>Chehab</surname>
18<othername role="mi">Carvalho</othername>
19<affiliation><address><email>mchehab@redhat.com</email></address></affiliation>
20<contrib>Ported document to Docbook XML.</contrib>
21</author>
22</authorgroup>
23<copyright>
24 <year>2002</year>
25 <year>2003</year>
26 <year>2009</year>
27 <holder>Convergence GmbH</holder>
28</copyright>
29
30<revhistory>
31<!-- Put document revisions here, newest first. -->
32<revision>
33<revnumber>2.0.0</revnumber>
34<date>2009-09-06</date>
35<authorinitials>mcc</authorinitials>
36<revremark>Conversion from LaTex to DocBook XML. The
37 contents is the same as the original LaTex version.</revremark>
38</revision>
39<revision>
40<revnumber>1.0.0</revnumber>
41<date>2003-07-24</date>
42<authorinitials>rjkm</authorinitials>
43<revremark>Initial revision on LaTEX.</revremark>
44</revision>
45</revhistory>
46</partinfo>
47
48
49<title>LINUX DVB API</title>
50<subtitle>Version 3</subtitle>
51<!-- ADD THE CHAPTERS HERE -->
52 <chapter id="dvb_introdution">
53 &sub-intro;
54 </chapter>
55 <chapter id="dvb_frontend">
56 &sub-frontend;
57 </chapter>
58 <chapter id="dvb_demux">
59 &sub-demux;
60 </chapter>
61 <chapter id="dvb_video">
62 &sub-video;
63 </chapter>
64 <chapter id="dvb_audio">
65 &sub-audio;
66 </chapter>
67 <chapter id="dvb_ca">
68 &sub-ca;
69 </chapter>
70 <chapter id="dvb_net">
71 &sub-net;
72 </chapter>
73 <chapter id="dvb_kdapi">
74 &sub-kdapi;
75 </chapter>
76 <chapter id="dvb_examples">
77 &sub-examples;
78 </chapter>
79<!-- END OF CHAPTERS -->
diff --git a/Documentation/DocBook/dvb/dvbstb.pdf b/Documentation/DocBook/dvb/dvbstb.pdf
new file mode 100644
index 000000000000..0fa75d90c3eb
--- /dev/null
+++ b/Documentation/DocBook/dvb/dvbstb.pdf
Binary files differ
diff --git a/Documentation/DocBook/dvb/dvbstb.png b/Documentation/DocBook/dvb/dvbstb.png
new file mode 100644
index 000000000000..9b8f372e7afd
--- /dev/null
+++ b/Documentation/DocBook/dvb/dvbstb.png
Binary files differ
diff --git a/Documentation/DocBook/dvb/examples.xml b/Documentation/DocBook/dvb/examples.xml
new file mode 100644
index 000000000000..b89dceda6048
--- /dev/null
+++ b/Documentation/DocBook/dvb/examples.xml
@@ -0,0 +1,365 @@
1<title>Examples</title>
2<para>In this section we would like to present some examples for using the DVB API.
3</para>
4<para>Maintainer note: This section is out of date. Please refer to the sample programs packaged
5with the driver distribution from <emphasis role="tt">http://linuxtv.org/</emphasis>.
6</para>
7
8<section id="tuning">
9<title>Tuning</title>
10<para>We will start with a generic tuning subroutine that uses the frontend and SEC, as well as
11the demux devices. The example is given for QPSK tuners, but can easily be adjusted for
12QAM.
13</para>
14<programlisting>
15 #include &#x003C;sys/ioctl.h&#x003E;
16 #include &#x003C;stdio.h&#x003E;
17 #include &#x003C;stdint.h&#x003E;
18 #include &#x003C;sys/types.h&#x003E;
19 #include &#x003C;sys/stat.h&#x003E;
20 #include &#x003C;fcntl.h&#x003E;
21 #include &#x003C;time.h&#x003E;
22 #include &#x003C;unistd.h&#x003E;
23
24 #include &#x003C;linux/dvb/dmx.h&#x003E;
25 #include &#x003C;linux/dvb/frontend.h&#x003E;
26 #include &#x003C;linux/dvb/sec.h&#x003E;
27 #include &#x003C;sys/poll.h&#x003E;
28
29 #define DMX "/dev/dvb/adapter0/demux1"
30 #define FRONT "/dev/dvb/adapter0/frontend1"
31 #define SEC "/dev/dvb/adapter0/sec1"
32
33 /&#x22C6; routine for checking if we have a signal and other status information&#x22C6;/
34 int FEReadStatus(int fd, fe_status_t &#x22C6;stat)
35 {
36 int ans;
37
38 if ( (ans = ioctl(fd,FE_READ_STATUS,stat) &#x003C; 0)){
39 perror("FE READ STATUS: ");
40 return -1;
41 }
42
43 if (&#x22C6;stat &amp; FE_HAS_POWER)
44 printf("FE HAS POWER\n");
45
46 if (&#x22C6;stat &amp; FE_HAS_SIGNAL)
47 printf("FE HAS SIGNAL\n");
48
49 if (&#x22C6;stat &amp; FE_SPECTRUM_INV)
50 printf("SPEKTRUM INV\n");
51
52 return 0;
53 }
54
55
56 /&#x22C6; tune qpsk &#x22C6;/
57 /&#x22C6; freq: frequency of transponder &#x22C6;/
58 /&#x22C6; vpid, apid, tpid: PIDs of video, audio and teletext TS packets &#x22C6;/
59 /&#x22C6; diseqc: DiSEqC address of the used LNB &#x22C6;/
60 /&#x22C6; pol: Polarisation &#x22C6;/
61 /&#x22C6; srate: Symbol Rate &#x22C6;/
62 /&#x22C6; fec. FEC &#x22C6;/
63 /&#x22C6; lnb_lof1: local frequency of lower LNB band &#x22C6;/
64 /&#x22C6; lnb_lof2: local frequency of upper LNB band &#x22C6;/
65 /&#x22C6; lnb_slof: switch frequency of LNB &#x22C6;/
66
67 int set_qpsk_channel(int freq, int vpid, int apid, int tpid,
68 int diseqc, int pol, int srate, int fec, int lnb_lof1,
69 int lnb_lof2, int lnb_slof)
70 {
71 struct secCommand scmd;
72 struct secCmdSequence scmds;
73 struct dmx_pes_filter_params pesFilterParams;
74 FrontendParameters frp;
75 struct pollfd pfd[1];
76 FrontendEvent event;
77 int demux1, demux2, demux3, front;
78
79 frequency = (uint32_t) freq;
80 symbolrate = (uint32_t) srate;
81
82 if((front = open(FRONT,O_RDWR)) &#x003C; 0){
83 perror("FRONTEND DEVICE: ");
84 return -1;
85 }
86
87 if((sec = open(SEC,O_RDWR)) &#x003C; 0){
88 perror("SEC DEVICE: ");
89 return -1;
90 }
91
92 if (demux1 &#x003C; 0){
93 if ((demux1=open(DMX, O_RDWR|O_NONBLOCK))
94 &#x003C; 0){
95 perror("DEMUX DEVICE: ");
96 return -1;
97 }
98 }
99
100 if (demux2 &#x003C; 0){
101 if ((demux2=open(DMX, O_RDWR|O_NONBLOCK))
102 &#x003C; 0){
103 perror("DEMUX DEVICE: ");
104 return -1;
105 }
106 }
107
108 if (demux3 &#x003C; 0){
109 if ((demux3=open(DMX, O_RDWR|O_NONBLOCK))
110 &#x003C; 0){
111 perror("DEMUX DEVICE: ");
112 return -1;
113 }
114 }
115
116 if (freq &#x003C; lnb_slof) {
117 frp.Frequency = (freq - lnb_lof1);
118 scmds.continuousTone = SEC_TONE_OFF;
119 } else {
120 frp.Frequency = (freq - lnb_lof2);
121 scmds.continuousTone = SEC_TONE_ON;
122 }
123 frp.Inversion = INVERSION_AUTO;
124 if (pol) scmds.voltage = SEC_VOLTAGE_18;
125 else scmds.voltage = SEC_VOLTAGE_13;
126
127 scmd.type=0;
128 scmd.u.diseqc.addr=0x10;
129 scmd.u.diseqc.cmd=0x38;
130 scmd.u.diseqc.numParams=1;
131 scmd.u.diseqc.params[0] = 0xF0 | ((diseqc &#x22C6; 4) &amp; 0x0F) |
132 (scmds.continuousTone == SEC_TONE_ON ? 1 : 0) |
133 (scmds.voltage==SEC_VOLTAGE_18 ? 2 : 0);
134
135 scmds.miniCommand=SEC_MINI_NONE;
136 scmds.numCommands=1;
137 scmds.commands=&amp;scmd;
138 if (ioctl(sec, SEC_SEND_SEQUENCE, &amp;scmds) &#x003C; 0){
139 perror("SEC SEND: ");
140 return -1;
141 }
142
143 if (ioctl(sec, SEC_SEND_SEQUENCE, &amp;scmds) &#x003C; 0){
144 perror("SEC SEND: ");
145 return -1;
146 }
147
148 frp.u.qpsk.SymbolRate = srate;
149 frp.u.qpsk.FEC_inner = fec;
150
151 if (ioctl(front, FE_SET_FRONTEND, &amp;frp) &#x003C; 0){
152 perror("QPSK TUNE: ");
153 return -1;
154 }
155
156 pfd[0].fd = front;
157 pfd[0].events = POLLIN;
158
159 if (poll(pfd,1,3000)){
160 if (pfd[0].revents &amp; POLLIN){
161 printf("Getting QPSK event\n");
162 if ( ioctl(front, FE_GET_EVENT, &amp;event)
163
164 == -EOVERFLOW){
165 perror("qpsk get event");
166 return -1;
167 }
168 printf("Received ");
169 switch(event.type){
170 case FE_UNEXPECTED_EV:
171 printf("unexpected event\n");
172 return -1;
173 case FE_FAILURE_EV:
174 printf("failure event\n");
175 return -1;
176
177 case FE_COMPLETION_EV:
178 printf("completion event\n");
179 }
180 }
181 }
182
183
184 pesFilterParams.pid = vpid;
185 pesFilterParams.input = DMX_IN_FRONTEND;
186 pesFilterParams.output = DMX_OUT_DECODER;
187 pesFilterParams.pes_type = DMX_PES_VIDEO;
188 pesFilterParams.flags = DMX_IMMEDIATE_START;
189 if (ioctl(demux1, DMX_SET_PES_FILTER, &amp;pesFilterParams) &#x003C; 0){
190 perror("set_vpid");
191 return -1;
192 }
193
194 pesFilterParams.pid = apid;
195 pesFilterParams.input = DMX_IN_FRONTEND;
196 pesFilterParams.output = DMX_OUT_DECODER;
197 pesFilterParams.pes_type = DMX_PES_AUDIO;
198 pesFilterParams.flags = DMX_IMMEDIATE_START;
199 if (ioctl(demux2, DMX_SET_PES_FILTER, &amp;pesFilterParams) &#x003C; 0){
200 perror("set_apid");
201 return -1;
202 }
203
204 pesFilterParams.pid = tpid;
205 pesFilterParams.input = DMX_IN_FRONTEND;
206 pesFilterParams.output = DMX_OUT_DECODER;
207 pesFilterParams.pes_type = DMX_PES_TELETEXT;
208 pesFilterParams.flags = DMX_IMMEDIATE_START;
209 if (ioctl(demux3, DMX_SET_PES_FILTER, &amp;pesFilterParams) &#x003C; 0){
210 perror("set_tpid");
211 return -1;
212 }
213
214 return has_signal(fds);
215 }
216
217</programlisting>
218<para>The program assumes that you are using a universal LNB and a standard DiSEqC
219switch with up to 4 addresses. Of course, you could build in some more checking if
220tuning was successful and maybe try to repeat the tuning process. Depending on the
221external hardware, i.e. LNB and DiSEqC switch, and weather conditions this may be
222necessary.
223</para>
224</section>
225
226<section id="the_dvr_device">
227<title>The DVR device</title>
228<para>The following program code shows how to use the DVR device for recording.
229</para>
230<programlisting>
231 #include &#x003C;sys/ioctl.h&#x003E;
232 #include &#x003C;stdio.h&#x003E;
233 #include &#x003C;stdint.h&#x003E;
234 #include &#x003C;sys/types.h&#x003E;
235 #include &#x003C;sys/stat.h&#x003E;
236 #include &#x003C;fcntl.h&#x003E;
237 #include &#x003C;time.h&#x003E;
238 #include &#x003C;unistd.h&#x003E;
239
240 #include &#x003C;linux/dvb/dmx.h&#x003E;
241 #include &#x003C;linux/dvb/video.h&#x003E;
242 #include &#x003C;sys/poll.h&#x003E;
243 #define DVR "/dev/dvb/adapter0/dvr1"
244 #define AUDIO "/dev/dvb/adapter0/audio1"
245 #define VIDEO "/dev/dvb/adapter0/video1"
246
247 #define BUFFY (188&#x22C6;20)
248 #define MAX_LENGTH (1024&#x22C6;1024&#x22C6;5) /&#x22C6; record 5MB &#x22C6;/
249
250
251 /&#x22C6; switch the demuxes to recording, assuming the transponder is tuned &#x22C6;/
252
253 /&#x22C6; demux1, demux2: file descriptor of video and audio filters &#x22C6;/
254 /&#x22C6; vpid, apid: PIDs of video and audio channels &#x22C6;/
255
256 int switch_to_record(int demux1, int demux2, uint16_t vpid, uint16_t apid)
257 {
258 struct dmx_pes_filter_params pesFilterParams;
259
260 if (demux1 &#x003C; 0){
261 if ((demux1=open(DMX, O_RDWR|O_NONBLOCK))
262 &#x003C; 0){
263 perror("DEMUX DEVICE: ");
264 return -1;
265 }
266 }
267
268 if (demux2 &#x003C; 0){
269 if ((demux2=open(DMX, O_RDWR|O_NONBLOCK))
270 &#x003C; 0){
271 perror("DEMUX DEVICE: ");
272 return -1;
273 }
274 }
275
276 pesFilterParams.pid = vpid;
277 pesFilterParams.input = DMX_IN_FRONTEND;
278 pesFilterParams.output = DMX_OUT_TS_TAP;
279 pesFilterParams.pes_type = DMX_PES_VIDEO;
280 pesFilterParams.flags = DMX_IMMEDIATE_START;
281 if (ioctl(demux1, DMX_SET_PES_FILTER, &amp;pesFilterParams) &#x003C; 0){
282 perror("DEMUX DEVICE");
283 return -1;
284 }
285 pesFilterParams.pid = apid;
286 pesFilterParams.input = DMX_IN_FRONTEND;
287 pesFilterParams.output = DMX_OUT_TS_TAP;
288 pesFilterParams.pes_type = DMX_PES_AUDIO;
289 pesFilterParams.flags = DMX_IMMEDIATE_START;
290 if (ioctl(demux2, DMX_SET_PES_FILTER, &amp;pesFilterParams) &#x003C; 0){
291 perror("DEMUX DEVICE");
292 return -1;
293 }
294 return 0;
295 }
296
297 /&#x22C6; start recording MAX_LENGTH , assuming the transponder is tuned &#x22C6;/
298
299 /&#x22C6; demux1, demux2: file descriptor of video and audio filters &#x22C6;/
300 /&#x22C6; vpid, apid: PIDs of video and audio channels &#x22C6;/
301 int record_dvr(int demux1, int demux2, uint16_t vpid, uint16_t apid)
302 {
303 int i;
304 int len;
305 int written;
306 uint8_t buf[BUFFY];
307 uint64_t length;
308 struct pollfd pfd[1];
309 int dvr, dvr_out;
310
311 /&#x22C6; open dvr device &#x22C6;/
312 if ((dvr = open(DVR, O_RDONLY|O_NONBLOCK)) &#x003C; 0){
313 perror("DVR DEVICE");
314 return -1;
315 }
316
317 /&#x22C6; switch video and audio demuxes to dvr &#x22C6;/
318 printf ("Switching dvr on\n");
319 i = switch_to_record(demux1, demux2, vpid, apid);
320 printf("finished: ");
321
322 printf("Recording %2.0f MB of test file in TS format\n",
323 MAX_LENGTH/(1024.0&#x22C6;1024.0));
324 length = 0;
325
326 /&#x22C6; open output file &#x22C6;/
327 if ((dvr_out = open(DVR_FILE,O_WRONLY|O_CREAT
328 |O_TRUNC, S_IRUSR|S_IWUSR
329 |S_IRGRP|S_IWGRP|S_IROTH|
330 S_IWOTH)) &#x003C; 0){
331 perror("Can't open file for dvr test");
332 return -1;
333 }
334
335 pfd[0].fd = dvr;
336 pfd[0].events = POLLIN;
337
338 /&#x22C6; poll for dvr data and write to file &#x22C6;/
339 while (length &#x003C; MAX_LENGTH ) {
340 if (poll(pfd,1,1)){
341 if (pfd[0].revents &amp; POLLIN){
342 len = read(dvr, buf, BUFFY);
343 if (len &#x003C; 0){
344 perror("recording");
345 return -1;
346 }
347 if (len &#x003E; 0){
348 written = 0;
349 while (written &#x003C; len)
350 written +=
351 write (dvr_out,
352 buf, len);
353 length += len;
354 printf("written %2.0f MB\r",
355 length/1024./1024.);
356 }
357 }
358 }
359 }
360 return 0;
361 }
362
363</programlisting>
364
365</section>
diff --git a/Documentation/DocBook/dvb/frontend.xml b/Documentation/DocBook/dvb/frontend.xml
new file mode 100644
index 000000000000..91a749f70cb8
--- /dev/null
+++ b/Documentation/DocBook/dvb/frontend.xml
@@ -0,0 +1,1765 @@
1<title>DVB Frontend API</title>
2
3<para>The DVB frontend device controls the tuner and DVB demodulator
4hardware. It can be accessed through <emphasis
5role="tt">/dev/dvb/adapter0/frontend0</emphasis>. Data types and and
6ioctl definitions can be accessed by including <emphasis
7role="tt">linux/dvb/frontend.h</emphasis> in your application.</para>
8
9<para>DVB frontends come in three varieties: DVB-S (satellite), DVB-C
10(cable) and DVB-T (terrestrial). Transmission via the internet (DVB-IP)
11is not yet handled by this API but a future extension is possible. For
12DVB-S the frontend device also supports satellite equipment control
13(SEC) via DiSEqC and V-SEC protocols. The DiSEqC (digital SEC)
14specification is available from Eutelsat <emphasis
15role="tt">http://www.eutelsat.org/</emphasis>.</para>
16
17<para>Note that the DVB API may also be used for MPEG decoder-only PCI
18cards, in which case there exists no frontend device.</para>
19
20<section id="frontend_types">
21<title>Frontend Data Types</title>
22
23<section id="frontend_type">
24<title>frontend type</title>
25
26<para>For historical reasons frontend types are named after the type of modulation used in
27transmission.</para>
28<programlisting>
29 typedef enum fe_type {
30 FE_QPSK, /&#x22C6; DVB-S &#x22C6;/
31 FE_QAM, /&#x22C6; DVB-C &#x22C6;/
32 FE_OFDM /&#x22C6; DVB-T &#x22C6;/
33 } fe_type_t;
34</programlisting>
35
36</section>
37
38<section id="frontend_caps">
39<title>frontend capabilities</title>
40
41<para>Capabilities describe what a frontend can do. Some capabilities can only be supported for
42a specific frontend type.</para>
43<programlisting>
44 typedef enum fe_caps {
45 FE_IS_STUPID = 0,
46 FE_CAN_INVERSION_AUTO = 0x1,
47 FE_CAN_FEC_1_2 = 0x2,
48 FE_CAN_FEC_2_3 = 0x4,
49 FE_CAN_FEC_3_4 = 0x8,
50 FE_CAN_FEC_4_5 = 0x10,
51 FE_CAN_FEC_5_6 = 0x20,
52 FE_CAN_FEC_6_7 = 0x40,
53 FE_CAN_FEC_7_8 = 0x80,
54 FE_CAN_FEC_8_9 = 0x100,
55 FE_CAN_FEC_AUTO = 0x200,
56 FE_CAN_QPSK = 0x400,
57 FE_CAN_QAM_16 = 0x800,
58 FE_CAN_QAM_32 = 0x1000,
59 FE_CAN_QAM_64 = 0x2000,
60 FE_CAN_QAM_128 = 0x4000,
61 FE_CAN_QAM_256 = 0x8000,
62 FE_CAN_QAM_AUTO = 0x10000,
63 FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
64 FE_CAN_BANDWIDTH_AUTO = 0x40000,
65 FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
66 FE_CAN_HIERARCHY_AUTO = 0x100000,
67 FE_CAN_MUTE_TS = 0x80000000,
68 FE_CAN_CLEAN_SETUP = 0x40000000
69 } fe_caps_t;
70</programlisting>
71</section>
72
73<section id="frontend_info">
74<title>frontend information</title>
75
76<para>Information about the frontend ca be queried with FE_GET_INFO.</para>
77
78<programlisting>
79 struct dvb_frontend_info {
80 char name[128];
81 fe_type_t type;
82 uint32_t frequency_min;
83 uint32_t frequency_max;
84 uint32_t frequency_stepsize;
85 uint32_t frequency_tolerance;
86 uint32_t symbol_rate_min;
87 uint32_t symbol_rate_max;
88 uint32_t symbol_rate_tolerance; /&#x22C6; ppm &#x22C6;/
89 uint32_t notifier_delay; /&#x22C6; ms &#x22C6;/
90 fe_caps_t caps;
91 };
92</programlisting>
93</section>
94
95<section id="frontend_diseqc">
96<title>diseqc master command</title>
97
98<para>A message sent from the frontend to DiSEqC capable equipment.</para>
99<programlisting>
100 struct dvb_diseqc_master_cmd {
101 uint8_t msg [6]; /&#x22C6; { framing, address, command, data[3] } &#x22C6;/
102 uint8_t msg_len; /&#x22C6; valid values are 3...6 &#x22C6;/
103 };
104</programlisting>
105</section>
106<section role="subsection">
107<title>diseqc slave reply</title>
108
109<para>A reply to the frontend from DiSEqC 2.0 capable equipment.</para>
110<programlisting>
111 struct dvb_diseqc_slave_reply {
112 uint8_t msg [4]; /&#x22C6; { framing, data [3] } &#x22C6;/
113 uint8_t msg_len; /&#x22C6; valid values are 0...4, 0 means no msg &#x22C6;/
114 int timeout; /&#x22C6; return from ioctl after timeout ms with &#x22C6;/
115 }; /&#x22C6; errorcode when no message was received &#x22C6;/
116</programlisting>
117</section>
118
119<section id="frontend_diseqc_slave_reply">
120<title>diseqc slave reply</title>
121<para>The voltage is usually used with non-DiSEqC capable LNBs to switch the polarzation
122(horizontal/vertical). When using DiSEqC epuipment this voltage has to be switched
123consistently to the DiSEqC commands as described in the DiSEqC spec.</para>
124<programlisting>
125 typedef enum fe_sec_voltage {
126 SEC_VOLTAGE_13,
127 SEC_VOLTAGE_18
128 } fe_sec_voltage_t;
129</programlisting>
130</section>
131
132<section id="frontend_sec_tone">
133<title>SEC continuous tone</title>
134
135<para>The continous 22KHz tone is usually used with non-DiSEqC capable LNBs to switch the
136high/low band of a dual-band LNB. When using DiSEqC epuipment this voltage has to
137be switched consistently to the DiSEqC commands as described in the DiSEqC
138spec.</para>
139<programlisting>
140 typedef enum fe_sec_tone_mode {
141 SEC_TONE_ON,
142 SEC_TONE_OFF
143 } fe_sec_tone_mode_t;
144</programlisting>
145</section>
146
147<section id="frontend_sec_burst">
148<title>SEC tone burst</title>
149
150<para>The 22KHz tone burst is usually used with non-DiSEqC capable switches to select
151between two connected LNBs/satellites. When using DiSEqC epuipment this voltage has to
152be switched consistently to the DiSEqC commands as described in the DiSEqC
153spec.</para>
154<programlisting>
155 typedef enum fe_sec_mini_cmd {
156 SEC_MINI_A,
157 SEC_MINI_B
158 } fe_sec_mini_cmd_t;
159</programlisting>
160
161<para></para>
162</section>
163
164<section id="frontend_status">
165<title>frontend status</title>
166<para>Several functions of the frontend device use the fe_status data type defined
167by</para>
168<programlisting>
169 typedef enum fe_status {
170 FE_HAS_SIGNAL = 0x01, /&#x22C6; found something above the noise level &#x22C6;/
171 FE_HAS_CARRIER = 0x02, /&#x22C6; found a DVB signal &#x22C6;/
172 FE_HAS_VITERBI = 0x04, /&#x22C6; FEC is stable &#x22C6;/
173 FE_HAS_SYNC = 0x08, /&#x22C6; found sync bytes &#x22C6;/
174 FE_HAS_LOCK = 0x10, /&#x22C6; everything's working... &#x22C6;/
175 FE_TIMEDOUT = 0x20, /&#x22C6; no lock within the last ~2 seconds &#x22C6;/
176 FE_REINIT = 0x40 /&#x22C6; frontend was reinitialized, &#x22C6;/
177 } fe_status_t; /&#x22C6; application is recommned to reset &#x22C6;/
178</programlisting>
179<para>to indicate the current state and/or state changes of the frontend hardware.
180</para>
181
182</section>
183
184<section id="frontend_params">
185<title>frontend parameters</title>
186<para>The kind of parameters passed to the frontend device for tuning depend on
187the kind of hardware you are using. All kinds of parameters are combined as an
188union in the FrontendParameters structure:</para>
189<programlisting>
190 struct dvb_frontend_parameters {
191 uint32_t frequency; /&#x22C6; (absolute) frequency in Hz for QAM/OFDM &#x22C6;/
192 /&#x22C6; intermediate frequency in kHz for QPSK &#x22C6;/
193 fe_spectral_inversion_t inversion;
194 union {
195 struct dvb_qpsk_parameters qpsk;
196 struct dvb_qam_parameters qam;
197 struct dvb_ofdm_parameters ofdm;
198 } u;
199 };
200</programlisting>
201<para>For satellite QPSK frontends you have to use the <constant>QPSKParameters</constant> member defined by</para>
202<programlisting>
203 struct dvb_qpsk_parameters {
204 uint32_t symbol_rate; /&#x22C6; symbol rate in Symbols per second &#x22C6;/
205 fe_code_rate_t fec_inner; /&#x22C6; forward error correction (see above) &#x22C6;/
206 };
207</programlisting>
208<para>for cable QAM frontend you use the <constant>QAMParameters</constant> structure</para>
209<programlisting>
210 struct dvb_qam_parameters {
211 uint32_t symbol_rate; /&#x22C6; symbol rate in Symbols per second &#x22C6;/
212 fe_code_rate_t fec_inner; /&#x22C6; forward error correction (see above) &#x22C6;/
213 fe_modulation_t modulation; /&#x22C6; modulation type (see above) &#x22C6;/
214 };
215</programlisting>
216<para>DVB-T frontends are supported by the <constant>OFDMParamters</constant> structure
217</para>
218<programlisting>
219 struct dvb_ofdm_parameters {
220 fe_bandwidth_t bandwidth;
221 fe_code_rate_t code_rate_HP; /&#x22C6; high priority stream code rate &#x22C6;/
222 fe_code_rate_t code_rate_LP; /&#x22C6; low priority stream code rate &#x22C6;/
223 fe_modulation_t constellation; /&#x22C6; modulation type (see above) &#x22C6;/
224 fe_transmit_mode_t transmission_mode;
225 fe_guard_interval_t guard_interval;
226 fe_hierarchy_t hierarchy_information;
227 };
228</programlisting>
229<para>In the case of QPSK frontends the <constant>Frequency</constant> field specifies the intermediate
230frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of
231the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and
232OFDM frontends the Frequency specifies the absolute frequency and is given in
233Hz.
234</para>
235<para>The Inversion field can take one of these values:
236</para>
237<programlisting>
238 typedef enum fe_spectral_inversion {
239 INVERSION_OFF,
240 INVERSION_ON,
241 INVERSION_AUTO
242 } fe_spectral_inversion_t;
243</programlisting>
244<para>It indicates if spectral inversion should be presumed or not. In the automatic setting
245(<constant>INVERSION_AUTO</constant>) the hardware will try to figure out the correct setting by
246itself.
247</para>
248<para>The possible values for the <constant>FEC_inner</constant> field are
249</para>
250<programlisting>
251 typedef enum fe_code_rate {
252 FEC_NONE = 0,
253 FEC_1_2,
254 FEC_2_3,
255 FEC_3_4,
256 FEC_4_5,
257 FEC_5_6,
258 FEC_6_7,
259 FEC_7_8,
260 FEC_8_9,
261 FEC_AUTO
262 } fe_code_rate_t;
263</programlisting>
264<para>which correspond to error correction rates of 1/2, 2/3, etc., no error correction or auto
265detection.
266</para>
267<para>For cable and terrestrial frontends (QAM and OFDM) one also has to specify the quadrature
268modulation mode which can be one of the following:
269</para>
270<programlisting>
271 typedef enum fe_modulation {
272 QPSK,
273 QAM_16,
274 QAM_32,
275 QAM_64,
276 QAM_128,
277 QAM_256,
278 QAM_AUTO
279 } fe_modulation_t;
280</programlisting>
281<para>Finally, there are several more parameters for OFDM:
282</para>
283<programlisting>
284 typedef enum fe_transmit_mode {
285 TRANSMISSION_MODE_2K,
286 TRANSMISSION_MODE_8K,
287 TRANSMISSION_MODE_AUTO
288 } fe_transmit_mode_t;
289</programlisting>
290 <programlisting>
291 typedef enum fe_bandwidth {
292 BANDWIDTH_8_MHZ,
293 BANDWIDTH_7_MHZ,
294 BANDWIDTH_6_MHZ,
295 BANDWIDTH_AUTO
296 } fe_bandwidth_t;
297</programlisting>
298 <programlisting>
299 typedef enum fe_guard_interval {
300 GUARD_INTERVAL_1_32,
301 GUARD_INTERVAL_1_16,
302 GUARD_INTERVAL_1_8,
303 GUARD_INTERVAL_1_4,
304 GUARD_INTERVAL_AUTO
305 } fe_guard_interval_t;
306</programlisting>
307 <programlisting>
308 typedef enum fe_hierarchy {
309 HIERARCHY_NONE,
310 HIERARCHY_1,
311 HIERARCHY_2,
312 HIERARCHY_4,
313 HIERARCHY_AUTO
314 } fe_hierarchy_t;
315</programlisting>
316
317</section>
318
319<section id="frontend_events">
320<title>frontend events</title>
321 <programlisting>
322 struct dvb_frontend_event {
323 fe_status_t status;
324 struct dvb_frontend_parameters parameters;
325 };
326</programlisting>
327 </section>
328</section>
329
330
331<section id="frontend_fcalls">
332<title>Frontend Function Calls</title>
333
334<section id="frontend_f_open">
335<title>open()</title>
336<para>DESCRIPTION</para>
337<informaltable><tgroup cols="1"><tbody><row>
338<entry align="char">
339<para>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0)
340 for subsequent use. Usually the first thing to do after a successful open is to
341 find out the frontend type with FE_GET_INFO.</para>
342<para>The device can be opened in read-only mode, which only allows monitoring of
343 device status and statistics, or read/write mode, which allows any kind of use
344 (e.g. performing tuning operations.)
345</para>
346<para>In a system with multiple front-ends, it is usually the case that multiple devices
347 cannot be open in read/write mode simultaneously. As long as a front-end
348 device is opened in read/write mode, other open() calls in read/write mode will
349 either fail or block, depending on whether non-blocking or blocking mode was
350 specified. A front-end device opened in blocking mode can later be put into
351 non-blocking mode (and vice versa) using the F_SETFL command of the fcntl
352 system call. This is a standard system call, documented in the Linux manual
353 page for fcntl. When an open() call has succeeded, the device will be ready
354 for use in the specified mode. This implies that the corresponding hardware is
355 powered up, and that other front-ends may have been powered down to make
356 that possible.</para>
357</entry>
358 </row></tbody></tgroup></informaltable>
359
360<para>SYNOPSIS</para>
361<informaltable><tgroup cols="1"><tbody><row><entry
362 align="char">
363<para>int open(const char &#x22C6;deviceName, int flags);</para>
364</entry>
365 </row></tbody></tgroup></informaltable>
366<para>PARAMETERS
367</para>
368<informaltable><tgroup cols="2"><tbody><row><entry
369 align="char">
370<para>const char
371 *deviceName</para>
372</entry><entry
373 align="char">
374<para>Name of specific video device.</para>
375</entry>
376 </row><row><entry
377 align="char">
378<para>int flags</para>
379</entry><entry
380 align="char">
381<para>A bit-wise OR of the following flags:</para>
382</entry>
383 </row><row><entry
384 align="char">
385</entry><entry
386 align="char">
387<para>O_RDONLY read-only access</para>
388</entry>
389 </row><row><entry
390 align="char">
391</entry><entry
392 align="char">
393<para>O_RDWR read/write access</para>
394</entry>
395 </row><row><entry
396 align="char">
397</entry><entry
398 align="char">
399<para>O_NONBLOCK open in non-blocking mode</para>
400</entry>
401 </row><row><entry
402 align="char">
403</entry><entry
404 align="char">
405<para>(blocking mode is the default)</para>
406</entry>
407 </row></tbody></tgroup></informaltable>
408<para>ERRORS
409</para>
410<informaltable><tgroup cols="2"><tbody><row><entry
411 align="char">
412<para>ENODEV</para>
413</entry><entry
414 align="char">
415<para>Device driver not loaded/available.</para>
416</entry>
417 </row><row><entry
418 align="char">
419<para>EINTERNAL</para>
420</entry><entry
421 align="char">
422<para>Internal error.</para>
423</entry>
424 </row><row><entry
425 align="char">
426<para>EBUSY</para>
427</entry><entry
428 align="char">
429<para>Device or resource busy.</para>
430</entry>
431 </row><row><entry
432 align="char">
433<para>EINVAL</para>
434</entry><entry
435 align="char">
436<para>Invalid argument.</para>
437</entry>
438 </row></tbody></tgroup></informaltable>
439</section>
440
441<section id="frontend_f_close">
442<title>close()</title>
443<para>DESCRIPTION
444</para>
445<informaltable><tgroup cols="1"><tbody><row><entry
446 align="char">
447<para>This system call closes a previously opened front-end device. After closing
448 a front-end device, its corresponding hardware might be powered down
449 automatically.</para>
450</entry>
451 </row></tbody></tgroup></informaltable>
452<para>SYNOPSIS
453</para>
454<informaltable><tgroup cols="1"><tbody><row><entry
455 align="char">
456<para>int close(int fd);</para>
457</entry>
458 </row></tbody></tgroup></informaltable>
459<para>PARAMETERS
460</para>
461<informaltable><tgroup cols="2"><tbody><row><entry
462 align="char">
463<para>int fd</para>
464</entry><entry
465 align="char">
466<para>File descriptor returned by a previous call to open().</para>
467</entry>
468 </row></tbody></tgroup></informaltable>
469<para>ERRORS
470</para>
471<informaltable><tgroup cols="2"><tbody><row><entry
472 align="char">
473<para>EBADF</para>
474</entry><entry
475 align="char">
476<para>fd is not a valid open file descriptor.</para>
477</entry>
478 </row></tbody></tgroup></informaltable>
479</section>
480
481<section id="frontend_read_status">
482<title>FE_READ_STATUS</title>
483<para>DESCRIPTION
484</para>
485<informaltable><tgroup cols="1"><tbody><row><entry
486 align="char">
487<para>This ioctl call returns status information about the front-end. This call only
488 requires read-only access to the device.</para>
489</entry>
490 </row></tbody></tgroup></informaltable>
491<para>SYNOPSIS
492</para>
493<informaltable><tgroup cols="1"><tbody><row><entry
494 align="char">
495<para>int ioctl(int fd, int request = FE_READ_STATUS,
496 fe_status_t &#x22C6;status);</para>
497</entry>
498 </row></tbody></tgroup></informaltable>
499<para>PARAMETERS
500</para>
501
502<informaltable><tgroup cols="2"><tbody><row><entry
503 align="char">
504<para>int fd</para>
505</entry><entry
506 align="char">
507<para>File descriptor returned by a previous call to open().</para>
508</entry>
509 </row><row><entry
510 align="char">
511<para>int request</para>
512</entry><entry
513 align="char">
514<para>Equals FE_READ_STATUS for this command.</para>
515</entry>
516 </row><row><entry
517 align="char">
518<para>struct fe_status_t
519 *status</para>
520</entry><entry
521 align="char">
522<para>Points to the location where the front-end status word is
523 to be stored.</para>
524</entry>
525 </row></tbody></tgroup></informaltable>
526<para>ERRORS
527</para>
528<informaltable><tgroup cols="2"><tbody><row><entry
529 align="char">
530<para>EBADF</para>
531</entry><entry
532 align="char">
533<para>fd is not a valid open file descriptor.</para>
534</entry>
535 </row><row><entry
536 align="char">
537<para>EFAULT</para>
538</entry><entry
539 align="char">
540<para>status points to invalid address.</para>
541</entry>
542 </row></tbody></tgroup></informaltable>
543</section>
544
545<section id="frontend_read_ber">
546<title>FE_READ_BER</title>
547<para>DESCRIPTION
548</para>
549<informaltable><tgroup cols="1"><tbody><row><entry
550 align="char">
551<para>This ioctl call returns the bit error rate for the signal currently
552 received/demodulated by the front-end. For this command, read-only access to
553 the device is sufficient.</para>
554</entry>
555 </row></tbody></tgroup></informaltable>
556<para>SYNOPSIS
557</para>
558<informaltable><tgroup cols="1"><tbody><row><entry
559 align="char">
560<para>int ioctl(int fd, int request = FE_READ_BER,
561 uint32_t &#x22C6;ber);</para>
562</entry>
563 </row></tbody></tgroup></informaltable>
564<para>PARAMETERS
565</para>
566<informaltable><tgroup cols="2"><tbody><row><entry
567 align="char">
568<para>int fd</para>
569</entry><entry
570 align="char">
571<para>File descriptor returned by a previous call to open().</para>
572</entry>
573 </row><row><entry
574 align="char">
575<para>int request</para>
576</entry><entry
577 align="char">
578<para>Equals FE_READ_BER for this command.</para>
579</entry>
580 </row><row><entry
581 align="char">
582<para>uint32_t *ber</para>
583</entry><entry
584 align="char">
585<para>The bit error rate is stored into *ber.</para>
586</entry>
587 </row></tbody></tgroup></informaltable>
588<para>ERRORS
589</para>
590<informaltable><tgroup cols="2"><tbody><row><entry
591 align="char">
592<para>EBADF</para>
593</entry><entry
594 align="char">
595<para>fd is not a valid open file descriptor.</para>
596</entry>
597 </row><row><entry
598 align="char">
599<para>EFAULT</para>
600</entry><entry
601 align="char">
602<para>ber points to invalid address.</para>
603</entry>
604 </row><row><entry
605 align="char">
606<para>ENOSIGNAL</para>
607</entry><entry
608 align="char">
609<para>There is no signal, thus no meaningful bit error rate. Also
610 returned if the front-end is not turned on.</para>
611</entry>
612 </row><row><entry
613 align="char">
614<para>ENOSYS</para>
615</entry><entry
616 align="char">
617<para>Function not available for this device.</para>
618</entry>
619 </row></tbody></tgroup></informaltable>
620</section>
621
622<section id="frontend_read_snr">
623<title>FE_READ_SNR</title>
624
625<para>DESCRIPTION
626</para>
627<informaltable><tgroup cols="1"><tbody><row><entry
628 align="char">
629<para>This ioctl call returns the signal-to-noise ratio for the signal currently received
630 by the front-end. For this command, read-only access to the device is sufficient.</para>
631</entry>
632 </row></tbody></tgroup></informaltable>
633<para>SYNOPSIS
634</para>
635<informaltable><tgroup cols="1"><tbody><row><entry
636 align="char">
637<para>int ioctl(int fd, int request = FE_READ_SNR, int16_t
638 &#x22C6;snr);</para>
639</entry>
640 </row></tbody></tgroup></informaltable>
641<para>PARAMETERS
642</para>
643<informaltable><tgroup cols="2"><tbody><row><entry
644 align="char">
645<para>int fd</para>
646</entry><entry
647 align="char">
648<para>File descriptor returned by a previous call to open().</para>
649</entry>
650 </row><row><entry
651 align="char">
652<para>int request</para>
653</entry><entry
654 align="char">
655<para>Equals FE_READ_SNR for this command.</para>
656</entry>
657 </row><row><entry
658 align="char">
659<para>int16_t *snr</para>
660</entry><entry
661 align="char">
662<para>The signal-to-noise ratio is stored into *snr.</para>
663</entry>
664 </row></tbody></tgroup></informaltable>
665
666<para>ERRORS
667</para>
668<informaltable><tgroup cols="2"><tbody><row><entry
669 align="char">
670<para>EBADF</para>
671</entry><entry
672 align="char">
673<para>fd is not a valid open file descriptor.</para>
674</entry>
675 </row><row><entry
676 align="char">
677<para>EFAULT</para>
678</entry><entry
679 align="char">
680<para>snr points to invalid address.</para>
681</entry>
682 </row><row><entry
683 align="char">
684<para>ENOSIGNAL</para>
685</entry><entry
686 align="char">
687<para>There is no signal, thus no meaningful signal strength
688 value. Also returned if front-end is not turned on.</para>
689</entry>
690 </row><row><entry
691 align="char">
692<para>ENOSYS</para>
693</entry><entry
694 align="char">
695<para>Function not available for this device.</para>
696</entry>
697 </row></tbody></tgroup></informaltable>
698</section>
699
700<section id="frontend_read_signal_strength">
701<title>FE_READ_SIGNAL_STRENGTH</title>
702<para>DESCRIPTION
703</para>
704<informaltable><tgroup cols="1"><tbody><row><entry
705 align="char">
706<para>This ioctl call returns the signal strength value for the signal currently received
707 by the front-end. For this command, read-only access to the device is sufficient.</para>
708</entry>
709 </row></tbody></tgroup></informaltable>
710<para>SYNOPSIS
711</para>
712<informaltable><tgroup cols="1"><tbody><row><entry
713 align="char">
714<para>int ioctl( int fd, int request =
715 FE_READ_SIGNAL_STRENGTH, int16_t &#x22C6;strength);</para>
716</entry>
717 </row></tbody></tgroup></informaltable>
718
719<para>PARAMETERS
720</para>
721<informaltable><tgroup cols="2"><tbody><row><entry
722 align="char">
723<para>int fd</para>
724</entry><entry
725 align="char">
726<para>File descriptor returned by a previous call to open().</para>
727</entry>
728 </row><row><entry
729 align="char">
730<para>int request</para>
731</entry><entry
732 align="char">
733<para>Equals FE_READ_SIGNAL_STRENGTH for this
734 command.</para>
735</entry>
736 </row><row><entry
737 align="char">
738<para>int16_t *strength</para>
739</entry><entry
740 align="char">
741<para>The signal strength value is stored into *strength.</para>
742</entry>
743 </row></tbody></tgroup></informaltable>
744<para>ERRORS
745</para>
746<informaltable><tgroup cols="2"><tbody><row><entry
747 align="char">
748<para>EBADF</para>
749</entry><entry
750 align="char">
751<para>fd is not a valid open file descriptor.</para>
752</entry>
753 </row><row><entry
754 align="char">
755<para>EFAULT</para>
756</entry><entry
757 align="char">
758<para>status points to invalid address.</para>
759</entry>
760 </row><row><entry
761 align="char">
762<para>ENOSIGNAL</para>
763</entry><entry
764 align="char">
765<para>There is no signal, thus no meaningful signal strength
766 value. Also returned if front-end is not turned on.</para>
767</entry>
768 </row><row><entry
769 align="char">
770<para>ENOSYS</para>
771</entry><entry
772 align="char">
773<para>Function not available for this device.</para>
774</entry>
775 </row></tbody></tgroup></informaltable>
776</section>
777
778<section id="frontend_read_ub">
779<title>FE_READ_UNCORRECTED_BLOCKS</title>
780<para>DESCRIPTION
781</para>
782<informaltable><tgroup cols="1"><tbody><row><entry
783 align="char">
784<para>This ioctl call returns the number of uncorrected blocks detected by the device
785 driver during its lifetime. For meaningful measurements, the increment in block
786 count during a specific time interval should be calculated. For this command,
787 read-only access to the device is sufficient.</para>
788</entry>
789 </row><row><entry
790 align="char">
791<para>Note that the counter will wrap to zero after its maximum count has been
792 reached.</para>
793</entry>
794 </row></tbody></tgroup></informaltable>
795<para>SYNOPSIS
796</para>
797<informaltable><tgroup cols="1"><tbody><row><entry
798 align="char">
799<para>int ioctl( int fd, int request =
800 FE_READ_UNCORRECTED_BLOCKS, uint32_t &#x22C6;ublocks);</para>
801</entry>
802 </row></tbody></tgroup></informaltable>
803<para>PARAMETERS
804</para>
805<informaltable><tgroup cols="2"><tbody><row><entry
806 align="char">
807<para>int fd</para>
808</entry><entry
809 align="char">
810<para>File descriptor returned by a previous call to open().</para>
811</entry>
812 </row><row><entry
813 align="char">
814<para>int request</para>
815</entry><entry
816 align="char">
817<para>Equals FE_READ_UNCORRECTED_BLOCKS for this
818 command.</para>
819</entry>
820 </row><row><entry
821 align="char">
822<para>uint32_t *ublocks</para>
823</entry><entry
824 align="char">
825<para>The total number of uncorrected blocks seen by the driver
826 so far.</para>
827</entry>
828 </row></tbody></tgroup></informaltable>
829<para>ERRORS
830</para>
831<informaltable><tgroup cols="2"><tbody><row><entry
832 align="char">
833<para>EBADF</para>
834</entry><entry
835 align="char">
836<para>fd is not a valid open file descriptor.</para>
837</entry>
838 </row><row><entry
839 align="char">
840<para>EFAULT</para>
841</entry><entry
842 align="char">
843<para>ublocks points to invalid address.</para>
844</entry>
845 </row><row><entry
846 align="char">
847<para>ENOSYS</para>
848</entry><entry
849 align="char">
850<para>Function not available for this device.</para>
851</entry>
852 </row></tbody></tgroup></informaltable>
853</section>
854
855<section id="frontend_set_fe">
856<title>FE_SET_FRONTEND</title>
857<para>DESCRIPTION
858</para>
859<informaltable><tgroup cols="1"><tbody><row><entry
860 align="char">
861<para>This ioctl call starts a tuning operation using specified parameters. The result
862 of this call will be successful if the parameters were valid and the tuning could
863 be initiated. The result of the tuning operation in itself, however, will arrive
864 asynchronously as an event (see documentation for FE_GET_EVENT and
865 FrontendEvent.) If a new FE_SET_FRONTEND operation is initiated before
866 the previous one was completed, the previous operation will be aborted in favor
867 of the new one. This command requires read/write access to the device.</para>
868</entry>
869 </row></tbody></tgroup></informaltable>
870
871<para>SYNOPSIS
872</para>
873<informaltable><tgroup cols="1"><tbody><row><entry
874 align="char">
875<para>int ioctl(int fd, int request = FE_SET_FRONTEND,
876 struct dvb_frontend_parameters &#x22C6;p);</para>
877</entry>
878 </row></tbody></tgroup></informaltable>
879<para>PARAMETERS
880</para>
881<informaltable><tgroup cols="2"><tbody><row><entry
882 align="char">
883<para>int fd</para>
884</entry><entry
885 align="char">
886<para>File descriptor returned by a previous call to open().</para>
887</entry>
888 </row><row><entry
889 align="char">
890<para>int request</para>
891</entry><entry
892 align="char">
893<para>Equals FE_SET_FRONTEND for this command.</para>
894</entry>
895 </row><row><entry
896 align="char">
897<para>struct
898 dvb_frontend_parameters
899 *p</para>
900</entry><entry
901 align="char">
902<para>Points to parameters for tuning operation.</para>
903</entry>
904 </row></tbody></tgroup></informaltable>
905<para>ERRORS
906</para>
907<informaltable><tgroup cols="2"><tbody><row><entry
908 align="char">
909<para>EBADF</para>
910</entry><entry
911 align="char">
912<para>fd is not a valid open file descriptor.</para>
913</entry>
914 </row><row><entry
915 align="char">
916<para>EFAULT</para>
917</entry><entry
918 align="char">
919<para>p points to invalid address.</para>
920</entry>
921 </row><row><entry
922 align="char">
923<para>EINVAL</para>
924</entry><entry
925 align="char">
926<para>Maximum supported symbol rate reached.</para>
927</entry>
928</row></tbody></tgroup></informaltable>
929</section>
930
931<section id="frontend_get_fe">
932<title>FE_GET_FRONTEND</title>
933<para>DESCRIPTION
934</para>
935<informaltable><tgroup cols="1"><tbody><row><entry
936 align="char">
937<para>This ioctl call queries the currently effective frontend parameters. For this
938 command, read-only access to the device is sufficient.</para>
939</entry>
940 </row></tbody></tgroup></informaltable>
941
942<para>SYNOPSIS
943</para>
944<informaltable><tgroup cols="1"><tbody><row><entry
945 align="char">
946<para>int ioctl(int fd, int request = FE_GET_FRONTEND,
947 struct dvb_frontend_parameters &#x22C6;p);</para>
948</entry>
949 </row></tbody></tgroup></informaltable>
950
951<para>PARAMETERS
952</para>
953<informaltable><tgroup cols="2"><tbody><row><entry
954 align="char">
955<para>int fd</para>
956</entry><entry
957 align="char">
958<para>File descriptor returned by a previous call to open().</para>
959</entry>
960 </row><row><entry
961 align="char">
962<para>int request</para>
963</entry><entry
964 align="char">
965<para>Equals FE_SET_FRONTEND for this command.</para>
966</entry>
967 </row><row><entry
968 align="char">
969<para>struct
970 dvb_frontend_parameters
971 *p</para>
972</entry><entry
973 align="char">
974<para>Points to parameters for tuning operation.</para>
975</entry>
976 </row></tbody></tgroup></informaltable>
977
978<para>ERRORS
979</para>
980
981<informaltable><tgroup cols="2"><tbody><row><entry
982 align="char">
983<para>EBADF</para>
984</entry><entry
985 align="char">
986<para>fd is not a valid open file descriptor.</para>
987</entry>
988 </row><row><entry
989 align="char">
990<para>EFAULT</para>
991</entry><entry
992 align="char">
993<para>p points to invalid address.</para>
994</entry>
995 </row><row><entry
996 align="char">
997<para>EINVAL</para>
998</entry><entry
999 align="char">
1000<para>Maximum supported symbol rate reached.</para>
1001</entry>
1002 </row></tbody></tgroup></informaltable>
1003
1004</section>
1005
1006<section id="frontend_get_event">
1007<title>FE_GET_EVENT</title>
1008<para>DESCRIPTION
1009</para>
1010<informaltable><tgroup cols="1"><tbody><row><entry
1011 align="char">
1012<para>This ioctl call returns a frontend event if available. If an event is not
1013 available, the behavior depends on whether the device is in blocking or
1014 non-blocking mode. In the latter case, the call fails immediately with errno
1015 set to EWOULDBLOCK. In the former case, the call blocks until an event
1016 becomes available.</para>
1017</entry>
1018 </row><row><entry
1019 align="char">
1020<para>The standard Linux poll() and/or select() system calls can be used with the
1021 device file descriptor to watch for new events. For select(), the file descriptor
1022 should be included in the exceptfds argument, and for poll(), POLLPRI should
1023 be specified as the wake-up condition. Since the event queue allocated is
1024 rather small (room for 8 events), the queue must be serviced regularly to avoid
1025 overflow. If an overflow happens, the oldest event is discarded from the queue,
1026 and an error (EOVERFLOW) occurs the next time the queue is read. After
1027 reporting the error condition in this fashion, subsequent FE_GET_EVENT
1028 calls will return events from the queue as usual.</para>
1029</entry>
1030 </row><row><entry
1031 align="char">
1032<para>For the sake of implementation simplicity, this command requires read/write
1033 access to the device.</para>
1034</entry>
1035 </row></tbody></tgroup></informaltable>
1036
1037<para>SYNOPSIS
1038</para>
1039<informaltable><tgroup cols="1"><tbody><row><entry
1040 align="char">
1041<para>int ioctl(int fd, int request = QPSK_GET_EVENT,
1042 struct dvb_frontend_event &#x22C6;ev);</para>
1043</entry>
1044 </row></tbody></tgroup></informaltable>
1045
1046<para>PARAMETERS
1047</para>
1048<informaltable><tgroup cols="2"><tbody><row><entry
1049 align="char">
1050<para>int fd</para>
1051</entry><entry
1052 align="char">
1053<para>File descriptor returned by a previous call to open().</para>
1054</entry>
1055 </row><row><entry
1056 align="char">
1057<para>int request</para>
1058</entry><entry
1059 align="char">
1060<para>Equals FE_GET_EVENT for this command.</para>
1061</entry>
1062 </row><row><entry
1063 align="char">
1064<para>struct
1065 dvb_frontend_event
1066 *ev</para>
1067</entry><entry
1068 align="char">
1069<para>Points to the location where the event,</para>
1070</entry>
1071 </row><row><entry
1072 align="char">
1073</entry><entry
1074 align="char">
1075<para>if any, is to be stored.</para>
1076</entry>
1077 </row></tbody></tgroup></informaltable>
1078
1079<para>ERRORS
1080</para>
1081<informaltable><tgroup cols="2"><tbody><row><entry
1082 align="char">
1083<para>EBADF</para>
1084</entry><entry
1085 align="char">
1086<para>fd is not a valid open file descriptor.</para>
1087</entry>
1088 </row><row><entry
1089 align="char">
1090<para>EFAULT</para>
1091</entry><entry
1092 align="char">
1093<para>ev points to invalid address.</para>
1094</entry>
1095 </row><row><entry
1096 align="char">
1097<para>EWOULDBLOCK</para>
1098</entry><entry
1099 align="char">
1100<para>There is no event pending, and the device is in
1101 non-blocking mode.</para>
1102</entry>
1103 </row><row><entry
1104 align="char">
1105<para>EOVERFLOW</para>
1106</entry><entry
1107 align="char">
1108</entry>
1109 </row><row><entry
1110 align="char">
1111</entry><entry
1112 align="char">
1113<para>Overflow in event queue - one or more events were lost.</para>
1114</entry>
1115</row></tbody></tgroup></informaltable>
1116</section>
1117
1118<section id="frontend_get_info">
1119<title>FE_GET_INFO</title>
1120<para>DESCRIPTION
1121</para>
1122<informaltable><tgroup cols="1"><tbody><row><entry
1123 align="char">
1124<para>This ioctl call returns information about the front-end. This call only requires
1125 read-only access to the device.</para>
1126</entry>
1127 </row></tbody></tgroup></informaltable>
1128<para>SYNOPSIS
1129</para>
1130
1131<informaltable><tgroup cols="1"><tbody><row><entry
1132 align="char">
1133<para> int ioctl(int fd, int request = FE_GET_INFO, struct
1134 dvb_frontend_info &#x22C6;info);</para>
1135</entry>
1136 </row></tbody></tgroup></informaltable>
1137<para>PARAMETERS
1138</para>
1139
1140<informaltable><tgroup cols="2"><tbody><row><entry
1141 align="char">
1142<para>int fd</para>
1143</entry><entry
1144 align="char">
1145<para>File descriptor returned by a previous call to open().</para>
1146</entry>
1147 </row><row><entry
1148 align="char">
1149<para>int request</para>
1150</entry><entry
1151 align="char">
1152<para>Equals FE_GET_INFO for this command.</para>
1153</entry>
1154 </row><row><entry
1155 align="char">
1156<para>struct
1157 dvb_frontend_info
1158 *info</para>
1159</entry><entry
1160 align="char">
1161<para>Points to the location where the front-end information is
1162 to be stored.</para>
1163</entry>
1164 </row></tbody></tgroup></informaltable>
1165<para>ERRORS
1166</para>
1167<informaltable><tgroup cols="2"><tbody><row><entry
1168 align="char">
1169<para>EBADF</para>
1170</entry><entry
1171 align="char">
1172<para>fd is not a valid open file descriptor.</para>
1173</entry>
1174 </row><row><entry
1175 align="char">
1176<para>EFAULT</para>
1177</entry><entry
1178 align="char">
1179<para>info points to invalid address.</para>
1180</entry>
1181</row></tbody></tgroup></informaltable>
1182</section>
1183
1184<section id="frontend_diseqc_reset_overload">
1185<title>FE_DISEQC_RESET_OVERLOAD</title>
1186<para>DESCRIPTION
1187</para>
1188<informaltable><tgroup cols="1"><tbody><row><entry
1189 align="char">
1190<para>If the bus has been automatically powered off due to power overload, this ioctl
1191 call restores the power to the bus. The call requires read/write access to the
1192 device. This call has no effect if the device is manually powered off. Not all
1193 DVB adapters support this ioctl.</para>
1194</entry>
1195 </row></tbody></tgroup></informaltable>
1196
1197<para>SYNOPSIS
1198</para>
1199<informaltable><tgroup cols="1"><tbody><row><entry
1200 align="char">
1201<para>int ioctl(int fd, int request =
1202 FE_DISEQC_RESET_OVERLOAD);</para>
1203</entry>
1204 </row></tbody></tgroup></informaltable>
1205<para>PARAMETERS
1206</para>
1207<informaltable><tgroup cols="2"><tbody><row><entry
1208 align="char">
1209<para>int fd</para>
1210</entry><entry
1211 align="char">
1212<para>File descriptor returned by a previous call to open().</para>
1213</entry>
1214 </row><row><entry
1215 align="char">
1216<para>int request</para>
1217</entry><entry
1218 align="char">
1219<para>Equals FE_DISEQC_RESET_OVERLOAD for this
1220 command.</para>
1221</entry>
1222 </row></tbody></tgroup></informaltable>
1223
1224<para>ERRORS
1225</para>
1226<informaltable><tgroup cols="2"><tbody><row><entry
1227 align="char">
1228<para>EBADF</para>
1229</entry><entry
1230 align="char">
1231<para>fd is not a valid file descriptor.</para>
1232</entry>
1233 </row><row><entry
1234 align="char">
1235<para>EPERM</para>
1236</entry><entry
1237 align="char">
1238<para>Permission denied (needs read/write access).</para>
1239</entry>
1240 </row><row><entry
1241 align="char">
1242<para>EINTERNAL</para>
1243</entry><entry
1244 align="char">
1245<para>Internal error in the device driver.</para>
1246</entry>
1247</row></tbody></tgroup></informaltable>
1248</section>
1249
1250<section id="frontend_diseqc_send_master_cmd">
1251<title>FE_DISEQC_SEND_MASTER_CMD</title>
1252<para>DESCRIPTION
1253</para>
1254<informaltable><tgroup cols="1"><tbody><row><entry
1255 align="char">
1256<para>This ioctl call is used to send a a DiSEqC command.</para>
1257</entry>
1258 </row></tbody></tgroup></informaltable>
1259<para>SYNOPSIS
1260</para>
1261<informaltable><tgroup cols="1"><tbody><row><entry
1262 align="char">
1263<para>int ioctl(int fd, int request =
1264 FE_DISEQC_SEND_MASTER_CMD, struct
1265 dvb_diseqc_master_cmd &#x22C6;cmd);</para>
1266</entry>
1267 </row></tbody></tgroup></informaltable>
1268
1269<para>PARAMETERS
1270</para>
1271<informaltable><tgroup cols="2"><tbody><row><entry
1272 align="char">
1273<para>int fd</para>
1274</entry><entry
1275 align="char">
1276<para>File descriptor returned by a previous call to open().</para>
1277</entry>
1278 </row><row><entry
1279 align="char">
1280<para>int request</para>
1281</entry><entry
1282 align="char">
1283<para>Equals FE_DISEQC_SEND_MASTER_CMD for this
1284 command.</para>
1285</entry>
1286 </row><row><entry
1287 align="char">
1288<para>struct
1289 dvb_diseqc_master_cmd
1290 *cmd</para>
1291</entry><entry
1292 align="char">
1293<para>Pointer to the command to be transmitted.</para>
1294</entry>
1295 </row></tbody></tgroup></informaltable>
1296
1297<para>ERRORS
1298</para>
1299<informaltable><tgroup cols="2"><tbody><row><entry
1300 align="char">
1301<para>EBADF</para>
1302</entry><entry
1303 align="char">
1304<para>fd is not a valid file descriptor.</para>
1305</entry>
1306 </row><row><entry
1307 align="char">
1308<para>EFAULT</para>
1309</entry><entry
1310 align="char">
1311<para>Seq points to an invalid address.</para>
1312</entry>
1313 </row><row><entry
1314 align="char">
1315<para>EINVAL</para>
1316</entry><entry
1317 align="char">
1318<para>The data structure referred to by seq is invalid in some
1319 way.</para>
1320</entry>
1321 </row><row><entry
1322 align="char">
1323<para>EPERM</para>
1324</entry><entry
1325 align="char">
1326<para>Permission denied (needs read/write access).</para>
1327</entry>
1328 </row><row><entry
1329 align="char">
1330<para>EINTERNAL</para>
1331</entry><entry
1332 align="char">
1333<para>Internal error in the device driver.</para>
1334</entry>
1335</row></tbody></tgroup></informaltable>
1336</section>
1337
1338<section id="frontend_diseqc_recv_slave_reply">
1339<title>FE_DISEQC_RECV_SLAVE_REPLY</title>
1340<para>DESCRIPTION
1341</para>
1342<informaltable><tgroup cols="1"><tbody><row><entry
1343 align="char">
1344<para>This ioctl call is used to receive reply to a DiSEqC 2.0 command.</para>
1345</entry>
1346 </row></tbody></tgroup></informaltable>
1347
1348<para>SYNOPSIS
1349</para>
1350<informaltable><tgroup cols="1"><tbody><row><entry
1351 align="char">
1352<para>int ioctl(int fd, int request =
1353 FE_DISEQC_RECV_SLAVE_REPLY, struct
1354 dvb_diseqc_slave_reply &#x22C6;reply);</para>
1355</entry>
1356 </row></tbody></tgroup></informaltable>
1357
1358<para>PARAMETERS
1359</para>
1360<informaltable><tgroup cols="2"><tbody><row><entry
1361 align="char">
1362<para>int fd</para>
1363</entry><entry
1364 align="char">
1365<para>File descriptor returned by a previous call to open().</para>
1366</entry>
1367 </row><row><entry
1368 align="char">
1369<para>int request</para>
1370</entry><entry
1371 align="char">
1372<para>Equals FE_DISEQC_RECV_SLAVE_REPLY for this
1373 command.</para>
1374</entry>
1375 </row><row><entry
1376 align="char">
1377<para>struct
1378 dvb_diseqc_slave_reply
1379 *reply</para>
1380</entry><entry
1381 align="char">
1382<para>Pointer to the command to be received.</para>
1383</entry>
1384 </row></tbody></tgroup></informaltable>
1385<para>ERRORS
1386</para>
1387<informaltable><tgroup cols="2"><tbody><row><entry
1388 align="char">
1389<para>EBADF</para>
1390</entry><entry
1391 align="char">
1392<para>fd is not a valid file descriptor.</para>
1393</entry>
1394 </row><row><entry
1395 align="char">
1396<para>EFAULT</para>
1397</entry><entry
1398 align="char">
1399<para>Seq points to an invalid address.</para>
1400</entry>
1401 </row><row><entry
1402 align="char">
1403<para>EINVAL</para>
1404</entry><entry
1405 align="char">
1406<para>The data structure referred to by seq is invalid in some
1407 way.</para>
1408</entry>
1409 </row><row><entry
1410 align="char">
1411<para>EPERM</para>
1412</entry><entry
1413 align="char">
1414<para>Permission denied (needs read/write access).</para>
1415</entry>
1416 </row><row><entry
1417 align="char">
1418<para>EINTERNAL</para>
1419</entry><entry
1420 align="char">
1421<para>Internal error in the device driver.</para>
1422</entry>
1423 </row></tbody></tgroup></informaltable>
1424</section>
1425
1426<section id="frontend_diseqc_send_burst">
1427<title>FE_DISEQC_SEND_BURST</title>
1428<para>DESCRIPTION
1429</para>
1430<informaltable><tgroup cols="1"><tbody><row><entry
1431 align="char">
1432<para>This ioctl call is used to send a 22KHz tone burst.</para>
1433</entry>
1434 </row></tbody></tgroup></informaltable>
1435
1436<para>SYNOPSIS
1437</para>
1438<informaltable><tgroup cols="1"><tbody><row><entry
1439 align="char">
1440<para>int ioctl(int fd, int request =
1441 FE_DISEQC_SEND_BURST, fe_sec_mini_cmd_t burst);</para>
1442</entry>
1443 </row></tbody></tgroup></informaltable>
1444
1445<para>PARAMETERS
1446</para>
1447<informaltable><tgroup cols="2"><tbody><row><entry
1448 align="char">
1449<para>int fd</para>
1450</entry><entry
1451 align="char">
1452<para>File descriptor returned by a previous call to open().</para>
1453</entry>
1454 </row><row><entry
1455 align="char">
1456<para>int request</para>
1457</entry><entry
1458 align="char">
1459<para>Equals FE_DISEQC_SEND_BURST for this command.</para>
1460</entry>
1461 </row><row><entry
1462 align="char">
1463<para>fe_sec_mini_cmd_t
1464 burst</para>
1465</entry><entry
1466 align="char">
1467<para>burst A or B.</para>
1468</entry>
1469 </row></tbody></tgroup></informaltable>
1470
1471<para>ERRORS
1472</para>
1473<informaltable><tgroup cols="2"><tbody><row><entry
1474 align="char">
1475<para>EBADF</para>
1476</entry><entry
1477 align="char">
1478<para>fd is not a valid file descriptor.</para>
1479</entry>
1480 </row><row><entry
1481 align="char">
1482<para>EFAULT</para>
1483</entry><entry
1484 align="char">
1485<para>Seq points to an invalid address.</para>
1486</entry>
1487 </row><row><entry
1488 align="char">
1489<para>EINVAL</para>
1490</entry><entry
1491 align="char">
1492<para>The data structure referred to by seq is invalid in some
1493 way.</para>
1494</entry>
1495 </row><row><entry
1496 align="char">
1497<para>EPERM</para>
1498</entry><entry
1499 align="char">
1500<para>Permission denied (needs read/write access).</para>
1501</entry>
1502 </row><row><entry
1503 align="char">
1504<para>EINTERNAL</para>
1505</entry><entry
1506 align="char">
1507<para>Internal error in the device driver.</para>
1508</entry>
1509</row></tbody></tgroup></informaltable>
1510</section>
1511
1512<section id="frontend_set_tone">
1513<title>FE_SET_TONE</title>
1514<para>DESCRIPTION
1515</para>
1516<informaltable><tgroup cols="1"><tbody><row><entry
1517 align="char">
1518<para>This call is used to set the generation of the continuous 22kHz tone. This call
1519 requires read/write permissions.</para>
1520</entry>
1521 </row></tbody></tgroup></informaltable>
1522<para>SYNOPSIS
1523</para>
1524<informaltable><tgroup cols="1"><tbody><row><entry
1525 align="char">
1526<para>int ioctl(int fd, int request = FE_SET_TONE,
1527 fe_sec_tone_mode_t tone);</para>
1528</entry>
1529 </row></tbody></tgroup></informaltable>
1530<para>PARAMETERS
1531</para>
1532<informaltable><tgroup cols="2"><tbody><row><entry
1533 align="char">
1534<para>int fd</para>
1535</entry><entry
1536 align="char">
1537<para>File descriptor returned by a previous call to open().</para>
1538</entry>
1539 </row><row><entry
1540 align="char">
1541<para>int request</para>
1542</entry><entry
1543 align="char">
1544<para>Equals FE_SET_TONE for this command.</para>
1545</entry>
1546 </row><row><entry
1547 align="char">
1548<para>fe_sec_tone_mode_t
1549 tone</para>
1550</entry><entry
1551 align="char">
1552<para>The requested tone generation mode (on/off).</para>
1553</entry>
1554 </row></tbody></tgroup></informaltable>
1555<para>ERRORS
1556</para>
1557<informaltable><tgroup cols="2"><tbody><row><entry
1558 align="char">
1559<para>ENODEV</para>
1560</entry><entry
1561 align="char">
1562<para>Device driver not loaded/available.</para>
1563</entry>
1564 </row><row><entry
1565 align="char">
1566<para>EBUSY</para>
1567</entry><entry
1568 align="char">
1569<para>Device or resource busy.</para>
1570</entry>
1571 </row><row><entry
1572 align="char">
1573<para>EINVAL</para>
1574</entry><entry
1575 align="char">
1576<para>Invalid argument.</para>
1577</entry>
1578 </row><row><entry
1579 align="char">
1580<para>EPERM</para>
1581</entry><entry
1582 align="char">
1583<para>File not opened with read permissions.</para>
1584</entry>
1585 </row><row><entry
1586 align="char">
1587<para>EINTERNAL</para>
1588</entry><entry
1589 align="char">
1590<para>Internal error in the device driver.</para>
1591</entry>
1592</row></tbody></tgroup></informaltable>
1593</section>
1594
1595<section id="fe_set_voltage">
1596<title>FE_SET_VOLTAGE</title>
1597<para>DESCRIPTION
1598</para>
1599<informaltable><tgroup cols="1"><tbody><row><entry
1600 align="char">
1601<para>This call is used to set the bus voltage. This call requires read/write
1602 permissions.</para>
1603</entry>
1604 </row></tbody></tgroup></informaltable>
1605<para>SYNOPSIS
1606</para>
1607<informaltable><tgroup cols="1"><tbody><row><entry
1608 align="char">
1609<para>int ioctl(int fd, int request = FE_SET_VOLTAGE,
1610 fe_sec_voltage_t voltage);</para>
1611</entry>
1612 </row></tbody></tgroup></informaltable>
1613
1614<para>PARAMETERS
1615</para>
1616<informaltable><tgroup cols="2"><tbody><row><entry
1617 align="char">
1618<para>int fd</para>
1619</entry><entry
1620 align="char">
1621<para>File descriptor returned by a previous call to open().</para>
1622</entry>
1623 </row><row><entry
1624 align="char">
1625<para>int request</para>
1626</entry><entry
1627 align="char">
1628<para>Equals FE_SET_VOLTAGE for this command.</para>
1629</entry>
1630 </row><row><entry
1631 align="char">
1632<para>fe_sec_voltage_t
1633 voltage</para>
1634</entry><entry
1635 align="char">
1636<para>The requested bus voltage.</para>
1637</entry>
1638 </row></tbody></tgroup></informaltable>
1639
1640<para>ERRORS
1641</para>
1642<informaltable><tgroup cols="2"><tbody><row><entry
1643 align="char">
1644<para>ENODEV</para>
1645</entry><entry
1646 align="char">
1647<para>Device driver not loaded/available.</para>
1648</entry>
1649 </row><row><entry
1650 align="char">
1651<para>EBUSY</para>
1652</entry><entry
1653 align="char">
1654<para>Device or resource busy.</para>
1655</entry>
1656 </row><row><entry
1657 align="char">
1658<para>EINVAL</para>
1659</entry><entry
1660 align="char">
1661<para>Invalid argument.</para>
1662</entry>
1663 </row><row><entry
1664 align="char">
1665<para>EPERM</para>
1666</entry><entry
1667 align="char">
1668<para>File not opened with read permissions.</para>
1669</entry>
1670 </row><row><entry
1671 align="char">
1672<para>EINTERNAL</para>
1673</entry><entry
1674 align="char">
1675<para>Internal error in the device driver.</para>
1676</entry>
1677 </row></tbody></tgroup></informaltable>
1678</section>
1679
1680<section id="frontend_enable_high_lnb_volt">
1681<title>FE_ENABLE_HIGH_LNB_VOLTAGE</title>
1682<para>DESCRIPTION
1683</para>
1684<informaltable><tgroup cols="1"><tbody><row><entry
1685 align="char">
1686<para>If high != 0 enables slightly higher voltages instead of 13/18V (to compensate
1687 for long cables). This call requires read/write permissions. Not all DVB
1688 adapters support this ioctl.</para>
1689</entry>
1690 </row></tbody></tgroup></informaltable>
1691
1692<para>SYNOPSIS
1693</para>
1694<informaltable><tgroup cols="1"><tbody><row><entry
1695 align="char">
1696<para>int ioctl(int fd, int request =
1697 FE_ENABLE_HIGH_LNB_VOLTAGE, int high);</para>
1698</entry>
1699 </row></tbody></tgroup></informaltable>
1700
1701<para>PARAMETERS
1702</para>
1703<informaltable><tgroup cols="2"><tbody><row><entry
1704 align="char">
1705<para>int fd</para>
1706</entry><entry
1707 align="char">
1708<para>File descriptor returned by a previous call to open().</para>
1709</entry>
1710 </row><row><entry
1711 align="char">
1712<para>int request</para>
1713</entry><entry
1714 align="char">
1715<para>Equals FE_SET_VOLTAGE for this command.</para>
1716</entry>
1717 </row><row><entry
1718 align="char">
1719<para>int high</para>
1720</entry><entry
1721 align="char">
1722<para>The requested bus voltage.</para>
1723</entry>
1724 </row></tbody></tgroup></informaltable>
1725
1726<para>ERRORS
1727</para>
1728<informaltable><tgroup cols="2"><tbody><row><entry
1729 align="char">
1730<para>ENODEV</para>
1731</entry><entry
1732 align="char">
1733<para>Device driver not loaded/available.</para>
1734</entry>
1735 </row><row><entry
1736 align="char">
1737<para>EBUSY</para>
1738</entry><entry
1739 align="char">
1740<para>Device or resource busy.</para>
1741</entry>
1742 </row><row><entry
1743 align="char">
1744<para>EINVAL</para>
1745</entry><entry
1746 align="char">
1747<para>Invalid argument.</para>
1748</entry>
1749 </row><row><entry
1750 align="char">
1751<para>EPERM</para>
1752</entry><entry
1753 align="char">
1754<para>File not opened with read permissions.</para>
1755</entry>
1756 </row><row><entry
1757 align="char">
1758<para>EINTERNAL</para>
1759</entry><entry
1760 align="char">
1761<para>Internal error in the device driver.</para>
1762</entry>
1763 </row></tbody></tgroup></informaltable>
1764</section>
1765</section>
diff --git a/Documentation/DocBook/dvb/intro.xml b/Documentation/DocBook/dvb/intro.xml
new file mode 100644
index 000000000000..83676c44e8ae
--- /dev/null
+++ b/Documentation/DocBook/dvb/intro.xml
@@ -0,0 +1,191 @@
1<title>Introduction</title>
2
3<section id="requisites">
4<title>What you need to know</title>
5
6<para>The reader of this document is required to have some knowledge in
7the area of digital video broadcasting (DVB) and should be familiar with
8part I of the MPEG2 specification ISO/IEC 13818 (aka ITU-T H.222), i.e
9you should know what a program/transport stream (PS/TS) is and what is
10meant by a packetized elementary stream (PES) or an I-frame.</para>
11
12<para>Various DVB standards documents are available from
13<emphasis role="tt">http://www.dvb.org/</emphasis> and/or
14<emphasis role="tt">http://www.etsi.org/</emphasis>.</para>
15
16<para>It is also necessary to know how to access unix/linux devices and
17how to use ioctl calls. This also includes the knowledge of C or C++.
18</para>
19</section>
20
21<section id="history">
22<title>History</title>
23
24<para>The first API for DVB cards we used at Convergence in late 1999
25was an extension of the Video4Linux API which was primarily developed
26for frame grabber cards. As such it was not really well suited to be
27used for DVB cards and their new features like recording MPEG streams
28and filtering several section and PES data streams at the same time.
29</para>
30
31<para>In early 2000, we were approached by Nokia with a proposal for a
32new standard Linux DVB API. As a commitment to the development of
33terminals based on open standards, Nokia and Convergence made it
34available to all Linux developers and published it on <emphasis
35role="tt">http://www.linuxtv.org/</emphasis> in September 2000.
36Convergence is the maintainer of the Linux DVB API. Together with the
37LinuxTV community (i.e. you, the reader of this document), the Linux DVB
38API will be constantly reviewed and improved. With the Linux driver for
39the Siemens/Hauppauge DVB PCI card Convergence provides a first
40implementation of the Linux DVB API.</para>
41</section>
42
43<section id="overview">
44<title>Overview</title>
45
46<figure id="stb_components">
47<title>Components of a DVB card/STB</title>
48<mediaobject>
49<imageobject>
50<imagedata fileref="dvbstb.pdf" format="PS" />
51</imageobject>
52<imageobject>
53<imagedata fileref="dvbstb.png" format="PNG" />
54</imageobject>
55</mediaobject>
56</figure>
57
58<para>A DVB PCI card or DVB set-top-box (STB) usually consists of the
59following main hardware components: </para>
60
61<itemizedlist>
62 <listitem>
63
64<para>Frontend consisting of tuner and DVB demodulator</para>
65
66<para>Here the raw signal reaches the DVB hardware from a satellite dish
67or antenna or directly from cable. The frontend down-converts and
68demodulates this signal into an MPEG transport stream (TS). In case of a
69satellite frontend, this includes a facility for satellite equipment
70control (SEC), which allows control of LNB polarization, multi feed
71switches or dish rotors.</para>
72
73</listitem>
74 <listitem>
75
76<para>Conditional Access (CA) hardware like CI adapters and smartcard slots
77</para>
78
79<para>The complete TS is passed through the CA hardware. Programs to
80which the user has access (controlled by the smart card) are decoded in
81real time and re-inserted into the TS.</para>
82
83</listitem>
84 <listitem>
85 <para>Demultiplexer which filters the incoming DVB stream</para>
86
87<para>The demultiplexer splits the TS into its components like audio and
88video streams. Besides usually several of such audio and video streams
89it also contains data streams with information about the programs
90offered in this or other streams of the same provider.</para>
91
92</listitem>
93<listitem>
94
95<para>MPEG2 audio and video decoder</para>
96
97<para>The main targets of the demultiplexer are the MPEG2 audio and
98video decoders. After decoding they pass on the uncompressed audio and
99video to the computer screen or (through a PAL/NTSC encoder) to a TV
100set.</para>
101
102
103</listitem>
104</itemizedlist>
105
106<para><xref linkend="stb_components" /> shows a crude schematic of the control and data flow
107between those components.</para>
108
109<para>On a DVB PCI card not all of these have to be present since some
110functionality can be provided by the main CPU of the PC (e.g. MPEG
111picture and sound decoding) or is not needed (e.g. for data-only uses
112like &#8220;internet over satellite&#8221;). Also not every card or STB
113provides conditional access hardware.</para>
114
115</section>
116
117<section id="dvb_devices">
118<title>Linux DVB Devices</title>
119
120<para>The Linux DVB API lets you control these hardware components
121through currently six Unix-style character devices for video, audio,
122frontend, demux, CA and IP-over-DVB networking. The video and audio
123devices control the MPEG2 decoder hardware, the frontend device the
124tuner and the DVB demodulator. The demux device gives you control over
125the PES and section filters of the hardware. If the hardware does not
126support filtering these filters can be implemented in software. Finally,
127the CA device controls all the conditional access capabilities of the
128hardware. It can depend on the individual security requirements of the
129platform, if and how many of the CA functions are made available to the
130application through this device.</para>
131
132<para>All devices can be found in the <emphasis role="tt">/dev</emphasis>
133tree under <emphasis role="tt">/dev/dvb</emphasis>. The individual devices
134are called:</para>
135
136<itemizedlist>
137<listitem>
138
139<para><emphasis role="tt">/dev/dvb/adapterN/audioM</emphasis>,</para>
140</listitem>
141<listitem>
142<para><emphasis role="tt">/dev/dvb/adapterN/videoM</emphasis>,</para>
143</listitem>
144<listitem>
145<para><emphasis role="tt">/dev/dvb/adapterN/frontendM</emphasis>,</para>
146</listitem>
147 <listitem>
148
149<para><emphasis role="tt">/dev/dvb/adapterN/netM</emphasis>,</para>
150</listitem>
151 <listitem>
152
153<para><emphasis role="tt">/dev/dvb/adapterN/demuxM</emphasis>,</para>
154</listitem>
155 <listitem>
156
157<para><emphasis role="tt">/dev/dvb/adapterN/caM</emphasis>,</para></listitem></itemizedlist>
158
159<para>where N enumerates the DVB PCI cards in a system starting
160from&#x00A0;0, and M enumerates the devices of each type within each
161adapter, starting from&#x00A0;0, too. We will omit the &#8220;<emphasis
162role="tt">/dev/dvb/adapterN/</emphasis>&#8221; in the further dicussion
163of these devices. The naming scheme for the devices is the same wheter
164devfs is used or not.</para>
165
166<para>More details about the data structures and function calls of all
167the devices are described in the following chapters.</para>
168
169</section>
170
171<section id="include_files">
172<title>API include files</title>
173
174<para>For each of the DVB devices a corresponding include file exists.
175The DVB API include files should be included in application sources with
176a partial path like:</para>
177
178
179<programlisting>
180 #include &#x003C;linux/dvb/frontend.h&#x003E;
181</programlisting>
182
183<para>To enable applications to support different API version, an
184additional include file <emphasis
185role="tt">linux/dvb/version.h</emphasis> exists, which defines the
186constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document
187describes <emphasis role="tt">DVB_API_VERSION&#x00A0;3</emphasis>.
188</para>
189
190</section>
191
diff --git a/Documentation/DocBook/dvb/kdapi.xml b/Documentation/DocBook/dvb/kdapi.xml
new file mode 100644
index 000000000000..6c67481eaa4b
--- /dev/null
+++ b/Documentation/DocBook/dvb/kdapi.xml
@@ -0,0 +1,2309 @@
1<title>Kernel Demux API</title>
2<para>The kernel demux API defines a driver-internal interface for registering low-level,
3hardware specific driver to a hardware independent demux layer. It is only of interest for
4DVB device driver writers. The header file for this API is named <emphasis role="tt">demux.h</emphasis> and located in
5<emphasis role="tt">drivers/media/dvb/dvb-core</emphasis>.
6</para>
7<para>Maintainer note: This section must be reviewed. It is probably out of date.
8</para>
9
10<section id="kernel_demux_data_types">
11<title>Kernel Demux Data Types</title>
12
13
14<section id="dmx_success_t">
15<title>dmx_success_t</title>
16 <programlisting>
17 typedef enum {
18 DMX_OK = 0, /&#x22C6; Received Ok &#x22C6;/
19 DMX_LENGTH_ERROR, /&#x22C6; Incorrect length &#x22C6;/
20 DMX_OVERRUN_ERROR, /&#x22C6; Receiver ring buffer overrun &#x22C6;/
21 DMX_CRC_ERROR, /&#x22C6; Incorrect CRC &#x22C6;/
22 DMX_FRAME_ERROR, /&#x22C6; Frame alignment error &#x22C6;/
23 DMX_FIFO_ERROR, /&#x22C6; Receiver FIFO overrun &#x22C6;/
24 DMX_MISSED_ERROR /&#x22C6; Receiver missed packet &#x22C6;/
25 } dmx_success_t;
26</programlisting>
27
28</section>
29<section id="ts_filter_types">
30<title>TS filter types</title>
31 <programlisting>
32 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
33 /&#x22C6; TS packet reception &#x22C6;/
34 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
35
36 /&#x22C6; TS filter type for set_type() &#x22C6;/
37
38 #define TS_PACKET 1 /&#x22C6; send TS packets (188 bytes) to callback (default) &#x22C6;/
39 #define TS_PAYLOAD_ONLY 2 /&#x22C6; in case TS_PACKET is set, only send the TS
40 payload (&#x003C;=184 bytes per packet) to callback &#x22C6;/
41 #define TS_DECODER 4 /&#x22C6; send stream to built-in decoder (if present) &#x22C6;/
42</programlisting>
43
44</section>
45<section id="dmx_ts_pes_t">
46<title>dmx_ts_pes_t</title>
47<para>The structure
48</para>
49<programlisting>
50 typedef enum
51 {
52 DMX_TS_PES_AUDIO, /&#x22C6; also send packets to audio decoder (if it exists) &#x22C6;/
53 DMX_TS_PES_VIDEO, /&#x22C6; ... &#x22C6;/
54 DMX_TS_PES_TELETEXT,
55 DMX_TS_PES_SUBTITLE,
56 DMX_TS_PES_PCR,
57 DMX_TS_PES_OTHER,
58 } dmx_ts_pes_t;
59</programlisting>
60<para>describes the PES type for filters which write to a built-in decoder. The correspond (and
61should be kept identical) to the types in the demux device.
62</para>
63<programlisting>
64 struct dmx_ts_feed_s {
65 int is_filtering; /&#x22C6; Set to non-zero when filtering in progress &#x22C6;/
66 struct dmx_demux_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
67 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
68 int (&#x22C6;set) (struct dmx_ts_feed_s&#x22C6; feed,
69 __u16 pid,
70 size_t callback_length,
71 size_t circular_buffer_size,
72 int descramble,
73 struct timespec timeout);
74 int (&#x22C6;start_filtering) (struct dmx_ts_feed_s&#x22C6; feed);
75 int (&#x22C6;stop_filtering) (struct dmx_ts_feed_s&#x22C6; feed);
76 int (&#x22C6;set_type) (struct dmx_ts_feed_s&#x22C6; feed,
77 int type,
78 dmx_ts_pes_t pes_type);
79 };
80
81 typedef struct dmx_ts_feed_s dmx_ts_feed_t;
82</programlisting>
83 <programlisting>
84 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
85 /&#x22C6; PES packet reception (not supported yet) &#x22C6;/
86 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
87
88 typedef struct dmx_pes_filter_s {
89 struct dmx_pes_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
90 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
91 } dmx_pes_filter_t;
92</programlisting>
93 <programlisting>
94 typedef struct dmx_pes_feed_s {
95 int is_filtering; /&#x22C6; Set to non-zero when filtering in progress &#x22C6;/
96 struct dmx_demux_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
97 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
98 int (&#x22C6;set) (struct dmx_pes_feed_s&#x22C6; feed,
99 __u16 pid,
100 size_t circular_buffer_size,
101 int descramble,
102 struct timespec timeout);
103 int (&#x22C6;start_filtering) (struct dmx_pes_feed_s&#x22C6; feed);
104 int (&#x22C6;stop_filtering) (struct dmx_pes_feed_s&#x22C6; feed);
105 int (&#x22C6;allocate_filter) (struct dmx_pes_feed_s&#x22C6; feed,
106 dmx_pes_filter_t&#x22C6;&#x22C6; filter);
107 int (&#x22C6;release_filter) (struct dmx_pes_feed_s&#x22C6; feed,
108 dmx_pes_filter_t&#x22C6; filter);
109 } dmx_pes_feed_t;
110</programlisting>
111 <programlisting>
112 typedef struct {
113 __u8 filter_value [DMX_MAX_FILTER_SIZE];
114 __u8 filter_mask [DMX_MAX_FILTER_SIZE];
115 struct dmx_section_feed_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
116 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
117 } dmx_section_filter_t;
118</programlisting>
119 <programlisting>
120 struct dmx_section_feed_s {
121 int is_filtering; /&#x22C6; Set to non-zero when filtering in progress &#x22C6;/
122 struct dmx_demux_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
123 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
124 int (&#x22C6;set) (struct dmx_section_feed_s&#x22C6; feed,
125 __u16 pid,
126 size_t circular_buffer_size,
127 int descramble,
128 int check_crc);
129 int (&#x22C6;allocate_filter) (struct dmx_section_feed_s&#x22C6; feed,
130 dmx_section_filter_t&#x22C6;&#x22C6; filter);
131 int (&#x22C6;release_filter) (struct dmx_section_feed_s&#x22C6; feed,
132 dmx_section_filter_t&#x22C6; filter);
133 int (&#x22C6;start_filtering) (struct dmx_section_feed_s&#x22C6; feed);
134 int (&#x22C6;stop_filtering) (struct dmx_section_feed_s&#x22C6; feed);
135 };
136 typedef struct dmx_section_feed_s dmx_section_feed_t;
137
138 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
139 /&#x22C6; Callback functions &#x22C6;/
140 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
141
142 typedef int (&#x22C6;dmx_ts_cb) ( __u8 &#x22C6; buffer1,
143 size_t buffer1_length,
144 __u8 &#x22C6; buffer2,
145 size_t buffer2_length,
146 dmx_ts_feed_t&#x22C6; source,
147 dmx_success_t success);
148
149 typedef int (&#x22C6;dmx_section_cb) ( __u8 &#x22C6; buffer1,
150 size_t buffer1_len,
151 __u8 &#x22C6; buffer2,
152 size_t buffer2_len,
153 dmx_section_filter_t &#x22C6; source,
154 dmx_success_t success);
155
156 typedef int (&#x22C6;dmx_pes_cb) ( __u8 &#x22C6; buffer1,
157 size_t buffer1_len,
158 __u8 &#x22C6; buffer2,
159 size_t buffer2_len,
160 dmx_pes_filter_t&#x22C6; source,
161 dmx_success_t success);
162
163 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
164 /&#x22C6; DVB Front-End &#x22C6;/
165 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
166
167 typedef enum {
168 DMX_OTHER_FE = 0,
169 DMX_SATELLITE_FE,
170 DMX_CABLE_FE,
171 DMX_TERRESTRIAL_FE,
172 DMX_LVDS_FE,
173 DMX_ASI_FE, /&#x22C6; DVB-ASI interface &#x22C6;/
174 DMX_MEMORY_FE
175 } dmx_frontend_source_t;
176
177 typedef struct {
178 /&#x22C6; The following char&#x22C6; fields point to NULL terminated strings &#x22C6;/
179 char&#x22C6; id; /&#x22C6; Unique front-end identifier &#x22C6;/
180 char&#x22C6; vendor; /&#x22C6; Name of the front-end vendor &#x22C6;/
181 char&#x22C6; model; /&#x22C6; Name of the front-end model &#x22C6;/
182 struct list_head connectivity_list; /&#x22C6; List of front-ends that can
183 be connected to a particular
184 demux &#x22C6;/
185 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
186 dmx_frontend_source_t source;
187 } dmx_frontend_t;
188
189 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
190 /&#x22C6; MPEG-2 TS Demux &#x22C6;/
191 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
192
193 /&#x22C6;
194 &#x22C6; Flags OR'ed in the capabilites field of struct dmx_demux_s.
195 &#x22C6;/
196
197 #define DMX_TS_FILTERING 1
198 #define DMX_PES_FILTERING 2
199 #define DMX_SECTION_FILTERING 4
200 #define DMX_MEMORY_BASED_FILTERING 8 /&#x22C6; write() available &#x22C6;/
201 #define DMX_CRC_CHECKING 16
202 #define DMX_TS_DESCRAMBLING 32
203 #define DMX_SECTION_PAYLOAD_DESCRAMBLING 64
204 #define DMX_MAC_ADDRESS_DESCRAMBLING 128
205</programlisting>
206
207</section>
208<section id="demux_demux_t">
209<title>demux_demux_t</title>
210 <programlisting>
211 /&#x22C6;
212 &#x22C6; DMX_FE_ENTRY(): Casts elements in the list of registered
213 &#x22C6; front-ends from the generic type struct list_head
214 &#x22C6; to the type &#x22C6; dmx_frontend_t
215 &#x22C6;.
216 &#x22C6;/
217
218 #define DMX_FE_ENTRY(list) list_entry(list, dmx_frontend_t, connectivity_list)
219
220 struct dmx_demux_s {
221 /&#x22C6; The following char&#x22C6; fields point to NULL terminated strings &#x22C6;/
222 char&#x22C6; id; /&#x22C6; Unique demux identifier &#x22C6;/
223 char&#x22C6; vendor; /&#x22C6; Name of the demux vendor &#x22C6;/
224 char&#x22C6; model; /&#x22C6; Name of the demux model &#x22C6;/
225 __u32 capabilities; /&#x22C6; Bitfield of capability flags &#x22C6;/
226 dmx_frontend_t&#x22C6; frontend; /&#x22C6; Front-end connected to the demux &#x22C6;/
227 struct list_head reg_list; /&#x22C6; List of registered demuxes &#x22C6;/
228 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
229 int users; /&#x22C6; Number of users &#x22C6;/
230 int (&#x22C6;open) (struct dmx_demux_s&#x22C6; demux);
231 int (&#x22C6;close) (struct dmx_demux_s&#x22C6; demux);
232 int (&#x22C6;write) (struct dmx_demux_s&#x22C6; demux, const char&#x22C6; buf, size_t count);
233 int (&#x22C6;allocate_ts_feed) (struct dmx_demux_s&#x22C6; demux,
234 dmx_ts_feed_t&#x22C6;&#x22C6; feed,
235 dmx_ts_cb callback);
236 int (&#x22C6;release_ts_feed) (struct dmx_demux_s&#x22C6; demux,
237 dmx_ts_feed_t&#x22C6; feed);
238 int (&#x22C6;allocate_pes_feed) (struct dmx_demux_s&#x22C6; demux,
239 dmx_pes_feed_t&#x22C6;&#x22C6; feed,
240 dmx_pes_cb callback);
241 int (&#x22C6;release_pes_feed) (struct dmx_demux_s&#x22C6; demux,
242 dmx_pes_feed_t&#x22C6; feed);
243 int (&#x22C6;allocate_section_feed) (struct dmx_demux_s&#x22C6; demux,
244 dmx_section_feed_t&#x22C6;&#x22C6; feed,
245 dmx_section_cb callback);
246 int (&#x22C6;release_section_feed) (struct dmx_demux_s&#x22C6; demux,
247 dmx_section_feed_t&#x22C6; feed);
248 int (&#x22C6;descramble_mac_address) (struct dmx_demux_s&#x22C6; demux,
249 __u8&#x22C6; buffer1,
250 size_t buffer1_length,
251 __u8&#x22C6; buffer2,
252 size_t buffer2_length,
253 __u16 pid);
254 int (&#x22C6;descramble_section_payload) (struct dmx_demux_s&#x22C6; demux,
255 __u8&#x22C6; buffer1,
256 size_t buffer1_length,
257 __u8&#x22C6; buffer2, size_t buffer2_length,
258 __u16 pid);
259 int (&#x22C6;add_frontend) (struct dmx_demux_s&#x22C6; demux,
260 dmx_frontend_t&#x22C6; frontend);
261 int (&#x22C6;remove_frontend) (struct dmx_demux_s&#x22C6; demux,
262 dmx_frontend_t&#x22C6; frontend);
263 struct list_head&#x22C6; (&#x22C6;get_frontends) (struct dmx_demux_s&#x22C6; demux);
264 int (&#x22C6;connect_frontend) (struct dmx_demux_s&#x22C6; demux,
265 dmx_frontend_t&#x22C6; frontend);
266 int (&#x22C6;disconnect_frontend) (struct dmx_demux_s&#x22C6; demux);
267
268
269 /&#x22C6; added because js cannot keep track of these himself &#x22C6;/
270 int (&#x22C6;get_pes_pids) (struct dmx_demux_s&#x22C6; demux, __u16 &#x22C6;pids);
271 };
272 typedef struct dmx_demux_s dmx_demux_t;
273</programlisting>
274
275</section>
276<section id="demux_directory">
277<title>Demux directory</title>
278 <programlisting>
279 /&#x22C6;
280 &#x22C6; DMX_DIR_ENTRY(): Casts elements in the list of registered
281 &#x22C6; demuxes from the generic type struct list_head&#x22C6; to the type dmx_demux_t
282 &#x22C6;.
283 &#x22C6;/
284
285 #define DMX_DIR_ENTRY(list) list_entry(list, dmx_demux_t, reg_list)
286
287 int dmx_register_demux (dmx_demux_t&#x22C6; demux);
288 int dmx_unregister_demux (dmx_demux_t&#x22C6; demux);
289 struct list_head&#x22C6; dmx_get_demuxes (void);
290</programlisting>
291 </section></section>
292<section id="demux_directory_api">
293<title>Demux Directory API</title>
294<para>The demux directory is a Linux kernel-wide facility for registering and accessing the
295MPEG-2 TS demuxes in the system. Run-time registering and unregistering of demux drivers
296is possible using this API.
297</para>
298<para>All demux drivers in the directory implement the abstract interface dmx_demux_t.
299</para>
300
301<section
302role="subsection"><title>dmx_register_demux()</title>
303<para>DESCRIPTION
304</para>
305<informaltable><tgroup cols="1"><tbody><row><entry
306 align="char">
307<para>This function makes a demux driver interface available to the Linux kernel. It is
308 usually called by the init_module() function of the kernel module that contains
309 the demux driver. The caller of this function is responsible for allocating
310 dynamic or static memory for the demux structure and for initializing its fields
311 before calling this function. The memory allocated for the demux structure
312 must not be freed before calling dmx_unregister_demux(),</para>
313</entry>
314 </row></tbody></tgroup></informaltable>
315<para>SYNOPSIS
316</para>
317<informaltable><tgroup cols="1"><tbody><row><entry
318 align="char">
319<para>int dmx_register_demux ( dmx_demux_t &#x22C6;demux )</para>
320</entry>
321 </row></tbody></tgroup></informaltable>
322<para>PARAMETERS
323</para>
324<informaltable><tgroup cols="2"><tbody><row><entry
325 align="char">
326<para>dmx_demux_t*
327 demux</para>
328</entry><entry
329 align="char">
330<para>Pointer to the demux structure.</para>
331</entry>
332 </row></tbody></tgroup></informaltable>
333<para>RETURNS
334</para>
335<informaltable><tgroup cols="2"><tbody><row><entry
336 align="char">
337<para>0</para>
338</entry><entry
339 align="char">
340<para>The function was completed without errors.</para>
341</entry>
342 </row><row><entry
343 align="char">
344<para>-EEXIST</para>
345</entry><entry
346 align="char">
347<para>A demux with the same value of the id field already stored
348 in the directory.</para>
349</entry>
350 </row><row><entry
351 align="char">
352<para>-ENOSPC</para>
353</entry><entry
354 align="char">
355<para>No space left in the directory.</para>
356</entry>
357 </row></tbody></tgroup></informaltable>
358
359</section><section
360role="subsection"><title>dmx_unregister_demux()</title>
361<para>DESCRIPTION
362</para>
363<informaltable><tgroup cols="1"><tbody><row><entry
364 align="char">
365<para>This function is called to indicate that the given demux interface is no
366 longer available. The caller of this function is responsible for freeing the
367 memory of the demux structure, if it was dynamically allocated before calling
368 dmx_register_demux(). The cleanup_module() function of the kernel module
369 that contains the demux driver should call this function. Note that this function
370 fails if the demux is currently in use, i.e., release_demux() has not been called
371 for the interface.</para>
372</entry>
373 </row></tbody></tgroup></informaltable>
374<para>SYNOPSIS
375</para>
376<informaltable><tgroup cols="1"><tbody><row><entry
377 align="char">
378<para>int dmx_unregister_demux ( dmx_demux_t &#x22C6;demux )</para>
379</entry>
380 </row></tbody></tgroup></informaltable>
381<para>PARAMETERS
382</para>
383<informaltable><tgroup cols="2"><tbody><row><entry
384 align="char">
385<para>dmx_demux_t*
386 demux</para>
387</entry><entry
388 align="char">
389<para>Pointer to the demux structure which is to be
390 unregistered.</para>
391</entry>
392 </row></tbody></tgroup></informaltable>
393<para>RETURNS
394</para>
395<informaltable><tgroup cols="2"><tbody><row><entry
396 align="char">
397<para>0</para>
398</entry><entry
399 align="char">
400<para>The function was completed without errors.</para>
401</entry>
402 </row><row><entry
403 align="char">
404<para>ENODEV</para>
405</entry><entry
406 align="char">
407<para>The specified demux is not registered in the demux
408 directory.</para>
409</entry>
410 </row><row><entry
411 align="char">
412<para>EBUSY</para>
413</entry><entry
414 align="char">
415<para>The specified demux is currently in use.</para>
416</entry>
417 </row></tbody></tgroup></informaltable>
418
419</section><section
420role="subsection"><title>dmx_get_demuxes()</title>
421<para>DESCRIPTION
422</para>
423<informaltable><tgroup cols="1"><tbody><row><entry
424 align="char">
425<para>Provides the caller with the list of registered demux interfaces, using the
426 standard list structure defined in the include file linux/list.h. The include file
427 demux.h defines the macro DMX_DIR_ENTRY() for converting an element of
428 the generic type struct list_head* to the type dmx_demux_t*. The caller must
429 not free the memory of any of the elements obtained via this function call.</para>
430</entry>
431 </row></tbody></tgroup></informaltable>
432<para>SYNOPSIS
433</para>
434<informaltable><tgroup cols="1"><tbody><row><entry
435 align="char">
436<para>struct list_head &#x22C6;dmx_get_demuxes ()</para>
437</entry>
438 </row></tbody></tgroup></informaltable>
439<para>PARAMETERS
440</para>
441<informaltable><tgroup cols="2"><tbody><row><entry
442 align="char">
443<para>none</para>
444</entry>
445 </row></tbody></tgroup></informaltable>
446<para>RETURNS
447</para>
448<informaltable><tgroup cols="2"><tbody><row><entry
449 align="char">
450<para>struct list_head *</para>
451</entry><entry
452 align="char">
453<para>A list of demux interfaces, or NULL in the case of an
454 empty list.</para>
455</entry>
456 </row></tbody></tgroup></informaltable>
457 </section></section>
458<section id="demux_api">
459<title>Demux API</title>
460<para>The demux API should be implemented for each demux in the system. It is used to select
461the TS source of a demux and to manage the demux resources. When the demux
462client allocates a resource via the demux API, it receives a pointer to the API of that
463resource.
464</para>
465<para>Each demux receives its TS input from a DVB front-end or from memory, as set via the
466demux API. In a system with more than one front-end, the API can be used to select one of
467the DVB front-ends as a TS source for a demux, unless this is fixed in the HW platform. The
468demux API only controls front-ends regarding their connections with demuxes; the APIs
469used to set the other front-end parameters, such as tuning, are not defined in this
470document.
471</para>
472<para>The functions that implement the abstract interface demux should be defined static or
473module private and registered to the Demux Directory for external access. It is not necessary
474to implement every function in the demux_t struct, however (for example, a demux interface
475might support Section filtering, but not TS or PES filtering). The API client is expected to
476check the value of any function pointer before calling the function: the value of NULL means
477&#8220;function not available&#8221;.
478</para>
479<para>Whenever the functions of the demux API modify shared data, the possibilities of lost
480update and race condition problems should be addressed, e.g. by protecting parts of code with
481mutexes. This is especially important on multi-processor hosts.
482</para>
483<para>Note that functions called from a bottom half context must not sleep, at least in the 2.2.x
484kernels. Even a simple memory allocation can result in a kernel thread being put to sleep if
485swapping is needed. For example, the Linux kernel calls the functions of a network device
486interface from a bottom half context. Thus, if a demux API function is called from network
487device code, the function must not sleep.
488</para>
489
490
491<section id="kdapi_fopen">
492<title>open()</title>
493<para>DESCRIPTION
494</para>
495<informaltable><tgroup cols="1"><tbody><row><entry
496 align="char">
497<para>This function reserves the demux for use by the caller and, if necessary,
498 initializes the demux. When the demux is no longer needed, the function close()
499 should be called. It should be possible for multiple clients to access the demux
500 at the same time. Thus, the function implementation should increment the
501 demux usage count when open() is called and decrement it when close() is
502 called.</para>
503</entry>
504 </row></tbody></tgroup></informaltable>
505<para>SYNOPSIS
506</para>
507<informaltable><tgroup cols="1"><tbody><row><entry
508 align="char">
509<para>int open ( demux_t&#x22C6; demux );</para>
510</entry>
511 </row></tbody></tgroup></informaltable>
512<para>PARAMETERS
513</para>
514<informaltable><tgroup cols="2"><tbody><row><entry
515 align="char">
516<para>demux_t* demux</para>
517</entry><entry
518 align="char">
519<para>Pointer to the demux API and instance data.</para>
520</entry>
521 </row></tbody></tgroup></informaltable>
522<para>RETURNS
523</para>
524<informaltable><tgroup cols="2"><tbody><row><entry
525 align="char">
526<para>0</para>
527</entry><entry
528 align="char">
529<para>The function was completed without errors.</para>
530</entry>
531 </row><row><entry
532 align="char">
533<para>-EUSERS</para>
534</entry><entry
535 align="char">
536<para>Maximum usage count reached.</para>
537</entry>
538 </row><row><entry
539 align="char">
540<para>-EINVAL</para>
541</entry><entry
542 align="char">
543<para>Bad parameter.</para>
544</entry>
545 </row></tbody></tgroup></informaltable>
546
547</section>
548<section id="kdapi_fclose">
549<title>close()</title>
550<para>DESCRIPTION
551</para>
552<informaltable><tgroup cols="1"><tbody><row><entry
553 align="char">
554<para>This function reserves the demux for use by the caller and, if necessary,
555 initializes the demux. When the demux is no longer needed, the function close()
556 should be called. It should be possible for multiple clients to access the demux
557 at the same time. Thus, the function implementation should increment the
558 demux usage count when open() is called and decrement it when close() is
559 called.</para>
560</entry>
561 </row></tbody></tgroup></informaltable>
562<para>SYNOPSIS
563</para>
564<informaltable><tgroup cols="1"><tbody><row><entry
565 align="char">
566<para>int close(demux_t&#x22C6; demux);</para>
567</entry>
568 </row></tbody></tgroup></informaltable>
569<para>PARAMETERS
570</para>
571<informaltable><tgroup cols="2"><tbody><row><entry
572 align="char">
573<para>demux_t* demux</para>
574</entry><entry
575 align="char">
576<para>Pointer to the demux API and instance data.</para>
577</entry>
578 </row></tbody></tgroup></informaltable>
579<para>RETURNS
580</para>
581<informaltable><tgroup cols="2"><tbody><row><entry
582 align="char">
583<para>0</para>
584</entry><entry
585 align="char">
586<para>The function was completed without errors.</para>
587</entry>
588 </row><row><entry
589 align="char">
590<para>-ENODEV</para>
591</entry><entry
592 align="char">
593<para>The demux was not in use.</para>
594</entry>
595 </row><row><entry
596 align="char">
597<para>-EINVAL</para>
598</entry><entry
599 align="char">
600<para>Bad parameter.</para>
601</entry>
602 </row></tbody></tgroup></informaltable>
603
604</section>
605<section id="kdapi_fwrite">
606<title>write()</title>
607<para>DESCRIPTION
608</para>
609<informaltable><tgroup cols="1"><tbody><row><entry
610 align="char">
611<para>This function provides the demux driver with a memory buffer containing TS
612 packets. Instead of receiving TS packets from the DVB front-end, the demux
613 driver software will read packets from memory. Any clients of this demux
614 with active TS, PES or Section filters will receive filtered data via the Demux
615 callback API (see 0). The function returns when all the data in the buffer has
616 been consumed by the demux. Demux hardware typically cannot read TS from
617 memory. If this is the case, memory-based filtering has to be implemented
618 entirely in software.</para>
619</entry>
620 </row></tbody></tgroup></informaltable>
621<para>SYNOPSIS
622</para>
623<informaltable><tgroup cols="1"><tbody><row><entry
624 align="char">
625<para>int write(demux_t&#x22C6; demux, const char&#x22C6; buf, size_t
626 count);</para>
627</entry>
628 </row></tbody></tgroup></informaltable>
629<para>PARAMETERS
630</para>
631<informaltable><tgroup cols="2"><tbody><row><entry
632 align="char">
633<para>demux_t* demux</para>
634</entry><entry
635 align="char">
636<para>Pointer to the demux API and instance data.</para>
637</entry>
638 </row><row><entry
639 align="char">
640<para>const char* buf</para>
641</entry><entry
642 align="char">
643<para>Pointer to the TS data in kernel-space memory.</para>
644</entry>
645 </row><row><entry
646 align="char">
647<para>size_t length</para>
648</entry><entry
649 align="char">
650<para>Length of the TS data.</para>
651</entry>
652 </row></tbody></tgroup></informaltable>
653<para>RETURNS
654</para>
655<informaltable><tgroup cols="2"><tbody><row><entry
656 align="char">
657<para>0</para>
658</entry><entry
659 align="char">
660<para>The function was completed without errors.</para>
661</entry>
662 </row><row><entry
663 align="char">
664<para>-ENOSYS</para>
665</entry><entry
666 align="char">
667<para>The command is not implemented.</para>
668</entry>
669 </row><row><entry
670 align="char">
671<para>-EINVAL</para>
672</entry><entry
673 align="char">
674<para>Bad parameter.</para>
675</entry>
676 </row></tbody></tgroup></informaltable>
677
678</section><section
679role="subsection"><title>allocate_ts_feed()</title>
680<para>DESCRIPTION
681</para>
682<informaltable><tgroup cols="1"><tbody><row><entry
683 align="char">
684<para>Allocates a new TS feed, which is used to filter the TS packets carrying a
685 certain PID. The TS feed normally corresponds to a hardware PID filter on the
686 demux chip.</para>
687</entry>
688 </row></tbody></tgroup></informaltable>
689<para>SYNOPSIS
690</para>
691<informaltable><tgroup cols="1"><tbody><row><entry
692 align="char">
693<para>int allocate_ts_feed(dmx_demux_t&#x22C6; demux,
694 dmx_ts_feed_t&#x22C6;&#x22C6; feed, dmx_ts_cb callback);</para>
695</entry>
696 </row></tbody></tgroup></informaltable>
697<para>PARAMETERS
698</para>
699<informaltable><tgroup cols="2"><tbody><row><entry
700 align="char">
701<para>demux_t* demux</para>
702</entry><entry
703 align="char">
704<para>Pointer to the demux API and instance data.</para>
705</entry>
706 </row><row><entry
707 align="char">
708<para>dmx_ts_feed_t**
709 feed</para>
710</entry><entry
711 align="char">
712<para>Pointer to the TS feed API and instance data.</para>
713</entry>
714 </row><row><entry
715 align="char">
716<para>dmx_ts_cb callback</para>
717</entry><entry
718 align="char">
719<para>Pointer to the callback function for passing received TS
720 packet</para>
721</entry>
722 </row></tbody></tgroup></informaltable>
723<para>RETURNS
724</para>
725<informaltable><tgroup cols="2"><tbody><row><entry
726 align="char">
727<para>0</para>
728</entry><entry
729 align="char">
730<para>The function was completed without errors.</para>
731</entry>
732 </row><row><entry
733 align="char">
734<para>-EBUSY</para>
735</entry><entry
736 align="char">
737<para>No more TS feeds available.</para>
738</entry>
739 </row><row><entry
740 align="char">
741<para>-ENOSYS</para>
742</entry><entry
743 align="char">
744<para>The command is not implemented.</para>
745</entry>
746 </row><row><entry
747 align="char">
748<para>-EINVAL</para>
749</entry><entry
750 align="char">
751<para>Bad parameter.</para>
752</entry>
753 </row></tbody></tgroup></informaltable>
754
755</section><section
756role="subsection"><title>release_ts_feed()</title>
757<para>DESCRIPTION
758</para>
759<informaltable><tgroup cols="1"><tbody><row><entry
760 align="char">
761<para>Releases the resources allocated with allocate_ts_feed(). Any filtering in
762 progress on the TS feed should be stopped before calling this function.</para>
763</entry>
764 </row></tbody></tgroup></informaltable>
765<para>SYNOPSIS
766</para>
767<informaltable><tgroup cols="1"><tbody><row><entry
768 align="char">
769<para>int release_ts_feed(dmx_demux_t&#x22C6; demux,
770 dmx_ts_feed_t&#x22C6; feed);</para>
771</entry>
772 </row></tbody></tgroup></informaltable>
773<para>PARAMETERS
774</para>
775<informaltable><tgroup cols="2"><tbody><row><entry
776 align="char">
777<para>demux_t* demux</para>
778</entry><entry
779 align="char">
780<para>Pointer to the demux API and instance data.</para>
781</entry>
782 </row><row><entry
783 align="char">
784<para>dmx_ts_feed_t* feed</para>
785</entry><entry
786 align="char">
787<para>Pointer to the TS feed API and instance data.</para>
788</entry>
789 </row></tbody></tgroup></informaltable>
790<para>RETURNS
791</para>
792<informaltable><tgroup cols="2"><tbody><row><entry
793 align="char">
794<para>0</para>
795</entry><entry
796 align="char">
797<para>The function was completed without errors.</para>
798</entry>
799 </row><row><entry
800 align="char">
801<para>-EINVAL</para>
802</entry><entry
803 align="char">
804<para>Bad parameter.</para>
805</entry>
806 </row></tbody></tgroup></informaltable>
807
808</section><section
809role="subsection"><title>allocate_section_feed()</title>
810<para>DESCRIPTION
811</para>
812<informaltable><tgroup cols="1"><tbody><row><entry
813 align="char">
814<para>Allocates a new section feed, i.e. a demux resource for filtering and receiving
815 sections. On platforms with hardware support for section filtering, a section
816 feed is directly mapped to the demux HW. On other platforms, TS packets are
817 first PID filtered in hardware and a hardware section filter then emulated in
818 software. The caller obtains an API pointer of type dmx_section_feed_t as an
819 out parameter. Using this API the caller can set filtering parameters and start
820 receiving sections.</para>
821</entry>
822 </row></tbody></tgroup></informaltable>
823<para>SYNOPSIS
824</para>
825<informaltable><tgroup cols="1"><tbody><row><entry
826 align="char">
827<para>int allocate_section_feed(dmx_demux_t&#x22C6; demux,
828 dmx_section_feed_t &#x22C6;&#x22C6;feed, dmx_section_cb callback);</para>
829</entry>
830 </row></tbody></tgroup></informaltable>
831<para>PARAMETERS
832</para>
833<informaltable><tgroup cols="2"><tbody><row><entry
834 align="char">
835<para>demux_t *demux</para>
836</entry><entry
837 align="char">
838<para>Pointer to the demux API and instance data.</para>
839</entry>
840 </row><row><entry
841 align="char">
842<para>dmx_section_feed_t
843 **feed</para>
844</entry><entry
845 align="char">
846<para>Pointer to the section feed API and instance data.</para>
847</entry>
848 </row><row><entry
849 align="char">
850<para>dmx_section_cb
851 callback</para>
852</entry><entry
853 align="char">
854<para>Pointer to the callback function for passing received
855 sections.</para>
856</entry>
857 </row></tbody></tgroup></informaltable>
858<para>RETURNS
859</para>
860<informaltable><tgroup cols="2"><tbody><row><entry
861 align="char">
862<para>0</para>
863</entry><entry
864 align="char">
865<para>The function was completed without errors.</para>
866</entry>
867 </row><row><entry
868 align="char">
869<para>-EBUSY</para>
870</entry><entry
871 align="char">
872<para>No more section feeds available.</para>
873</entry>
874 </row><row><entry
875 align="char">
876<para>-ENOSYS</para>
877</entry><entry
878 align="char">
879<para>The command is not implemented.</para>
880</entry>
881 </row><row><entry
882 align="char">
883<para>-EINVAL</para>
884</entry><entry
885 align="char">
886<para>Bad parameter.</para>
887</entry>
888 </row></tbody></tgroup></informaltable>
889
890</section><section
891role="subsection"><title>release_section_feed()</title>
892<para>DESCRIPTION
893</para>
894<informaltable><tgroup cols="1"><tbody><row><entry
895 align="char">
896<para>Releases the resources allocated with allocate_section_feed(), including
897 allocated filters. Any filtering in progress on the section feed should be stopped
898 before calling this function.</para>
899</entry>
900 </row></tbody></tgroup></informaltable>
901<para>SYNOPSIS
902</para>
903<informaltable><tgroup cols="1"><tbody><row><entry
904 align="char">
905<para>int release_section_feed(dmx_demux_t&#x22C6; demux,
906 dmx_section_feed_t &#x22C6;feed);</para>
907</entry>
908 </row></tbody></tgroup></informaltable>
909<para>PARAMETERS
910</para>
911<informaltable><tgroup cols="2"><tbody><row><entry
912 align="char">
913<para>demux_t *demux</para>
914</entry><entry
915 align="char">
916<para>Pointer to the demux API and instance data.</para>
917</entry>
918 </row><row><entry
919 align="char">
920<para>dmx_section_feed_t
921 *feed</para>
922</entry><entry
923 align="char">
924<para>Pointer to the section feed API and instance data.</para>
925</entry>
926 </row></tbody></tgroup></informaltable>
927<para>RETURNS
928</para>
929<informaltable><tgroup cols="2"><tbody><row><entry
930 align="char">
931<para>0</para>
932</entry><entry
933 align="char">
934<para>The function was completed without errors.</para>
935</entry>
936 </row><row><entry
937 align="char">
938<para>-EINVAL</para>
939</entry><entry
940 align="char">
941<para>Bad parameter.</para>
942</entry>
943 </row></tbody></tgroup></informaltable>
944
945</section><section
946role="subsection"><title>descramble_mac_address()</title>
947<para>DESCRIPTION
948</para>
949<informaltable><tgroup cols="1"><tbody><row><entry
950 align="char">
951<para>This function runs a descrambling algorithm on the destination MAC
952 address field of a DVB Datagram Section, replacing the original address
953 with its un-encrypted version. Otherwise, the description on the function
954 descramble_section_payload() applies also to this function.</para>
955</entry>
956 </row></tbody></tgroup></informaltable>
957<para>SYNOPSIS
958</para>
959<informaltable><tgroup cols="1"><tbody><row><entry
960 align="char">
961<para>int descramble_mac_address(dmx_demux_t&#x22C6; demux, __u8
962 &#x22C6;buffer1, size_t buffer1_length, __u8 &#x22C6;buffer2,
963 size_t buffer2_length, __u16 pid);</para>
964</entry>
965 </row></tbody></tgroup></informaltable>
966<para>PARAMETERS
967</para>
968<informaltable><tgroup cols="2"><tbody><row><entry
969 align="char">
970<para>dmx_demux_t
971 *demux</para>
972</entry><entry
973 align="char">
974<para>Pointer to the demux API and instance data.</para>
975</entry>
976 </row><row><entry
977 align="char">
978<para>__u8 *buffer1</para>
979</entry><entry
980 align="char">
981<para>Pointer to the first byte of the section.</para>
982</entry>
983 </row><row><entry
984 align="char">
985<para>size_t buffer1_length</para>
986</entry><entry
987 align="char">
988<para>Length of the section data, including headers and CRC,
989 in buffer1.</para>
990</entry>
991 </row><row><entry
992 align="char">
993<para>__u8* buffer2</para>
994</entry><entry
995 align="char">
996<para>Pointer to the tail of the section data, or NULL. The
997 pointer has a non-NULL value if the section wraps past
998 the end of a circular buffer.</para>
999</entry>
1000 </row><row><entry
1001 align="char">
1002<para>size_t buffer2_length</para>
1003</entry><entry
1004 align="char">
1005<para>Length of the section data, including headers and CRC,
1006 in buffer2.</para>
1007</entry>
1008 </row><row><entry
1009 align="char">
1010<para>__u16 pid</para>
1011</entry><entry
1012 align="char">
1013<para>The PID on which the section was received. Useful
1014 for obtaining the descrambling key, e.g. from a DVB
1015 Common Access facility.</para>
1016</entry>
1017 </row></tbody></tgroup></informaltable>
1018<para>RETURNS
1019</para>
1020<informaltable><tgroup cols="2"><tbody><row><entry
1021 align="char">
1022<para>0</para>
1023</entry><entry
1024 align="char">
1025<para>The function was completed without errors.</para>
1026</entry>
1027 </row><row><entry
1028 align="char">
1029<para>-ENOSYS</para>
1030</entry><entry
1031 align="char">
1032<para>No descrambling facility available.</para>
1033</entry>
1034 </row><row><entry
1035 align="char">
1036<para>-EINVAL</para>
1037</entry><entry
1038 align="char">
1039<para>Bad parameter.</para>
1040</entry>
1041 </row></tbody></tgroup></informaltable>
1042
1043</section><section
1044role="subsection"><title>descramble_section_payload()</title>
1045<para>DESCRIPTION
1046</para>
1047<informaltable><tgroup cols="1"><tbody><row><entry
1048 align="char">
1049<para>This function runs a descrambling algorithm on the payload of a DVB
1050 Datagram Section, replacing the original payload with its un-encrypted
1051 version. The function will be called from the demux API implementation;
1052 the API client need not call this function directly. Section-level scrambling
1053 algorithms are currently standardized only for DVB-RCC (return channel
1054 over 2-directional cable TV network) systems. For all other DVB networks,
1055 encryption schemes are likely to be proprietary to each data broadcaster. Thus,
1056 it is expected that this function pointer will have the value of NULL (i.e.,
1057 function not available) in most demux API implementations. Nevertheless, it
1058 should be possible to use the function pointer as a hook for dynamically adding
1059 a &#8220;plug-in&#8221; descrambling facility to a demux driver.</para>
1060</entry>
1061 </row><row><entry
1062 align="char">
1063<para>While this function is not needed with hardware-based section descrambling,
1064 the descramble_section_payload function pointer can be used to override the
1065 default hardware-based descrambling algorithm: if the function pointer has a
1066 non-NULL value, the corresponding function should be used instead of any
1067 descrambling hardware.</para>
1068</entry>
1069 </row></tbody></tgroup></informaltable>
1070<para>SYNOPSIS
1071</para>
1072<informaltable><tgroup cols="1"><tbody><row><entry
1073 align="char">
1074<para>int descramble_section_payload(dmx_demux_t&#x22C6; demux,
1075 __u8 &#x22C6;buffer1, size_t buffer1_length, __u8 &#x22C6;buffer2,
1076 size_t buffer2_length, __u16 pid);</para>
1077</entry>
1078 </row></tbody></tgroup></informaltable>
1079<para>PARAMETERS
1080</para>
1081<informaltable><tgroup cols="2"><tbody><row><entry
1082 align="char">
1083<para>dmx_demux_t
1084 *demux</para>
1085</entry><entry
1086 align="char">
1087<para>Pointer to the demux API and instance data.</para>
1088</entry>
1089 </row><row><entry
1090 align="char">
1091<para>__u8 *buffer1</para>
1092</entry><entry
1093 align="char">
1094<para>Pointer to the first byte of the section.</para>
1095</entry>
1096 </row><row><entry
1097 align="char">
1098<para>size_t buffer1_length</para>
1099</entry><entry
1100 align="char">
1101<para>Length of the section data, including headers and CRC,
1102 in buffer1.</para>
1103</entry>
1104 </row><row><entry
1105 align="char">
1106<para>__u8 *buffer2</para>
1107</entry><entry
1108 align="char">
1109<para>Pointer to the tail of the section data, or NULL. The
1110 pointer has a non-NULL value if the section wraps past
1111 the end of a circular buffer.</para>
1112</entry>
1113 </row><row><entry
1114 align="char">
1115<para>size_t buffer2_length</para>
1116</entry><entry
1117 align="char">
1118<para>Length of the section data, including headers and CRC,
1119 in buffer2.</para>
1120</entry>
1121 </row><row><entry
1122 align="char">
1123<para>__u16 pid</para>
1124</entry><entry
1125 align="char">
1126<para>The PID on which the section was received. Useful
1127 for obtaining the descrambling key, e.g. from a DVB
1128 Common Access facility.</para>
1129</entry>
1130 </row></tbody></tgroup></informaltable>
1131<para>RETURNS
1132</para>
1133<informaltable><tgroup cols="2"><tbody><row><entry
1134 align="char">
1135<para>0</para>
1136</entry><entry
1137 align="char">
1138<para>The function was completed without errors.</para>
1139</entry>
1140 </row><row><entry
1141 align="char">
1142<para>-ENOSYS</para>
1143</entry><entry
1144 align="char">
1145<para>No descrambling facility available.</para>
1146</entry>
1147 </row><row><entry
1148 align="char">
1149<para>-EINVAL</para>
1150</entry><entry
1151 align="char">
1152<para>Bad parameter.</para>
1153</entry>
1154 </row></tbody></tgroup></informaltable>
1155
1156</section><section
1157role="subsection"><title>add_frontend()</title>
1158<para>DESCRIPTION
1159</para>
1160<informaltable><tgroup cols="1"><tbody><row><entry
1161 align="char">
1162<para>Registers a connectivity between a demux and a front-end, i.e., indicates that
1163 the demux can be connected via a call to connect_frontend() to use the given
1164 front-end as a TS source. The client of this function has to allocate dynamic or
1165 static memory for the frontend structure and initialize its fields before calling
1166 this function. This function is normally called during the driver initialization.
1167 The caller must not free the memory of the frontend struct before successfully
1168 calling remove_frontend().</para>
1169</entry>
1170 </row></tbody></tgroup></informaltable>
1171<para>SYNOPSIS
1172</para>
1173<informaltable><tgroup cols="1"><tbody><row><entry
1174 align="char">
1175<para>int add_frontend(dmx_demux_t &#x22C6;demux, dmx_frontend_t
1176 &#x22C6;frontend);</para>
1177</entry>
1178 </row></tbody></tgroup></informaltable>
1179<para>PARAMETERS
1180</para>
1181<informaltable><tgroup cols="2"><tbody><row><entry
1182 align="char">
1183<para>dmx_demux_t*
1184 demux</para>
1185</entry><entry
1186 align="char">
1187<para>Pointer to the demux API and instance data.</para>
1188</entry>
1189 </row><row><entry
1190 align="char">
1191<para>dmx_frontend_t*
1192 frontend</para>
1193</entry><entry
1194 align="char">
1195<para>Pointer to the front-end instance data.</para>
1196</entry>
1197 </row></tbody></tgroup></informaltable>
1198<para>RETURNS
1199</para>
1200<informaltable><tgroup cols="2"><tbody><row><entry
1201 align="char">
1202<para>0</para>
1203</entry><entry
1204 align="char">
1205<para>The function was completed without errors.</para>
1206</entry>
1207 </row><row><entry
1208 align="char">
1209<para>-EEXIST</para>
1210</entry><entry
1211 align="char">
1212<para>A front-end with the same value of the id field already
1213 registered.</para>
1214</entry>
1215 </row><row><entry
1216 align="char">
1217<para>-EINUSE</para>
1218</entry><entry
1219 align="char">
1220<para>The demux is in use.</para>
1221</entry>
1222 </row><row><entry
1223 align="char">
1224<para>-ENOMEM</para>
1225</entry><entry
1226 align="char">
1227<para>No more front-ends can be added.</para>
1228</entry>
1229 </row><row><entry
1230 align="char">
1231<para>-EINVAL</para>
1232</entry><entry
1233 align="char">
1234<para>Bad parameter.</para>
1235</entry>
1236 </row></tbody></tgroup></informaltable>
1237
1238</section><section
1239role="subsection"><title>remove_frontend()</title>
1240<para>DESCRIPTION
1241</para>
1242<informaltable><tgroup cols="1"><tbody><row><entry
1243 align="char">
1244<para>Indicates that the given front-end, registered by a call to add_frontend(), can
1245 no longer be connected as a TS source by this demux. The function should be
1246 called when a front-end driver or a demux driver is removed from the system.
1247 If the front-end is in use, the function fails with the return value of -EBUSY.
1248 After successfully calling this function, the caller can free the memory of
1249 the frontend struct if it was dynamically allocated before the add_frontend()
1250 operation.</para>
1251</entry>
1252 </row></tbody></tgroup></informaltable>
1253<para>SYNOPSIS
1254</para>
1255<informaltable><tgroup cols="1"><tbody><row><entry
1256 align="char">
1257<para>int remove_frontend(dmx_demux_t&#x22C6; demux,
1258 dmx_frontend_t&#x22C6; frontend);</para>
1259</entry>
1260 </row></tbody></tgroup></informaltable>
1261<para>PARAMETERS
1262</para>
1263<informaltable><tgroup cols="2"><tbody><row><entry
1264 align="char">
1265<para>dmx_demux_t*
1266 demux</para>
1267</entry><entry
1268 align="char">
1269<para>Pointer to the demux API and instance data.</para>
1270</entry>
1271 </row><row><entry
1272 align="char">
1273<para>dmx_frontend_t*
1274 frontend</para>
1275</entry><entry
1276 align="char">
1277<para>Pointer to the front-end instance data.</para>
1278</entry>
1279 </row></tbody></tgroup></informaltable>
1280<para>RETURNS
1281</para>
1282<informaltable><tgroup cols="2"><tbody><row><entry
1283 align="char">
1284<para>0</para>
1285</entry><entry
1286 align="char">
1287<para>The function was completed without errors.</para>
1288</entry>
1289 </row><row><entry
1290 align="char">
1291<para>-EINVAL</para>
1292</entry><entry
1293 align="char">
1294<para>Bad parameter.</para>
1295</entry>
1296 </row><row><entry
1297 align="char">
1298<para>-EBUSY</para>
1299</entry><entry
1300 align="char">
1301<para>The front-end is in use, i.e. a call to connect_frontend()
1302 has not been followed by a call to disconnect_frontend().</para>
1303</entry>
1304 </row></tbody></tgroup></informaltable>
1305
1306</section><section
1307role="subsection"><title>get_frontends()</title>
1308<para>DESCRIPTION
1309</para>
1310<informaltable><tgroup cols="1"><tbody><row><entry
1311 align="char">
1312<para>Provides the APIs of the front-ends that have been registered for this demux.
1313 Any of the front-ends obtained with this call can be used as a parameter for
1314 connect_frontend().</para>
1315</entry>
1316 </row><row><entry
1317 align="char">
1318<para>The include file demux.h contains the macro DMX_FE_ENTRY() for
1319 converting an element of the generic type struct list_head* to the type
1320 dmx_frontend_t*. The caller must not free the memory of any of the elements
1321 obtained via this function call.</para>
1322</entry>
1323 </row></tbody></tgroup></informaltable>
1324<para>SYNOPSIS
1325</para>
1326<informaltable><tgroup cols="1"><tbody><row><entry
1327 align="char">
1328<para>struct list_head&#x22C6; get_frontends(dmx_demux_t&#x22C6; demux);</para>
1329</entry>
1330 </row></tbody></tgroup></informaltable>
1331<para>PARAMETERS
1332</para>
1333<informaltable><tgroup cols="2"><tbody><row><entry
1334 align="char">
1335<para>dmx_demux_t*
1336 demux</para>
1337</entry><entry
1338 align="char">
1339<para>Pointer to the demux API and instance data.</para>
1340</entry>
1341 </row></tbody></tgroup></informaltable>
1342<para>RETURNS
1343</para>
1344<informaltable><tgroup cols="2"><tbody><row><entry
1345 align="char">
1346<para>dmx_demux_t*</para>
1347</entry><entry
1348 align="char">
1349<para>A list of front-end interfaces, or NULL in the case of an
1350 empty list.</para>
1351</entry>
1352 </row></tbody></tgroup></informaltable>
1353
1354</section><section
1355role="subsection"><title>connect_frontend()</title>
1356<para>DESCRIPTION
1357</para>
1358<informaltable><tgroup cols="1"><tbody><row><entry
1359 align="char">
1360<para>Connects the TS output of the front-end to the input of the demux. A demux
1361 can only be connected to a front-end registered to the demux with the function
1362 add_frontend().</para>
1363</entry>
1364 </row><row><entry
1365 align="char">
1366<para>It may or may not be possible to connect multiple demuxes to the same
1367 front-end, depending on the capabilities of the HW platform. When not used,
1368 the front-end should be released by calling disconnect_frontend().</para>
1369</entry>
1370 </row></tbody></tgroup></informaltable>
1371<para>SYNOPSIS
1372</para>
1373<informaltable><tgroup cols="1"><tbody><row><entry
1374 align="char">
1375<para>int connect_frontend(dmx_demux_t&#x22C6; demux,
1376 dmx_frontend_t&#x22C6; frontend);</para>
1377</entry>
1378 </row></tbody></tgroup></informaltable>
1379<para>PARAMETERS
1380</para>
1381<informaltable><tgroup cols="2"><tbody><row><entry
1382 align="char">
1383<para>dmx_demux_t*
1384 demux</para>
1385</entry><entry
1386 align="char">
1387<para>Pointer to the demux API and instance data.</para>
1388</entry>
1389 </row><row><entry
1390 align="char">
1391<para>dmx_frontend_t*
1392 frontend</para>
1393</entry><entry
1394 align="char">
1395<para>Pointer to the front-end instance data.</para>
1396</entry>
1397 </row></tbody></tgroup></informaltable>
1398<para>RETURNS
1399</para>
1400<informaltable><tgroup cols="2"><tbody><row><entry
1401 align="char">
1402<para>0</para>
1403</entry><entry
1404 align="char">
1405<para>The function was completed without errors.</para>
1406</entry>
1407 </row><row><entry
1408 align="char">
1409<para>-EINVAL</para>
1410</entry><entry
1411 align="char">
1412<para>Bad parameter.</para>
1413</entry>
1414 </row><row><entry
1415 align="char">
1416<para>-EBUSY</para>
1417</entry><entry
1418 align="char">
1419<para>The front-end is in use.</para>
1420</entry>
1421 </row></tbody></tgroup></informaltable>
1422
1423</section><section
1424role="subsection"><title>disconnect_frontend()</title>
1425<para>DESCRIPTION
1426</para>
1427<informaltable><tgroup cols="1"><tbody><row><entry
1428 align="char">
1429<para>Disconnects the demux and a front-end previously connected by a
1430 connect_frontend() call.</para>
1431</entry>
1432 </row></tbody></tgroup></informaltable>
1433<para>SYNOPSIS
1434</para>
1435<informaltable><tgroup cols="1"><tbody><row><entry
1436 align="char">
1437<para>int disconnect_frontend(dmx_demux_t&#x22C6; demux);</para>
1438</entry>
1439 </row></tbody></tgroup></informaltable>
1440<para>PARAMETERS
1441</para>
1442<informaltable><tgroup cols="2"><tbody><row><entry
1443 align="char">
1444<para>dmx_demux_t*
1445 demux</para>
1446</entry><entry
1447 align="char">
1448<para>Pointer to the demux API and instance data.</para>
1449</entry>
1450 </row></tbody></tgroup></informaltable>
1451<para>RETURNS
1452</para>
1453<informaltable><tgroup cols="2"><tbody><row><entry
1454 align="char">
1455<para>0</para>
1456</entry><entry
1457 align="char">
1458<para>The function was completed without errors.</para>
1459</entry>
1460 </row><row><entry
1461 align="char">
1462<para>-EINVAL</para>
1463</entry><entry
1464 align="char">
1465<para>Bad parameter.</para>
1466</entry>
1467 </row></tbody></tgroup></informaltable>
1468 </section></section>
1469<section id="demux_callback_api">
1470<title>Demux Callback API</title>
1471<para>This kernel-space API comprises the callback functions that deliver filtered data to the
1472demux client. Unlike the other APIs, these API functions are provided by the client and called
1473from the demux code.
1474</para>
1475<para>The function pointers of this abstract interface are not packed into a structure as in the
1476other demux APIs, because the callback functions are registered and used independent
1477of each other. As an example, it is possible for the API client to provide several
1478callback functions for receiving TS packets and no callbacks for PES packets or
1479sections.
1480</para>
1481<para>The functions that implement the callback API need not be re-entrant: when a demux
1482driver calls one of these functions, the driver is not allowed to call the function again before
1483the original call returns. If a callback is triggered by a hardware interrupt, it is recommended
1484to use the Linux &#8220;bottom half&#8221; mechanism or start a tasklet instead of making the callback
1485function call directly from a hardware interrupt.
1486</para>
1487
1488<section
1489role="subsection"><title>dmx_ts_cb()</title>
1490<para>DESCRIPTION
1491</para>
1492<informaltable><tgroup cols="1"><tbody><row><entry
1493 align="char">
1494<para>This function, provided by the client of the demux API, is called from the
1495 demux code. The function is only called when filtering on this TS feed has
1496 been enabled using the start_filtering() function.</para>
1497</entry>
1498 </row><row><entry
1499 align="char">
1500<para>Any TS packets that match the filter settings are copied to a circular buffer. The
1501 filtered TS packets are delivered to the client using this callback function. The
1502 size of the circular buffer is controlled by the circular_buffer_size parameter
1503 of the set() function in the TS Feed API. It is expected that the buffer1 and
1504 buffer2 callback parameters point to addresses within the circular buffer, but
1505 other implementations are also possible. Note that the called party should not
1506 try to free the memory the buffer1 and buffer2 parameters point to.</para>
1507</entry>
1508 </row><row><entry
1509 align="char">
1510<para>When this function is called, the buffer1 parameter typically points to the
1511 start of the first undelivered TS packet within a circular buffer. The buffer2
1512 buffer parameter is normally NULL, except when the received TS packets have
1513 crossed the last address of the circular buffer and &#8221;wrapped&#8221; to the beginning
1514 of the buffer. In the latter case the buffer1 parameter would contain an address
1515 within the circular buffer, while the buffer2 parameter would contain the first
1516 address of the circular buffer.</para>
1517</entry>
1518 </row><row><entry
1519 align="char">
1520<para>The number of bytes delivered with this function (i.e. buffer1_length +
1521 buffer2_length) is usually equal to the value of callback_length parameter
1522 given in the set() function, with one exception: if a timeout occurs before
1523 receiving callback_length bytes of TS data, any undelivered packets are
1524 immediately delivered to the client by calling this function. The timeout
1525 duration is controlled by the set() function in the TS Feed API.</para>
1526</entry>
1527 </row><row><entry
1528 align="char">
1529<para>If a TS packet is received with errors that could not be fixed by the TS-level
1530 forward error correction (FEC), the Transport_error_indicator flag of the TS
1531 packet header should be set. The TS packet should not be discarded, as
1532 the error can possibly be corrected by a higher layer protocol. If the called
1533 party is slow in processing the callback, it is possible that the circular buffer
1534 eventually fills up. If this happens, the demux driver should discard any TS
1535 packets received while the buffer is full. The error should be indicated to the
1536 client on the next callback by setting the success parameter to the value of
1537 DMX_OVERRUN_ERROR.</para>
1538</entry>
1539 </row><row><entry
1540 align="char">
1541<para>The type of data returned to the callback can be selected by the new
1542 function int (*set_type) (struct dmx_ts_feed_s* feed, int type, dmx_ts_pes_t
1543 pes_type) which is part of the dmx_ts_feed_s struct (also cf. to the
1544 include file ost/demux.h) The type parameter decides if the raw TS packet
1545 (TS_PACKET) or just the payload (TS_PACKET&#8212;TS_PAYLOAD_ONLY)
1546 should be returned. If additionally the TS_DECODER bit is set the stream
1547 will also be sent to the hardware MPEG decoder. In this case, the second
1548 flag decides as what kind of data the stream should be interpreted. The
1549 possible choices are one of DMX_TS_PES_AUDIO, DMX_TS_PES_VIDEO,
1550 DMX_TS_PES_TELETEXT, DMX_TS_PES_SUBTITLE,
1551 DMX_TS_PES_PCR, or DMX_TS_PES_OTHER.</para>
1552</entry>
1553 </row></tbody></tgroup></informaltable>
1554<para>SYNOPSIS
1555</para>
1556<informaltable><tgroup cols="1"><tbody><row><entry
1557 align="char">
1558<para>int dmx_ts_cb(__u8&#x22C6; buffer1, size_t buffer1_length,
1559 __u8&#x22C6; buffer2, size_t buffer2_length, dmx_ts_feed_t&#x22C6;
1560 source, dmx_success_t success);</para>
1561</entry>
1562 </row></tbody></tgroup></informaltable>
1563<para>PARAMETERS
1564</para>
1565<informaltable><tgroup cols="2"><tbody><row><entry
1566 align="char">
1567<para>__u8* buffer1</para>
1568</entry><entry
1569 align="char">
1570<para>Pointer to the start of the filtered TS packets.</para>
1571</entry>
1572 </row><row><entry
1573 align="char">
1574<para>size_t buffer1_length</para>
1575</entry><entry
1576 align="char">
1577<para>Length of the TS data in buffer1.</para>
1578</entry>
1579 </row><row><entry
1580 align="char">
1581<para>__u8* buffer2</para>
1582</entry><entry
1583 align="char">
1584<para>Pointer to the tail of the filtered TS packets, or NULL.</para>
1585</entry>
1586 </row><row><entry
1587 align="char">
1588<para>size_t buffer2_length</para>
1589</entry><entry
1590 align="char">
1591<para>Length of the TS data in buffer2.</para>
1592</entry>
1593 </row><row><entry
1594 align="char">
1595<para>dmx_ts_feed_t*
1596 source</para>
1597</entry><entry
1598 align="char">
1599<para>Indicates which TS feed is the source of the callback.</para>
1600</entry>
1601 </row><row><entry
1602 align="char">
1603<para>dmx_success_t
1604 success</para>
1605</entry><entry
1606 align="char">
1607<para>Indicates if there was an error in TS reception.</para>
1608</entry>
1609 </row></tbody></tgroup></informaltable>
1610<para>RETURNS
1611</para>
1612<informaltable><tgroup cols="2"><tbody><row><entry
1613 align="char">
1614<para>0</para>
1615</entry><entry
1616 align="char">
1617<para>Continue filtering.</para>
1618</entry>
1619 </row><row><entry
1620 align="char">
1621<para>-1</para>
1622</entry><entry
1623 align="char">
1624<para>Stop filtering - has the same effect as a call to
1625 stop_filtering() on the TS Feed API.</para>
1626</entry>
1627 </row></tbody></tgroup></informaltable>
1628
1629</section><section
1630role="subsection"><title>dmx_section_cb()</title>
1631<para>DESCRIPTION
1632</para>
1633<informaltable><tgroup cols="1"><tbody><row><entry
1634 align="char">
1635<para>This function, provided by the client of the demux API, is called from the
1636 demux code. The function is only called when filtering of sections has been
1637 enabled using the function start_filtering() of the section feed API. When the
1638 demux driver has received a complete section that matches at least one section
1639 filter, the client is notified via this callback function. Normally this function is
1640 called for each received section; however, it is also possible to deliver multiple
1641 sections with one callback, for example when the system load is high. If an
1642 error occurs while receiving a section, this function should be called with
1643 the corresponding error type set in the success field, whether or not there is
1644 data to deliver. The Section Feed implementation should maintain a circular
1645 buffer for received sections. However, this is not necessary if the Section Feed
1646 API is implemented as a client of the TS Feed API, because the TS Feed
1647 implementation then buffers the received data. The size of the circular buffer
1648 can be configured using the set() function in the Section Feed API. If there
1649 is no room in the circular buffer when a new section is received, the section
1650 must be discarded. If this happens, the value of the success parameter should
1651 be DMX_OVERRUN_ERROR on the next callback.</para>
1652</entry>
1653 </row></tbody></tgroup></informaltable>
1654<para>SYNOPSIS
1655</para>
1656<informaltable><tgroup cols="1"><tbody><row><entry
1657 align="char">
1658<para>int dmx_section_cb(__u8&#x22C6; buffer1, size_t
1659 buffer1_length, __u8&#x22C6; buffer2, size_t
1660 buffer2_length, dmx_section_filter_t&#x22C6; source,
1661 dmx_success_t success);</para>
1662</entry>
1663 </row></tbody></tgroup></informaltable>
1664<para>PARAMETERS
1665</para>
1666<informaltable><tgroup cols="2"><tbody><row><entry
1667 align="char">
1668<para>__u8* buffer1</para>
1669</entry><entry
1670 align="char">
1671<para>Pointer to the start of the filtered section, e.g. within the
1672 circular buffer of the demux driver.</para>
1673</entry>
1674 </row><row><entry
1675 align="char">
1676<para>size_t buffer1_length</para>
1677</entry><entry
1678 align="char">
1679<para>Length of the filtered section data in buffer1, including
1680 headers and CRC.</para>
1681</entry>
1682 </row><row><entry
1683 align="char">
1684<para>__u8* buffer2</para>
1685</entry><entry
1686 align="char">
1687<para>Pointer to the tail of the filtered section data, or NULL.
1688 Useful to handle the wrapping of a circular buffer.</para>
1689</entry>
1690 </row><row><entry
1691 align="char">
1692<para>size_t buffer2_length</para>
1693</entry><entry
1694 align="char">
1695<para>Length of the filtered section data in buffer2, including
1696 headers and CRC.</para>
1697</entry>
1698 </row><row><entry
1699 align="char">
1700<para>dmx_section_filter_t*
1701 filter</para>
1702</entry><entry
1703 align="char">
1704<para>Indicates the filter that triggered the callback.</para>
1705</entry>
1706 </row><row><entry
1707 align="char">
1708<para>dmx_success_t
1709 success</para>
1710</entry><entry
1711 align="char">
1712<para>Indicates if there was an error in section reception.</para>
1713</entry>
1714 </row></tbody></tgroup></informaltable>
1715<para>RETURNS
1716</para>
1717<informaltable><tgroup cols="2"><tbody><row><entry
1718 align="char">
1719<para>0</para>
1720</entry><entry
1721 align="char">
1722<para>Continue filtering.</para>
1723</entry>
1724 </row><row><entry
1725 align="char">
1726<para>-1</para>
1727</entry><entry
1728 align="char">
1729<para>Stop filtering - has the same effect as a call to
1730 stop_filtering() on the Section Feed API.</para>
1731</entry>
1732 </row></tbody></tgroup></informaltable>
1733 </section></section>
1734<section id="ts_feed_api">
1735<title>TS Feed API</title>
1736<para>A TS feed is typically mapped to a hardware PID filter on the demux chip.
1737Using this API, the client can set the filtering properties to start/stop filtering TS
1738packets on a particular TS feed. The API is defined as an abstract interface of the type
1739dmx_ts_feed_t.
1740</para>
1741<para>The functions that implement the interface should be defined static or module private. The
1742client can get the handle of a TS feed API by calling the function allocate_ts_feed() in the
1743demux API.
1744</para>
1745
1746<section
1747role="subsection"><title>set()</title>
1748<para>DESCRIPTION
1749</para>
1750<informaltable><tgroup cols="1"><tbody><row><entry
1751 align="char">
1752<para>This function sets the parameters of a TS feed. Any filtering in progress on the
1753 TS feed must be stopped before calling this function.</para>
1754</entry>
1755 </row></tbody></tgroup></informaltable>
1756<para>SYNOPSIS
1757</para>
1758<informaltable><tgroup cols="1"><tbody><row><entry
1759 align="char">
1760<para>int set ( dmx_ts_feed_t&#x22C6; feed, __u16 pid, size_t
1761 callback_length, size_t circular_buffer_size, int
1762 descramble, struct timespec timeout);</para>
1763</entry>
1764 </row></tbody></tgroup></informaltable>
1765<para>PARAMETERS
1766</para>
1767<informaltable><tgroup cols="2"><tbody><row><entry
1768 align="char">
1769<para>dmx_ts_feed_t* feed</para>
1770</entry><entry
1771 align="char">
1772<para>Pointer to the TS feed API and instance data.</para>
1773</entry>
1774 </row><row><entry
1775 align="char">
1776<para>__u16 pid</para>
1777</entry><entry
1778 align="char">
1779<para>PID value to filter. Only the TS packets carrying the
1780 specified PID will be passed to the API client.</para>
1781</entry>
1782 </row><row><entry
1783 align="char">
1784<para>size_t
1785 callback_length</para>
1786</entry><entry
1787 align="char">
1788<para>Number of bytes to deliver with each call to the
1789 dmx_ts_cb() callback function. The value of this
1790 parameter should be a multiple of 188.</para>
1791</entry>
1792 </row><row><entry
1793 align="char">
1794<para>size_t
1795 circular_buffer_size</para>
1796</entry><entry
1797 align="char">
1798<para>Size of the circular buffer for the filtered TS packets.</para>
1799</entry>
1800 </row><row><entry
1801 align="char">
1802<para>int descramble</para>
1803</entry><entry
1804 align="char">
1805<para>If non-zero, descramble the filtered TS packets.</para>
1806</entry>
1807 </row><row><entry
1808 align="char">
1809<para>struct timespec
1810 timeout</para>
1811</entry><entry
1812 align="char">
1813<para>Maximum time to wait before delivering received TS
1814 packets to the client.</para>
1815</entry>
1816 </row></tbody></tgroup></informaltable>
1817<para>RETURNS
1818</para>
1819<informaltable><tgroup cols="2"><tbody><row><entry
1820 align="char">
1821<para>0</para>
1822</entry><entry
1823 align="char">
1824<para>The function was completed without errors.</para>
1825</entry>
1826 </row><row><entry
1827 align="char">
1828<para>-ENOMEM</para>
1829</entry><entry
1830 align="char">
1831<para>Not enough memory for the requested buffer size.</para>
1832</entry>
1833 </row><row><entry
1834 align="char">
1835<para>-ENOSYS</para>
1836</entry><entry
1837 align="char">
1838<para>No descrambling facility available for TS.</para>
1839</entry>
1840 </row><row><entry
1841 align="char">
1842<para>-EINVAL</para>
1843</entry><entry
1844 align="char">
1845<para>Bad parameter.</para>
1846</entry>
1847 </row></tbody></tgroup></informaltable>
1848
1849</section><section
1850role="subsection"><title>start_filtering()</title>
1851<para>DESCRIPTION
1852</para>
1853<informaltable><tgroup cols="1"><tbody><row><entry
1854 align="char">
1855<para>Starts filtering TS packets on this TS feed, according to its settings. The PID
1856 value to filter can be set by the API client. All matching TS packets are
1857 delivered asynchronously to the client, using the callback function registered
1858 with allocate_ts_feed().</para>
1859</entry>
1860 </row></tbody></tgroup></informaltable>
1861<para>SYNOPSIS
1862</para>
1863<informaltable><tgroup cols="1"><tbody><row><entry
1864 align="char">
1865<para>int start_filtering(dmx_ts_feed_t&#x22C6; feed);</para>
1866</entry>
1867 </row></tbody></tgroup></informaltable>
1868<para>PARAMETERS
1869</para>
1870<informaltable><tgroup cols="2"><tbody><row><entry
1871 align="char">
1872<para>dmx_ts_feed_t* feed</para>
1873</entry><entry
1874 align="char">
1875<para>Pointer to the TS feed API and instance data.</para>
1876</entry>
1877 </row></tbody></tgroup></informaltable>
1878<para>RETURNS
1879</para>
1880<informaltable><tgroup cols="2"><tbody><row><entry
1881 align="char">
1882<para>0</para>
1883</entry><entry
1884 align="char">
1885<para>The function was completed without errors.</para>
1886</entry>
1887 </row><row><entry
1888 align="char">
1889<para>-EINVAL</para>
1890</entry><entry
1891 align="char">
1892<para>Bad parameter.</para>
1893</entry>
1894 </row></tbody></tgroup></informaltable>
1895
1896</section><section
1897role="subsection"><title>stop_filtering()</title>
1898<para>DESCRIPTION
1899</para>
1900<informaltable><tgroup cols="1"><tbody><row><entry
1901 align="char">
1902<para>Stops filtering TS packets on this TS feed.</para>
1903</entry>
1904 </row></tbody></tgroup></informaltable>
1905<para>SYNOPSIS
1906</para>
1907<informaltable><tgroup cols="1"><tbody><row><entry
1908 align="char">
1909<para>int stop_filtering(dmx_ts_feed_t&#x22C6; feed);</para>
1910</entry>
1911 </row></tbody></tgroup></informaltable>
1912<para>PARAMETERS
1913</para>
1914<informaltable><tgroup cols="2"><tbody><row><entry
1915 align="char">
1916<para>dmx_ts_feed_t* feed</para>
1917</entry><entry
1918 align="char">
1919<para>Pointer to the TS feed API and instance data.</para>
1920</entry>
1921 </row></tbody></tgroup></informaltable>
1922<para>RETURNS
1923</para>
1924<informaltable><tgroup cols="2"><tbody><row><entry
1925 align="char">
1926<para>0</para>
1927</entry><entry
1928 align="char">
1929<para>The function was completed without errors.</para>
1930</entry>
1931 </row><row><entry
1932 align="char">
1933<para>-EINVAL</para>
1934</entry><entry
1935 align="char">
1936<para>Bad parameter.</para>
1937</entry>
1938 </row></tbody></tgroup></informaltable>
1939 </section></section>
1940<section id="section_feed_api">
1941<title>Section Feed API</title>
1942<para>A section feed is a resource consisting of a PID filter and a set of section filters. Using this
1943API, the client can set the properties of a section feed and to start/stop filtering. The API is
1944defined as an abstract interface of the type dmx_section_feed_t. The functions that implement
1945the interface should be defined static or module private. The client can get the handle of
1946a section feed API by calling the function allocate_section_feed() in the demux
1947API.
1948</para>
1949<para>On demux platforms that provide section filtering in hardware, the Section Feed API
1950implementation provides a software wrapper for the demux hardware. Other platforms may
1951support only PID filtering in hardware, requiring that TS packets are converted to sections in
1952software. In the latter case the Section Feed API implementation can be a client of the TS
1953Feed API.
1954</para>
1955
1956</section>
1957<section id="kdapi_set">
1958<title>set()</title>
1959<para>DESCRIPTION
1960</para>
1961<informaltable><tgroup cols="1"><tbody><row><entry
1962 align="char">
1963<para>This function sets the parameters of a section feed. Any filtering in progress on
1964 the section feed must be stopped before calling this function. If descrambling
1965 is enabled, the payload_scrambling_control and address_scrambling_control
1966 fields of received DVB datagram sections should be observed. If either one is
1967 non-zero, the section should be descrambled either in hardware or using the
1968 functions descramble_mac_address() and descramble_section_payload() of the
1969 demux API. Note that according to the MPEG-2 Systems specification, only
1970 the payloads of private sections can be scrambled while the rest of the section
1971 data must be sent in the clear.</para>
1972</entry>
1973 </row></tbody></tgroup></informaltable>
1974<para>SYNOPSIS
1975</para>
1976<informaltable><tgroup cols="1"><tbody><row><entry
1977 align="char">
1978<para>int set(dmx_section_feed_t&#x22C6; feed, __u16 pid, size_t
1979 circular_buffer_size, int descramble, int
1980 check_crc);</para>
1981</entry>
1982 </row></tbody></tgroup></informaltable>
1983<para>PARAMETERS
1984</para>
1985<informaltable><tgroup cols="2"><tbody><row><entry
1986 align="char">
1987<para>dmx_section_feed_t*
1988 feed</para>
1989</entry><entry
1990 align="char">
1991<para>Pointer to the section feed API and instance data.</para>
1992</entry>
1993 </row><row><entry
1994 align="char">
1995<para>__u16 pid</para>
1996</entry><entry
1997 align="char">
1998<para>PID value to filter; only the TS packets carrying the
1999 specified PID will be accepted.</para>
2000</entry>
2001 </row><row><entry
2002 align="char">
2003<para>size_t
2004 circular_buffer_size</para>
2005</entry><entry
2006 align="char">
2007<para>Size of the circular buffer for filtered sections.</para>
2008</entry>
2009 </row><row><entry
2010 align="char">
2011<para>int descramble</para>
2012</entry><entry
2013 align="char">
2014<para>If non-zero, descramble any sections that are scrambled.</para>
2015</entry>
2016 </row><row><entry
2017 align="char">
2018<para>int check_crc</para>
2019</entry><entry
2020 align="char">
2021<para>If non-zero, check the CRC values of filtered sections.</para>
2022</entry>
2023 </row></tbody></tgroup></informaltable>
2024<para>RETURNS
2025</para>
2026<informaltable><tgroup cols="2"><tbody><row><entry
2027 align="char">
2028<para>0</para>
2029</entry><entry
2030 align="char">
2031<para>The function was completed without errors.</para>
2032</entry>
2033 </row><row><entry
2034 align="char">
2035<para>-ENOMEM</para>
2036</entry><entry
2037 align="char">
2038<para>Not enough memory for the requested buffer size.</para>
2039</entry>
2040 </row><row><entry
2041 align="char">
2042<para>-ENOSYS</para>
2043</entry><entry
2044 align="char">
2045<para>No descrambling facility available for sections.</para>
2046</entry>
2047 </row><row><entry
2048 align="char">
2049<para>-EINVAL</para>
2050</entry><entry
2051 align="char">
2052<para>Bad parameters.</para>
2053</entry>
2054 </row></tbody></tgroup></informaltable>
2055
2056</section><section
2057role="subsection"><title>allocate_filter()</title>
2058<para>DESCRIPTION
2059</para>
2060<informaltable><tgroup cols="1"><tbody><row><entry
2061 align="char">
2062<para>This function is used to allocate a section filter on the demux. It should only be
2063 called when no filtering is in progress on this section feed. If a filter cannot be
2064 allocated, the function fails with -ENOSPC. See in section ?? for the format of
2065 the section filter.</para>
2066</entry>
2067 </row><row><entry
2068 align="char">
2069<para>The bitfields filter_mask and filter_value should only be modified when no
2070 filtering is in progress on this section feed. filter_mask controls which bits of
2071 filter_value are compared with the section headers/payload. On a binary value
2072 of 1 in filter_mask, the corresponding bits are compared. The filter only accepts
2073 sections that are equal to filter_value in all the tested bit positions. Any changes
2074 to the values of filter_mask and filter_value are guaranteed to take effect only
2075 when the start_filtering() function is called next time. The parent pointer in
2076 the struct is initialized by the API implementation to the value of the feed
2077 parameter. The priv pointer is not used by the API implementation, and can
2078 thus be freely utilized by the caller of this function. Any data pointed to by the
2079 priv pointer is available to the recipient of the dmx_section_cb() function call.</para>
2080</entry>
2081 </row><row><entry
2082 align="char">
2083<para>While the maximum section filter length (DMX_MAX_FILTER_SIZE) is
2084 currently set at 16 bytes, hardware filters of that size are not available on all
2085 platforms. Therefore, section filtering will often take place first in hardware,
2086 followed by filtering in software for the header bytes that were not covered
2087 by a hardware filter. The filter_mask field can be checked to determine how
2088 many bytes of the section filter are actually used, and if the hardware filter will
2089 suffice. Additionally, software-only section filters can optionally be allocated
2090 to clients when all hardware section filters are in use. Note that on most demux
2091 hardware it is not possible to filter on the section_length field of the section
2092 header &#8211; thus this field is ignored, even though it is included in filter_value and
2093 filter_mask fields.</para>
2094</entry>
2095 </row></tbody></tgroup></informaltable>
2096<para>SYNOPSIS
2097</para>
2098<informaltable><tgroup cols="1"><tbody><row><entry
2099 align="char">
2100<para>int allocate_filter(dmx_section_feed_t&#x22C6; feed,
2101 dmx_section_filter_t&#x22C6;&#x22C6; filter);</para>
2102</entry>
2103 </row></tbody></tgroup></informaltable>
2104<para>PARAMETERS
2105</para>
2106<informaltable><tgroup cols="2"><tbody><row><entry
2107 align="char">
2108<para>dmx_section_feed_t*
2109 feed</para>
2110</entry><entry
2111 align="char">
2112<para>Pointer to the section feed API and instance data.</para>
2113</entry>
2114 </row><row><entry
2115 align="char">
2116<para>dmx_section_filter_t**
2117 filter</para>
2118</entry><entry
2119 align="char">
2120<para>Pointer to the allocated filter.</para>
2121</entry>
2122 </row></tbody></tgroup></informaltable>
2123<para>RETURNS
2124</para>
2125<informaltable><tgroup cols="2"><tbody><row><entry
2126 align="char">
2127<para>0</para>
2128</entry><entry
2129 align="char">
2130<para>The function was completed without errors.</para>
2131</entry>
2132 </row><row><entry
2133 align="char">
2134<para>-ENOSPC</para>
2135</entry><entry
2136 align="char">
2137<para>No filters of given type and length available.</para>
2138</entry>
2139 </row><row><entry
2140 align="char">
2141<para>-EINVAL</para>
2142</entry><entry
2143 align="char">
2144<para>Bad parameters.</para>
2145</entry>
2146 </row></tbody></tgroup></informaltable>
2147
2148</section><section
2149role="subsection"><title>release_filter()</title>
2150<para>DESCRIPTION
2151</para>
2152<informaltable><tgroup cols="1"><tbody><row><entry
2153 align="char">
2154<para>This function releases all the resources of a previously allocated section filter.
2155 The function should not be called while filtering is in progress on this section
2156 feed. After calling this function, the caller should not try to dereference the
2157 filter pointer.</para>
2158</entry>
2159 </row></tbody></tgroup></informaltable>
2160<para>SYNOPSIS
2161</para>
2162<informaltable><tgroup cols="1"><tbody><row><entry
2163 align="char">
2164<para>int release_filter ( dmx_section_feed_t&#x22C6; feed,
2165 dmx_section_filter_t&#x22C6; filter);</para>
2166</entry>
2167 </row></tbody></tgroup></informaltable>
2168<para>PARAMETERS
2169</para>
2170<informaltable><tgroup cols="2"><tbody><row><entry
2171 align="char">
2172<para>dmx_section_feed_t*
2173 feed</para>
2174</entry><entry
2175 align="char">
2176<para>Pointer to the section feed API and instance data.</para>
2177</entry>
2178 </row><row><entry
2179 align="char">
2180<para>dmx_section_filter_t*
2181 filter</para>
2182</entry><entry
2183 align="char">
2184<para>I/O Pointer to the instance data of a section filter.</para>
2185</entry>
2186 </row></tbody></tgroup></informaltable>
2187<para>RETURNS
2188</para>
2189<informaltable><tgroup cols="2"><tbody><row><entry
2190 align="char">
2191<para>0</para>
2192</entry><entry
2193 align="char">
2194<para>The function was completed without errors.</para>
2195</entry>
2196 </row><row><entry
2197 align="char">
2198<para>-ENODEV</para>
2199</entry><entry
2200 align="char">
2201<para>No such filter allocated.</para>
2202</entry>
2203 </row><row><entry
2204 align="char">
2205<para>-EINVAL</para>
2206</entry><entry
2207 align="char">
2208<para>Bad parameter.</para>
2209</entry>
2210 </row></tbody></tgroup></informaltable>
2211
2212</section><section
2213role="subsection"><title>start_filtering()</title>
2214<para>DESCRIPTION
2215</para>
2216<informaltable><tgroup cols="1"><tbody><row><entry
2217 align="char">
2218<para>Starts filtering sections on this section feed, according to its settings. Sections
2219 are first filtered based on their PID and then matched with the section
2220 filters allocated for this feed. If the section matches the PID filter and
2221 at least one section filter, it is delivered to the API client. The section
2222 is delivered asynchronously using the callback function registered with
2223 allocate_section_feed().</para>
2224</entry>
2225 </row></tbody></tgroup></informaltable>
2226<para>SYNOPSIS
2227</para>
2228<informaltable><tgroup cols="1"><tbody><row><entry
2229 align="char">
2230<para>int start_filtering ( dmx_section_feed_t&#x22C6; feed );</para>
2231</entry>
2232 </row></tbody></tgroup></informaltable>
2233<para>PARAMETERS
2234</para>
2235<informaltable><tgroup cols="2"><tbody><row><entry
2236 align="char">
2237<para>dmx_section_feed_t*
2238 feed</para>
2239</entry><entry
2240 align="char">
2241<para>Pointer to the section feed API and instance data.</para>
2242</entry>
2243 </row></tbody></tgroup></informaltable>
2244<para>RETURNS
2245</para>
2246<informaltable><tgroup cols="2"><tbody><row><entry
2247 align="char">
2248<para>0</para>
2249</entry><entry
2250 align="char">
2251<para>The function was completed without errors.</para>
2252</entry>
2253 </row><row><entry
2254 align="char">
2255<para>-EINVAL</para>
2256</entry><entry
2257 align="char">
2258<para>Bad parameter.</para>
2259</entry>
2260 </row></tbody></tgroup></informaltable>
2261
2262</section><section
2263role="subsection"><title>stop_filtering()</title>
2264<para>DESCRIPTION
2265</para>
2266<informaltable><tgroup cols="1"><tbody><row><entry
2267 align="char">
2268<para>Stops filtering sections on this section feed. Note that any changes to the
2269 filtering parameters (filter_value, filter_mask, etc.) should only be made when
2270 filtering is stopped.</para>
2271</entry>
2272 </row></tbody></tgroup></informaltable>
2273<para>SYNOPSIS
2274</para>
2275<informaltable><tgroup cols="1"><tbody><row><entry
2276 align="char">
2277<para>int stop_filtering ( dmx_section_feed_t&#x22C6; feed );</para>
2278</entry>
2279 </row></tbody></tgroup></informaltable>
2280<para>PARAMETERS
2281</para>
2282<informaltable><tgroup cols="2"><tbody><row><entry
2283 align="char">
2284<para>dmx_section_feed_t*
2285 feed</para>
2286</entry><entry
2287 align="char">
2288<para>Pointer to the section feed API and instance data.</para>
2289</entry>
2290 </row></tbody></tgroup></informaltable>
2291<para>RETURNS
2292</para>
2293<informaltable><tgroup cols="2"><tbody><row><entry
2294 align="char">
2295<para>0</para>
2296</entry><entry
2297 align="char">
2298<para>The function was completed without errors.</para>
2299</entry>
2300 </row><row><entry
2301 align="char">
2302<para>-EINVAL</para>
2303</entry><entry
2304 align="char">
2305<para>Bad parameter.</para>
2306</entry>
2307 </row></tbody></tgroup></informaltable>
2308
2309</section>
diff --git a/Documentation/DocBook/dvb/net.xml b/Documentation/DocBook/dvb/net.xml
new file mode 100644
index 000000000000..94e388d94c0d
--- /dev/null
+++ b/Documentation/DocBook/dvb/net.xml
@@ -0,0 +1,12 @@
1<title>DVB Network API</title>
2<para>The DVB net device enables feeding of MPE (multi protocol encapsulation) packets
3received via DVB into the Linux network protocol stack, e.g. for internet via satellite
4applications. It can be accessed through <emphasis role="tt">/dev/dvb/adapter0/net0</emphasis>. Data types and
5and ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/net.h</emphasis> in your
6application.
7</para>
8<section id="dvb_net_types">
9<title>DVB Net Data Types</title>
10<para>To be written&#x2026;
11</para>
12</section>
diff --git a/Documentation/DocBook/dvb/video.xml b/Documentation/DocBook/dvb/video.xml
new file mode 100644
index 000000000000..7bb287e67c8e
--- /dev/null
+++ b/Documentation/DocBook/dvb/video.xml
@@ -0,0 +1,1971 @@
1<title>DVB Video Device</title>
2<para>The DVB video device controls the MPEG2 video decoder of the DVB hardware. It
3can be accessed through <emphasis role="tt">/dev/dvb/adapter0/video0</emphasis>. Data types and and
4ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/video.h</emphasis> in your
5application.
6</para>
7<para>Note that the DVB video device only controls decoding of the MPEG video stream, not
8its presentation on the TV or computer screen. On PCs this is typically handled by an
9associated video4linux device, e.g. <emphasis role="tt">/dev/video</emphasis>, which allows scaling and defining output
10windows.
11</para>
12<para>Some DVB cards don&#8217;t have their own MPEG decoder, which results in the omission of
13the audio and video device as well as the video4linux device.
14</para>
15<para>The ioctls that deal with SPUs (sub picture units) and navigation packets are only
16supported on some MPEG decoders made for DVD playback.
17</para>
18<section id="video_types">
19<title>Video Data Types</title>
20
21<section id="video_format_t">
22<title>video_format_t</title>
23<para>The <emphasis role="tt">video_format_t</emphasis> data type defined by
24</para>
25<programlisting>
26 typedef enum {
27 VIDEO_FORMAT_4_3,
28 VIDEO_FORMAT_16_9
29 } video_format_t;
30</programlisting>
31<para>is used in the VIDEO_SET_FORMAT function (??) to tell the driver which aspect ratio
32the output hardware (e.g. TV) has. It is also used in the data structures video_status
33(??) returned by VIDEO_GET_STATUS (??) and video_event (??) returned by
34VIDEO_GET_EVENT (??) which report about the display format of the current video
35stream.
36</para>
37</section>
38
39<section id="video_display_format_t">
40<title>video_display_format_t</title>
41<para>In case the display format of the video stream and of the display hardware differ the
42application has to specify how to handle the cropping of the picture. This can be done using
43the VIDEO_SET_DISPLAY_FORMAT call (??) which accepts
44</para>
45<programlisting>
46 typedef enum {
47 VIDEO_PAN_SCAN,
48 VIDEO_LETTER_BOX,
49 VIDEO_CENTER_CUT_OUT
50 } video_display_format_t;
51</programlisting>
52<para>as argument.
53</para>
54</section>
55
56<section id="video_stream_source">
57<title>video stream source</title>
58<para>The video stream source is set through the VIDEO_SELECT_SOURCE call and can take
59the following values, depending on whether we are replaying from an internal (demuxer) or
60external (user write) source.
61</para>
62<programlisting>
63 typedef enum {
64 VIDEO_SOURCE_DEMUX,
65 VIDEO_SOURCE_MEMORY
66 } video_stream_source_t;
67</programlisting>
68<para>VIDEO_SOURCE_DEMUX selects the demultiplexer (fed either by the frontend or the
69DVR device) as the source of the video stream. If VIDEO_SOURCE_MEMORY
70is selected the stream comes from the application through the <emphasis role="tt">write()</emphasis> system
71call.
72</para>
73</section>
74
75<section id="video_play_state">
76<title>video play state</title>
77<para>The following values can be returned by the VIDEO_GET_STATUS call representing the
78state of video playback.
79</para>
80<programlisting>
81 typedef enum {
82 VIDEO_STOPPED,
83 VIDEO_PLAYING,
84 VIDEO_FREEZED
85 } video_play_state_t;
86</programlisting>
87</section>
88
89<section id="video_event">
90<title>struct video_event</title>
91<para>The following is the structure of a video event as it is returned by the VIDEO_GET_EVENT
92call.
93</para>
94<programlisting>
95 struct video_event {
96 int32_t type;
97 time_t timestamp;
98 union {
99 video_format_t video_format;
100 } u;
101 };
102</programlisting>
103</section>
104
105<section id="video_status">
106<title>struct video_status</title>
107<para>The VIDEO_GET_STATUS call returns the following structure informing about various
108states of the playback operation.
109</para>
110<programlisting>
111 struct video_status {
112 boolean video_blank;
113 video_play_state_t play_state;
114 video_stream_source_t stream_source;
115 video_format_t video_format;
116 video_displayformat_t display_format;
117 };
118</programlisting>
119<para>If video_blank is set video will be blanked out if the channel is changed or if playback is
120stopped. Otherwise, the last picture will be displayed. play_state indicates if the video is
121currently frozen, stopped, or being played back. The stream_source corresponds to the seleted
122source for the video stream. It can come either from the demultiplexer or from memory.
123The video_format indicates the aspect ratio (one of 4:3 or 16:9) of the currently
124played video stream. Finally, display_format corresponds to the selected cropping
125mode in case the source video format is not the same as the format of the output
126device.
127</para>
128</section>
129
130<section id="video_still_picture">
131<title>struct video_still_picture</title>
132<para>An I-frame displayed via the VIDEO_STILLPICTURE call is passed on within the
133following structure.
134</para>
135<programlisting>
136 /&#x22C6; pointer to and size of a single iframe in memory &#x22C6;/
137 struct video_still_picture {
138 char &#x22C6;iFrame;
139 int32_t size;
140 };
141</programlisting>
142</section>
143
144<section id="video_caps">
145<title>video capabilities</title>
146<para>A call to VIDEO_GET_CAPABILITIES returns an unsigned integer with the following
147bits set according to the hardwares capabilities.
148</para>
149<programlisting>
150 /&#x22C6; bit definitions for capabilities: &#x22C6;/
151 /&#x22C6; can the hardware decode MPEG1 and/or MPEG2? &#x22C6;/
152 #define VIDEO_CAP_MPEG1 1
153 #define VIDEO_CAP_MPEG2 2
154 /&#x22C6; can you send a system and/or program stream to video device?
155 (you still have to open the video and the audio device but only
156 send the stream to the video device) &#x22C6;/
157 #define VIDEO_CAP_SYS 4
158 #define VIDEO_CAP_PROG 8
159 /&#x22C6; can the driver also handle SPU, NAVI and CSS encoded data?
160 (CSS API is not present yet) &#x22C6;/
161 #define VIDEO_CAP_SPU 16
162 #define VIDEO_CAP_NAVI 32
163 #define VIDEO_CAP_CSS 64
164</programlisting>
165</section>
166
167<section id="video_system">
168<title>video system</title>
169<para>A call to VIDEO_SET_SYSTEM sets the desired video system for TV output. The
170following system types can be set:
171</para>
172<programlisting>
173 typedef enum {
174 VIDEO_SYSTEM_PAL,
175 VIDEO_SYSTEM_NTSC,
176 VIDEO_SYSTEM_PALN,
177 VIDEO_SYSTEM_PALNc,
178 VIDEO_SYSTEM_PALM,
179 VIDEO_SYSTEM_NTSC60,
180 VIDEO_SYSTEM_PAL60,
181 VIDEO_SYSTEM_PALM60
182 } video_system_t;
183</programlisting>
184</section>
185
186<section id="video_highlight">
187<title>struct video_highlight</title>
188<para>Calling the ioctl VIDEO_SET_HIGHLIGHTS posts the SPU highlight information. The
189call expects the following format for that information:
190</para>
191<programlisting>
192 typedef
193 struct video_highlight {
194 boolean active; /&#x22C6; 1=show highlight, 0=hide highlight &#x22C6;/
195 uint8_t contrast1; /&#x22C6; 7- 4 Pattern pixel contrast &#x22C6;/
196 /&#x22C6; 3- 0 Background pixel contrast &#x22C6;/
197 uint8_t contrast2; /&#x22C6; 7- 4 Emphasis pixel-2 contrast &#x22C6;/
198 /&#x22C6; 3- 0 Emphasis pixel-1 contrast &#x22C6;/
199 uint8_t color1; /&#x22C6; 7- 4 Pattern pixel color &#x22C6;/
200 /&#x22C6; 3- 0 Background pixel color &#x22C6;/
201 uint8_t color2; /&#x22C6; 7- 4 Emphasis pixel-2 color &#x22C6;/
202 /&#x22C6; 3- 0 Emphasis pixel-1 color &#x22C6;/
203 uint32_t ypos; /&#x22C6; 23-22 auto action mode &#x22C6;/
204 /&#x22C6; 21-12 start y &#x22C6;/
205 /&#x22C6; 9- 0 end y &#x22C6;/
206 uint32_t xpos; /&#x22C6; 23-22 button color number &#x22C6;/
207 /&#x22C6; 21-12 start x &#x22C6;/
208 /&#x22C6; 9- 0 end x &#x22C6;/
209 } video_highlight_t;
210</programlisting>
211
212</section>
213<section id="video_spu">
214<title>video SPU</title>
215<para>Calling VIDEO_SET_SPU deactivates or activates SPU decoding, according to the
216following format:
217</para>
218<programlisting>
219 typedef
220 struct video_spu {
221 boolean active;
222 int stream_id;
223 } video_spu_t;
224</programlisting>
225
226</section>
227<section id="video_spu_palette">
228<title>video SPU palette</title>
229<para>The following structure is used to set the SPU palette by calling VIDEO_SPU_PALETTE:
230</para>
231<programlisting>
232 typedef
233 struct video_spu_palette{
234 int length;
235 uint8_t &#x22C6;palette;
236 } video_spu_palette_t;
237</programlisting>
238
239</section>
240<section id="video_navi_pack">
241<title>video NAVI pack</title>
242<para>In order to get the navigational data the following structure has to be passed to the ioctl
243VIDEO_GET_NAVI:
244</para>
245<programlisting>
246 typedef
247 struct video_navi_pack{
248 int length; /&#x22C6; 0 ... 1024 &#x22C6;/
249 uint8_t data[1024];
250 } video_navi_pack_t;
251</programlisting>
252</section>
253
254
255<section id="video_attributes">
256<title>video attributes</title>
257<para>The following attributes can be set by a call to VIDEO_SET_ATTRIBUTES:
258</para>
259<programlisting>
260 typedef uint16_t video_attributes_t;
261 /&#x22C6; bits: descr. &#x22C6;/
262 /&#x22C6; 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) &#x22C6;/
263 /&#x22C6; 13-12 TV system (0=525/60, 1=625/50) &#x22C6;/
264 /&#x22C6; 11-10 Aspect ratio (0=4:3, 3=16:9) &#x22C6;/
265 /&#x22C6; 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca &#x22C6;/
266 /&#x22C6; 7 line 21-1 data present in GOP (1=yes, 0=no) &#x22C6;/
267 /&#x22C6; 6 line 21-2 data present in GOP (1=yes, 0=no) &#x22C6;/
268 /&#x22C6; 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 &#x22C6;/
269 /&#x22C6; 2 source letterboxed (1=yes, 0=no) &#x22C6;/
270 /&#x22C6; 0 film/camera mode (0=camera, 1=film (625/50 only)) &#x22C6;/
271</programlisting>
272</section></section>
273
274
275<section id="video_function_calls">
276<title>Video Function Calls</title>
277
278
279<section id="video_fopen">
280<title>open()</title>
281<para>DESCRIPTION
282</para>
283<informaltable><tgroup cols="1"><tbody><row><entry
284 align="char">
285<para>This system call opens a named video device (e.g. /dev/dvb/adapter0/video0)
286 for subsequent use.</para>
287<para>When an open() call has succeeded, the device will be ready for use.
288 The significance of blocking or non-blocking mode is described in the
289 documentation for functions where there is a difference. It does not affect the
290 semantics of the open() call itself. A device opened in blocking mode can later
291 be put into non-blocking mode (and vice versa) using the F_SETFL command
292 of the fcntl system call. This is a standard system call, documented in the Linux
293 manual page for fcntl. Only one user can open the Video Device in O_RDWR
294 mode. All other attempts to open the device in this mode will fail, and an
295 error-code will be returned. If the Video Device is opened in O_RDONLY
296 mode, the only ioctl call that can be used is VIDEO_GET_STATUS. All other
297 call will return an error code.</para>
298</entry>
299 </row></tbody></tgroup></informaltable>
300
301<para>SYNOPSIS
302</para>
303<informaltable><tgroup cols="1"><tbody><row><entry
304 align="char">
305<para>int open(const char &#x22C6;deviceName, int flags);</para>
306</entry>
307 </row></tbody></tgroup></informaltable>
308<para>PARAMETERS
309</para>
310<informaltable><tgroup cols="2"><tbody><row><entry
311 align="char">
312<para>const char
313 *deviceName</para>
314</entry><entry
315 align="char">
316<para>Name of specific video device.</para>
317</entry>
318 </row><row><entry
319 align="char">
320<para>int flags</para>
321</entry><entry
322 align="char">
323<para>A bit-wise OR of the following flags:</para>
324</entry>
325 </row><row><entry
326 align="char">
327</entry><entry
328 align="char">
329<para>O_RDONLY read-only access</para>
330</entry>
331 </row><row><entry
332 align="char">
333</entry><entry
334 align="char">
335<para>O_RDWR read/write access</para>
336</entry>
337 </row><row><entry
338 align="char">
339</entry><entry
340 align="char">
341<para>O_NONBLOCK open in non-blocking mode</para>
342</entry>
343 </row><row><entry
344 align="char">
345</entry><entry
346 align="char">
347<para>(blocking mode is the default)</para>
348</entry>
349 </row></tbody></tgroup></informaltable>
350<para>ERRORS
351</para>
352<informaltable><tgroup cols="2"><tbody><row><entry
353 align="char">
354<para>ENODEV</para>
355</entry><entry
356 align="char">
357<para>Device driver not loaded/available.</para>
358</entry>
359 </row><row><entry
360 align="char">
361<para>EINTERNAL</para>
362</entry><entry
363 align="char">
364<para>Internal error.</para>
365</entry>
366 </row><row><entry
367 align="char">
368<para>EBUSY</para>
369</entry><entry
370 align="char">
371<para>Device or resource busy.</para>
372</entry>
373 </row><row><entry
374 align="char">
375<para>EINVAL</para>
376</entry><entry
377 align="char">
378<para>Invalid argument.</para>
379</entry>
380 </row></tbody></tgroup></informaltable>
381
382</section>
383<section id="video_fclose">
384<title>close()</title>
385<para>DESCRIPTION
386</para>
387<informaltable><tgroup cols="1"><tbody><row><entry
388 align="char">
389<para>This system call closes a previously opened video device.</para>
390</entry>
391 </row></tbody></tgroup></informaltable>
392<para>SYNOPSIS
393</para>
394<informaltable><tgroup cols="1"><tbody><row><entry
395 align="char">
396<para>int close(int fd);</para>
397</entry>
398 </row></tbody></tgroup></informaltable>
399<para>PARAMETERS
400</para>
401<informaltable><tgroup cols="2"><tbody><row><entry
402 align="char">
403<para>int fd</para>
404</entry><entry
405 align="char">
406<para>File descriptor returned by a previous call to open().</para>
407</entry>
408 </row></tbody></tgroup></informaltable>
409<para>ERRORS
410</para>
411<informaltable><tgroup cols="2"><tbody><row><entry
412 align="char">
413<para>EBADF</para>
414</entry><entry
415 align="char">
416<para>fd is not a valid open file descriptor.</para>
417</entry>
418 </row></tbody></tgroup></informaltable>
419
420</section>
421<section id="video_fwrite">
422<title>write()</title>
423<para>DESCRIPTION
424</para>
425<informaltable><tgroup cols="1"><tbody><row><entry
426 align="char">
427<para>This system call can only be used if VIDEO_SOURCE_MEMORY is selected
428 in the ioctl call VIDEO_SELECT_SOURCE. The data provided shall be in
429 PES format, unless the capability allows other formats. If O_NONBLOCK is
430 not specified the function will block until buffer space is available. The amount
431 of data to be transferred is implied by count.</para>
432</entry>
433 </row></tbody></tgroup></informaltable>
434<para>SYNOPSIS
435</para>
436<informaltable><tgroup cols="1"><tbody><row><entry
437 align="char">
438<para>size_t write(int fd, const void &#x22C6;buf, size_t count);</para>
439</entry>
440 </row></tbody></tgroup></informaltable>
441<para>PARAMETERS
442</para>
443<informaltable><tgroup cols="2"><tbody><row><entry
444 align="char">
445<para>int fd</para>
446</entry><entry
447 align="char">
448<para>File descriptor returned by a previous call to open().</para>
449</entry>
450 </row><row><entry
451 align="char">
452<para>void *buf</para>
453</entry><entry
454 align="char">
455<para>Pointer to the buffer containing the PES data.</para>
456</entry>
457 </row><row><entry
458 align="char">
459<para>size_t count</para>
460</entry><entry
461 align="char">
462<para>Size of buf.</para>
463</entry>
464 </row></tbody></tgroup></informaltable>
465<para>ERRORS
466</para>
467<informaltable><tgroup cols="2"><tbody><row><entry
468 align="char">
469<para>EPERM</para>
470</entry><entry
471 align="char">
472<para>Mode VIDEO_SOURCE_MEMORY not selected.</para>
473</entry>
474 </row><row><entry
475 align="char">
476<para>ENOMEM</para>
477</entry><entry
478 align="char">
479<para>Attempted to write more data than the internal buffer can
480 hold.</para>
481</entry>
482 </row><row><entry
483 align="char">
484<para>EBADF</para>
485</entry><entry
486 align="char">
487<para>fd is not a valid open file descriptor.</para>
488</entry>
489 </row></tbody></tgroup></informaltable>
490
491</section><section
492role="subsection"><title>VIDEO_STOP</title>
493<para>DESCRIPTION
494</para>
495<informaltable><tgroup cols="1"><tbody><row><entry
496 align="char">
497<para>This ioctl call asks the Video Device to stop playing the current stream.
498 Depending on the input parameter, the screen can be blanked out or displaying
499 the last decoded frame.</para>
500</entry>
501 </row></tbody></tgroup></informaltable>
502<para>SYNOPSIS
503</para>
504<informaltable><tgroup cols="1"><tbody><row><entry
505 align="char">
506<para>int ioctl(fd, int request = VIDEO_STOP, boolean
507 mode);</para>
508</entry>
509 </row></tbody></tgroup></informaltable>
510<para>PARAMETERS
511</para>
512<informaltable><tgroup cols="2"><tbody><row><entry
513 align="char">
514<para>int fd</para>
515</entry><entry
516 align="char">
517<para>File descriptor returned by a previous call to open().</para>
518</entry>
519 </row><row><entry
520 align="char">
521<para>int request</para>
522</entry><entry
523 align="char">
524<para>Equals VIDEO_STOP for this command.</para>
525</entry>
526 </row><row><entry
527 align="char">
528<para>Boolean mode</para>
529</entry><entry
530 align="char">
531<para>Indicates how the screen shall be handled.</para>
532</entry>
533 </row><row><entry
534 align="char">
535</entry><entry
536 align="char">
537<para>TRUE: Blank screen when stop.</para>
538</entry>
539 </row><row><entry
540 align="char">
541</entry><entry
542 align="char">
543<para>FALSE: Show last decoded frame.</para>
544</entry>
545 </row></tbody></tgroup></informaltable>
546<para>ERRORS
547</para>
548<informaltable><tgroup cols="2"><tbody><row><entry
549 align="char">
550<para>EBADF</para>
551</entry><entry
552 align="char">
553<para>fd is not a valid open file descriptor</para>
554</entry>
555 </row><row><entry
556 align="char">
557<para>EINTERNAL</para>
558</entry><entry
559 align="char">
560<para>Internal error, possibly in the communication with the
561 DVB subsystem.</para>
562</entry>
563 </row></tbody></tgroup></informaltable>
564
565</section><section
566role="subsection"><title>VIDEO_PLAY</title>
567<para>DESCRIPTION
568</para>
569<informaltable><tgroup cols="1"><tbody><row><entry
570 align="char">
571<para>This ioctl call asks the Video Device to start playing a video stream from the
572 selected source.</para>
573</entry>
574 </row></tbody></tgroup></informaltable>
575<para>SYNOPSIS
576</para>
577<informaltable><tgroup cols="1"><tbody><row><entry
578 align="char">
579<para>int ioctl(fd, int request = VIDEO_PLAY);</para>
580</entry>
581 </row></tbody></tgroup></informaltable>
582<para>PARAMETERS
583</para>
584<informaltable><tgroup cols="2"><tbody><row><entry
585 align="char">
586<para>int fd</para>
587</entry><entry
588 align="char">
589<para>File descriptor returned by a previous call to open().</para>
590</entry>
591 </row><row><entry
592 align="char">
593<para>int request</para>
594</entry><entry
595 align="char">
596<para>Equals VIDEO_PLAY for this command.</para>
597</entry>
598 </row></tbody></tgroup></informaltable>
599<para>ERRORS
600</para>
601<informaltable><tgroup cols="2"><tbody><row><entry
602 align="char">
603<para>EBADF</para>
604</entry><entry
605 align="char">
606<para>fd is not a valid open file descriptor</para>
607</entry>
608 </row><row><entry
609 align="char">
610<para>EINTERNAL</para>
611</entry><entry
612 align="char">
613<para>Internal error, possibly in the communication with the
614 DVB subsystem.</para>
615</entry>
616 </row></tbody></tgroup></informaltable>
617
618</section><section
619role="subsection"><title>VIDEO_FREEZE</title>
620<para>DESCRIPTION
621</para>
622<informaltable><tgroup cols="1"><tbody><row><entry
623 align="char">
624<para>This ioctl call suspends the live video stream being played. Decoding
625 and playing are frozen. It is then possible to restart the decoding
626 and playing process of the video stream using the VIDEO_CONTINUE
627 command. If VIDEO_SOURCE_MEMORY is selected in the ioctl call
628 VIDEO_SELECT_SOURCE, the DVB subsystem will not decode any more
629 data until the ioctl call VIDEO_CONTINUE or VIDEO_PLAY is performed.</para>
630</entry>
631 </row></tbody></tgroup></informaltable>
632<para>SYNOPSIS
633</para>
634<informaltable><tgroup cols="1"><tbody><row><entry
635 align="char">
636<para>int ioctl(fd, int request = VIDEO_FREEZE);</para>
637</entry>
638 </row></tbody></tgroup></informaltable>
639<para>PARAMETERS
640</para>
641<informaltable><tgroup cols="2"><tbody><row><entry
642 align="char">
643<para>int fd</para>
644</entry><entry
645 align="char">
646<para>File descriptor returned by a previous call to open().</para>
647</entry>
648 </row><row><entry
649 align="char">
650<para>int request</para>
651</entry><entry
652 align="char">
653<para>Equals VIDEO_FREEZE for this command.</para>
654</entry>
655 </row></tbody></tgroup></informaltable>
656<para>ERRORS
657</para>
658<informaltable><tgroup cols="2"><tbody><row><entry
659 align="char">
660<para>EBADF</para>
661</entry><entry
662 align="char">
663<para>fd is not a valid open file descriptor</para>
664</entry>
665 </row><row><entry
666 align="char">
667<para>EINTERNAL</para>
668</entry><entry
669 align="char">
670<para>Internal error, possibly in the communication with the
671 DVB subsystem.</para>
672</entry>
673 </row></tbody></tgroup></informaltable>
674
675</section><section
676role="subsection"><title>VIDEO_CONTINUE</title>
677<para>DESCRIPTION
678</para>
679<informaltable><tgroup cols="1"><tbody><row><entry
680 align="char">
681<para>This ioctl call restarts decoding and playing processes of the video stream
682 which was played before a call to VIDEO_FREEZE was made.</para>
683</entry>
684 </row></tbody></tgroup></informaltable>
685<para>SYNOPSIS
686</para>
687<informaltable><tgroup cols="1"><tbody><row><entry
688 align="char">
689<para>int ioctl(fd, int request = VIDEO_CONTINUE);</para>
690</entry>
691 </row></tbody></tgroup></informaltable>
692<para>PARAMETERS
693</para>
694<informaltable><tgroup cols="2"><tbody><row><entry
695 align="char">
696<para>int fd</para>
697</entry><entry
698 align="char">
699<para>File descriptor returned by a previous call to open().</para>
700</entry>
701 </row><row><entry
702 align="char">
703<para>int request</para>
704</entry><entry
705 align="char">
706<para>Equals VIDEO_CONTINUE for this command.</para>
707</entry>
708 </row></tbody></tgroup></informaltable>
709<para>ERRORS
710</para>
711<informaltable><tgroup cols="2"><tbody><row><entry
712 align="char">
713<para>EBADF</para>
714</entry><entry
715 align="char">
716<para>fd is not a valid open file descriptor</para>
717</entry>
718 </row><row><entry
719 align="char">
720<para>EINTERNAL</para>
721</entry><entry
722 align="char">
723<para>Internal error, possibly in the communication with the
724 DVB subsystem.</para>
725</entry>
726 </row></tbody></tgroup></informaltable>
727
728</section><section
729role="subsection"><title>VIDEO_SELECT_SOURCE</title>
730<para>DESCRIPTION
731</para>
732<informaltable><tgroup cols="1"><tbody><row><entry
733 align="char">
734<para>This ioctl call informs the video device which source shall be used for the input
735 data. The possible sources are demux or memory. If memory is selected, the
736 data is fed to the video device through the write command.</para>
737</entry>
738 </row></tbody></tgroup></informaltable>
739<para>SYNOPSIS
740</para>
741<informaltable><tgroup cols="1"><tbody><row><entry
742 align="char">
743<para>int ioctl(fd, int request = VIDEO_SELECT_SOURCE,
744 video_stream_source_t source);</para>
745</entry>
746 </row></tbody></tgroup></informaltable>
747<para>PARAMETERS
748</para>
749<informaltable><tgroup cols="2"><tbody><row><entry
750 align="char">
751<para>int fd</para>
752</entry><entry
753 align="char">
754<para>File descriptor returned by a previous call to open().</para>
755</entry>
756 </row><row><entry
757 align="char">
758<para>int request</para>
759</entry><entry
760 align="char">
761<para>Equals VIDEO_SELECT_SOURCE for this command.</para>
762</entry>
763 </row><row><entry
764 align="char">
765<para>video_stream_source_t
766 source</para>
767</entry><entry
768 align="char">
769<para>Indicates which source shall be used for the Video stream.</para>
770</entry>
771 </row></tbody></tgroup></informaltable>
772<para>ERRORS
773</para>
774<informaltable><tgroup cols="2"><tbody><row><entry
775 align="char">
776<para>EBADF</para>
777</entry><entry
778 align="char">
779<para>fd is not a valid open file descriptor</para>
780</entry>
781 </row><row><entry
782 align="char">
783<para>EINTERNAL</para>
784</entry><entry
785 align="char">
786<para>Internal error, possibly in the communication with the
787 DVB subsystem.</para>
788</entry>
789 </row></tbody></tgroup></informaltable>
790
791</section><section
792role="subsection"><title>VIDEO_SET_BLANK</title>
793<para>DESCRIPTION
794</para>
795<informaltable><tgroup cols="1"><tbody><row><entry
796 align="char">
797<para>This ioctl call asks the Video Device to blank out the picture.</para>
798</entry>
799 </row></tbody></tgroup></informaltable>
800<para>SYNOPSIS
801</para>
802<informaltable><tgroup cols="1"><tbody><row><entry
803 align="char">
804<para>int ioctl(fd, int request = VIDEO_SET_BLANK, boolean
805 mode);</para>
806</entry>
807 </row></tbody></tgroup></informaltable>
808<para>PARAMETERS
809</para>
810<informaltable><tgroup cols="2"><tbody><row><entry
811 align="char">
812<para>int fd</para>
813</entry><entry
814 align="char">
815<para>File descriptor returned by a previous call to open().</para>
816</entry>
817 </row><row><entry
818 align="char">
819<para>int request</para>
820</entry><entry
821 align="char">
822<para>Equals VIDEO_SET_BLANK for this command.</para>
823</entry>
824 </row><row><entry
825 align="char">
826<para>boolean mode</para>
827</entry><entry
828 align="char">
829<para>TRUE: Blank screen when stop.</para>
830</entry>
831 </row><row><entry
832 align="char">
833</entry><entry
834 align="char">
835<para>FALSE: Show last decoded frame.</para>
836</entry>
837 </row></tbody></tgroup></informaltable>
838<para>ERRORS
839</para>
840<informaltable><tgroup cols="2"><tbody><row><entry
841 align="char">
842<para>EBADF</para>
843</entry><entry
844 align="char">
845<para>fd is not a valid open file descriptor</para>
846</entry>
847 </row><row><entry
848 align="char">
849<para>EINTERNAL</para>
850</entry><entry
851 align="char">
852<para>Internal error, possibly in the communication with the
853 DVB subsystem.</para>
854</entry>
855 </row><row><entry
856 align="char">
857<para>EINVAL</para>
858</entry><entry
859 align="char">
860<para>Illegal input parameter</para>
861</entry>
862 </row></tbody></tgroup></informaltable>
863
864</section><section
865role="subsection"><title>VIDEO_GET_STATUS</title>
866<para>DESCRIPTION
867</para>
868<informaltable><tgroup cols="1"><tbody><row><entry
869 align="char">
870<para>This ioctl call asks the Video Device to return the current status of the device.</para>
871</entry>
872 </row></tbody></tgroup></informaltable>
873<para>SYNOPSIS
874</para>
875<informaltable><tgroup cols="1"><tbody><row><entry
876 align="char">
877<para> int ioctl(fd, int request = VIDEO_GET_STATUS, struct
878 video_status &#x22C6;status);</para>
879</entry>
880 </row></tbody></tgroup></informaltable>
881<para>PARAMETERS
882</para>
883<informaltable><tgroup cols="2"><tbody><row><entry
884 align="char">
885<para>int fd</para>
886</entry><entry
887 align="char">
888<para>File descriptor returned by a previous call to open().</para>
889</entry>
890 </row><row><entry
891 align="char">
892<para>int request</para>
893</entry><entry
894 align="char">
895<para>Equals VIDEO_GET_STATUS for this command.</para>
896</entry>
897 </row><row><entry
898 align="char">
899<para>struct video_status
900 *status</para>
901</entry><entry
902 align="char">
903<para>Returns the current status of the Video Device.</para>
904</entry>
905 </row></tbody></tgroup></informaltable>
906<para>ERRORS
907</para>
908<informaltable><tgroup cols="2"><tbody><row><entry
909 align="char">
910<para>EBADF</para>
911</entry><entry
912 align="char">
913<para>fd is not a valid open file descriptor</para>
914</entry>
915 </row><row><entry
916 align="char">
917<para>EINTERNAL</para>
918</entry><entry
919 align="char">
920<para>Internal error, possibly in the communication with the
921 DVB subsystem.</para>
922</entry>
923 </row><row><entry
924 align="char">
925<para>EFAULT</para>
926</entry><entry
927 align="char">
928<para>status points to invalid address</para>
929</entry>
930 </row></tbody></tgroup></informaltable>
931
932</section><section
933role="subsection"><title>VIDEO_GET_EVENT</title>
934<para>DESCRIPTION
935</para>
936<informaltable><tgroup cols="1"><tbody><row><entry
937 align="char">
938<para>This ioctl call returns an event of type video_event if available. If an event is
939 not available, the behavior depends on whether the device is in blocking or
940 non-blocking mode. In the latter case, the call fails immediately with errno
941 set to EWOULDBLOCK. In the former case, the call blocks until an event
942 becomes available. The standard Linux poll() and/or select() system calls can
943 be used with the device file descriptor to watch for new events. For select(),
944 the file descriptor should be included in the exceptfds argument, and for
945 poll(), POLLPRI should be specified as the wake-up condition. Read-only
946 permissions are sufficient for this ioctl call.</para>
947</entry>
948 </row></tbody></tgroup></informaltable>
949<para>SYNOPSIS
950</para>
951<informaltable><tgroup cols="1"><tbody><row><entry
952 align="char">
953<para> int ioctl(fd, int request = VIDEO_GET_EVENT, struct
954 video_event &#x22C6;ev);</para>
955</entry>
956 </row></tbody></tgroup></informaltable>
957<para>PARAMETERS
958</para>
959<informaltable><tgroup cols="2"><tbody><row><entry
960 align="char">
961<para>int fd</para>
962</entry><entry
963 align="char">
964<para>File descriptor returned by a previous call to open().</para>
965</entry>
966 </row><row><entry
967 align="char">
968<para>int request</para>
969</entry><entry
970 align="char">
971<para>Equals VIDEO_GET_EVENT for this command.</para>
972</entry>
973 </row><row><entry
974 align="char">
975<para>struct video_event
976 *ev</para>
977</entry><entry
978 align="char">
979<para>Points to the location where the event, if any, is to be
980 stored.</para>
981</entry>
982 </row></tbody></tgroup></informaltable>
983<para>ERRORS
984</para>
985<informaltable><tgroup cols="2"><tbody><row><entry
986 align="char">
987<para>EBADF</para>
988</entry><entry
989 align="char">
990<para>fd is not a valid open file descriptor</para>
991</entry>
992 </row><row><entry
993 align="char">
994<para>EFAULT</para>
995</entry><entry
996 align="char">
997<para>ev points to invalid address</para>
998</entry>
999 </row><row><entry
1000 align="char">
1001<para>EWOULDBLOCK</para>
1002</entry><entry
1003 align="char">
1004<para>There is no event pending, and the device is in
1005 non-blocking mode.</para>
1006</entry>
1007 </row><row><entry
1008 align="char">
1009<para>EOVERFLOW</para>
1010</entry><entry
1011 align="char">
1012</entry>
1013 </row><row><entry
1014 align="char">
1015</entry><entry
1016 align="char">
1017<para>Overflow in event queue - one or more events were lost.</para>
1018</entry>
1019 </row></tbody></tgroup></informaltable>
1020
1021</section><section
1022role="subsection"><title>VIDEO_SET_DISPLAY_FORMAT</title>
1023<para>DESCRIPTION
1024</para>
1025<informaltable><tgroup cols="1"><tbody><row><entry
1026 align="char">
1027<para>This ioctl call asks the Video Device to select the video format to be applied
1028 by the MPEG chip on the video.</para>
1029</entry>
1030 </row></tbody></tgroup></informaltable>
1031<para>SYNOPSIS
1032</para>
1033<informaltable><tgroup cols="1"><tbody><row><entry
1034 align="char">
1035<para> int ioctl(fd, int request =
1036 VIDEO_SET_DISPLAY_FORMAT, video_display_format_t
1037 format);</para>
1038</entry>
1039 </row></tbody></tgroup></informaltable>
1040<para>PARAMETERS
1041</para>
1042<informaltable><tgroup cols="2"><tbody><row><entry
1043 align="char">
1044<para>int fd</para>
1045</entry><entry
1046 align="char">
1047<para>File descriptor returned by a previous call to open().</para>
1048</entry>
1049 </row><row><entry
1050 align="char">
1051<para>int request</para>
1052</entry><entry
1053 align="char">
1054<para>Equals VIDEO_SET_DISPLAY_FORMAT for this
1055 command.</para>
1056</entry>
1057 </row><row><entry
1058 align="char">
1059<para>video_display_format_t
1060 format</para>
1061</entry><entry
1062 align="char">
1063<para>Selects the video format to be used.</para>
1064</entry>
1065 </row></tbody></tgroup></informaltable>
1066<para>ERRORS
1067</para>
1068<informaltable><tgroup cols="2"><tbody><row><entry
1069 align="char">
1070<para>EBADF</para>
1071</entry><entry
1072 align="char">
1073<para>fd is not a valid open file descriptor</para>
1074</entry>
1075 </row><row><entry
1076 align="char">
1077<para>EINTERNAL</para>
1078</entry><entry
1079 align="char">
1080<para>Internal error.</para>
1081</entry>
1082 </row><row><entry
1083 align="char">
1084<para>EINVAL</para>
1085</entry><entry
1086 align="char">
1087<para>Illegal parameter format.</para>
1088</entry>
1089 </row></tbody></tgroup></informaltable>
1090
1091</section><section
1092role="subsection"><title>VIDEO_STILLPICTURE</title>
1093<para>DESCRIPTION
1094</para>
1095<informaltable><tgroup cols="1"><tbody><row><entry
1096 align="char">
1097<para>This ioctl call asks the Video Device to display a still picture (I-frame). The
1098 input data shall contain an I-frame. If the pointer is NULL, then the current
1099 displayed still picture is blanked.</para>
1100</entry>
1101 </row></tbody></tgroup></informaltable>
1102<para>SYNOPSIS
1103</para>
1104<informaltable><tgroup cols="1"><tbody><row><entry
1105 align="char">
1106<para>int ioctl(fd, int request = VIDEO_STILLPICTURE,
1107 struct video_still_picture &#x22C6;sp);</para>
1108</entry>
1109 </row></tbody></tgroup></informaltable>
1110<para>PARAMETERS
1111</para>
1112<informaltable><tgroup cols="2"><tbody><row><entry
1113 align="char">
1114<para>int fd</para>
1115</entry><entry
1116 align="char">
1117<para>File descriptor returned by a previous call to open().</para>
1118</entry>
1119 </row><row><entry
1120 align="char">
1121<para>int request</para>
1122</entry><entry
1123 align="char">
1124<para>Equals VIDEO_STILLPICTURE for this command.</para>
1125</entry>
1126 </row><row><entry
1127 align="char">
1128<para>struct
1129 video_still_picture
1130 *sp</para>
1131</entry><entry
1132 align="char">
1133<para>Pointer to a location where an I-frame and size is stored.</para>
1134</entry>
1135 </row></tbody></tgroup></informaltable>
1136<para>ERRORS
1137</para>
1138<informaltable><tgroup cols="2"><tbody><row><entry
1139 align="char">
1140<para>EBADF</para>
1141</entry><entry
1142 align="char">
1143<para>fd is not a valid open file descriptor</para>
1144</entry>
1145 </row><row><entry
1146 align="char">
1147<para>EINTERNAL</para>
1148</entry><entry
1149 align="char">
1150<para>Internal error.</para>
1151</entry>
1152 </row><row><entry
1153 align="char">
1154<para>EFAULT</para>
1155</entry><entry
1156 align="char">
1157<para>sp points to an invalid iframe.</para>
1158</entry>
1159 </row></tbody></tgroup></informaltable>
1160
1161</section><section
1162role="subsection"><title>VIDEO_FAST_FORWARD</title>
1163<para>DESCRIPTION
1164</para>
1165<informaltable><tgroup cols="1"><tbody><row><entry
1166 align="char">
1167<para>This ioctl call asks the Video Device to skip decoding of N number of I-frames.
1168 This call can only be used if VIDEO_SOURCE_MEMORY is selected.</para>
1169</entry>
1170 </row></tbody></tgroup></informaltable>
1171<para>SYNOPSIS
1172</para>
1173<informaltable><tgroup cols="1"><tbody><row><entry
1174 align="char">
1175<para>int ioctl(fd, int request = VIDEO_FAST_FORWARD, int
1176 nFrames);</para>
1177</entry>
1178 </row></tbody></tgroup></informaltable>
1179<para>PARAMETERS
1180</para>
1181<informaltable><tgroup cols="2"><tbody><row><entry
1182 align="char">
1183<para>int fd</para>
1184</entry><entry
1185 align="char">
1186<para>File descriptor returned by a previous call to open().</para>
1187</entry>
1188 </row><row><entry
1189 align="char">
1190<para>int request</para>
1191</entry><entry
1192 align="char">
1193<para>Equals VIDEO_FAST_FORWARD for this command.</para>
1194</entry>
1195 </row><row><entry
1196 align="char">
1197<para>int nFrames</para>
1198</entry><entry
1199 align="char">
1200<para>The number of frames to skip.</para>
1201</entry>
1202 </row></tbody></tgroup></informaltable>
1203<para>ERRORS
1204</para>
1205<informaltable><tgroup cols="2"><tbody><row><entry
1206 align="char">
1207<para>EBADF</para>
1208</entry><entry
1209 align="char">
1210<para>fd is not a valid open file descriptor</para>
1211</entry>
1212 </row><row><entry
1213 align="char">
1214<para>EINTERNAL</para>
1215</entry><entry
1216 align="char">
1217<para>Internal error.</para>
1218</entry>
1219 </row><row><entry
1220 align="char">
1221<para>EPERM</para>
1222</entry><entry
1223 align="char">
1224<para>Mode VIDEO_SOURCE_MEMORY not selected.</para>
1225</entry>
1226 </row><row><entry
1227 align="char">
1228<para>EINVAL</para>
1229</entry><entry
1230 align="char">
1231<para>Illegal parameter format.</para>
1232</entry>
1233 </row></tbody></tgroup></informaltable>
1234
1235</section><section
1236role="subsection"><title>VIDEO_SLOWMOTION</title>
1237<para>DESCRIPTION
1238</para>
1239<informaltable><tgroup cols="1"><tbody><row><entry
1240 align="char">
1241<para>This ioctl call asks the video device to repeat decoding frames N number of
1242 times. This call can only be used if VIDEO_SOURCE_MEMORY is selected.</para>
1243</entry>
1244 </row></tbody></tgroup></informaltable>
1245<para>SYNOPSIS
1246</para>
1247<informaltable><tgroup cols="1"><tbody><row><entry
1248 align="char">
1249<para>int ioctl(fd, int request = VIDEO_SLOWMOTION, int
1250 nFrames);</para>
1251</entry>
1252 </row></tbody></tgroup></informaltable>
1253<para>PARAMETERS
1254</para>
1255<informaltable><tgroup cols="2"><tbody><row><entry
1256 align="char">
1257<para>int fd</para>
1258</entry><entry
1259 align="char">
1260<para>File descriptor returned by a previous call to open().</para>
1261</entry>
1262 </row><row><entry
1263 align="char">
1264<para>int request</para>
1265</entry><entry
1266 align="char">
1267<para>Equals VIDEO_SLOWMOTION for this command.</para>
1268</entry>
1269 </row><row><entry
1270 align="char">
1271<para>int nFrames</para>
1272</entry><entry
1273 align="char">
1274<para>The number of times to repeat each frame.</para>
1275</entry>
1276 </row></tbody></tgroup></informaltable>
1277<para>ERRORS
1278</para>
1279<informaltable><tgroup cols="2"><tbody><row><entry
1280 align="char">
1281<para>EBADF</para>
1282</entry><entry
1283 align="char">
1284<para>fd is not a valid open file descriptor</para>
1285</entry>
1286 </row><row><entry
1287 align="char">
1288<para>EINTERNAL</para>
1289</entry><entry
1290 align="char">
1291<para>Internal error.</para>
1292</entry>
1293 </row><row><entry
1294 align="char">
1295<para>EPERM</para>
1296</entry><entry
1297 align="char">
1298<para>Mode VIDEO_SOURCE_MEMORY not selected.</para>
1299</entry>
1300 </row><row><entry
1301 align="char">
1302<para>EINVAL</para>
1303</entry><entry
1304 align="char">
1305<para>Illegal parameter format.</para>
1306</entry>
1307 </row></tbody></tgroup></informaltable>
1308
1309</section><section
1310role="subsection"><title>VIDEO_GET_CAPABILITIES</title>
1311<para>DESCRIPTION
1312</para>
1313<informaltable><tgroup cols="1"><tbody><row><entry
1314 align="char">
1315<para>This ioctl call asks the video device about its decoding capabilities. On success
1316 it returns and integer which has bits set according to the defines in section ??.</para>
1317</entry>
1318 </row></tbody></tgroup></informaltable>
1319<para>SYNOPSIS
1320</para>
1321<informaltable><tgroup cols="1"><tbody><row><entry
1322 align="char">
1323<para>int ioctl(fd, int request = VIDEO_GET_CAPABILITIES,
1324 unsigned int &#x22C6;cap);</para>
1325</entry>
1326 </row></tbody></tgroup></informaltable>
1327<para>PARAMETERS
1328</para>
1329<informaltable><tgroup cols="2"><tbody><row><entry
1330 align="char">
1331<para>int fd</para>
1332</entry><entry
1333 align="char">
1334<para>File descriptor returned by a previous call to open().</para>
1335</entry>
1336 </row><row><entry
1337 align="char">
1338<para>int request</para>
1339</entry><entry
1340 align="char">
1341<para>Equals VIDEO_GET_CAPABILITIES for this
1342 command.</para>
1343</entry>
1344 </row><row><entry
1345 align="char">
1346<para>unsigned int *cap</para>
1347</entry><entry
1348 align="char">
1349<para>Pointer to a location where to store the capability
1350 information.</para>
1351</entry>
1352 </row></tbody></tgroup></informaltable>
1353<para>ERRORS
1354</para>
1355<informaltable><tgroup cols="2"><tbody><row><entry
1356 align="char">
1357<para>EBADF</para>
1358</entry><entry
1359 align="char">
1360<para>fd is not a valid open file descriptor</para>
1361</entry>
1362 </row><row><entry
1363 align="char">
1364<para>EFAULT</para>
1365</entry><entry
1366 align="char">
1367<para>cap points to an invalid iframe.</para>
1368</entry>
1369 </row></tbody></tgroup></informaltable>
1370
1371</section><section
1372role="subsection"><title>VIDEO_SET_ID</title>
1373<para>DESCRIPTION
1374</para>
1375<informaltable><tgroup cols="1"><tbody><row><entry
1376 align="char">
1377<para>This ioctl selects which sub-stream is to be decoded if a program or system
1378 stream is sent to the video device.</para>
1379</entry>
1380 </row></tbody></tgroup></informaltable>
1381<para>SYNOPSIS
1382</para>
1383<informaltable><tgroup cols="1"><tbody><row><entry
1384 align="char">
1385<para>int ioctl(int fd, int request = VIDEO_SET_ID, int
1386 id);</para>
1387</entry>
1388 </row></tbody></tgroup></informaltable>
1389<para>PARAMETERS
1390</para>
1391<informaltable><tgroup cols="2"><tbody><row><entry
1392 align="char">
1393<para>int fd</para>
1394</entry><entry
1395 align="char">
1396<para>File descriptor returned by a previous call to open().</para>
1397</entry>
1398 </row><row><entry
1399 align="char">
1400<para>int request</para>
1401</entry><entry
1402 align="char">
1403<para>Equals VIDEO_SET_ID for this command.</para>
1404</entry>
1405 </row><row><entry
1406 align="char">
1407<para>int id</para>
1408</entry><entry
1409 align="char">
1410<para>video sub-stream id</para>
1411</entry>
1412 </row></tbody></tgroup></informaltable>
1413<para>ERRORS
1414</para>
1415<informaltable><tgroup cols="2"><tbody><row><entry
1416 align="char">
1417<para>EBADF</para>
1418</entry><entry
1419 align="char">
1420<para>fd is not a valid open file descriptor.</para>
1421</entry>
1422 </row><row><entry
1423 align="char">
1424<para>EINTERNAL</para>
1425</entry><entry
1426 align="char">
1427<para>Internal error.</para>
1428</entry>
1429 </row><row><entry
1430 align="char">
1431<para>EINVAL</para>
1432</entry><entry
1433 align="char">
1434<para>Invalid sub-stream id.</para>
1435</entry>
1436 </row></tbody></tgroup></informaltable>
1437
1438</section><section
1439role="subsection"><title>VIDEO_CLEAR_BUFFER</title>
1440<para>DESCRIPTION
1441</para>
1442<informaltable><tgroup cols="1"><tbody><row><entry
1443 align="char">
1444<para>This ioctl call clears all video buffers in the driver and in the decoder hardware.</para>
1445</entry>
1446 </row></tbody></tgroup></informaltable>
1447<para>SYNOPSIS
1448</para>
1449<informaltable><tgroup cols="1"><tbody><row><entry
1450 align="char">
1451<para>int ioctl(fd, int request = VIDEO_CLEAR_BUFFER);</para>
1452</entry>
1453 </row></tbody></tgroup></informaltable>
1454<para>PARAMETERS
1455</para>
1456<informaltable><tgroup cols="2"><tbody><row><entry
1457 align="char">
1458<para>int fd</para>
1459</entry><entry
1460 align="char">
1461<para>File descriptor returned by a previous call to open().</para>
1462</entry>
1463 </row><row><entry
1464 align="char">
1465<para>int request</para>
1466</entry><entry
1467 align="char">
1468<para>Equals VIDEO_CLEAR_BUFFER for this command.</para>
1469</entry>
1470 </row></tbody></tgroup></informaltable>
1471<para>ERRORS
1472</para>
1473<informaltable><tgroup cols="2"><tbody><row><entry
1474 align="char">
1475<para>EBADF</para>
1476</entry><entry
1477 align="char">
1478<para>fd is not a valid open file descriptor</para>
1479</entry>
1480 </row></tbody></tgroup></informaltable>
1481
1482</section><section
1483role="subsection"><title>VIDEO_SET_STREAMTYPE</title>
1484<para>DESCRIPTION
1485</para>
1486<informaltable><tgroup cols="1"><tbody><row><entry
1487 align="char">
1488<para>This ioctl tells the driver which kind of stream to expect being written to it. If
1489 this call is not used the default of video PES is used. Some drivers might not
1490 support this call and always expect PES.</para>
1491</entry>
1492 </row></tbody></tgroup></informaltable>
1493<para>SYNOPSIS
1494</para>
1495<informaltable><tgroup cols="1"><tbody><row><entry
1496 align="char">
1497<para>int ioctl(fd, int request = VIDEO_SET_STREAMTYPE,
1498 int type);</para>
1499</entry>
1500 </row></tbody></tgroup></informaltable>
1501<para>PARAMETERS
1502</para>
1503<informaltable><tgroup cols="2"><tbody><row><entry
1504 align="char">
1505<para>int fd</para>
1506</entry><entry
1507 align="char">
1508<para>File descriptor returned by a previous call to open().</para>
1509</entry>
1510 </row><row><entry
1511 align="char">
1512<para>int request</para>
1513</entry><entry
1514 align="char">
1515<para>Equals VIDEO_SET_STREAMTYPE for this command.</para>
1516</entry>
1517 </row><row><entry
1518 align="char">
1519<para>int type</para>
1520</entry><entry
1521 align="char">
1522<para>stream type</para>
1523</entry>
1524 </row></tbody></tgroup></informaltable>
1525<para>ERRORS
1526</para>
1527<informaltable><tgroup cols="2"><tbody><row><entry
1528 align="char">
1529<para>EBADF</para>
1530</entry><entry
1531 align="char">
1532<para>fd is not a valid open file descriptor</para>
1533</entry>
1534 </row><row><entry
1535 align="char">
1536<para>EINVAL</para>
1537</entry><entry
1538 align="char">
1539<para>type is not a valid or supported stream type.</para>
1540</entry>
1541 </row></tbody></tgroup></informaltable>
1542
1543</section><section
1544role="subsection"><title>VIDEO_SET_FORMAT</title>
1545<para>DESCRIPTION
1546</para>
1547<informaltable><tgroup cols="1"><tbody><row><entry
1548 align="char">
1549<para>This ioctl sets the screen format (aspect ratio) of the connected output device
1550 (TV) so that the output of the decoder can be adjusted accordingly.</para>
1551</entry>
1552 </row></tbody></tgroup></informaltable>
1553<para>SYNOPSIS
1554</para>
1555<informaltable><tgroup cols="1"><tbody><row><entry
1556 align="char">
1557<para> int ioctl(fd, int request = VIDEO_SET_FORMAT,
1558 video_format_t format);</para>
1559</entry>
1560 </row></tbody></tgroup></informaltable>
1561<para>PARAMETERS
1562</para>
1563<informaltable><tgroup cols="2"><tbody><row><entry
1564 align="char">
1565<para>int fd</para>
1566</entry><entry
1567 align="char">
1568<para>File descriptor returned by a previous call to open().</para>
1569</entry>
1570 </row><row><entry
1571 align="char">
1572<para>int request</para>
1573</entry><entry
1574 align="char">
1575<para>Equals VIDEO_SET_FORMAT for this command.</para>
1576</entry>
1577 </row><row><entry
1578 align="char">
1579<para>video_format_t
1580 format</para>
1581</entry><entry
1582 align="char">
1583<para>video format of TV as defined in section ??.</para>
1584</entry>
1585 </row></tbody></tgroup></informaltable>
1586<para>ERRORS
1587</para>
1588<informaltable><tgroup cols="2"><tbody><row><entry
1589 align="char">
1590<para>EBADF</para>
1591</entry><entry
1592 align="char">
1593<para>fd is not a valid open file descriptor</para>
1594</entry>
1595 </row><row><entry
1596 align="char">
1597<para>EINVAL</para>
1598</entry><entry
1599 align="char">
1600<para>format is not a valid video format.</para>
1601</entry>
1602 </row></tbody></tgroup></informaltable>
1603
1604</section><section
1605role="subsection"><title>VIDEO_SET_SYSTEM</title>
1606<para>DESCRIPTION
1607</para>
1608<informaltable><tgroup cols="1"><tbody><row><entry
1609 align="char">
1610<para>This ioctl sets the television output format. The format (see section ??) may
1611 vary from the color format of the displayed MPEG stream. If the hardware is
1612 not able to display the requested format the call will return an error.</para>
1613</entry>
1614 </row></tbody></tgroup></informaltable>
1615<para>SYNOPSIS
1616</para>
1617<informaltable><tgroup cols="1"><tbody><row><entry
1618 align="char">
1619<para> int ioctl(fd, int request = VIDEO_SET_SYSTEM ,
1620 video_system_t system);</para>
1621</entry>
1622 </row></tbody></tgroup></informaltable>
1623<para>PARAMETERS
1624</para>
1625<informaltable><tgroup cols="2"><tbody><row><entry
1626 align="char">
1627<para>int fd</para>
1628</entry><entry
1629 align="char">
1630<para>File descriptor returned by a previous call to open().</para>
1631</entry>
1632 </row><row><entry
1633 align="char">
1634<para>int request</para>
1635</entry><entry
1636 align="char">
1637<para>Equals VIDEO_SET_FORMAT for this command.</para>
1638</entry>
1639 </row><row><entry
1640 align="char">
1641<para>video_system_t
1642 system</para>
1643</entry><entry
1644 align="char">
1645<para>video system of TV output.</para>
1646</entry>
1647 </row></tbody></tgroup></informaltable>
1648<para>ERRORS
1649</para>
1650<informaltable><tgroup cols="2"><tbody><row><entry
1651 align="char">
1652<para>EBADF</para>
1653</entry><entry
1654 align="char">
1655<para>fd is not a valid open file descriptor</para>
1656</entry>
1657 </row><row><entry
1658 align="char">
1659<para>EINVAL</para>
1660</entry><entry
1661 align="char">
1662<para>system is not a valid or supported video system.</para>
1663</entry>
1664 </row></tbody></tgroup></informaltable>
1665
1666</section><section
1667role="subsection"><title>VIDEO_SET_HIGHLIGHT</title>
1668<para>DESCRIPTION
1669</para>
1670<informaltable><tgroup cols="1"><tbody><row><entry
1671 align="char">
1672<para>This ioctl sets the SPU highlight information for the menu access of a DVD.</para>
1673</entry>
1674 </row></tbody></tgroup></informaltable>
1675<para>SYNOPSIS
1676</para>
1677<informaltable><tgroup cols="1"><tbody><row><entry
1678 align="char">
1679<para> int ioctl(fd, int request = VIDEO_SET_HIGHLIGHT
1680 ,video_highlight_t &#x22C6;vhilite)</para>
1681</entry>
1682 </row></tbody></tgroup></informaltable>
1683<para>PARAMETERS
1684</para>
1685<informaltable><tgroup cols="2"><tbody><row><entry
1686 align="char">
1687<para>int fd</para>
1688</entry><entry
1689 align="char">
1690<para>File descriptor returned by a previous call to open().</para>
1691</entry>
1692 </row><row><entry
1693 align="char">
1694<para>int request</para>
1695</entry><entry
1696 align="char">
1697<para>Equals VIDEO_SET_HIGHLIGHT for this command.</para>
1698</entry>
1699 </row><row><entry
1700 align="char">
1701<para>video_highlight_t
1702 *vhilite</para>
1703</entry><entry
1704 align="char">
1705<para>SPU Highlight information according to section ??.</para>
1706</entry>
1707 </row></tbody></tgroup></informaltable>
1708<para>ERRORS
1709</para>
1710<informaltable><tgroup cols="2"><tbody><row><entry
1711 align="char">
1712<para>EBADF</para>
1713</entry><entry
1714 align="char">
1715<para>fd is not a valid open file descriptor.</para>
1716</entry>
1717 </row><row><entry
1718 align="char">
1719<para>EINVAL</para>
1720</entry><entry
1721 align="char">
1722<para>input is not a valid highlight setting.</para>
1723</entry>
1724 </row></tbody></tgroup></informaltable>
1725
1726</section><section
1727role="subsection"><title>VIDEO_SET_SPU</title>
1728<para>DESCRIPTION
1729</para>
1730<informaltable><tgroup cols="1"><tbody><row><entry
1731 align="char">
1732<para>This ioctl activates or deactivates SPU decoding in a DVD input stream. It can
1733 only be used, if the driver is able to handle a DVD stream.</para>
1734</entry>
1735 </row></tbody></tgroup></informaltable>
1736<para>SYNOPSIS
1737</para>
1738<informaltable><tgroup cols="1"><tbody><row><entry
1739 align="char">
1740<para> int ioctl(fd, int request = VIDEO_SET_SPU ,
1741 video_spu_t &#x22C6;spu)</para>
1742</entry>
1743 </row></tbody></tgroup></informaltable>
1744<para>PARAMETERS
1745</para>
1746<informaltable><tgroup cols="2"><tbody><row><entry
1747 align="char">
1748<para>int fd</para>
1749</entry><entry
1750 align="char">
1751<para>File descriptor returned by a previous call to open().</para>
1752</entry>
1753 </row><row><entry
1754 align="char">
1755<para>int request</para>
1756</entry><entry
1757 align="char">
1758<para>Equals VIDEO_SET_SPU for this command.</para>
1759</entry>
1760 </row><row><entry
1761 align="char">
1762<para>video_spu_t *spu</para>
1763</entry><entry
1764 align="char">
1765<para>SPU decoding (de)activation and subid setting according
1766 to section ??.</para>
1767</entry>
1768 </row></tbody></tgroup></informaltable>
1769<para>ERRORS
1770</para>
1771<informaltable><tgroup cols="2"><tbody><row><entry
1772 align="char">
1773<para>EBADF</para>
1774</entry><entry
1775 align="char">
1776<para>fd is not a valid open file descriptor</para>
1777</entry>
1778 </row><row><entry
1779 align="char">
1780<para>EINVAL</para>
1781</entry><entry
1782 align="char">
1783<para>input is not a valid spu setting or driver cannot handle
1784 SPU.</para>
1785</entry>
1786 </row></tbody></tgroup></informaltable>
1787
1788</section><section
1789role="subsection"><title>VIDEO_SET_SPU_PALETTE</title>
1790<para>DESCRIPTION
1791</para>
1792<informaltable><tgroup cols="1"><tbody><row><entry
1793 align="char">
1794<para>This ioctl sets the SPU color palette.</para>
1795</entry>
1796 </row></tbody></tgroup></informaltable>
1797<para>SYNOPSIS
1798</para>
1799<informaltable><tgroup cols="1"><tbody><row><entry
1800 align="char">
1801<para> int ioctl(fd, int request = VIDEO_SET_SPU_PALETTE
1802 ,video_spu_palette_t &#x22C6;palette )</para>
1803</entry>
1804 </row></tbody></tgroup></informaltable>
1805<para>PARAMETERS
1806</para>
1807<informaltable><tgroup cols="2"><tbody><row><entry
1808 align="char">
1809<para>int fd</para>
1810</entry><entry
1811 align="char">
1812<para>File descriptor returned by a previous call to open().</para>
1813</entry>
1814 </row><row><entry
1815 align="char">
1816<para>int request</para>
1817</entry><entry
1818 align="char">
1819<para>Equals VIDEO_SET_SPU_PALETTE for this command.</para>
1820</entry>
1821 </row><row><entry
1822 align="char">
1823<para>video_spu_palette_t
1824 *palette</para>
1825</entry><entry
1826 align="char">
1827<para>SPU palette according to section ??.</para>
1828</entry>
1829 </row></tbody></tgroup></informaltable>
1830<para>ERRORS
1831</para>
1832<informaltable><tgroup cols="2"><tbody><row><entry
1833 align="char">
1834<para>EBADF</para>
1835</entry><entry
1836 align="char">
1837<para>fd is not a valid open file descriptor</para>
1838</entry>
1839 </row><row><entry
1840 align="char">
1841<para>EINVAL</para>
1842</entry><entry
1843 align="char">
1844<para>input is not a valid palette or driver doesn&#8217;t handle SPU.</para>
1845</entry>
1846 </row></tbody></tgroup></informaltable>
1847
1848</section><section
1849role="subsection"><title>VIDEO_GET_NAVI</title>
1850<para>DESCRIPTION
1851</para>
1852<informaltable><tgroup cols="1"><tbody><row><entry
1853 align="char">
1854<para>This ioctl returns navigational information from the DVD stream. This is
1855 especially needed if an encoded stream has to be decoded by the hardware.</para>
1856</entry>
1857 </row></tbody></tgroup></informaltable>
1858<para>SYNOPSIS
1859</para>
1860<informaltable><tgroup cols="1"><tbody><row><entry
1861 align="char">
1862<para> int ioctl(fd, int request = VIDEO_GET_NAVI ,
1863 video_navi_pack_t &#x22C6;navipack)</para>
1864</entry>
1865 </row></tbody></tgroup></informaltable>
1866<para>PARAMETERS
1867</para>
1868<informaltable><tgroup cols="2"><tbody><row><entry
1869 align="char">
1870<para>int fd</para>
1871</entry><entry
1872 align="char">
1873<para>File descriptor returned by a previous call to open().</para>
1874</entry>
1875 </row><row><entry
1876 align="char">
1877<para>int request</para>
1878</entry><entry
1879 align="char">
1880<para>Equals VIDEO_GET_NAVI for this command.</para>
1881</entry>
1882 </row><row><entry
1883 align="char">
1884<para>video_navi_pack_t
1885 *navipack</para>
1886</entry><entry
1887 align="char">
1888<para>PCI or DSI pack (private stream 2) according to section
1889 ??.</para>
1890</entry>
1891 </row></tbody></tgroup></informaltable>
1892<para>ERRORS
1893</para>
1894<informaltable><tgroup cols="2"><tbody><row><entry
1895 align="char">
1896<para>EBADF</para>
1897</entry><entry
1898 align="char">
1899<para>fd is not a valid open file descriptor</para>
1900</entry>
1901 </row><row><entry
1902 align="char">
1903<para>EFAULT</para>
1904</entry><entry
1905 align="char">
1906<para>driver is not able to return navigational information</para>
1907</entry>
1908 </row></tbody></tgroup></informaltable>
1909
1910</section><section
1911role="subsection"><title>VIDEO_SET_ATTRIBUTES</title>
1912<para>DESCRIPTION
1913</para>
1914<informaltable><tgroup cols="1"><tbody><row><entry
1915 align="char">
1916<para>This ioctl is intended for DVD playback and allows you to set certain
1917 information about the stream. Some hardware may not need this information,
1918 but the call also tells the hardware to prepare for DVD playback.</para>
1919</entry>
1920 </row></tbody></tgroup></informaltable>
1921<para>SYNOPSIS
1922</para>
1923<informaltable><tgroup cols="1"><tbody><row><entry
1924 align="char">
1925<para> int ioctl(fd, int request = VIDEO_SET_ATTRIBUTE
1926 ,video_attributes_t vattr)</para>
1927</entry>
1928 </row></tbody></tgroup></informaltable>
1929<para>PARAMETERS
1930</para>
1931<informaltable><tgroup cols="2"><tbody><row><entry
1932 align="char">
1933<para>int fd</para>
1934</entry><entry
1935 align="char">
1936<para>File descriptor returned by a previous call to open().</para>
1937</entry>
1938 </row><row><entry
1939 align="char">
1940<para>int request</para>
1941</entry><entry
1942 align="char">
1943<para>Equals VIDEO_SET_ATTRIBUTE for this command.</para>
1944</entry>
1945 </row><row><entry
1946 align="char">
1947<para>video_attributes_t
1948 vattr</para>
1949</entry><entry
1950 align="char">
1951<para>video attributes according to section ??.</para>
1952</entry>
1953 </row></tbody></tgroup></informaltable>
1954<para>ERRORS
1955</para>
1956<informaltable><tgroup cols="2"><tbody><row><entry
1957 align="char">
1958<para>EBADF</para>
1959</entry><entry
1960 align="char">
1961<para>fd is not a valid open file descriptor</para>
1962</entry>
1963 </row><row><entry
1964 align="char">
1965<para>EINVAL</para>
1966</entry><entry
1967 align="char">
1968<para>input is not a valid attribute setting.</para>
1969</entry>
1970 </row></tbody></tgroup></informaltable>
1971 </section></section>