doc-rst: linux_tv: simplify references
[deliverable/linux.git] / Documentation / linux_tv / media / dvb / video_function_calls.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _video_function_calls:
4
5 ********************
6 Video Function Calls
7 ********************
8
9
10 .. _video_fopen:
11
12 open()
13 ======
14
15 DESCRIPTION
16
17 This system call opens a named video device (e.g.
18 /dev/dvb/adapter0/video0) for subsequent use.
19
20 When an open() call has succeeded, the device will be ready for use. The
21 significance of blocking or non-blocking mode is described in the
22 documentation for functions where there is a difference. It does not
23 affect the semantics of the open() call itself. A device opened in
24 blocking mode can later be put into non-blocking mode (and vice versa)
25 using the F_SETFL command of the fcntl system call. This is a standard
26 system call, documented in the Linux manual page for fcntl. Only one
27 user can open the Video Device in O_RDWR mode. All other attempts to
28 open the device in this mode will fail, and an error-code will be
29 returned. If the Video Device is opened in O_RDONLY mode, the only
30 ioctl call that can be used is VIDEO_GET_STATUS. All other call will
31 return an error code.
32
33 SYNOPSIS
34
35 int open(const char *deviceName, int flags);
36
37 PARAMETERS
38
39
40
41 .. flat-table::
42 :header-rows: 0
43 :stub-columns: 0
44
45
46 - .. row 1
47
48 - const char *deviceName
49
50 - Name of specific video device.
51
52 - .. row 2
53
54 - int flags
55
56 - A bit-wise OR of the following flags:
57
58 - .. row 3
59
60 -
61 - O_RDONLY read-only access
62
63 - .. row 4
64
65 -
66 - O_RDWR read/write access
67
68 - .. row 5
69
70 -
71 - O_NONBLOCK open in non-blocking mode
72
73 - .. row 6
74
75 -
76 - (blocking mode is the default)
77
78
79 RETURN VALUE
80
81
82
83 .. flat-table::
84 :header-rows: 0
85 :stub-columns: 0
86
87
88 - .. row 1
89
90 - ENODEV
91
92 - Device driver not loaded/available.
93
94 - .. row 2
95
96 - EINTERNAL
97
98 - Internal error.
99
100 - .. row 3
101
102 - EBUSY
103
104 - Device or resource busy.
105
106 - .. row 4
107
108 - EINVAL
109
110 - Invalid argument.
111
112
113
114 .. _video_fclose:
115
116 close()
117 =======
118
119 DESCRIPTION
120
121 This system call closes a previously opened video device.
122
123 SYNOPSIS
124
125 int close(int fd);
126
127 PARAMETERS
128
129
130
131 .. flat-table::
132 :header-rows: 0
133 :stub-columns: 0
134
135
136 - .. row 1
137
138 - int fd
139
140 - File descriptor returned by a previous call to open().
141
142
143 RETURN VALUE
144
145
146
147 .. flat-table::
148 :header-rows: 0
149 :stub-columns: 0
150
151
152 - .. row 1
153
154 - EBADF
155
156 - fd is not a valid open file descriptor.
157
158
159
160 .. _video_fwrite:
161
162 write()
163 =======
164
165 DESCRIPTION
166
167 This system call can only be used if VIDEO_SOURCE_MEMORY is selected
168 in the ioctl call VIDEO_SELECT_SOURCE. The data provided shall be in
169 PES format, unless the capability allows other formats. If O_NONBLOCK
170 is not specified the function will block until buffer space is
171 available. The amount of data to be transferred is implied by count.
172
173 SYNOPSIS
174
175 size_t write(int fd, const void *buf, size_t count);
176
177 PARAMETERS
178
179
180
181 .. flat-table::
182 :header-rows: 0
183 :stub-columns: 0
184
185
186 - .. row 1
187
188 - int fd
189
190 - File descriptor returned by a previous call to open().
191
192 - .. row 2
193
194 - void *buf
195
196 - Pointer to the buffer containing the PES data.
197
198 - .. row 3
199
200 - size_t count
201
202 - Size of buf.
203
204
205 RETURN VALUE
206
207
208
209 .. flat-table::
210 :header-rows: 0
211 :stub-columns: 0
212
213
214 - .. row 1
215
216 - EPERM
217
218 - Mode VIDEO_SOURCE_MEMORY not selected.
219
220 - .. row 2
221
222 - ENOMEM
223
224 - Attempted to write more data than the internal buffer can hold.
225
226 - .. row 3
227
228 - EBADF
229
230 - fd is not a valid open file descriptor.
231
232
233
234 .. _VIDEO_STOP:
235
236 VIDEO_STOP
237 ==========
238
239 DESCRIPTION
240
241 This ioctl is for DVB devices only. To control a V4L2 decoder use the
242 V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
243
244 This ioctl call asks the Video Device to stop playing the current
245 stream. Depending on the input parameter, the screen can be blanked out
246 or displaying the last decoded frame.
247
248 SYNOPSIS
249
250 int ioctl(fd, int request = VIDEO_STOP, boolean mode);
251
252 PARAMETERS
253
254
255
256 .. flat-table::
257 :header-rows: 0
258 :stub-columns: 0
259
260
261 - .. row 1
262
263 - int fd
264
265 - File descriptor returned by a previous call to open().
266
267 - .. row 2
268
269 - int request
270
271 - Equals VIDEO_STOP for this command.
272
273 - .. row 3
274
275 - Boolean mode
276
277 - Indicates how the screen shall be handled.
278
279 - .. row 4
280
281 -
282 - TRUE: Blank screen when stop.
283
284 - .. row 5
285
286 -
287 - FALSE: Show last decoded frame.
288
289
290 RETURN VALUE
291
292 On success 0 is returned, on error -1 and the ``errno`` variable is set
293 appropriately. The generic error codes are described at the
294 :ref:`Generic Error Codes <gen-errors>` chapter.
295
296
297 .. _VIDEO_PLAY:
298
299 VIDEO_PLAY
300 ==========
301
302 DESCRIPTION
303
304 This ioctl is for DVB devices only. To control a V4L2 decoder use the
305 V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
306
307 This ioctl call asks the Video Device to start playing a video stream
308 from the selected source.
309
310 SYNOPSIS
311
312 int ioctl(fd, int request = VIDEO_PLAY);
313
314 PARAMETERS
315
316
317
318 .. flat-table::
319 :header-rows: 0
320 :stub-columns: 0
321
322
323 - .. row 1
324
325 - int fd
326
327 - File descriptor returned by a previous call to open().
328
329 - .. row 2
330
331 - int request
332
333 - Equals VIDEO_PLAY for this command.
334
335
336 RETURN VALUE
337
338 On success 0 is returned, on error -1 and the ``errno`` variable is set
339 appropriately. The generic error codes are described at the
340 :ref:`Generic Error Codes <gen-errors>` chapter.
341
342
343 .. _VIDEO_FREEZE:
344
345 VIDEO_FREEZE
346 ============
347
348 DESCRIPTION
349
350 This ioctl is for DVB devices only. To control a V4L2 decoder use the
351 V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
352
353 This ioctl call suspends the live video stream being played. Decoding
354 and playing are frozen. It is then possible to restart the decoding and
355 playing process of the video stream using the VIDEO_CONTINUE command.
356 If VIDEO_SOURCE_MEMORY is selected in the ioctl call
357 VIDEO_SELECT_SOURCE, the DVB subsystem will not decode any more data
358 until the ioctl call VIDEO_CONTINUE or VIDEO_PLAY is performed.
359
360 SYNOPSIS
361
362 int ioctl(fd, int request = VIDEO_FREEZE);
363
364 PARAMETERS
365
366
367
368 .. flat-table::
369 :header-rows: 0
370 :stub-columns: 0
371
372
373 - .. row 1
374
375 - int fd
376
377 - File descriptor returned by a previous call to open().
378
379 - .. row 2
380
381 - int request
382
383 - Equals VIDEO_FREEZE for this command.
384
385
386 RETURN VALUE
387
388 On success 0 is returned, on error -1 and the ``errno`` variable is set
389 appropriately. The generic error codes are described at the
390 :ref:`Generic Error Codes <gen-errors>` chapter.
391
392
393 .. _VIDEO_CONTINUE:
394
395 VIDEO_CONTINUE
396 ==============
397
398 DESCRIPTION
399
400 This ioctl is for DVB devices only. To control a V4L2 decoder use the
401 V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
402
403 This ioctl call restarts decoding and playing processes of the video
404 stream which was played before a call to VIDEO_FREEZE was made.
405
406 SYNOPSIS
407
408 int ioctl(fd, int request = VIDEO_CONTINUE);
409
410 PARAMETERS
411
412
413
414 .. flat-table::
415 :header-rows: 0
416 :stub-columns: 0
417
418
419 - .. row 1
420
421 - int fd
422
423 - File descriptor returned by a previous call to open().
424
425 - .. row 2
426
427 - int request
428
429 - Equals VIDEO_CONTINUE for this command.
430
431
432 RETURN VALUE
433
434 On success 0 is returned, on error -1 and the ``errno`` variable is set
435 appropriately. The generic error codes are described at the
436 :ref:`Generic Error Codes <gen-errors>` chapter.
437
438
439 .. _VIDEO_SELECT_SOURCE:
440
441 VIDEO_SELECT_SOURCE
442 ===================
443
444 DESCRIPTION
445
446 This ioctl is for DVB devices only. This ioctl was also supported by the
447 V4L2 ivtv driver, but that has been replaced by the ivtv-specific
448 ``IVTV_IOC_PASSTHROUGH_MODE`` ioctl.
449
450 This ioctl call informs the video device which source shall be used for
451 the input data. The possible sources are demux or memory. If memory is
452 selected, the data is fed to the video device through the write command.
453
454 SYNOPSIS
455
456 int ioctl(fd, int request = VIDEO_SELECT_SOURCE,
457 video_stream_source_t source);
458
459 PARAMETERS
460
461
462
463 .. flat-table::
464 :header-rows: 0
465 :stub-columns: 0
466
467
468 - .. row 1
469
470 - int fd
471
472 - File descriptor returned by a previous call to open().
473
474 - .. row 2
475
476 - int request
477
478 - Equals VIDEO_SELECT_SOURCE for this command.
479
480 - .. row 3
481
482 - video_stream_source_t source
483
484 - Indicates which source shall be used for the Video stream.
485
486
487 RETURN VALUE
488
489 On success 0 is returned, on error -1 and the ``errno`` variable is set
490 appropriately. The generic error codes are described at the
491 :ref:`Generic Error Codes <gen-errors>` chapter.
492
493
494 .. _VIDEO_SET_BLANK:
495
496 VIDEO_SET_BLANK
497 ===============
498
499 DESCRIPTION
500
501 This ioctl call asks the Video Device to blank out the picture.
502
503 SYNOPSIS
504
505 int ioctl(fd, int request = VIDEO_SET_BLANK, boolean mode);
506
507 PARAMETERS
508
509
510
511 .. flat-table::
512 :header-rows: 0
513 :stub-columns: 0
514
515
516 - .. row 1
517
518 - int fd
519
520 - File descriptor returned by a previous call to open().
521
522 - .. row 2
523
524 - int request
525
526 - Equals VIDEO_SET_BLANK for this command.
527
528 - .. row 3
529
530 - boolean mode
531
532 - TRUE: Blank screen when stop.
533
534 - .. row 4
535
536 -
537 - FALSE: Show last decoded frame.
538
539
540 RETURN VALUE
541
542 On success 0 is returned, on error -1 and the ``errno`` variable is set
543 appropriately. The generic error codes are described at the
544 :ref:`Generic Error Codes <gen-errors>` chapter.
545
546
547 .. _VIDEO_GET_STATUS:
548
549 VIDEO_GET_STATUS
550 ================
551
552 DESCRIPTION
553
554 This ioctl call asks the Video Device to return the current status of
555 the device.
556
557 SYNOPSIS
558
559 int ioctl(fd, int request = VIDEO_GET_STATUS, struct video_status
560 *status);
561
562 PARAMETERS
563
564
565
566 .. flat-table::
567 :header-rows: 0
568 :stub-columns: 0
569
570
571 - .. row 1
572
573 - int fd
574
575 - File descriptor returned by a previous call to open().
576
577 - .. row 2
578
579 - int request
580
581 - Equals VIDEO_GET_STATUS for this command.
582
583 - .. row 3
584
585 - struct video_status *status
586
587 - Returns the current status of the Video Device.
588
589
590 RETURN VALUE
591
592 On success 0 is returned, on error -1 and the ``errno`` variable is set
593 appropriately. The generic error codes are described at the
594 :ref:`Generic Error Codes <gen-errors>` chapter.
595
596
597 .. _VIDEO_GET_FRAME_COUNT:
598
599 VIDEO_GET_FRAME_COUNT
600 =====================
601
602 DESCRIPTION
603
604 This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
605 this ioctl has been replaced by the ``V4L2_CID_MPEG_VIDEO_DEC_FRAME``
606 control.
607
608 This ioctl call asks the Video Device to return the number of displayed
609 frames since the decoder was started.
610
611 SYNOPSIS
612
613 int ioctl(int fd, int request = VIDEO_GET_FRAME_COUNT, __u64 *pts);
614
615 PARAMETERS
616
617
618
619 .. flat-table::
620 :header-rows: 0
621 :stub-columns: 0
622
623
624 - .. row 1
625
626 - int fd
627
628 - File descriptor returned by a previous call to open().
629
630 - .. row 2
631
632 - int request
633
634 - Equals VIDEO_GET_FRAME_COUNT for this command.
635
636 - .. row 3
637
638 - __u64 *pts
639
640 - Returns the number of frames displayed since the decoder was
641 started.
642
643
644 RETURN VALUE
645
646 On success 0 is returned, on error -1 and the ``errno`` variable is set
647 appropriately. The generic error codes are described at the
648 :ref:`Generic Error Codes <gen-errors>` chapter.
649
650
651 .. _VIDEO_GET_PTS:
652
653 VIDEO_GET_PTS
654 =============
655
656 DESCRIPTION
657
658 This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
659 this ioctl has been replaced by the ``V4L2_CID_MPEG_VIDEO_DEC_PTS``
660 control.
661
662 This ioctl call asks the Video Device to return the current PTS
663 timestamp.
664
665 SYNOPSIS
666
667 int ioctl(int fd, int request = VIDEO_GET_PTS, __u64 *pts);
668
669 PARAMETERS
670
671
672
673 .. flat-table::
674 :header-rows: 0
675 :stub-columns: 0
676
677
678 - .. row 1
679
680 - int fd
681
682 - File descriptor returned by a previous call to open().
683
684 - .. row 2
685
686 - int request
687
688 - Equals VIDEO_GET_PTS for this command.
689
690 - .. row 3
691
692 - __u64 *pts
693
694 - Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 /
695 ISO/IEC 13818-1.
696
697 The PTS should belong to the currently played frame if possible,
698 but may also be a value close to it like the PTS of the last
699 decoded frame or the last PTS extracted by the PES parser.
700
701
702 RETURN VALUE
703
704 On success 0 is returned, on error -1 and the ``errno`` variable is set
705 appropriately. The generic error codes are described at the
706 :ref:`Generic Error Codes <gen-errors>` chapter.
707
708
709 .. _VIDEO_GET_FRAME_RATE:
710
711 VIDEO_GET_FRAME_RATE
712 ====================
713
714 DESCRIPTION
715
716 This ioctl call asks the Video Device to return the current framerate.
717
718 SYNOPSIS
719
720 int ioctl(int fd, int request = VIDEO_GET_FRAME_RATE, unsigned int
721 *rate);
722
723 PARAMETERS
724
725
726
727 .. flat-table::
728 :header-rows: 0
729 :stub-columns: 0
730
731
732 - .. row 1
733
734 - int fd
735
736 - File descriptor returned by a previous call to open().
737
738 - .. row 2
739
740 - int request
741
742 - Equals VIDEO_GET_FRAME_RATE for this command.
743
744 - .. row 3
745
746 - unsigned int *rate
747
748 - Returns the framerate in number of frames per 1000 seconds.
749
750
751 RETURN VALUE
752
753 On success 0 is returned, on error -1 and the ``errno`` variable is set
754 appropriately. The generic error codes are described at the
755 :ref:`Generic Error Codes <gen-errors>` chapter.
756
757
758 .. _VIDEO_GET_EVENT:
759
760 VIDEO_GET_EVENT
761 ===============
762
763 DESCRIPTION
764
765 This ioctl is for DVB devices only. To get events from a V4L2 decoder
766 use the V4L2 :ref:`VIDIOC_DQEVENT` ioctl instead.
767
768 This ioctl call returns an event of type video_event if available. If
769 an event is not available, the behavior depends on whether the device is
770 in blocking or non-blocking mode. In the latter case, the call fails
771 immediately with errno set to EWOULDBLOCK. In the former case, the call
772 blocks until an event becomes available. The standard Linux poll()
773 and/or select() system calls can be used with the device file descriptor
774 to watch for new events. For select(), the file descriptor should be
775 included in the exceptfds argument, and for poll(), POLLPRI should be
776 specified as the wake-up condition. Read-only permissions are sufficient
777 for this ioctl call.
778
779 SYNOPSIS
780
781 int ioctl(fd, int request = VIDEO_GET_EVENT, struct video_event *ev);
782
783 PARAMETERS
784
785
786
787 .. flat-table::
788 :header-rows: 0
789 :stub-columns: 0
790
791
792 - .. row 1
793
794 - int fd
795
796 - File descriptor returned by a previous call to open().
797
798 - .. row 2
799
800 - int request
801
802 - Equals VIDEO_GET_EVENT for this command.
803
804 - .. row 3
805
806 - struct video_event *ev
807
808 - Points to the location where the event, if any, is to be stored.
809
810
811 RETURN VALUE
812
813 On success 0 is returned, on error -1 and the ``errno`` variable is set
814 appropriately. The generic error codes are described at the
815 :ref:`Generic Error Codes <gen-errors>` chapter.
816
817
818
819 .. flat-table::
820 :header-rows: 0
821 :stub-columns: 0
822
823
824 - .. row 1
825
826 - EWOULDBLOCK
827
828 - There is no event pending, and the device is in non-blocking mode.
829
830 - .. row 2
831
832 - EOVERFLOW
833
834 - Overflow in event queue - one or more events were lost.
835
836
837
838 .. _VIDEO_COMMAND:
839
840 VIDEO_COMMAND
841 =============
842
843 DESCRIPTION
844
845 This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
846 this ioctl has been replaced by the
847 :ref:`VIDIOC_DECODER_CMD` ioctl.
848
849 This ioctl commands the decoder. The ``video_command`` struct is a
850 subset of the ``v4l2_decoder_cmd`` struct, so refer to the
851 :ref:`VIDIOC_DECODER_CMD` documentation for
852 more information.
853
854 SYNOPSIS
855
856 int ioctl(int fd, int request = VIDEO_COMMAND, struct video_command
857 *cmd);
858
859 PARAMETERS
860
861
862
863 .. flat-table::
864 :header-rows: 0
865 :stub-columns: 0
866
867
868 - .. row 1
869
870 - int fd
871
872 - File descriptor returned by a previous call to open().
873
874 - .. row 2
875
876 - int request
877
878 - Equals VIDEO_COMMAND for this command.
879
880 - .. row 3
881
882 - struct video_command *cmd
883
884 - Commands the decoder.
885
886
887 RETURN VALUE
888
889 On success 0 is returned, on error -1 and the ``errno`` variable is set
890 appropriately. The generic error codes are described at the
891 :ref:`Generic Error Codes <gen-errors>` chapter.
892
893
894 .. _VIDEO_TRY_COMMAND:
895
896 VIDEO_TRY_COMMAND
897 =================
898
899 DESCRIPTION
900
901 This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
902 this ioctl has been replaced by the
903 :ref:`VIDIOC_TRY_DECODER_CMD <VIDIOC_DECODER_CMD>` ioctl.
904
905 This ioctl tries a decoder command. The ``video_command`` struct is a
906 subset of the ``v4l2_decoder_cmd`` struct, so refer to the
907 :ref:`VIDIOC_TRY_DECODER_CMD <VIDIOC_DECODER_CMD>` documentation
908 for more information.
909
910 SYNOPSIS
911
912 int ioctl(int fd, int request = VIDEO_TRY_COMMAND, struct
913 video_command *cmd);
914
915 PARAMETERS
916
917
918
919 .. flat-table::
920 :header-rows: 0
921 :stub-columns: 0
922
923
924 - .. row 1
925
926 - int fd
927
928 - File descriptor returned by a previous call to open().
929
930 - .. row 2
931
932 - int request
933
934 - Equals VIDEO_TRY_COMMAND for this command.
935
936 - .. row 3
937
938 - struct video_command *cmd
939
940 - Try a decoder command.
941
942
943 RETURN VALUE
944
945 On success 0 is returned, on error -1 and the ``errno`` variable is set
946 appropriately. The generic error codes are described at the
947 :ref:`Generic Error Codes <gen-errors>` chapter.
948
949
950 .. _VIDEO_GET_SIZE:
951
952 VIDEO_GET_SIZE
953 ==============
954
955 DESCRIPTION
956
957 This ioctl returns the size and aspect ratio.
958
959 SYNOPSIS
960
961 int ioctl(int fd, int request = VIDEO_GET_SIZE, video_size_t *size);
962
963 PARAMETERS
964
965
966
967 .. flat-table::
968 :header-rows: 0
969 :stub-columns: 0
970
971
972 - .. row 1
973
974 - int fd
975
976 - File descriptor returned by a previous call to open().
977
978 - .. row 2
979
980 - int request
981
982 - Equals VIDEO_GET_SIZE for this command.
983
984 - .. row 3
985
986 - video_size_t *size
987
988 - Returns the size and aspect ratio.
989
990
991 RETURN VALUE
992
993 On success 0 is returned, on error -1 and the ``errno`` variable is set
994 appropriately. The generic error codes are described at the
995 :ref:`Generic Error Codes <gen-errors>` chapter.
996
997
998 .. _VIDEO_SET_DISPLAY_FORMAT:
999
1000 VIDEO_SET_DISPLAY_FORMAT
1001 ========================
1002
1003 DESCRIPTION
1004
1005 This ioctl call asks the Video Device to select the video format to be
1006 applied by the MPEG chip on the video.
1007
1008 SYNOPSIS
1009
1010 int ioctl(fd, int request = VIDEO_SET_DISPLAY_FORMAT,
1011 video_display_format_t format);
1012
1013 PARAMETERS
1014
1015
1016
1017 .. flat-table::
1018 :header-rows: 0
1019 :stub-columns: 0
1020
1021
1022 - .. row 1
1023
1024 - int fd
1025
1026 - File descriptor returned by a previous call to open().
1027
1028 - .. row 2
1029
1030 - int request
1031
1032 - Equals VIDEO_SET_DISPLAY_FORMAT for this command.
1033
1034 - .. row 3
1035
1036 - video_display_format_t format
1037
1038 - Selects the video format to be used.
1039
1040
1041 RETURN VALUE
1042
1043 On success 0 is returned, on error -1 and the ``errno`` variable is set
1044 appropriately. The generic error codes are described at the
1045 :ref:`Generic Error Codes <gen-errors>` chapter.
1046
1047
1048 .. _VIDEO_STILLPICTURE:
1049
1050 VIDEO_STILLPICTURE
1051 ==================
1052
1053 DESCRIPTION
1054
1055 This ioctl call asks the Video Device to display a still picture
1056 (I-frame). The input data shall contain an I-frame. If the pointer is
1057 NULL, then the current displayed still picture is blanked.
1058
1059 SYNOPSIS
1060
1061 int ioctl(fd, int request = VIDEO_STILLPICTURE, struct
1062 video_still_picture *sp);
1063
1064 PARAMETERS
1065
1066
1067
1068 .. flat-table::
1069 :header-rows: 0
1070 :stub-columns: 0
1071
1072
1073 - .. row 1
1074
1075 - int fd
1076
1077 - File descriptor returned by a previous call to open().
1078
1079 - .. row 2
1080
1081 - int request
1082
1083 - Equals VIDEO_STILLPICTURE for this command.
1084
1085 - .. row 3
1086
1087 - struct video_still_picture *sp
1088
1089 - Pointer to a location where an I-frame and size is stored.
1090
1091
1092 RETURN VALUE
1093
1094 On success 0 is returned, on error -1 and the ``errno`` variable is set
1095 appropriately. The generic error codes are described at the
1096 :ref:`Generic Error Codes <gen-errors>` chapter.
1097
1098
1099 .. _VIDEO_FAST_FORWARD:
1100
1101 VIDEO_FAST_FORWARD
1102 ==================
1103
1104 DESCRIPTION
1105
1106 This ioctl call asks the Video Device to skip decoding of N number of
1107 I-frames. This call can only be used if VIDEO_SOURCE_MEMORY is
1108 selected.
1109
1110 SYNOPSIS
1111
1112 int ioctl(fd, int request = VIDEO_FAST_FORWARD, int nFrames);
1113
1114 PARAMETERS
1115
1116
1117
1118 .. flat-table::
1119 :header-rows: 0
1120 :stub-columns: 0
1121
1122
1123 - .. row 1
1124
1125 - int fd
1126
1127 - File descriptor returned by a previous call to open().
1128
1129 - .. row 2
1130
1131 - int request
1132
1133 - Equals VIDEO_FAST_FORWARD for this command.
1134
1135 - .. row 3
1136
1137 - int nFrames
1138
1139 - The number of frames to skip.
1140
1141
1142 RETURN VALUE
1143
1144 On success 0 is returned, on error -1 and the ``errno`` variable is set
1145 appropriately. The generic error codes are described at the
1146 :ref:`Generic Error Codes <gen-errors>` chapter.
1147
1148
1149
1150 .. flat-table::
1151 :header-rows: 0
1152 :stub-columns: 0
1153
1154
1155 - .. row 1
1156
1157 - EPERM
1158
1159 - Mode VIDEO_SOURCE_MEMORY not selected.
1160
1161
1162
1163 .. _VIDEO_SLOWMOTION:
1164
1165 VIDEO_SLOWMOTION
1166 ================
1167
1168 DESCRIPTION
1169
1170 This ioctl call asks the video device to repeat decoding frames N number
1171 of times. This call can only be used if VIDEO_SOURCE_MEMORY is
1172 selected.
1173
1174 SYNOPSIS
1175
1176 int ioctl(fd, int request = VIDEO_SLOWMOTION, int nFrames);
1177
1178 PARAMETERS
1179
1180
1181
1182 .. flat-table::
1183 :header-rows: 0
1184 :stub-columns: 0
1185
1186
1187 - .. row 1
1188
1189 - int fd
1190
1191 - File descriptor returned by a previous call to open().
1192
1193 - .. row 2
1194
1195 - int request
1196
1197 - Equals VIDEO_SLOWMOTION for this command.
1198
1199 - .. row 3
1200
1201 - int nFrames
1202
1203 - The number of times to repeat each frame.
1204
1205
1206 RETURN VALUE
1207
1208 On success 0 is returned, on error -1 and the ``errno`` variable is set
1209 appropriately. The generic error codes are described at the
1210 :ref:`Generic Error Codes <gen-errors>` chapter.
1211
1212
1213
1214 .. flat-table::
1215 :header-rows: 0
1216 :stub-columns: 0
1217
1218
1219 - .. row 1
1220
1221 - EPERM
1222
1223 - Mode VIDEO_SOURCE_MEMORY not selected.
1224
1225
1226
1227 .. _VIDEO_GET_CAPABILITIES:
1228
1229 VIDEO_GET_CAPABILITIES
1230 ======================
1231
1232 DESCRIPTION
1233
1234 This ioctl call asks the video device about its decoding capabilities.
1235 On success it returns and integer which has bits set according to the
1236 defines in section ??.
1237
1238 SYNOPSIS
1239
1240 int ioctl(fd, int request = VIDEO_GET_CAPABILITIES, unsigned int
1241 *cap);
1242
1243 PARAMETERS
1244
1245
1246
1247 .. flat-table::
1248 :header-rows: 0
1249 :stub-columns: 0
1250
1251
1252 - .. row 1
1253
1254 - int fd
1255
1256 - File descriptor returned by a previous call to open().
1257
1258 - .. row 2
1259
1260 - int request
1261
1262 - Equals VIDEO_GET_CAPABILITIES for this command.
1263
1264 - .. row 3
1265
1266 - unsigned int *cap
1267
1268 - Pointer to a location where to store the capability information.
1269
1270
1271 RETURN VALUE
1272
1273 On success 0 is returned, on error -1 and the ``errno`` variable is set
1274 appropriately. The generic error codes are described at the
1275 :ref:`Generic Error Codes <gen-errors>` chapter.
1276
1277
1278 .. _VIDEO_SET_ID:
1279
1280 VIDEO_SET_ID
1281 ============
1282
1283 DESCRIPTION
1284
1285 This ioctl selects which sub-stream is to be decoded if a program or
1286 system stream is sent to the video device.
1287
1288 SYNOPSIS
1289
1290 int ioctl(int fd, int request = VIDEO_SET_ID, int id);
1291
1292 PARAMETERS
1293
1294
1295
1296 .. flat-table::
1297 :header-rows: 0
1298 :stub-columns: 0
1299
1300
1301 - .. row 1
1302
1303 - int fd
1304
1305 - File descriptor returned by a previous call to open().
1306
1307 - .. row 2
1308
1309 - int request
1310
1311 - Equals VIDEO_SET_ID for this command.
1312
1313 - .. row 3
1314
1315 - int id
1316
1317 - video sub-stream id
1318
1319
1320 RETURN VALUE
1321
1322 On success 0 is returned, on error -1 and the ``errno`` variable is set
1323 appropriately. The generic error codes are described at the
1324 :ref:`Generic Error Codes <gen-errors>` chapter.
1325
1326
1327
1328 .. flat-table::
1329 :header-rows: 0
1330 :stub-columns: 0
1331
1332
1333 - .. row 1
1334
1335 - EINVAL
1336
1337 - Invalid sub-stream id.
1338
1339
1340
1341 .. _VIDEO_CLEAR_BUFFER:
1342
1343 VIDEO_CLEAR_BUFFER
1344 ==================
1345
1346 DESCRIPTION
1347
1348 This ioctl call clears all video buffers in the driver and in the
1349 decoder hardware.
1350
1351 SYNOPSIS
1352
1353 int ioctl(fd, int request = VIDEO_CLEAR_BUFFER);
1354
1355 PARAMETERS
1356
1357
1358
1359 .. flat-table::
1360 :header-rows: 0
1361 :stub-columns: 0
1362
1363
1364 - .. row 1
1365
1366 - int fd
1367
1368 - File descriptor returned by a previous call to open().
1369
1370 - .. row 2
1371
1372 - int request
1373
1374 - Equals VIDEO_CLEAR_BUFFER for this command.
1375
1376
1377 RETURN VALUE
1378
1379 On success 0 is returned, on error -1 and the ``errno`` variable is set
1380 appropriately. The generic error codes are described at the
1381 :ref:`Generic Error Codes <gen-errors>` chapter.
1382
1383
1384 .. _VIDEO_SET_STREAMTYPE:
1385
1386 VIDEO_SET_STREAMTYPE
1387 ====================
1388
1389 DESCRIPTION
1390
1391 This ioctl tells the driver which kind of stream to expect being written
1392 to it. If this call is not used the default of video PES is used. Some
1393 drivers might not support this call and always expect PES.
1394
1395 SYNOPSIS
1396
1397 int ioctl(fd, int request = VIDEO_SET_STREAMTYPE, int type);
1398
1399 PARAMETERS
1400
1401
1402
1403 .. flat-table::
1404 :header-rows: 0
1405 :stub-columns: 0
1406
1407
1408 - .. row 1
1409
1410 - int fd
1411
1412 - File descriptor returned by a previous call to open().
1413
1414 - .. row 2
1415
1416 - int request
1417
1418 - Equals VIDEO_SET_STREAMTYPE for this command.
1419
1420 - .. row 3
1421
1422 - int type
1423
1424 - stream type
1425
1426
1427 RETURN VALUE
1428
1429 On success 0 is returned, on error -1 and the ``errno`` variable is set
1430 appropriately. The generic error codes are described at the
1431 :ref:`Generic Error Codes <gen-errors>` chapter.
1432
1433
1434 .. _VIDEO_SET_FORMAT:
1435
1436 VIDEO_SET_FORMAT
1437 ================
1438
1439 DESCRIPTION
1440
1441 This ioctl sets the screen format (aspect ratio) of the connected output
1442 device (TV) so that the output of the decoder can be adjusted
1443 accordingly.
1444
1445 SYNOPSIS
1446
1447 int ioctl(fd, int request = VIDEO_SET_FORMAT, video_format_t
1448 format);
1449
1450 PARAMETERS
1451
1452
1453
1454 .. flat-table::
1455 :header-rows: 0
1456 :stub-columns: 0
1457
1458
1459 - .. row 1
1460
1461 - int fd
1462
1463 - File descriptor returned by a previous call to open().
1464
1465 - .. row 2
1466
1467 - int request
1468
1469 - Equals VIDEO_SET_FORMAT for this command.
1470
1471 - .. row 3
1472
1473 - video_format_t format
1474
1475 - video format of TV as defined in section ??.
1476
1477
1478 RETURN VALUE
1479
1480 On success 0 is returned, on error -1 and the ``errno`` variable is set
1481 appropriately. The generic error codes are described at the
1482 :ref:`Generic Error Codes <gen-errors>` chapter.
1483
1484
1485
1486 .. flat-table::
1487 :header-rows: 0
1488 :stub-columns: 0
1489
1490
1491 - .. row 1
1492
1493 - EINVAL
1494
1495 - format is not a valid video format.
1496
1497
1498
1499 .. _VIDEO_SET_SYSTEM:
1500
1501 VIDEO_SET_SYSTEM
1502 ================
1503
1504 DESCRIPTION
1505
1506 This ioctl sets the television output format. The format (see section
1507 ??) may vary from the color format of the displayed MPEG stream. If the
1508 hardware is not able to display the requested format the call will
1509 return an error.
1510
1511 SYNOPSIS
1512
1513 int ioctl(fd, int request = VIDEO_SET_SYSTEM , video_system_t
1514 system);
1515
1516 PARAMETERS
1517
1518
1519
1520 .. flat-table::
1521 :header-rows: 0
1522 :stub-columns: 0
1523
1524
1525 - .. row 1
1526
1527 - int fd
1528
1529 - File descriptor returned by a previous call to open().
1530
1531 - .. row 2
1532
1533 - int request
1534
1535 - Equals VIDEO_SET_FORMAT for this command.
1536
1537 - .. row 3
1538
1539 - video_system_t system
1540
1541 - video system of TV output.
1542
1543
1544 RETURN VALUE
1545
1546 On success 0 is returned, on error -1 and the ``errno`` variable is set
1547 appropriately. The generic error codes are described at the
1548 :ref:`Generic Error Codes <gen-errors>` chapter.
1549
1550
1551
1552 .. flat-table::
1553 :header-rows: 0
1554 :stub-columns: 0
1555
1556
1557 - .. row 1
1558
1559 - EINVAL
1560
1561 - system is not a valid or supported video system.
1562
1563
1564
1565 .. _VIDEO_SET_HIGHLIGHT:
1566
1567 VIDEO_SET_HIGHLIGHT
1568 ===================
1569
1570 DESCRIPTION
1571
1572 This ioctl sets the SPU highlight information for the menu access of a
1573 DVD.
1574
1575 SYNOPSIS
1576
1577 int ioctl(fd, int request = VIDEO_SET_HIGHLIGHT ,video_highlight_t
1578 *vhilite)
1579
1580 PARAMETERS
1581
1582
1583
1584 .. flat-table::
1585 :header-rows: 0
1586 :stub-columns: 0
1587
1588
1589 - .. row 1
1590
1591 - int fd
1592
1593 - File descriptor returned by a previous call to open().
1594
1595 - .. row 2
1596
1597 - int request
1598
1599 - Equals VIDEO_SET_HIGHLIGHT for this command.
1600
1601 - .. row 3
1602
1603 - video_highlight_t *vhilite
1604
1605 - SPU Highlight information according to section ??.
1606
1607
1608 RETURN VALUE
1609
1610 On success 0 is returned, on error -1 and the ``errno`` variable is set
1611 appropriately. The generic error codes are described at the
1612 :ref:`Generic Error Codes <gen-errors>` chapter.
1613
1614
1615 .. _VIDEO_SET_SPU:
1616
1617 VIDEO_SET_SPU
1618 =============
1619
1620 DESCRIPTION
1621
1622 This ioctl activates or deactivates SPU decoding in a DVD input stream.
1623 It can only be used, if the driver is able to handle a DVD stream.
1624
1625 SYNOPSIS
1626
1627 int ioctl(fd, int request = VIDEO_SET_SPU , video_spu_t *spu)
1628
1629 PARAMETERS
1630
1631
1632
1633 .. flat-table::
1634 :header-rows: 0
1635 :stub-columns: 0
1636
1637
1638 - .. row 1
1639
1640 - int fd
1641
1642 - File descriptor returned by a previous call to open().
1643
1644 - .. row 2
1645
1646 - int request
1647
1648 - Equals VIDEO_SET_SPU for this command.
1649
1650 - .. row 3
1651
1652 - video_spu_t *spu
1653
1654 - SPU decoding (de)activation and subid setting according to section
1655 ??.
1656
1657
1658 RETURN VALUE
1659
1660 On success 0 is returned, on error -1 and the ``errno`` variable is set
1661 appropriately. The generic error codes are described at the
1662 :ref:`Generic Error Codes <gen-errors>` chapter.
1663
1664
1665
1666 .. flat-table::
1667 :header-rows: 0
1668 :stub-columns: 0
1669
1670
1671 - .. row 1
1672
1673 - EINVAL
1674
1675 - input is not a valid spu setting or driver cannot handle SPU.
1676
1677
1678
1679 .. _VIDEO_SET_SPU_PALETTE:
1680
1681 VIDEO_SET_SPU_PALETTE
1682 =====================
1683
1684 DESCRIPTION
1685
1686 This ioctl sets the SPU color palette.
1687
1688 SYNOPSIS
1689
1690 int ioctl(fd, int request = VIDEO_SET_SPU_PALETTE
1691 ,video_spu_palette_t *palette )
1692
1693 PARAMETERS
1694
1695
1696
1697 .. flat-table::
1698 :header-rows: 0
1699 :stub-columns: 0
1700
1701
1702 - .. row 1
1703
1704 - int fd
1705
1706 - File descriptor returned by a previous call to open().
1707
1708 - .. row 2
1709
1710 - int request
1711
1712 - Equals VIDEO_SET_SPU_PALETTE for this command.
1713
1714 - .. row 3
1715
1716 - video_spu_palette_t *palette
1717
1718 - SPU palette according to section ??.
1719
1720
1721 RETURN VALUE
1722
1723 On success 0 is returned, on error -1 and the ``errno`` variable is set
1724 appropriately. The generic error codes are described at the
1725 :ref:`Generic Error Codes <gen-errors>` chapter.
1726
1727
1728
1729 .. flat-table::
1730 :header-rows: 0
1731 :stub-columns: 0
1732
1733
1734 - .. row 1
1735
1736 - EINVAL
1737
1738 - input is not a valid palette or driver doesn’t handle SPU.
1739
1740
1741
1742 .. _VIDEO_GET_NAVI:
1743
1744 VIDEO_GET_NAVI
1745 ==============
1746
1747 DESCRIPTION
1748
1749 This ioctl returns navigational information from the DVD stream. This is
1750 especially needed if an encoded stream has to be decoded by the
1751 hardware.
1752
1753 SYNOPSIS
1754
1755 int ioctl(fd, int request = VIDEO_GET_NAVI , video_navi_pack_t
1756 *navipack)
1757
1758 PARAMETERS
1759
1760
1761
1762 .. flat-table::
1763 :header-rows: 0
1764 :stub-columns: 0
1765
1766
1767 - .. row 1
1768
1769 - int fd
1770
1771 - File descriptor returned by a previous call to open().
1772
1773 - .. row 2
1774
1775 - int request
1776
1777 - Equals VIDEO_GET_NAVI for this command.
1778
1779 - .. row 3
1780
1781 - video_navi_pack_t *navipack
1782
1783 - PCI or DSI pack (private stream 2) according to section ??.
1784
1785
1786 RETURN VALUE
1787
1788 On success 0 is returned, on error -1 and the ``errno`` variable is set
1789 appropriately. The generic error codes are described at the
1790 :ref:`Generic Error Codes <gen-errors>` chapter.
1791
1792
1793
1794 .. flat-table::
1795 :header-rows: 0
1796 :stub-columns: 0
1797
1798
1799 - .. row 1
1800
1801 - EFAULT
1802
1803 - driver is not able to return navigational information
1804
1805
1806
1807 .. _VIDEO_SET_ATTRIBUTES:
1808
1809 VIDEO_SET_ATTRIBUTES
1810 ====================
1811
1812 DESCRIPTION
1813
1814 This ioctl is intended for DVD playback and allows you to set certain
1815 information about the stream. Some hardware may not need this
1816 information, but the call also tells the hardware to prepare for DVD
1817 playback.
1818
1819 SYNOPSIS
1820
1821 int ioctl(fd, int request = VIDEO_SET_ATTRIBUTE ,video_attributes_t
1822 vattr)
1823
1824 PARAMETERS
1825
1826
1827
1828 .. flat-table::
1829 :header-rows: 0
1830 :stub-columns: 0
1831
1832
1833 - .. row 1
1834
1835 - int fd
1836
1837 - File descriptor returned by a previous call to open().
1838
1839 - .. row 2
1840
1841 - int request
1842
1843 - Equals VIDEO_SET_ATTRIBUTE for this command.
1844
1845 - .. row 3
1846
1847 - video_attributes_t vattr
1848
1849 - video attributes according to section ??.
1850
1851
1852 RETURN VALUE
1853
1854 On success 0 is returned, on error -1 and the ``errno`` variable is set
1855 appropriately. The generic error codes are described at the
1856 :ref:`Generic Error Codes <gen-errors>` chapter.
1857
1858
1859
1860 .. flat-table::
1861 :header-rows: 0
1862 :stub-columns: 0
1863
1864
1865 - .. row 1
1866
1867 - EINVAL
1868
1869 - input is not a valid attribute setting.
1870
1871
1872
1873
1874 .. ------------------------------------------------------------------------------
1875 .. This file was automatically converted from DocBook-XML with the dbxml
1876 .. library (https://github.com/return42/sphkerneldoc). The origin XML comes
1877 .. from the linux kernel, refer to:
1878 ..
1879 .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
1880 .. ------------------------------------------------------------------------------
This page took 0.109642 seconds and 5 git commands to generate.