Lines Matching +full:queue +full:- +full:sizes
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
11 the Streaming I/O methods. In the multi-planar API, the data is held in
14 copied. These pointers, together with meta-information like timestamps
18 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. In the multi-planar API,
19 some plane-specific members of struct :c:type:`v4l2_buffer`,
20 such as pointers and sizes for each plane, are stored in
27 ``V4L2_BUF_FLAG_TSTAMP_SRC_MASK`` in :ref:`buffer-flags`. These flags
33 mem-to-mem devices is an exception to the rule: the timestamp source
112 or control set ioctl to return the ``EBUSY`` error. Any attempt to queue a
133 currently queued, without checking the queued buffers sizes.
151 based on the queried sizes (for instance by allocating a set of buffers large
164 .. flat-table:: struct v4l2_buffer
165 :header-rows: 0
166 :stub-columns: 0
169 * - __u32
170 - ``index``
171 - Number of the buffer, set by the application except when calling
178 * - __u32
179 - ``type``
180 - Type of the buffer, same as struct
184 * - __u32
185 - ``bytesused``
186 - The number of bytes occupied by the data in the buffer. It depends
193 * - __u32
194 - ``flags``
195 - Flags set by the application or driver, see :ref:`buffer-flags`.
196 * - __u32
197 - ``field``
198 - Indicates the field order of the image in the buffer, see
202 * - struct timeval
203 - ``timestamp``
204 - For capture streams this is time when the first data byte was
207 :ref:`buffer-flags`. For output streams the driver stores the
214 * - struct :c:type:`v4l2_timecode`
215 - ``timecode``
216 - When the ``V4L2_BUF_FLAG_TIMECODE`` flag is set in ``flags``, this
223 * - __u32
224 - ``sequence``
225 - Set by the driver, counting the frames (not fields!) in sequence.
227 * - :cspan:`2`
245 * - __u32
246 - ``memory``
247 - This field must be set by applications and/or drivers in
249 * - union {
250 - ``m``
251 * - __u32
252 - ``offset``
253 - For the single-planar API and when ``memory`` is
259 * - unsigned long
260 - ``userptr``
261 - For the single-planar API and when ``memory`` is
265 * - struct v4l2_plane
266 - ``*planes``
267 - When using the multi-planar API, contains a userspace pointer to
271 * - int
272 - ``fd``
273 - For the single-plane API and when ``memory`` is
276 * - }
277 -
278 * - __u32
279 - ``length``
280 - Size of the buffer (not the payload) in bytes for the
281 single-planar API. This is set by the driver based on the calls to
284 multi-planar API the application sets this to the number of
287 * - __u32
288 - ``reserved2``
289 - A place holder for future extensions. Drivers and applications
291 * - __u32
292 - ``request_fd``
293 - The file descriptor of the request to queue the buffer to. If the flag
319 .. flat-table::
320 :header-rows: 0
321 :stub-columns: 0
324 * - __u32
325 - ``bytesused``
326 - The number of bytes occupied by data in the plane (its payload).
334 * - __u32
335 - ``length``
336 - Size in bytes of the plane (not its payload). This is set by the
340 * - union {
341 - ``m``
342 * - __u32
343 - ``mem_offset``
344 - When the memory type in the containing struct
349 * - unsigned long
350 - ``userptr``
351 - When the memory type in the containing struct
355 * - int
356 - ``fd``
357 - When the memory type in the containing struct
361 * - }
362 -
363 * - __u32
364 - ``data_offset``
365 - Offset in bytes to video data in the plane. Drivers must set this
372 size of the image in the plane is ``bytesused``-``data_offset``
374 * - __u32
375 - ``reserved[11]``
376 - Reserved for future use. Should be zeroed by drivers and
389 .. flat-table::
390 :header-rows: 0
391 :stub-columns: 0
394 * - ``V4L2_BUF_TYPE_VIDEO_CAPTURE``
395 - 1
396 - Buffer of a single-planar video capture stream, see
398 * - ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``
399 - 9
400 - Buffer of a multi-planar video capture stream, see
402 * - ``V4L2_BUF_TYPE_VIDEO_OUTPUT``
403 - 2
404 - Buffer of a single-planar video output stream, see
406 * - ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``
407 - 10
408 - Buffer of a multi-planar video output stream, see :ref:`output`.
409 * - ``V4L2_BUF_TYPE_VIDEO_OVERLAY``
410 - 3
411 - Buffer for video overlay, see :ref:`overlay`.
412 * - ``V4L2_BUF_TYPE_VBI_CAPTURE``
413 - 4
414 - Buffer of a raw VBI capture stream, see :ref:`raw-vbi`.
415 * - ``V4L2_BUF_TYPE_VBI_OUTPUT``
416 - 5
417 - Buffer of a raw VBI output stream, see :ref:`raw-vbi`.
418 * - ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE``
419 - 6
420 - Buffer of a sliced VBI capture stream, see :ref:`sliced`.
421 * - ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``
422 - 7
423 - Buffer of a sliced VBI output stream, see :ref:`sliced`.
424 * - ``V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY``
425 - 8
426 - Buffer for video output overlay (OSD), see :ref:`osd`.
427 * - ``V4L2_BUF_TYPE_SDR_CAPTURE``
428 - 11
429 - Buffer for Software Defined Radio (SDR) capture stream, see
431 * - ``V4L2_BUF_TYPE_SDR_OUTPUT``
432 - 12
433 - Buffer for Software Defined Radio (SDR) output stream, see
435 * - ``V4L2_BUF_TYPE_META_CAPTURE``
436 - 13
437 - Buffer for metadata capture, see :ref:`metadata`.
438 * - ``V4L2_BUF_TYPE_META_OUTPUT``
439 - 14
440 - Buffer for metadata output, see :ref:`metadata`.
443 .. _buffer-flags:
456 .. flat-table::
457 :header-rows: 0
458 :stub-columns: 0
461 * .. _`V4L2-BUF-FLAG-MAPPED`:
463 - ``V4L2_BUF_FLAG_MAPPED``
464 - 0x00000001
465 - The buffer resides in device memory and has been mapped into the
472 * .. _`V4L2-BUF-FLAG-QUEUED`:
474 - ``V4L2_BUF_FLAG_QUEUED``
475 - 0x00000002
476 - Internally drivers maintain two buffer queues, an incoming and
477 outgoing queue. When this flag is set, the buffer is currently on
478 the incoming queue. It automatically moves to the outgoing queue
484 * .. _`V4L2-BUF-FLAG-DONE`:
486 - ``V4L2_BUF_FLAG_DONE``
487 - 0x00000004
488 - When this flag is set, the buffer is currently on the outgoing
489 queue, ready to be dequeued from the driver. Drivers set or clear
497 * .. _`V4L2-BUF-FLAG-ERROR`:
499 - ``V4L2_BUF_FLAG_ERROR``
500 - 0x00000040
501 - When this flag is set, the buffer has been dequeued successfully,
506 * .. _`V4L2-BUF-FLAG-IN-REQUEST`:
508 - ``V4L2_BUF_FLAG_IN_REQUEST``
509 - 0x00000080
510 - This buffer is part of a request that hasn't been queued yet.
511 * .. _`V4L2-BUF-FLAG-KEYFRAME`:
513 - ``V4L2_BUF_FLAG_KEYFRAME``
514 - 0x00000008
515 - Drivers set or clear this flag when calling the ``VIDIOC_DQBUF``
518 can be decompressed on its own. Also known as an I-frame.
521 * .. _`V4L2-BUF-FLAG-PFRAME`:
523 - ``V4L2_BUF_FLAG_PFRAME``
524 - 0x00000010
525 - Similar to ``V4L2_BUF_FLAG_KEYFRAME`` this flags predicted frames
529 * .. _`V4L2-BUF-FLAG-BFRAME`:
531 - ``V4L2_BUF_FLAG_BFRAME``
532 - 0x00000020
533 - Similar to ``V4L2_BUF_FLAG_KEYFRAME`` this flags a bi-directional
538 * .. _`V4L2-BUF-FLAG-TIMECODE`:
540 - ``V4L2_BUF_FLAG_TIMECODE``
541 - 0x00000100
542 - The ``timecode`` field is valid. Drivers set or clear this flag
546 * .. _`V4L2-BUF-FLAG-PREPARED`:
548 - ``V4L2_BUF_FLAG_PREPARED``
549 - 0x00000400
550 - The buffer has been prepared for I/O and can be queued by the
556 * .. _`V4L2-BUF-FLAG-NO-CACHE-INVALIDATE`:
558 - ``V4L2_BUF_FLAG_NO_CACHE_INVALIDATE``
559 - 0x00000800
560 - Caches do not have to be invalidated for this buffer. Typically
563 will, probably, be passed on to a DMA-capable hardware unit for
565 queue is used for :ref:`memory mapping <mmap>` streaming I/O and
567 <V4L2-BUF-CAP-SUPPORTS-MMAP-CACHE-HINTS>` capability.
568 * .. _`V4L2-BUF-FLAG-NO-CACHE-CLEAN`:
570 - ``V4L2_BUF_FLAG_NO_CACHE_CLEAN``
571 - 0x00001000
572 - Caches do not have to be cleaned for this buffer. Typically
575 DMA-capable unit, in which case caches have not been used. This flag
576 is ignored unless the queue is used for :ref:`memory mapping <mmap>`
578 <V4L2-BUF-CAP-SUPPORTS-MMAP-CACHE-HINTS>` capability.
579 * .. _`V4L2-BUF-FLAG-M2M-HOLD-CAPTURE-BUF`:
581 - ``V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF``
582 - 0x00000200
583 …- Only valid if struct :c:type:`v4l2_requestbuffers` flag ``V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE…
592 * .. _`V4L2-BUF-FLAG-LAST`:
594 - ``V4L2_BUF_FLAG_LAST``
595 - 0x00100000
596 - Last buffer produced by the hardware. mem2mem codec drivers set
597 this flag on the capture queue for the last buffer when the
605 * .. _`V4L2-BUF-FLAG-REQUEST-FD`:
607 - ``V4L2_BUF_FLAG_REQUEST_FD``
608 - 0x00800000
609 - The ``request_fd`` field contains a valid file descriptor.
610 * .. _`V4L2-BUF-FLAG-TIMESTAMP-MASK`:
612 - ``V4L2_BUF_FLAG_TIMESTAMP_MASK``
613 - 0x0000e000
614 - Mask for timestamp types below. To test the timestamp type, mask
617 * .. _`V4L2-BUF-FLAG-TIMESTAMP-UNKNOWN`:
619 - ``V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN``
620 - 0x00000000
621 - Unknown timestamp type. This type is used by drivers before Linux
628 * .. _`V4L2-BUF-FLAG-TIMESTAMP-MONOTONIC`:
630 - ``V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC``
631 - 0x00002000
632 - The buffer timestamp has been taken from the ``CLOCK_MONOTONIC``
635 * .. _`V4L2-BUF-FLAG-TIMESTAMP-COPY`:
637 - ``V4L2_BUF_FLAG_TIMESTAMP_COPY``
638 - 0x00004000
639 - The CAPTURE buffer timestamp has been taken from the corresponding
641 * .. _`V4L2-BUF-FLAG-TSTAMP-SRC-MASK`:
643 - ``V4L2_BUF_FLAG_TSTAMP_SRC_MASK``
644 - 0x00070000
645 - Mask for timestamp sources below. The timestamp source defines the
652 * .. _`V4L2-BUF-FLAG-TSTAMP-SRC-EOF`:
654 - ``V4L2_BUF_FLAG_TSTAMP_SRC_EOF``
655 - 0x00000000
656 - End Of Frame. The buffer timestamp has been taken when the last
662 * .. _`V4L2-BUF-FLAG-TSTAMP-SRC-SOE`:
664 - ``V4L2_BUF_FLAG_TSTAMP_SRC_SOE``
665 - 0x00010000
666 - Start Of Exposure. The buffer timestamp has been taken when the
679 .. flat-table::
680 :header-rows: 0
681 :stub-columns: 0
684 * - ``V4L2_MEMORY_MMAP``
685 - 1
686 - The buffer is used for :ref:`memory mapping <mmap>` I/O.
687 * - ``V4L2_MEMORY_USERPTR``
688 - 2
689 - The buffer is used for :ref:`user pointer <userp>` I/O.
690 * - ``V4L2_MEMORY_OVERLAY``
691 - 3
692 - [to do]
693 * - ``V4L2_MEMORY_DMABUF``
694 - 4
695 - The buffer is used for :ref:`DMA shared buffer <dmabuf>` I/O.
712 --------------------
716 .. flat-table::
717 :header-rows: 0
718 :stub-columns: 0
721 * - __u32
722 - ``type``
723 - Frame rate the timecodes are based on, see :ref:`timecode-type`.
724 * - __u32
725 - ``flags``
726 - Timecode flags, see :ref:`timecode-flags`.
727 * - __u8
728 - ``frames``
729 - Frame count, 0 ... 23/24/29/49/59, depending on the type of
731 * - __u8
732 - ``seconds``
733 - Seconds count, 0 ... 59. This is a binary, not BCD number.
734 * - __u8
735 - ``minutes``
736 - Minutes count, 0 ... 59. This is a binary, not BCD number.
737 * - __u8
738 - ``hours``
739 - Hours count, 0 ... 29. This is a binary, not BCD number.
740 * - __u8
741 - ``userbits``\ [4]
742 - The "user group" bits from the timecode.
745 .. _timecode-type:
748 --------------
750 .. flat-table::
751 :header-rows: 0
752 :stub-columns: 0
755 * - ``V4L2_TC_TYPE_24FPS``
756 - 1
757 - 24 frames per second, i. e. film.
758 * - ``V4L2_TC_TYPE_25FPS``
759 - 2
760 - 25 frames per second, i. e. PAL or SECAM video.
761 * - ``V4L2_TC_TYPE_30FPS``
762 - 3
763 - 30 frames per second, i. e. NTSC video.
764 * - ``V4L2_TC_TYPE_50FPS``
765 - 4
766 -
767 * - ``V4L2_TC_TYPE_60FPS``
768 - 5
769 -
772 .. _timecode-flags:
775 --------------
779 .. flat-table::
780 :header-rows: 0
781 :stub-columns: 0
784 * - ``V4L2_TC_FLAG_DROPFRAME``
785 - 0x0001
786 - Indicates "drop frame" semantics for counting frames in 29.97 fps
790 * - ``V4L2_TC_FLAG_COLORFRAME``
791 - 0x0002
792 - The "color frame" flag.
793 * - ``V4L2_TC_USERBITS_field``
794 - 0x000C
795 - Field mask for the "binary group flags".
796 * - ``V4L2_TC_USERBITS_USERDEFINED``
797 - 0x0000
798 - Unspecified format.
799 * - ``V4L2_TC_USERBITS_8BITCHARS``
800 - 0x0008
801 - 8-bit ISO characters.