.. _video_fopen:
-open()
-======
+dvb video open()
+================
-DESCRIPTION
+Description
+-----------
This system call opens a named video device (e.g.
/dev/dvb/adapter0/video0) for subsequent use.
ioctl call that can be used is VIDEO_GET_STATUS. All other call will
return an error code.
-SYNOPSIS
-
-int open(const char *deviceName, int flags);
-
-PARAMETERS
+Synopsis
+--------
+.. c:function:: int open(const char *deviceName, int flags)
+Arguments
+----------
.. flat-table::
:header-rows: 0
- .. row 1
- - const char *deviceName
+ - const char \*deviceName
- Name of specific video device.
- (blocking mode is the default)
-RETURN VALUE
+Return Value
+------------
.. _video_fclose:
-close()
-=======
+dvb video close()
+=================
-DESCRIPTION
+Description
+-----------
This system call closes a previously opened video device.
-SYNOPSIS
+Synopsis
+--------
-int close(int fd);
+.. c:function:: int close(int fd)
-PARAMETERS
+Arguments
+----------
- File descriptor returned by a previous call to open().
-RETURN VALUE
+Return Value
+------------
.. _video_fwrite:
-write()
-=======
+dvb video write()
+=================
-DESCRIPTION
+Description
+-----------
This system call can only be used if VIDEO_SOURCE_MEMORY is selected
in the ioctl call VIDEO_SELECT_SOURCE. The data provided shall be in
is not specified the function will block until buffer space is
available. The amount of data to be transferred is implied by count.
-SYNOPSIS
+Synopsis
+--------
-size_t write(int fd, const void *buf, size_t count);
+.. c:function:: size_t write(int fd, const void *buf, size_t count)
-PARAMETERS
+Arguments
+----------
- .. row 2
- - void *buf
+ - void \*buf
- Pointer to the buffer containing the PES data.
- Size of buf.
-RETURN VALUE
+Return Value
+------------
VIDEO_STOP
==========
-DESCRIPTION
+Description
+-----------
This ioctl is for DVB devices only. To control a V4L2 decoder use the
V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
stream. Depending on the input parameter, the screen can be blanked out
or displaying the last decoded frame.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_STOP, boolean mode);
+.. c:function:: int ioctl(fd, int request = VIDEO_STOP, boolean mode)
-PARAMETERS
+Arguments
+----------
- FALSE: Show last decoded frame.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_PLAY
==========
-DESCRIPTION
+Description
+-----------
This ioctl is for DVB devices only. To control a V4L2 decoder use the
V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
This ioctl call asks the Video Device to start playing a video stream
from the selected source.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_PLAY);
+.. c:function:: int ioctl(fd, int request = VIDEO_PLAY)
-PARAMETERS
+Arguments
+----------
- Equals VIDEO_PLAY for this command.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_FREEZE
============
-DESCRIPTION
+Description
+-----------
This ioctl is for DVB devices only. To control a V4L2 decoder use the
V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
VIDEO_SELECT_SOURCE, the DVB subsystem will not decode any more data
until the ioctl call VIDEO_CONTINUE or VIDEO_PLAY is performed.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_FREEZE);
+.. c:function:: int ioctl(fd, int request = VIDEO_FREEZE)
-PARAMETERS
+Arguments
+----------
- Equals VIDEO_FREEZE for this command.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_CONTINUE
==============
-DESCRIPTION
+Description
+-----------
This ioctl is for DVB devices only. To control a V4L2 decoder use the
V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
This ioctl call restarts decoding and playing processes of the video
stream which was played before a call to VIDEO_FREEZE was made.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_CONTINUE);
+.. c:function:: int ioctl(fd, int request = VIDEO_CONTINUE)
-PARAMETERS
+Arguments
+----------
- Equals VIDEO_CONTINUE for this command.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SELECT_SOURCE
===================
-DESCRIPTION
+Description
+-----------
This ioctl is for DVB devices only. This ioctl was also supported by the
V4L2 ivtv driver, but that has been replaced by the ivtv-specific
the input data. The possible sources are demux or memory. If memory is
selected, the data is fed to the video device through the write command.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_SELECT_SOURCE,
-video_stream_source_t source);
+.. c:function:: int ioctl(fd, int request = VIDEO_SELECT_SOURCE, video_stream_source_t source)
-PARAMETERS
+Arguments
+----------
- Indicates which source shall be used for the Video stream.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SET_BLANK
===============
-DESCRIPTION
+Description
+-----------
This ioctl call asks the Video Device to blank out the picture.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_SET_BLANK, boolean mode);
+.. c:function:: int ioctl(fd, int request = VIDEO_SET_BLANK, boolean mode)
-PARAMETERS
+Arguments
+----------
- FALSE: Show last decoded frame.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_GET_STATUS
================
-DESCRIPTION
+Description
+-----------
This ioctl call asks the Video Device to return the current status of
the device.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_GET_STATUS, struct video_status
-*status);
+.. c:function:: int ioctl(fd, int request = VIDEO_GET_STATUS, struct video_status *status)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - struct video_status *status
+ - struct video_status \*status
- Returns the current status of the Video Device.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_GET_FRAME_COUNT
=====================
-DESCRIPTION
+Description
+-----------
This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
this ioctl has been replaced by the ``V4L2_CID_MPEG_VIDEO_DEC_FRAME``
This ioctl call asks the Video Device to return the number of displayed
frames since the decoder was started.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(int fd, int request = VIDEO_GET_FRAME_COUNT, __u64 *pts);
+.. c:function:: int ioctl(int fd, int request = VIDEO_GET_FRAME_COUNT, __u64 *pts)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - __u64 *pts
+ - __u64 \*pts
- Returns the number of frames displayed since the decoder was
started.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_GET_PTS
=============
-DESCRIPTION
+Description
+-----------
This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
this ioctl has been replaced by the ``V4L2_CID_MPEG_VIDEO_DEC_PTS``
This ioctl call asks the Video Device to return the current PTS
timestamp.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(int fd, int request = VIDEO_GET_PTS, __u64 *pts);
+.. c:function:: int ioctl(int fd, int request = VIDEO_GET_PTS, __u64 *pts)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - __u64 *pts
+ - __u64 \*pts
- Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 /
ISO/IEC 13818-1.
decoded frame or the last PTS extracted by the PES parser.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_GET_FRAME_RATE
====================
-DESCRIPTION
+Description
+-----------
This ioctl call asks the Video Device to return the current framerate.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(int fd, int request = VIDEO_GET_FRAME_RATE, unsigned int
-*rate);
+.. c:function:: int ioctl(int fd, int request = VIDEO_GET_FRAME_RATE, unsigned int *rate)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - unsigned int *rate
+ - unsigned int \*rate
- Returns the framerate in number of frames per 1000 seconds.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_GET_EVENT
===============
-DESCRIPTION
+Description
+-----------
This ioctl is for DVB devices only. To get events from a V4L2 decoder
use the V4L2 :ref:`VIDIOC_DQEVENT` ioctl instead.
specified as the wake-up condition. Read-only permissions are sufficient
for this ioctl call.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_GET_EVENT, struct video_event *ev);
+.. c:function:: int ioctl(fd, int request = VIDEO_GET_EVENT, struct video_event *ev)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - struct video_event *ev
+ - struct video_event \*ev
- Points to the location where the event, if any, is to be stored.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_COMMAND
=============
-DESCRIPTION
+Description
+-----------
This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
this ioctl has been replaced by the
:ref:`VIDIOC_DECODER_CMD` documentation for
more information.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(int fd, int request = VIDEO_COMMAND, struct video_command
-*cmd);
+.. c:function:: int ioctl(int fd, int request = VIDEO_COMMAND, struct video_command *cmd)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - struct video_command *cmd
+ - struct video_command \*cmd
- Commands the decoder.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_TRY_COMMAND
=================
-DESCRIPTION
+Description
+-----------
This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
this ioctl has been replaced by the
:ref:`VIDIOC_TRY_DECODER_CMD <VIDIOC_DECODER_CMD>` documentation
for more information.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(int fd, int request = VIDEO_TRY_COMMAND, struct
-video_command *cmd);
+.. c:function:: int ioctl(int fd, int request = VIDEO_TRY_COMMAND, struct video_command *cmd)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - struct video_command *cmd
+ - struct video_command \*cmd
- Try a decoder command.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_GET_SIZE
==============
-DESCRIPTION
+Description
+-----------
This ioctl returns the size and aspect ratio.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(int fd, int request = VIDEO_GET_SIZE, video_size_t *size);
+.. c:function:: int ioctl(int fd, int request = VIDEO_GET_SIZE, video_size_t *size)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - video_size_t *size
+ - video_size_t \*size
- Returns the size and aspect ratio.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SET_DISPLAY_FORMAT
========================
-DESCRIPTION
+Description
+-----------
This ioctl call asks the Video Device to select the video format to be
applied by the MPEG chip on the video.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_SET_DISPLAY_FORMAT,
-video_display_format_t format);
+.. c:function:: int ioctl(fd, int request = VIDEO_SET_DISPLAY_FORMAT, video_display_format_t format)
-PARAMETERS
+Arguments
+----------
- Selects the video format to be used.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_STILLPICTURE
==================
-DESCRIPTION
+Description
+-----------
This ioctl call asks the Video Device to display a still picture
(I-frame). The input data shall contain an I-frame. If the pointer is
NULL, then the current displayed still picture is blanked.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_STILLPICTURE, struct
-video_still_picture *sp);
+.. c:function:: int ioctl(fd, int request = VIDEO_STILLPICTURE, struct video_still_picture *sp)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - struct video_still_picture *sp
+ - struct video_still_picture \*sp
- Pointer to a location where an I-frame and size is stored.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_FAST_FORWARD
==================
-DESCRIPTION
+Description
+-----------
This ioctl call asks the Video Device to skip decoding of N number of
I-frames. This call can only be used if VIDEO_SOURCE_MEMORY is
selected.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_FAST_FORWARD, int nFrames);
+.. c:function:: int ioctl(fd, int request = VIDEO_FAST_FORWARD, int nFrames)
-PARAMETERS
+Arguments
+----------
- The number of frames to skip.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SLOWMOTION
================
-DESCRIPTION
+Description
+-----------
This ioctl call asks the video device to repeat decoding frames N number
of times. This call can only be used if VIDEO_SOURCE_MEMORY is
selected.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_SLOWMOTION, int nFrames);
+.. c:function:: int ioctl(fd, int request = VIDEO_SLOWMOTION, int nFrames)
-PARAMETERS
+Arguments
+----------
- The number of times to repeat each frame.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_GET_CAPABILITIES
======================
-DESCRIPTION
+Description
+-----------
This ioctl call asks the video device about its decoding capabilities.
On success it returns and integer which has bits set according to the
defines in section ??.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_GET_CAPABILITIES, unsigned int
-*cap);
+.. c:function:: int ioctl(fd, int request = VIDEO_GET_CAPABILITIES, unsigned int *cap)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - unsigned int *cap
+ - unsigned int \*cap
- Pointer to a location where to store the capability information.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SET_ID
============
-DESCRIPTION
+Description
+-----------
This ioctl selects which sub-stream is to be decoded if a program or
system stream is sent to the video device.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(int fd, int request = VIDEO_SET_ID, int id);
+.. c:function:: int ioctl(int fd, int request = VIDEO_SET_ID, int id)
-PARAMETERS
+Arguments
+----------
- video sub-stream id
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_CLEAR_BUFFER
==================
-DESCRIPTION
+Description
+-----------
This ioctl call clears all video buffers in the driver and in the
decoder hardware.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_CLEAR_BUFFER);
+.. c:function:: int ioctl(fd, int request = VIDEO_CLEAR_BUFFER)
-PARAMETERS
+Arguments
+----------
- Equals VIDEO_CLEAR_BUFFER for this command.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SET_STREAMTYPE
====================
-DESCRIPTION
+Description
+-----------
This ioctl tells the driver which kind of stream to expect being written
to it. If this call is not used the default of video PES is used. Some
drivers might not support this call and always expect PES.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_SET_STREAMTYPE, int type);
+.. c:function:: int ioctl(fd, int request = VIDEO_SET_STREAMTYPE, int type)
-PARAMETERS
+Arguments
+----------
- stream type
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SET_FORMAT
================
-DESCRIPTION
+Description
+-----------
This ioctl sets the screen format (aspect ratio) of the connected output
device (TV) so that the output of the decoder can be adjusted
accordingly.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_SET_FORMAT, video_format_t
-format);
+.. c:function:: int ioctl(fd, int request = VIDEO_SET_FORMAT, video_format_t format)
-PARAMETERS
+Arguments
+----------
- video format of TV as defined in section ??.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SET_SYSTEM
================
-DESCRIPTION
+Description
+-----------
This ioctl sets the television output format. The format (see section
??) may vary from the color format of the displayed MPEG stream. If the
hardware is not able to display the requested format the call will
return an error.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_SET_SYSTEM , video_system_t
-system);
+.. c:function:: int ioctl(fd, int request = VIDEO_SET_SYSTEM , video_system_t system)
-PARAMETERS
+Arguments
+----------
- video system of TV output.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SET_HIGHLIGHT
===================
-DESCRIPTION
+Description
+-----------
This ioctl sets the SPU highlight information for the menu access of a
DVD.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_SET_HIGHLIGHT ,video_highlight_t
-*vhilite)
+.. c:function:: int ioctl(fd, int request = VIDEO_SET_HIGHLIGHT ,video_highlight_t *vhilite)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - video_highlight_t *vhilite
+ - video_highlight_t \*vhilite
- SPU Highlight information according to section ??.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SET_SPU
=============
-DESCRIPTION
+Description
+-----------
This ioctl activates or deactivates SPU decoding in a DVD input stream.
It can only be used, if the driver is able to handle a DVD stream.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_SET_SPU , video_spu_t *spu)
+.. c:function:: int ioctl(fd, int request = VIDEO_SET_SPU , video_spu_t *spu)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - video_spu_t *spu
+ - video_spu_t \*spu
- SPU decoding (de)activation and subid setting according to section
??.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SET_SPU_PALETTE
=====================
-DESCRIPTION
+Description
+-----------
This ioctl sets the SPU color palette.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_SET_SPU_PALETTE
-,video_spu_palette_t *palette )
+.. c:function:: int ioctl(fd, int request = VIDEO_SET_SPU_PALETTE, video_spu_palette_t *palette )
-PARAMETERS
+Arguments
+----------
- .. row 3
- - video_spu_palette_t *palette
+ - video_spu_palette_t \*palette
- SPU palette according to section ??.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_GET_NAVI
==============
-DESCRIPTION
+Description
+-----------
This ioctl returns navigational information from the DVD stream. This is
especially needed if an encoded stream has to be decoded by the
hardware.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_GET_NAVI , video_navi_pack_t
-*navipack)
+.. c:function:: int ioctl(fd, int request = VIDEO_GET_NAVI , video_navi_pack_t *navipack)
-PARAMETERS
+Arguments
+----------
- .. row 3
- - video_navi_pack_t *navipack
+ - video_navi_pack_t \*navipack
- PCI or DSI pack (private stream 2) according to section ??.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
VIDEO_SET_ATTRIBUTES
====================
-DESCRIPTION
+Description
+-----------
This ioctl is intended for DVD playback and allows you to set certain
information about the stream. Some hardware may not need this
information, but the call also tells the hardware to prepare for DVD
playback.
-SYNOPSIS
+Synopsis
+--------
-int ioctl(fd, int request = VIDEO_SET_ATTRIBUTE ,video_attributes_t
-vattr)
+.. c:function:: int ioctl(fd, int request = VIDEO_SET_ATTRIBUTE ,video_attributes_t vattr)
-PARAMETERS
+Arguments
+----------
- video attributes according to section ??.
-RETURN VALUE
+Return Value
+------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the