L4T Multimedia API Reference

28.1 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
V4L2 Video Converter

Detailed Description

NVIDIA Tegra V4L2 Video Converter Description and Extensions.

Use the video converter for color space conversion, scaling, and conversion between hardware buffer memory (V4L2_MEMORY_MMAP/V4L2_MEMORY_DMABUF), software buffer memory (V4L2_MEMORY_USERPTR), and other operations such as cropping, flipping/rotating, and temporal noise reduction (TNR). The video converter device node is "/dev/nvhost-vic".

Supported Pixelformats

PIXEL FORMAT PIXEL FORMAT
V4L2_PIX_FMT_YUV444M V4L2_PIX_FMT_YVU422M
V4L2_PIX_FMT_YUV420M V4L2_PIX_FMT_YVU420M
V4L2_PIX_FMT_NV12M V4L2_PIX_FMT_GREY
V4L2_PIX_FMT_YUYV V4L2_PIX_FMT_YVYU
V4L2_PIX_FMT_UYVY V4L2_PIX_FMT_VYUY
V4L2_PIX_FMT_ABGR32 V4L2_PIX_FMT_XBGR32

Supported Pixel Formats for TNR

PIXEL FORMAT PIXEL FORMAT
V4L2_PIX_FMT_YUV420M V4L2_PIX_FMT_NV12M
V4L2_PIX_FMT_UYVY V4L2_PIX_FMT_YUYV

Supported Memory Types

MEMORY OUTPUT PLANE CAPTURE PLANE
V4L2_MEMORY_MMAP Y Y
V4L2_MEMORY_DMABUF Y Y
V4L2_MEMORY_USERPTR Y Y

Supported Controls

Cropping

Video converter supports cropping using VIDIOC_S_SELECTION IOCTL with type V4L2_BUF_TYPE_VIDEO_CAPTURE and target V4L2_SEL_TGT_CROP. This must be set before requesting buffers on either plane.

EOS Handling

The following sequence must be followed for sending EOS and recieving EOS from the converter.

  1. Send EOS to converter by queueing on the output plane a buffer with bytesused = 0 for the 0th plane (v4l2_buffer.m.planes[0].bytesused = 0).
  2. Dequeues buffers on the capture plane until it gets a buffer with bytesused = 0 for the 0th plane.
Note
Currently, V4L2 plugins do not support odd resolution.

Macros

#define V4L2_CID_VIDEO_CONVERT_OUTPUT_PLANE_LAYOUT   (V4L2_CID_MPEG_BASE+520)
 Defines the Control ID to set converter output plane buffer layout. More...
 
#define V4L2_CID_VIDEO_CONVERT_CAPTURE_PLANE_LAYOUT   (V4L2_CID_MPEG_BASE+521)
 Defines the Control ID to set converter capture plane buffer layout. More...
 
#define V4L2_CID_VIDEO_CONVERT_FLIP_METHOD   (V4L2_CID_MPEG_BASE+522)
 Defines the Control ID to set the converter flip/rotation method. More...
 
#define V4L2_CID_VIDEO_CONVERT_INTERPOLATION_METHOD   (V4L2_CID_MPEG_BASE+523)
 Defines the Control ID to set the converter interpolation method. More...
 
#define V4L2_CID_VIDEO_CONVERT_TNR_ALGORITHM   (V4L2_CID_MPEG_BASE+524)
 Defines the Control ID to set the converter Temporal Noise Reduction (TNR) algorithm. More...
 

Enumerations

enum  v4l2_nv_buffer_layout {
  V4L2_NV_BUFFER_LAYOUT_PITCH = 0,
  V4L2_NV_BUFFER_LAYOUT_BLOCKLINEAR = 1
}
 Enum specifying types of buffer layouts. More...
 
enum  v4l2_flip_method {
  V4L2_FLIP_METHOD_IDENTITY = 0,
  V4L2_FLIP_METHOD_90L = 1,
  V4L2_FLIP_METHOD_180 = 2,
  V4L2_FLIP_METHOD_90R = 3,
  V4L2_FLIP_METHOD_HORIZ = 4,
  V4L2_FLIP_METHOD_INVTRANS = 5,
  V4L2_FLIP_METHOD_VERT = 6,
  V4L2_FLIP_METHOD_TRANS = 7
}
 Specifies the types of rotation/flip algorithms. More...
 
enum  v4l2_interpolation_method {
  V4L2_INTERPOLATION_NEAREST = 1,
  V4L2_INTERPOLATION_LINEAR = 2,
  V4L2_INTERPOLATION_SMART = 3,
  V4L2_INTERPOLATION_BILINEAR = 4
}
 Specifies the types of interpolation methods. More...
 
enum  v4l2_tnr_algorithm {
  V4L2_TNR_ALGO_ORIGINAL = 0,
  V4L2_TNR_ALGO_OUTDOOR_LOW_LIGHT = 1,
  V4L2_TNR_ALGO_OUTDOOR_MEDIUM_LIGHT = 2,
  V4L2_TNR_ALGO_OUTDOOR_HIGH_LIGHT = 3,
  V4L2_TNR_ALGO_INDOOR_LOW_LIGHT = 4,
  V4L2_TNR_ALGO_INDOOR_MEDIUM_LIGHT = 5,
  V4L2_TNR_ALGO_INDOOR_HIGH_LIGHT = 6
}
 Specifies the types of TNR algorithms. More...
 

Macro Definition Documentation

#define V4L2_CID_VIDEO_CONVERT_CAPTURE_PLANE_LAYOUT   (V4L2_CID_MPEG_BASE+521)

Defines the Control ID to set converter capture plane buffer layout.

A value of type v4l2_nv_buffer_layout must be supplied with this control.

Attention
This control must be set before requesting buffers on the capture plane.

Definition at line 575 of file v4l2_nv_extensions.h.

#define V4L2_CID_VIDEO_CONVERT_FLIP_METHOD   (V4L2_CID_MPEG_BASE+522)

Defines the Control ID to set the converter flip/rotation method.

A value of type v4l2_flip_method must be supplied with this control.

Attention
This control must be set before requesting buffers on either plane.

Definition at line 584 of file v4l2_nv_extensions.h.

#define V4L2_CID_VIDEO_CONVERT_INTERPOLATION_METHOD   (V4L2_CID_MPEG_BASE+523)

Defines the Control ID to set the converter interpolation method.

A value of type v4l2_interpolation_method must be supplied with this control.

Attention
This control must be set before requesting buffers on either plane.

Definition at line 593 of file v4l2_nv_extensions.h.

#define V4L2_CID_VIDEO_CONVERT_OUTPUT_PLANE_LAYOUT   (V4L2_CID_MPEG_BASE+520)

Defines the Control ID to set converter output plane buffer layout.

A value of type v4l2_nv_buffer_layout must be supplied with this control.

Attention
This control must be set before requesting buffers on the output plane.

Definition at line 566 of file v4l2_nv_extensions.h.

#define V4L2_CID_VIDEO_CONVERT_TNR_ALGORITHM   (V4L2_CID_MPEG_BASE+524)

Defines the Control ID to set the converter Temporal Noise Reduction (TNR) algorithm.

A value of type v4l2_tnr_algorithm must be supplied with this control.

Attention
This control must be set before requesting buffers on either plane.
TNR algorithms are not supported with YUV422 and YUV444 capture plane formats.

Definition at line 604 of file v4l2_nv_extensions.h.

Enumeration Type Documentation

Specifies the types of rotation/flip algorithms.

Enumerator
V4L2_FLIP_METHOD_IDENTITY 

Identity (no rotation).

V4L2_FLIP_METHOD_90L 

Rotate counter-clockwise 90 degrees.

V4L2_FLIP_METHOD_180 

Rotate 180 degrees.

V4L2_FLIP_METHOD_90R 

Rotate clockwise 90 degrees.

V4L2_FLIP_METHOD_HORIZ 

Flip horizontally.

V4L2_FLIP_METHOD_INVTRANS 

Flip across upper right/lower left diagonal.

V4L2_FLIP_METHOD_VERT 

Flip vertically.

V4L2_FLIP_METHOD_TRANS 

Flip across upper left/lower right diagonal.

Definition at line 1525 of file v4l2_nv_extensions.h.

Specifies the types of interpolation methods.

Enumerator
V4L2_INTERPOLATION_NEAREST 

Nearest interpolation method.

V4L2_INTERPOLATION_LINEAR 

Linear interpolation method.

V4L2_INTERPOLATION_SMART 

Smart interpolation method.

V4L2_INTERPOLATION_BILINEAR 

Bi-Linear interpolation method.

Definition at line 1539 of file v4l2_nv_extensions.h.

Enum specifying types of buffer layouts.

Enumerator
V4L2_NV_BUFFER_LAYOUT_PITCH 

Pitch Linear Layout.

V4L2_NV_BUFFER_LAYOUT_BLOCKLINEAR 

Block Linear Layout.

Definition at line 1517 of file v4l2_nv_extensions.h.

Specifies the types of TNR algorithms.

Enumerator
V4L2_TNR_ALGO_ORIGINAL 

Default TNR algorithm.

V4L2_TNR_ALGO_OUTDOOR_LOW_LIGHT 

Outdoor Low Light TNR algorithm.

V4L2_TNR_ALGO_OUTDOOR_MEDIUM_LIGHT 

Outdoor Medium Light TNR algorithm.

V4L2_TNR_ALGO_OUTDOOR_HIGH_LIGHT 

Outdoor High Light TNR algorithm.

V4L2_TNR_ALGO_INDOOR_LOW_LIGHT 

Indoor Low Light TNR algorithm.

V4L2_TNR_ALGO_INDOOR_MEDIUM_LIGHT 

Indoor Medium Light TNR algorithm.

V4L2_TNR_ALGO_INDOOR_HIGH_LIGHT 

Indoor High Light TNR algorithm.

Definition at line 1549 of file v4l2_nv_extensions.h.