1 <title>DVB Video Device</title>
2 <para>The DVB video device controls the MPEG2 video decoder of the DVB hardware. It
3 can be accessed through <emphasis role="tt">/dev/dvb/adapter0/video0</emphasis>. Data types and and
4 ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/video.h</emphasis> in your
7 <para>Note that the DVB video device only controls decoding of the MPEG video stream, not
8 its presentation on the TV or computer screen. On PCs this is typically handled by an
9 associated video4linux device, e.g. <emphasis role="tt">/dev/video</emphasis>, which allows scaling and defining output
12 <para>Some DVB cards don’t have their own MPEG decoder, which results in the omission of
13 the audio and video device as well as the video4linux device.
15 <para>The ioctls that deal with SPUs (sub picture units) and navigation packets are only
16 supported on some MPEG decoders made for DVD playback.
19 These ioctls were also used by V4L2 to control MPEG decoders implemented in V4L2. The use
20 of these ioctls for that purpose has been made obsolete and proper V4L2 ioctls or controls
21 have been created to replace that functionality.</para>
22 <section id="video_types">
23 <title>Video Data Types</title>
25 <section id="video-format-t">
26 <title>video_format_t</title>
27 <para>The <emphasis role="tt">video_format_t</emphasis> data type defined by
31 VIDEO_FORMAT_4_3, /⋆ Select 4:3 format ⋆/
32 VIDEO_FORMAT_16_9, /⋆ Select 16:9 format. ⋆/
33 VIDEO_FORMAT_221_1 /⋆ 2.21:1 ⋆/
36 <para>is used in the VIDEO_SET_FORMAT function (??) to tell the driver which aspect ratio
37 the output hardware (e.g. TV) has. It is also used in the data structures video_status
38 (??) returned by VIDEO_GET_STATUS (??) and video_event (??) returned by
39 VIDEO_GET_EVENT (??) which report about the display format of the current video
44 <section id="video-displayformat-t">
45 <title>video_displayformat_t</title>
46 <para>In case the display format of the video stream and of the display hardware differ the
47 application has to specify how to handle the cropping of the picture. This can be done using
48 the VIDEO_SET_DISPLAY_FORMAT call (??) which accepts
52 VIDEO_PAN_SCAN, /⋆ use pan and scan format ⋆/
53 VIDEO_LETTER_BOX, /⋆ use letterbox format ⋆/
54 VIDEO_CENTER_CUT_OUT /⋆ use center cut out format ⋆/
55 } video_displayformat_t;
61 <section id="video-stream-source-t">
62 <title>video_stream_source_t</title>
63 <para>The video stream source is set through the VIDEO_SELECT_SOURCE call and can take
64 the following values, depending on whether we are replaying from an internal (demuxer) or
65 external (user write) source.
69 VIDEO_SOURCE_DEMUX, /⋆ Select the demux as the main source ⋆/
70 VIDEO_SOURCE_MEMORY /⋆ If this source is selected, the stream
71 comes from the user through the write
73 } video_stream_source_t;
75 <para>VIDEO_SOURCE_DEMUX selects the demultiplexer (fed either by the frontend or the
76 DVR device) as the source of the video stream. If VIDEO_SOURCE_MEMORY
77 is selected the stream comes from the application through the <emphasis role="tt">write()</emphasis> system
82 <section id="video-play-state-t">
83 <title>video_play_state_t</title>
84 <para>The following values can be returned by the VIDEO_GET_STATUS call representing the
85 state of video playback.
89 VIDEO_STOPPED, /⋆ Video is stopped ⋆/
90 VIDEO_PLAYING, /⋆ Video is currently playing ⋆/
91 VIDEO_FREEZED /⋆ Video is freezed ⋆/
96 <section id="video-command">
97 <title>struct video_command</title>
98 <para>The structure must be zeroed before use by the application
99 This ensures it can be extended safely in the future.</para>
101 struct video_command {
110 /⋆ 0 or 1000 specifies normal speed,
111 1 specifies forward single stepping,
112 -1 specifies backward single stepping,
113 >>1: playback at speed/1000 of the normal speed,
114 <-1: reverse playback at (-speed/1000) of the normal speed. ⋆/
127 <section id="video-size-t">
128 <title>video_size_t</title>
133 video_format_t aspect_ratio;
139 <section id="video-event">
140 <title>struct video_event</title>
141 <para>The following is the structure of a video event as it is returned by the VIDEO_GET_EVENT
147 #define VIDEO_EVENT_SIZE_CHANGED 1
148 #define VIDEO_EVENT_FRAME_RATE_CHANGED 2
149 #define VIDEO_EVENT_DECODER_STOPPED 3
150 #define VIDEO_EVENT_VSYNC 4
151 __kernel_time_t timestamp;
154 unsigned int frame_rate; /⋆ in frames per 1000sec ⋆/
155 unsigned char vsync_field; /⋆ unknown/odd/even/progressive ⋆/
161 <section id="video-status">
162 <title>struct video_status</title>
163 <para>The VIDEO_GET_STATUS call returns the following structure informing about various
164 states of the playback operation.
167 struct video_status {
168 int video_blank; /⋆ blank video on freeze? ⋆/
169 video_play_state_t play_state; /⋆ current state of playback ⋆/
170 video_stream_source_t stream_source; /⋆ current source (demux/memory) ⋆/
171 video_format_t video_format; /⋆ current aspect ratio of stream ⋆/
172 video_displayformat_t display_format;/⋆ selected cropping mode ⋆/
175 <para>If video_blank is set video will be blanked out if the channel is changed or if playback is
176 stopped. Otherwise, the last picture will be displayed. play_state indicates if the video is
177 currently frozen, stopped, or being played back. The stream_source corresponds to the seleted
178 source for the video stream. It can come either from the demultiplexer or from memory.
179 The video_format indicates the aspect ratio (one of 4:3 or 16:9) of the currently
180 played video stream. Finally, display_format corresponds to the selected cropping
181 mode in case the source video format is not the same as the format of the output
186 <section id="video-still-picture">
187 <title>struct video_still_picture</title>
188 <para>An I-frame displayed via the VIDEO_STILLPICTURE call is passed on within the
192 /⋆ pointer to and size of a single iframe in memory ⋆/
193 struct video_still_picture {
194 char ⋆iFrame; /⋆ pointer to a single iframe in memory ⋆/
200 <section id="video_caps">
201 <title>video capabilities</title>
202 <para>A call to VIDEO_GET_CAPABILITIES returns an unsigned integer with the following
203 bits set according to the hardwares capabilities.
206 /⋆ bit definitions for capabilities: ⋆/
207 /⋆ can the hardware decode MPEG1 and/or MPEG2? ⋆/
208 #define VIDEO_CAP_MPEG1 1
209 #define VIDEO_CAP_MPEG2 2
210 /⋆ can you send a system and/or program stream to video device?
211 (you still have to open the video and the audio device but only
212 send the stream to the video device) ⋆/
213 #define VIDEO_CAP_SYS 4
214 #define VIDEO_CAP_PROG 8
215 /⋆ can the driver also handle SPU, NAVI and CSS encoded data?
216 (CSS API is not present yet) ⋆/
217 #define VIDEO_CAP_SPU 16
218 #define VIDEO_CAP_NAVI 32
219 #define VIDEO_CAP_CSS 64
223 <section id="video-system">
224 <title>video_system_t</title>
225 <para>A call to VIDEO_SET_SYSTEM sets the desired video system for TV output. The
226 following system types can be set:
242 <section id="video-highlight">
243 <title>struct video_highlight</title>
244 <para>Calling the ioctl VIDEO_SET_HIGHLIGHTS posts the SPU highlight information. The
245 call expects the following format for that information:
249 struct video_highlight {
250 boolean active; /⋆ 1=show highlight, 0=hide highlight ⋆/
251 uint8_t contrast1; /⋆ 7- 4 Pattern pixel contrast ⋆/
252 /⋆ 3- 0 Background pixel contrast ⋆/
253 uint8_t contrast2; /⋆ 7- 4 Emphasis pixel-2 contrast ⋆/
254 /⋆ 3- 0 Emphasis pixel-1 contrast ⋆/
255 uint8_t color1; /⋆ 7- 4 Pattern pixel color ⋆/
256 /⋆ 3- 0 Background pixel color ⋆/
257 uint8_t color2; /⋆ 7- 4 Emphasis pixel-2 color ⋆/
258 /⋆ 3- 0 Emphasis pixel-1 color ⋆/
259 uint32_t ypos; /⋆ 23-22 auto action mode ⋆/
260 /⋆ 21-12 start y ⋆/
261 /⋆ 9- 0 end y ⋆/
262 uint32_t xpos; /⋆ 23-22 button color number ⋆/
263 /⋆ 21-12 start x ⋆/
264 /⋆ 9- 0 end x ⋆/
269 <section id="video-spu">
270 <title>struct video_spu</title>
271 <para>Calling VIDEO_SET_SPU deactivates or activates SPU decoding, according to the
283 <section id="video-spu-palette">
284 <title>struct video_spu_palette</title>
285 <para>The following structure is used to set the SPU palette by calling VIDEO_SPU_PALETTE:
289 struct video_spu_palette {
291 uint8_t ⋆palette;
292 } video_spu_palette_t;
296 <section id="video-navi-pack">
297 <title>struct video_navi_pack</title>
298 <para>In order to get the navigational data the following structure has to be passed to the ioctl
303 struct video_navi_pack {
304 int length; /⋆ 0 ... 1024 ⋆/
311 <section id="video-attributes-t">
312 <title>video_attributes_t</title>
313 <para>The following attributes can be set by a call to VIDEO_SET_ATTRIBUTES:
316 typedef uint16_t video_attributes_t;
317 /⋆ bits: descr. ⋆/
318 /⋆ 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) ⋆/
319 /⋆ 13-12 TV system (0=525/60, 1=625/50) ⋆/
320 /⋆ 11-10 Aspect ratio (0=4:3, 3=16:9) ⋆/
321 /⋆ 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca ⋆/
322 /⋆ 7 line 21-1 data present in GOP (1=yes, 0=no) ⋆/
323 /⋆ 6 line 21-2 data present in GOP (1=yes, 0=no) ⋆/
324 /⋆ 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 ⋆/
325 /⋆ 2 source letterboxed (1=yes, 0=no) ⋆/
326 /⋆ 0 film/camera mode (0=camera, 1=film (625/50 only)) ⋆/
331 <section id="video_function_calls">
332 <title>Video Function Calls</title>
335 <section id="video_fopen">
336 <title>open()</title>
339 <informaltable><tgroup cols="1"><tbody><row><entry
341 <para>This system call opens a named video device (e.g. /dev/dvb/adapter0/video0)
342 for subsequent use.</para>
343 <para>When an open() call has succeeded, the device will be ready for use.
344 The significance of blocking or non-blocking mode is described in the
345 documentation for functions where there is a difference. It does not affect the
346 semantics of the open() call itself. A device opened in blocking mode can later
347 be put into non-blocking mode (and vice versa) using the F_SETFL command
348 of the fcntl system call. This is a standard system call, documented in the Linux
349 manual page for fcntl. Only one user can open the Video Device in O_RDWR
350 mode. All other attempts to open the device in this mode will fail, and an
351 error-code will be returned. If the Video Device is opened in O_RDONLY
352 mode, the only ioctl call that can be used is VIDEO_GET_STATUS. All other
353 call will return an error code.</para>
355 </row></tbody></tgroup></informaltable>
359 <informaltable><tgroup cols="1"><tbody><row><entry
361 <para>int open(const char ⋆deviceName, int flags);</para>
363 </row></tbody></tgroup></informaltable>
366 <informaltable><tgroup cols="2"><tbody><row><entry
372 <para>Name of specific video device.</para>
376 <para>int flags</para>
379 <para>A bit-wise OR of the following flags:</para>
385 <para>O_RDONLY read-only access</para>
391 <para>O_RDWR read/write access</para>
397 <para>O_NONBLOCK open in non-blocking mode</para>
403 <para>(blocking mode is the default)</para>
405 </row></tbody></tgroup></informaltable>
406 <para>RETURN VALUE</para>
407 <informaltable><tgroup cols="2"><tbody><row><entry
412 <para>Device driver not loaded/available.</para>
416 <para>EINTERNAL</para>
419 <para>Internal error.</para>
426 <para>Device or resource busy.</para>
433 <para>Invalid argument.</para>
435 </row></tbody></tgroup></informaltable>
438 <section id="video_fclose">
439 <title>close()</title>
442 <informaltable><tgroup cols="1"><tbody><row><entry
444 <para>This system call closes a previously opened video device.</para>
446 </row></tbody></tgroup></informaltable>
449 <informaltable><tgroup cols="1"><tbody><row><entry
451 <para>int close(int fd);</para>
453 </row></tbody></tgroup></informaltable>
456 <informaltable><tgroup cols="2"><tbody><row><entry
461 <para>File descriptor returned by a previous call to open().</para>
463 </row></tbody></tgroup></informaltable>
464 <para>RETURN VALUE</para>
465 <informaltable><tgroup cols="2"><tbody><row><entry
470 <para>fd is not a valid open file descriptor.</para>
472 </row></tbody></tgroup></informaltable>
475 <section id="video_fwrite">
476 <title>write()</title>
479 <informaltable><tgroup cols="1"><tbody><row><entry
481 <para>This system call can only be used if VIDEO_SOURCE_MEMORY is selected
482 in the ioctl call VIDEO_SELECT_SOURCE. The data provided shall be in
483 PES format, unless the capability allows other formats. If O_NONBLOCK is
484 not specified the function will block until buffer space is available. The amount
485 of data to be transferred is implied by count.</para>
487 </row></tbody></tgroup></informaltable>
490 <informaltable><tgroup cols="1"><tbody><row><entry
492 <para>size_t write(int fd, const void ⋆buf, size_t count);</para>
494 </row></tbody></tgroup></informaltable>
497 <informaltable><tgroup cols="2"><tbody><row><entry
502 <para>File descriptor returned by a previous call to open().</para>
506 <para>void *buf</para>
509 <para>Pointer to the buffer containing the PES data.</para>
513 <para>size_t count</para>
516 <para>Size of buf.</para>
518 </row></tbody></tgroup></informaltable>
519 <para>RETURN VALUE</para>
520 <informaltable><tgroup cols="2"><tbody><row><entry
525 <para>Mode VIDEO_SOURCE_MEMORY not selected.</para>
532 <para>Attempted to write more data than the internal buffer can
540 <para>fd is not a valid open file descriptor.</para>
542 </row></tbody></tgroup></informaltable>
544 </section><section id="VIDEO_STOP"
545 role="subsection"><title>VIDEO_STOP</title>
548 <para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
549 &VIDIOC-DECODER-CMD; instead.</para>
550 <informaltable><tgroup cols="1"><tbody><row><entry
552 <para>This ioctl call asks the Video Device to stop playing the current stream.
553 Depending on the input parameter, the screen can be blanked out or displaying
554 the last decoded frame.</para>
556 </row></tbody></tgroup></informaltable>
559 <informaltable><tgroup cols="1"><tbody><row><entry
561 <para>int ioctl(fd, int request = VIDEO_STOP, boolean
564 </row></tbody></tgroup></informaltable>
567 <informaltable><tgroup cols="2"><tbody><row><entry
572 <para>File descriptor returned by a previous call to open().</para>
576 <para>int request</para>
579 <para>Equals VIDEO_STOP for this command.</para>
583 <para>Boolean mode</para>
586 <para>Indicates how the screen shall be handled.</para>
592 <para>TRUE: Blank screen when stop.</para>
598 <para>FALSE: Show last decoded frame.</para>
600 </row></tbody></tgroup></informaltable>
603 </section><section id="VIDEO_PLAY"
604 role="subsection"><title>VIDEO_PLAY</title>
607 <para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
608 &VIDIOC-DECODER-CMD; instead.</para>
609 <informaltable><tgroup cols="1"><tbody><row><entry
611 <para>This ioctl call asks the Video Device to start playing a video stream from the
612 selected source.</para>
614 </row></tbody></tgroup></informaltable>
617 <informaltable><tgroup cols="1"><tbody><row><entry
619 <para>int ioctl(fd, int request = VIDEO_PLAY);</para>
621 </row></tbody></tgroup></informaltable>
624 <informaltable><tgroup cols="2"><tbody><row><entry
629 <para>File descriptor returned by a previous call to open().</para>
633 <para>int request</para>
636 <para>Equals VIDEO_PLAY for this command.</para>
638 </row></tbody></tgroup></informaltable>
641 </section><section id="VIDEO_FREEZE"
642 role="subsection"><title>VIDEO_FREEZE</title>
645 <para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
646 &VIDIOC-DECODER-CMD; instead.</para>
647 <informaltable><tgroup cols="1"><tbody><row><entry
649 <para>This ioctl call suspends the live video stream being played. Decoding
650 and playing are frozen. It is then possible to restart the decoding
651 and playing process of the video stream using the VIDEO_CONTINUE
652 command. If VIDEO_SOURCE_MEMORY is selected in the ioctl call
653 VIDEO_SELECT_SOURCE, the DVB subsystem will not decode any more
654 data until the ioctl call VIDEO_CONTINUE or VIDEO_PLAY is performed.</para>
656 </row></tbody></tgroup></informaltable>
659 <informaltable><tgroup cols="1"><tbody><row><entry
661 <para>int ioctl(fd, int request = VIDEO_FREEZE);</para>
663 </row></tbody></tgroup></informaltable>
666 <informaltable><tgroup cols="2"><tbody><row><entry
671 <para>File descriptor returned by a previous call to open().</para>
675 <para>int request</para>
678 <para>Equals VIDEO_FREEZE for this command.</para>
680 </row></tbody></tgroup></informaltable>
683 </section><section id="VIDEO_CONTINUE"
684 role="subsection"><title>VIDEO_CONTINUE</title>
687 <para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
688 &VIDIOC-DECODER-CMD; instead.</para>
689 <informaltable><tgroup cols="1"><tbody><row><entry
691 <para>This ioctl call restarts decoding and playing processes of the video stream
692 which was played before a call to VIDEO_FREEZE was made.</para>
694 </row></tbody></tgroup></informaltable>
697 <informaltable><tgroup cols="1"><tbody><row><entry
699 <para>int ioctl(fd, int request = VIDEO_CONTINUE);</para>
701 </row></tbody></tgroup></informaltable>
704 <informaltable><tgroup cols="2"><tbody><row><entry
709 <para>File descriptor returned by a previous call to open().</para>
713 <para>int request</para>
716 <para>Equals VIDEO_CONTINUE for this command.</para>
718 </row></tbody></tgroup></informaltable>
721 </section><section id="VIDEO_SELECT_SOURCE"
722 role="subsection"><title>VIDEO_SELECT_SOURCE</title>
725 <para>This ioctl is for DVB devices only. This ioctl was also supported by the
726 V4L2 ivtv driver, but that has been replaced by the ivtv-specific
727 <constant>IVTV_IOC_PASSTHROUGH_MODE</constant> ioctl.</para>
728 <informaltable><tgroup cols="1"><tbody><row><entry
730 <para>This ioctl call informs the video device which source shall be used for the input
731 data. The possible sources are demux or memory. If memory is selected, the
732 data is fed to the video device through the write command.</para>
734 </row></tbody></tgroup></informaltable>
737 <informaltable><tgroup cols="1"><tbody><row><entry
739 <para>int ioctl(fd, int request = VIDEO_SELECT_SOURCE,
740 video_stream_source_t source);</para>
742 </row></tbody></tgroup></informaltable>
745 <informaltable><tgroup cols="2"><tbody><row><entry
750 <para>File descriptor returned by a previous call to open().</para>
754 <para>int request</para>
757 <para>Equals VIDEO_SELECT_SOURCE for this command.</para>
761 <para>video_stream_source_t
765 <para>Indicates which source shall be used for the Video stream.</para>
767 </row></tbody></tgroup></informaltable>
770 </section><section id="VIDEO_SET_BLANK"
771 role="subsection"><title>VIDEO_SET_BLANK</title>
774 <informaltable><tgroup cols="1"><tbody><row><entry
776 <para>This ioctl call asks the Video Device to blank out the picture.</para>
778 </row></tbody></tgroup></informaltable>
781 <informaltable><tgroup cols="1"><tbody><row><entry
783 <para>int ioctl(fd, int request = VIDEO_SET_BLANK, boolean
786 </row></tbody></tgroup></informaltable>
789 <informaltable><tgroup cols="2"><tbody><row><entry
794 <para>File descriptor returned by a previous call to open().</para>
798 <para>int request</para>
801 <para>Equals VIDEO_SET_BLANK for this command.</para>
805 <para>boolean mode</para>
808 <para>TRUE: Blank screen when stop.</para>
814 <para>FALSE: Show last decoded frame.</para>
816 </row></tbody></tgroup></informaltable>
819 </section><section id="VIDEO_GET_STATUS"
820 role="subsection"><title>VIDEO_GET_STATUS</title>
823 <informaltable><tgroup cols="1"><tbody><row><entry
825 <para>This ioctl call asks the Video Device to return the current status of the device.</para>
827 </row></tbody></tgroup></informaltable>
830 <informaltable><tgroup cols="1"><tbody><row><entry
832 <para> int ioctl(fd, int request = VIDEO_GET_STATUS, struct
833 video_status ⋆status);</para>
835 </row></tbody></tgroup></informaltable>
838 <informaltable><tgroup cols="2"><tbody><row><entry
843 <para>File descriptor returned by a previous call to open().</para>
847 <para>int request</para>
850 <para>Equals VIDEO_GET_STATUS for this command.</para>
854 <para>struct video_status
858 <para>Returns the current status of the Video Device.</para>
860 </row></tbody></tgroup></informaltable>
863 </section><section id="VIDEO_GET_FRAME_COUNT"
864 role="subsection"><title>VIDEO_GET_FRAME_COUNT</title>
867 <para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
868 ioctl has been replaced by the <constant>V4L2_CID_MPEG_VIDEO_DEC_FRAME</constant> control.</para>
869 <informaltable><tgroup cols="1"><tbody><row><entry
871 <para>This ioctl call asks the Video Device to return the number of displayed frames
872 since the decoder was started.</para>
874 </row></tbody></tgroup></informaltable>
877 <informaltable><tgroup cols="1"><tbody><row><entry
879 <para>int ioctl(int fd, int request =
880 VIDEO_GET_FRAME_COUNT, __u64 *pts);</para>
882 </row></tbody></tgroup></informaltable>
885 <informaltable><tgroup cols="2"><tbody><row><entry
890 <para>File descriptor returned by a previous call to open().</para>
894 <para>int request</para>
897 <para>Equals VIDEO_GET_FRAME_COUNT for this
906 <para>Returns the number of frames displayed since the decoder was started.
909 </row></tbody></tgroup></informaltable>
912 </section><section id="VIDEO_GET_PTS"
913 role="subsection"><title>VIDEO_GET_PTS</title>
916 <para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
917 ioctl has been replaced by the <constant>V4L2_CID_MPEG_VIDEO_DEC_PTS</constant> control.</para>
918 <informaltable><tgroup cols="1"><tbody><row><entry
920 <para>This ioctl call asks the Video Device to return the current PTS timestamp.</para>
922 </row></tbody></tgroup></informaltable>
925 <informaltable><tgroup cols="1"><tbody><row><entry
927 <para>int ioctl(int fd, int request =
928 VIDEO_GET_PTS, __u64 *pts);</para>
930 </row></tbody></tgroup></informaltable>
933 <informaltable><tgroup cols="2"><tbody><row><entry
938 <para>File descriptor returned by a previous call to open().</para>
942 <para>int request</para>
945 <para>Equals VIDEO_GET_PTS for this
954 <para>Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
957 The PTS should belong to the currently played
958 frame if possible, but may also be a value close to it
959 like the PTS of the last decoded frame or the last PTS
960 extracted by the PES parser.</para>
962 </row></tbody></tgroup></informaltable>
965 </section><section id="VIDEO_GET_FRAME_RATE"
966 role="subsection"><title>VIDEO_GET_FRAME_RATE</title>
969 <informaltable><tgroup cols="1"><tbody><row><entry
971 <para>This ioctl call asks the Video Device to return the current framerate.</para>
973 </row></tbody></tgroup></informaltable>
976 <informaltable><tgroup cols="1"><tbody><row><entry
978 <para>int ioctl(int fd, int request =
979 VIDEO_GET_FRAME_RATE, unsigned int *rate);</para>
981 </row></tbody></tgroup></informaltable>
984 <informaltable><tgroup cols="2"><tbody><row><entry
989 <para>File descriptor returned by a previous call to open().</para>
993 <para>int request</para>
996 <para>Equals VIDEO_GET_FRAME_RATE for this
1001 <para>unsigned int *rate
1005 <para>Returns the framerate in number of frames per 1000 seconds.
1008 </row></tbody></tgroup></informaltable>
1011 </section><section id="VIDEO_GET_EVENT"
1012 role="subsection"><title>VIDEO_GET_EVENT</title>
1015 <para>This ioctl is for DVB devices only. To get events from a V4L2 decoder use the V4L2
1016 &VIDIOC-DQEVENT; ioctl instead.</para>
1017 <informaltable><tgroup cols="1"><tbody><row><entry
1019 <para>This ioctl call returns an event of type video_event if available. If an event is
1020 not available, the behavior depends on whether the device is in blocking or
1021 non-blocking mode. In the latter case, the call fails immediately with errno
1022 set to EWOULDBLOCK. In the former case, the call blocks until an event
1023 becomes available. The standard Linux poll() and/or select() system calls can
1024 be used with the device file descriptor to watch for new events. For select(),
1025 the file descriptor should be included in the exceptfds argument, and for
1026 poll(), POLLPRI should be specified as the wake-up condition. Read-only
1027 permissions are sufficient for this ioctl call.</para>
1029 </row></tbody></tgroup></informaltable>
1032 <informaltable><tgroup cols="1"><tbody><row><entry
1034 <para> int ioctl(fd, int request = VIDEO_GET_EVENT, struct
1035 video_event ⋆ev);</para>
1037 </row></tbody></tgroup></informaltable>
1040 <informaltable><tgroup cols="2"><tbody><row><entry
1045 <para>File descriptor returned by a previous call to open().</para>
1049 <para>int request</para>
1052 <para>Equals VIDEO_GET_EVENT for this command.</para>
1056 <para>struct video_event
1060 <para>Points to the location where the event, if any, is to be
1063 </row></tbody></tgroup></informaltable>
1065 <informaltable><tgroup cols="2"><tbody><row><entry
1067 <para>EWOULDBLOCK</para>
1070 <para>There is no event pending, and the device is in
1071 non-blocking mode.</para>
1075 <para>EOVERFLOW</para>
1078 <para>Overflow in event queue - one or more events were lost.</para>
1080 </row></tbody></tgroup></informaltable>
1082 </section><section id="VIDEO_COMMAND"
1083 role="subsection"><title>VIDEO_COMMAND</title>
1086 <para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
1087 ioctl has been replaced by the &VIDIOC-DECODER-CMD; ioctl.</para>
1088 <informaltable><tgroup cols="1"><tbody><row><entry
1090 <para>This ioctl commands the decoder. The <constant>video_command</constant> struct
1091 is a subset of the <constant>v4l2_decoder_cmd</constant> struct, so refer to the
1092 &VIDIOC-DECODER-CMD; documentation for more information.</para>
1094 </row></tbody></tgroup></informaltable>
1097 <informaltable><tgroup cols="1"><tbody><row><entry
1099 <para>int ioctl(int fd, int request =
1100 VIDEO_COMMAND, struct video_command *cmd);</para>
1102 </row></tbody></tgroup></informaltable>
1105 <informaltable><tgroup cols="2"><tbody><row><entry
1110 <para>File descriptor returned by a previous call to open().</para>
1114 <para>int request</para>
1117 <para>Equals VIDEO_COMMAND for this
1122 <para>struct video_command *cmd
1126 <para>Commands the decoder.
1129 </row></tbody></tgroup></informaltable>
1132 </section><section id="VIDEO_TRY_COMMAND"
1133 role="subsection"><title>VIDEO_TRY_COMMAND</title>
1136 <para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
1137 ioctl has been replaced by the &VIDIOC-TRY-DECODER-CMD; ioctl.</para>
1138 <informaltable><tgroup cols="1"><tbody><row><entry
1140 <para>This ioctl tries a decoder command. The <constant>video_command</constant> struct
1141 is a subset of the <constant>v4l2_decoder_cmd</constant> struct, so refer to the
1142 &VIDIOC-TRY-DECODER-CMD; documentation for more information.</para>
1144 </row></tbody></tgroup></informaltable>
1147 <informaltable><tgroup cols="1"><tbody><row><entry
1149 <para>int ioctl(int fd, int request =
1150 VIDEO_TRY_COMMAND, struct video_command *cmd);</para>
1152 </row></tbody></tgroup></informaltable>
1155 <informaltable><tgroup cols="2"><tbody><row><entry
1160 <para>File descriptor returned by a previous call to open().</para>
1164 <para>int request</para>
1167 <para>Equals VIDEO_TRY_COMMAND for this
1172 <para>struct video_command *cmd
1176 <para>Try a decoder command.
1179 </row></tbody></tgroup></informaltable>
1182 </section><section id="VIDEO_GET_SIZE"
1183 role="subsection"><title>VIDEO_GET_SIZE</title>
1186 <informaltable><tgroup cols="1"><tbody><row><entry
1188 <para>This ioctl returns the size and aspect ratio.</para>
1190 </row></tbody></tgroup></informaltable>
1193 <informaltable><tgroup cols="1"><tbody><row><entry
1195 <para>int ioctl(int fd, int request =
1196 VIDEO_GET_SIZE, video_size_t *size);</para>
1198 </row></tbody></tgroup></informaltable>
1201 <informaltable><tgroup cols="2"><tbody><row><entry
1206 <para>File descriptor returned by a previous call to open().</para>
1210 <para>int request</para>
1213 <para>Equals VIDEO_GET_SIZE for this
1218 <para>video_size_t *size
1222 <para>Returns the size and aspect ratio.
1225 </row></tbody></tgroup></informaltable>
1228 </section><section id="VIDEO_SET_DISPLAY_FORMAT"
1229 role="subsection"><title>VIDEO_SET_DISPLAY_FORMAT</title>
1232 <informaltable><tgroup cols="1"><tbody><row><entry
1234 <para>This ioctl call asks the Video Device to select the video format to be applied
1235 by the MPEG chip on the video.</para>
1237 </row></tbody></tgroup></informaltable>
1240 <informaltable><tgroup cols="1"><tbody><row><entry
1242 <para> int ioctl(fd, int request =
1243 VIDEO_SET_DISPLAY_FORMAT, video_display_format_t
1246 </row></tbody></tgroup></informaltable>
1249 <informaltable><tgroup cols="2"><tbody><row><entry
1254 <para>File descriptor returned by a previous call to open().</para>
1258 <para>int request</para>
1261 <para>Equals VIDEO_SET_DISPLAY_FORMAT for this
1266 <para>video_display_format_t
1270 <para>Selects the video format to be used.</para>
1272 </row></tbody></tgroup></informaltable>
1275 </section><section id="VIDEO_STILLPICTURE"
1276 role="subsection"><title>VIDEO_STILLPICTURE</title>
1279 <informaltable><tgroup cols="1"><tbody><row><entry
1281 <para>This ioctl call asks the Video Device to display a still picture (I-frame). The
1282 input data shall contain an I-frame. If the pointer is NULL, then the current
1283 displayed still picture is blanked.</para>
1285 </row></tbody></tgroup></informaltable>
1288 <informaltable><tgroup cols="1"><tbody><row><entry
1290 <para>int ioctl(fd, int request = VIDEO_STILLPICTURE,
1291 struct video_still_picture ⋆sp);</para>
1293 </row></tbody></tgroup></informaltable>
1296 <informaltable><tgroup cols="2"><tbody><row><entry
1301 <para>File descriptor returned by a previous call to open().</para>
1305 <para>int request</para>
1308 <para>Equals VIDEO_STILLPICTURE for this command.</para>
1317 <para>Pointer to a location where an I-frame and size is stored.</para>
1319 </row></tbody></tgroup></informaltable>
1322 </section><section id="VIDEO_FAST_FORWARD"
1323 role="subsection"><title>VIDEO_FAST_FORWARD</title>
1326 <informaltable><tgroup cols="1"><tbody><row><entry
1328 <para>This ioctl call asks the Video Device to skip decoding of N number of I-frames.
1329 This call can only be used if VIDEO_SOURCE_MEMORY is selected.</para>
1331 </row></tbody></tgroup></informaltable>
1334 <informaltable><tgroup cols="1"><tbody><row><entry
1336 <para>int ioctl(fd, int request = VIDEO_FAST_FORWARD, int
1339 </row></tbody></tgroup></informaltable>
1342 <informaltable><tgroup cols="2"><tbody><row><entry
1347 <para>File descriptor returned by a previous call to open().</para>
1351 <para>int request</para>
1354 <para>Equals VIDEO_FAST_FORWARD for this command.</para>
1358 <para>int nFrames</para>
1361 <para>The number of frames to skip.</para>
1363 </row></tbody></tgroup></informaltable>
1365 <informaltable><tgroup cols="2"><tbody><row><entry
1370 <para>Mode VIDEO_SOURCE_MEMORY not selected.</para>
1372 </row></tbody></tgroup></informaltable>
1374 </section><section id="VIDEO_SLOWMOTION"
1375 role="subsection"><title>VIDEO_SLOWMOTION</title>
1378 <informaltable><tgroup cols="1"><tbody><row><entry
1380 <para>This ioctl call asks the video device to repeat decoding frames N number of
1381 times. This call can only be used if VIDEO_SOURCE_MEMORY is selected.</para>
1383 </row></tbody></tgroup></informaltable>
1386 <informaltable><tgroup cols="1"><tbody><row><entry
1388 <para>int ioctl(fd, int request = VIDEO_SLOWMOTION, int
1391 </row></tbody></tgroup></informaltable>
1394 <informaltable><tgroup cols="2"><tbody><row><entry
1399 <para>File descriptor returned by a previous call to open().</para>
1403 <para>int request</para>
1406 <para>Equals VIDEO_SLOWMOTION for this command.</para>
1410 <para>int nFrames</para>
1413 <para>The number of times to repeat each frame.</para>
1415 </row></tbody></tgroup></informaltable>
1417 <informaltable><tgroup cols="2"><tbody><row><entry
1422 <para>Mode VIDEO_SOURCE_MEMORY not selected.</para>
1424 </row></tbody></tgroup></informaltable>
1426 </section><section id="VIDEO_GET_CAPABILITIES"
1427 role="subsection"><title>VIDEO_GET_CAPABILITIES</title>
1430 <informaltable><tgroup cols="1"><tbody><row><entry
1432 <para>This ioctl call asks the video device about its decoding capabilities. On success
1433 it returns and integer which has bits set according to the defines in section ??.</para>
1435 </row></tbody></tgroup></informaltable>
1438 <informaltable><tgroup cols="1"><tbody><row><entry
1440 <para>int ioctl(fd, int request = VIDEO_GET_CAPABILITIES,
1441 unsigned int ⋆cap);</para>
1443 </row></tbody></tgroup></informaltable>
1446 <informaltable><tgroup cols="2"><tbody><row><entry
1451 <para>File descriptor returned by a previous call to open().</para>
1455 <para>int request</para>
1458 <para>Equals VIDEO_GET_CAPABILITIES for this
1463 <para>unsigned int *cap</para>
1466 <para>Pointer to a location where to store the capability
1469 </row></tbody></tgroup></informaltable>
1472 </section><section id="VIDEO_SET_ID"
1473 role="subsection"><title>VIDEO_SET_ID</title>
1476 <informaltable><tgroup cols="1"><tbody><row><entry
1478 <para>This ioctl selects which sub-stream is to be decoded if a program or system
1479 stream is sent to the video device.</para>
1481 </row></tbody></tgroup></informaltable>
1484 <informaltable><tgroup cols="1"><tbody><row><entry
1486 <para>int ioctl(int fd, int request = VIDEO_SET_ID, int
1489 </row></tbody></tgroup></informaltable>
1492 <informaltable><tgroup cols="2"><tbody><row><entry
1497 <para>File descriptor returned by a previous call to open().</para>
1501 <para>int request</para>
1504 <para>Equals VIDEO_SET_ID for this command.</para>
1511 <para>video sub-stream id</para>
1513 </row></tbody></tgroup></informaltable>
1515 <informaltable><tgroup cols="2"><tbody><row><entry
1520 <para>Invalid sub-stream id.</para>
1522 </row></tbody></tgroup></informaltable>
1524 </section><section id="VIDEO_CLEAR_BUFFER"
1525 role="subsection"><title>VIDEO_CLEAR_BUFFER</title>
1528 <informaltable><tgroup cols="1"><tbody><row><entry
1530 <para>This ioctl call clears all video buffers in the driver and in the decoder hardware.</para>
1532 </row></tbody></tgroup></informaltable>
1535 <informaltable><tgroup cols="1"><tbody><row><entry
1537 <para>int ioctl(fd, int request = VIDEO_CLEAR_BUFFER);</para>
1539 </row></tbody></tgroup></informaltable>
1542 <informaltable><tgroup cols="2"><tbody><row><entry
1547 <para>File descriptor returned by a previous call to open().</para>
1551 <para>int request</para>
1554 <para>Equals VIDEO_CLEAR_BUFFER for this command.</para>
1556 </row></tbody></tgroup></informaltable>
1559 </section><section id="VIDEO_SET_STREAMTYPE"
1560 role="subsection"><title>VIDEO_SET_STREAMTYPE</title>
1563 <informaltable><tgroup cols="1"><tbody><row><entry
1565 <para>This ioctl tells the driver which kind of stream to expect being written to it. If
1566 this call is not used the default of video PES is used. Some drivers might not
1567 support this call and always expect PES.</para>
1569 </row></tbody></tgroup></informaltable>
1572 <informaltable><tgroup cols="1"><tbody><row><entry
1574 <para>int ioctl(fd, int request = VIDEO_SET_STREAMTYPE,
1577 </row></tbody></tgroup></informaltable>
1580 <informaltable><tgroup cols="2"><tbody><row><entry
1585 <para>File descriptor returned by a previous call to open().</para>
1589 <para>int request</para>
1592 <para>Equals VIDEO_SET_STREAMTYPE for this command.</para>
1596 <para>int type</para>
1599 <para>stream type</para>
1601 </row></tbody></tgroup></informaltable>
1604 </section><section id="VIDEO_SET_FORMAT"
1605 role="subsection"><title>VIDEO_SET_FORMAT</title>
1608 <informaltable><tgroup cols="1"><tbody><row><entry
1610 <para>This ioctl sets the screen format (aspect ratio) of the connected output device
1611 (TV) so that the output of the decoder can be adjusted accordingly.</para>
1613 </row></tbody></tgroup></informaltable>
1616 <informaltable><tgroup cols="1"><tbody><row><entry
1618 <para> int ioctl(fd, int request = VIDEO_SET_FORMAT,
1619 video_format_t format);</para>
1621 </row></tbody></tgroup></informaltable>
1624 <informaltable><tgroup cols="2"><tbody><row><entry
1629 <para>File descriptor returned by a previous call to open().</para>
1633 <para>int request</para>
1636 <para>Equals VIDEO_SET_FORMAT for this command.</para>
1640 <para>video_format_t
1644 <para>video format of TV as defined in section ??.</para>
1646 </row></tbody></tgroup></informaltable>
1648 <informaltable><tgroup cols="2"><tbody><row><entry
1653 <para>format is not a valid video format.</para>
1655 </row></tbody></tgroup></informaltable>
1657 </section><section id="VIDEO_SET_SYSTEM"
1658 role="subsection"><title>VIDEO_SET_SYSTEM</title>
1661 <informaltable><tgroup cols="1"><tbody><row><entry
1663 <para>This ioctl sets the television output format. The format (see section ??) may
1664 vary from the color format of the displayed MPEG stream. If the hardware is
1665 not able to display the requested format the call will return an error.</para>
1667 </row></tbody></tgroup></informaltable>
1670 <informaltable><tgroup cols="1"><tbody><row><entry
1672 <para> int ioctl(fd, int request = VIDEO_SET_SYSTEM ,
1673 video_system_t system);</para>
1675 </row></tbody></tgroup></informaltable>
1678 <informaltable><tgroup cols="2"><tbody><row><entry
1683 <para>File descriptor returned by a previous call to open().</para>
1687 <para>int request</para>
1690 <para>Equals VIDEO_SET_FORMAT for this command.</para>
1694 <para>video_system_t
1698 <para>video system of TV output.</para>
1700 </row></tbody></tgroup></informaltable>
1702 <informaltable><tgroup cols="2"><tbody><row><entry
1707 <para>system is not a valid or supported video system.</para>
1709 </row></tbody></tgroup></informaltable>
1711 </section><section id="VIDEO_SET_HIGHLIGHT"
1712 role="subsection"><title>VIDEO_SET_HIGHLIGHT</title>
1715 <informaltable><tgroup cols="1"><tbody><row><entry
1717 <para>This ioctl sets the SPU highlight information for the menu access of a DVD.</para>
1719 </row></tbody></tgroup></informaltable>
1722 <informaltable><tgroup cols="1"><tbody><row><entry
1724 <para> int ioctl(fd, int request = VIDEO_SET_HIGHLIGHT
1725 ,video_highlight_t ⋆vhilite)</para>
1727 </row></tbody></tgroup></informaltable>
1730 <informaltable><tgroup cols="2"><tbody><row><entry
1735 <para>File descriptor returned by a previous call to open().</para>
1739 <para>int request</para>
1742 <para>Equals VIDEO_SET_HIGHLIGHT for this command.</para>
1746 <para>video_highlight_t
1750 <para>SPU Highlight information according to section ??.</para>
1752 </row></tbody></tgroup></informaltable>
1755 </section><section id="VIDEO_SET_SPU"
1756 role="subsection"><title>VIDEO_SET_SPU</title>
1759 <informaltable><tgroup cols="1"><tbody><row><entry
1761 <para>This ioctl activates or deactivates SPU decoding in a DVD input stream. It can
1762 only be used, if the driver is able to handle a DVD stream.</para>
1764 </row></tbody></tgroup></informaltable>
1767 <informaltable><tgroup cols="1"><tbody><row><entry
1769 <para> int ioctl(fd, int request = VIDEO_SET_SPU ,
1770 video_spu_t ⋆spu)</para>
1772 </row></tbody></tgroup></informaltable>
1775 <informaltable><tgroup cols="2"><tbody><row><entry
1780 <para>File descriptor returned by a previous call to open().</para>
1784 <para>int request</para>
1787 <para>Equals VIDEO_SET_SPU for this command.</para>
1791 <para>video_spu_t *spu</para>
1794 <para>SPU decoding (de)activation and subid setting according
1795 to section ??.</para>
1797 </row></tbody></tgroup></informaltable>
1799 <informaltable><tgroup cols="2"><tbody><row><entry
1804 <para>input is not a valid spu setting or driver cannot handle
1807 </row></tbody></tgroup></informaltable>
1809 </section><section id="VIDEO_SET_SPU_PALETTE"
1810 role="subsection"><title>VIDEO_SET_SPU_PALETTE</title>
1813 <informaltable><tgroup cols="1"><tbody><row><entry
1815 <para>This ioctl sets the SPU color palette.</para>
1817 </row></tbody></tgroup></informaltable>
1820 <informaltable><tgroup cols="1"><tbody><row><entry
1822 <para> int ioctl(fd, int request = VIDEO_SET_SPU_PALETTE
1823 ,video_spu_palette_t ⋆palette )</para>
1825 </row></tbody></tgroup></informaltable>
1828 <informaltable><tgroup cols="2"><tbody><row><entry
1833 <para>File descriptor returned by a previous call to open().</para>
1837 <para>int request</para>
1840 <para>Equals VIDEO_SET_SPU_PALETTE for this command.</para>
1844 <para>video_spu_palette_t
1848 <para>SPU palette according to section ??.</para>
1850 </row></tbody></tgroup></informaltable>
1852 <informaltable><tgroup cols="2"><tbody><row><entry
1857 <para>input is not a valid palette or driver doesn’t handle SPU.</para>
1859 </row></tbody></tgroup></informaltable>
1861 </section><section id="VIDEO_GET_NAVI"
1862 role="subsection"><title>VIDEO_GET_NAVI</title>
1865 <informaltable><tgroup cols="1"><tbody><row><entry
1867 <para>This ioctl returns navigational information from the DVD stream. This is
1868 especially needed if an encoded stream has to be decoded by the hardware.</para>
1870 </row></tbody></tgroup></informaltable>
1873 <informaltable><tgroup cols="1"><tbody><row><entry
1875 <para> int ioctl(fd, int request = VIDEO_GET_NAVI ,
1876 video_navi_pack_t ⋆navipack)</para>
1878 </row></tbody></tgroup></informaltable>
1881 <informaltable><tgroup cols="2"><tbody><row><entry
1886 <para>File descriptor returned by a previous call to open().</para>
1890 <para>int request</para>
1893 <para>Equals VIDEO_GET_NAVI for this command.</para>
1897 <para>video_navi_pack_t
1901 <para>PCI or DSI pack (private stream 2) according to section
1904 </row></tbody></tgroup></informaltable>
1906 <informaltable><tgroup cols="2"><tbody><row><entry
1911 <para>driver is not able to return navigational information</para>
1913 </row></tbody></tgroup></informaltable>
1915 </section><section id="VIDEO_SET_ATTRIBUTES"
1916 role="subsection"><title>VIDEO_SET_ATTRIBUTES</title>
1919 <informaltable><tgroup cols="1"><tbody><row><entry
1921 <para>This ioctl is intended for DVD playback and allows you to set certain
1922 information about the stream. Some hardware may not need this information,
1923 but the call also tells the hardware to prepare for DVD playback.</para>
1925 </row></tbody></tgroup></informaltable>
1928 <informaltable><tgroup cols="1"><tbody><row><entry
1930 <para> int ioctl(fd, int request = VIDEO_SET_ATTRIBUTE
1931 ,video_attributes_t vattr)</para>
1933 </row></tbody></tgroup></informaltable>
1936 <informaltable><tgroup cols="2"><tbody><row><entry
1941 <para>File descriptor returned by a previous call to open().</para>
1945 <para>int request</para>
1948 <para>Equals VIDEO_SET_ATTRIBUTE for this command.</para>
1952 <para>video_attributes_t
1956 <para>video attributes according to section ??.</para>
1958 </row></tbody></tgroup></informaltable>
1960 <informaltable><tgroup cols="2"><tbody><row><entry
1965 <para>input is not a valid attribute setting.</para>
1967 </row></tbody></tgroup></informaltable>
1968 </section></section>