2016-06-30 21:18:56 +08:00
|
|
|
.. -*- coding: utf-8; mode: rst -*-
|
|
|
|
|
2016-07-02 00:42:29 +08:00
|
|
|
.. _VIDIOC_QUERY_DV_TIMINGS:
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
*****************************
|
|
|
|
ioctl VIDIOC_QUERY_DV_TIMINGS
|
|
|
|
*****************************
|
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Name
|
2016-07-05 18:58:48 +08:00
|
|
|
====
|
2016-06-30 21:18:56 +08:00
|
|
|
|
2016-07-05 18:58:48 +08:00
|
|
|
VIDIOC_QUERY_DV_TIMINGS - VIDIOC_SUBDEV_QUERY_DV_TIMINGS - Sense the DV preset received by the current input
|
2016-06-30 21:18:56 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
|
|
|
|
Synopsis
|
2016-06-30 21:18:56 +08:00
|
|
|
========
|
|
|
|
|
2016-08-20 03:53:38 +08:00
|
|
|
.. c:function:: int ioctl( int fd, VIDIOC_QUERY_DV_TIMINGS, struct v4l2_dv_timings *argp )
|
|
|
|
:name: VIDIOC_QUERY_DV_TIMINGS
|
|
|
|
|
|
|
|
.. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_QUERY_DV_TIMINGS, struct v4l2_dv_timings *argp )
|
|
|
|
:name: VIDIOC_SUBDEV_QUERY_DV_TIMINGS
|
2016-06-30 21:18:56 +08:00
|
|
|
|
2016-07-05 18:58:48 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Arguments
|
2016-06-30 21:18:56 +08:00
|
|
|
=========
|
|
|
|
|
|
|
|
``fd``
|
|
|
|
File descriptor returned by :ref:`open() <func-open>`.
|
|
|
|
|
|
|
|
``argp``
|
|
|
|
|
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Description
|
2016-06-30 21:18:56 +08:00
|
|
|
===========
|
|
|
|
|
|
|
|
The hardware may be able to detect the current DV timings automatically,
|
|
|
|
similar to sensing the video standard. To do so, applications call
|
2016-07-02 01:33:56 +08:00
|
|
|
:ref:`VIDIOC_QUERY_DV_TIMINGS` with a pointer to a struct
|
2016-06-30 21:18:56 +08:00
|
|
|
:ref:`v4l2_dv_timings <v4l2-dv-timings>`. Once the hardware detects
|
|
|
|
the timings, it will fill in the timings structure.
|
|
|
|
|
2016-08-16 04:49:50 +08:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
Drivers shall *not* switch timings automatically if new
|
2016-07-10 22:57:43 +08:00
|
|
|
timings are detected. Instead, drivers should send the
|
|
|
|
``V4L2_EVENT_SOURCE_CHANGE`` event (if they support this) and expect
|
|
|
|
that userspace will take action by calling :ref:`VIDIOC_QUERY_DV_TIMINGS`.
|
|
|
|
The reason is that new timings usually mean different buffer sizes as
|
|
|
|
well, and you cannot change buffer sizes on the fly. In general,
|
|
|
|
applications that receive the Source Change event will have to call
|
|
|
|
:ref:`VIDIOC_QUERY_DV_TIMINGS`, and if the detected timings are valid they
|
|
|
|
will have to stop streaming, set the new timings, allocate new buffers
|
|
|
|
and start streaming again.
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
If the timings could not be detected because there was no signal, then
|
|
|
|
ENOLINK is returned. If a signal was detected, but it was unstable and
|
2016-07-03 22:53:09 +08:00
|
|
|
the receiver could not lock to the signal, then ``ENOLCK`` is returned. If
|
2016-06-30 21:18:56 +08:00
|
|
|
the receiver could lock to the signal, but the format is unsupported
|
|
|
|
(e.g. because the pixelclock is out of range of the hardware
|
|
|
|
capabilities), then the driver fills in whatever timings it could find
|
2016-07-03 22:53:09 +08:00
|
|
|
and returns ``ERANGE``. In that case the application can call
|
2016-07-02 00:58:44 +08:00
|
|
|
:ref:`VIDIOC_DV_TIMINGS_CAP` to compare the
|
2016-06-30 21:18:56 +08:00
|
|
|
found timings with the hardware's capabilities in order to give more
|
|
|
|
precise feedback to the user.
|
|
|
|
|
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Return Value
|
2016-06-30 21:18:56 +08:00
|
|
|
============
|
|
|
|
|
|
|
|
On success 0 is returned, on error -1 and the ``errno`` variable is set
|
|
|
|
appropriately. The generic error codes are described at the
|
|
|
|
:ref:`Generic Error Codes <gen-errors>` chapter.
|
|
|
|
|
|
|
|
ENODATA
|
|
|
|
Digital video timings are not supported for this input or output.
|
|
|
|
|
|
|
|
ENOLINK
|
|
|
|
No timings could be detected because no signal was found.
|
|
|
|
|
|
|
|
ENOLCK
|
|
|
|
The signal was unstable and the hardware could not lock on to it.
|
|
|
|
|
|
|
|
ERANGE
|
|
|
|
Timings were found, but they are out of range of the hardware
|
|
|
|
capabilities.
|