NVIDIA V4L2 Video Decoder Description and Extensions.
The video decoder device node is
/dev/nvhost-nvdec
OUTPUT PLANE | CAPTURE PLANE | PLATFORM |
---|---|---|
V4L2_PIX_FMT_H264 | V4L2_PIX_FMT_NV12M | T210, T186, T194, T234 |
V4L2_PIX_FMT_H265 | V4L2_PIX_FMT_NV12M | T210, T186, T194, T234 |
V4L2_PIX_FMT_VP8 | V4L2_PIX_FMT_NV12M | T210, T186, T194, T234 |
V4L2_PIX_FMT_VP9 | V4L2_PIX_FMT_NV12M | T210, T186, T194, T234 |
V4L2_PIX_FMT_MPEG1 | V4L2_PIX_FMT_NV12M | T210, T186, T194, T234 |
V4L2_PIX_FMT_MPEG2 | V4L2_PIX_FMT_NV12M | T210, T186, T194, T234 |
V4L2_PIX_FMT_MPEG4 | V4L2_PIX_FMT_NV12M | T210, T186, T194, T234 |
V4L2_PIX_FMT_DIVX4 | V4L2_PIX_FMT_NV12M | T210, T186, T194, T234 |
V4L2_PIX_FMT_DIVX5 | V4L2_PIX_FMT_NV12M | T210, T186, T194, T234 |
V4L2_PIX_FMT_JPEG | V4L2_PIX_FMT_NV12M | T210, T186, T194, T234 |
V4L2_PIX_FMT_MJPEG | V4L2_PIX_FMT_NV12M | T210, T186, T194, T234 |
V4L2_PIX_FMT_AV1 | V4L2_PIX_FMT_NV12M | T234 |
MEMORY | OUTPUT PLANE | CAPTURE PLANE |
---|---|---|
V4L2_MEMORY_MMAP | Y | Y |
V4L2_MEMORY_DMABUF | N | Y |
V4L2_MEMORY_USERPTR | Y | N |
Event | Purpose |
---|---|
V4L2_EVENT_RESOLUTION_CHANGE | Resolution of the stream has changed. |
When the decoder generates a V4L2_EVENT_RESOLUTION_CHANGE
event, the application calls STREAMOFF
on the capture plane to tell the decoder to deallocate the current buffers by calling REQBUF with count zero, get the new capture plane format, and then proceed with setting up the buffers for the capture plane.
In case of decoder, the buffer format might differ from the display resolution. The application must use VIDIOC_G_CROP
to get the display resolution.
The following sequence must be followed for sending EOS and recieving EOS from the decoder.
v4l2_buffer.m.planes[0].bytesused = 0
).v4l2_buffer.m.planes[0].bytesused == 0
)Decoder supports reporting stream header parsing error info as input frame metadata. See V4L2_CID_MPEG_VIDEO_ERROR_REPORTING
, V4L2_CID_MPEG_VIDEODEC_INPUT_METADATA
and v4l2_ctrl_video_metadata
for more information.
Decoder supports reporting frame related metadata, including error reports and DPB info. See V4L2_CID_MPEG_VIDEO_ERROR_REPORTING
, V4L2_CID_MPEG_VIDEODEC_METADATA
and v4l2_ctrl_video_metadata
for more information.
Data Structures | |
struct | v4l2_ctrl_videodec_statusmetadata_ |
Holds the decoder error status metadata for the frame. More... | |
struct | v4l2_ctrl_videodec_refframe_metadata_ |
Holds the the frame specific metadata for a reference frame. More... | |
struct | v4l2_ctrl_videodec_currentframe_metadata_ |
Holds the the frame specific metadata for the current frame. More... | |
struct | v4l2_ctrl_videodec_dpbinfometadata_ |
Holds the decoder DPB info metadata. More... | |
struct | v4l2_ctrl_h264dec_bufmetadata_ |
Holds H.264 specific decoder metadata for the frame. More... | |
struct | v4l2_ctrl_hevcdec_bufmetadata_ |
Holds H.265 specific decoder metadata for the frame. More... | |
struct | v4l2_ctrl_av1dec_bufmetadata_ |
struct | v4l2_ctrl_videodec_inputbuf_metadata_ |
Holds the video decoder input header error metadata for a frame. More... | |
struct | v4l2_ctrl_videodec_outputbuf_metadata_ |
Holds the video decoder output metadata for a frame. More... | |
Macros | |
#define | V4L2_CID_MPEG_VIDEO_DISABLE_COMPLETE_FRAME_INPUT (V4L2_CID_MPEG_BASE+515) |
Defines the Control ID to indicate to the decoder that the input buffers do not contain complete buffers. More... | |
#define | V4L2_CID_MPEG_VIDEO_DISABLE_DPB (V4L2_CID_MPEG_BASE+516) |
Defines the Control ID to disable decoder DPB management. More... | |
#define | V4L2_CID_MPEG_VIDEO_ERROR_REPORTING (V4L2_CID_MPEG_BASE+517) |
Defines the Control ID to enable decoder error and metadata reporting. More... | |
#define | V4L2_CID_MPEG_VIDEO_SKIP_FRAMES (V4L2_CID_MPEG_BASE+518) |
Defines the Control ID to set the skip frames property of the decoder. More... | |
#define | V4L2_CID_MPEG_VIDEODEC_METADATA (V4L2_CID_MPEG_BASE+519) |
Defines the Control ID to get the decoder output metadata. More... | |
#define | V4L2_CID_MPEG_VIDEODEC_INPUT_METADATA (V4L2_CID_MPEG_BASE+520) |
Defines the Control ID to get the decoder input header error metadata. More... | |
#define | V4L2_CID_VIDEODEC_DISPLAYDATA_PRESENT (V4L2_CID_MPEG_BASE+521) |
Defines the Control ID to check if display data is present. More... | |
#define | V4L2_CID_VIDEODEC_HDR_MASTERING_DISPLAY_DATA (V4L2_CID_MPEG_BASE+522) |
Defines the Control ID to get display data if V4L2_CID_VIDEODEC_DISPLAYDATA_PRESENT returns true. More... | |
#define | V4L2_CID_MPEG_VIDEODEC_SAR_WIDTH (V4L2_CID_MPEG_BASE+580) |
Defines the Control ID to get Sample Aspect Ratio width for decoding. More... | |
#define | V4L2_CID_MPEG_VIDEODEC_SAR_HEIGHT (V4L2_CID_MPEG_BASE+581) |
Defines the Control ID to get Sample Aspect Ratio height for decoding. More... | |
#define | V4L2_CID_MPEG_VIDEOENC_DS_SEI_DATA (V4L2_CID_MPEG_BASE+571) |
Defines the Control ID to embed the SEI data coming from upstream plugins. More... | |
#define | V4L2_CID_MPEG_VIDEODEC_GDR_STREAM (V4L2_CID_MPEG_BASE+591) |
Defines the Control ID to enable GDR stream playback. More... | |
#define | V4L2_CID_MPEG_VIDEOENC_DS_SEI_UUID (V4L2_CID_MPEG_BASE+594) |
Defines the Control ID to set SEI UUID. More... | |
#define | V4L2_CID_MPEG_VIDEODEC_OPERATING_POINT (V4L2_CID_MPEG_BASE+595) |
Defines the Control ID to set the AV1 decoder operating point. More... | |
#define | V4L2_CID_MPEG_VIDEODEC_ENABLE_MVC (V4L2_CID_MPEG_BASE+596) |
Defines the Control ID to enable the AV1 decoder MVC feature. More... | |
#define | V4L2_CID_MPEG_VIDEODEC_NUM_OPERATING_POINTS (V4L2_CID_MPEG_BASE+597) |
Defines the Control ID to get number of operating points in AV1 decoder stream. More... | |
Enumerations | |
enum | v4l2_skip_frames_type { V4L2_SKIP_FRAMES_TYPE_NONE = 0, V4L2_SKIP_FRAMES_TYPE_NONREF = 1, V4L2_SKIP_FRAMES_TYPE_DECODE_IDR_ONLY = 2 } |
Enum v4l2_skip_frames_type, possible methods for decoder skip frames. More... | |
enum | v4l2_cuda_mem_type { V4L2_CUDA_MEM_TYPE_DEVICE = 0, V4L2_CUDA_MEM_TYPE_PINNED = 1, V4L2_CUDA_MEM_TYPE_UNIFIED = 2 } |
Enum v4l2_cuda_mem_type, possible methods for cuda memory tpye. More... | |
enum | v4l2_videodec_input_error_type { V4L2_DEC_ERROR_NONE = 0x0, V4L2_DEC_ERROR_SPS = 0x1, V4L2_DEC_ERROR_PPS = 0x2, V4L2_DEC_ERROR_SLICE_HDR = 0x4, V4L2_DEC_ERROR_MISSING_REF_FRAME = 0x8, V4L2_DEC_ERROR_VPS = 0x10, V4L2_DEC_ERROR_FORCE32 = 0x7FFFFFFF } |
Enum v4l2_videodec_input_error_type, possible error types for input stream. More... | |
#define V4L2_CID_MPEG_VIDEO_DISABLE_COMPLETE_FRAME_INPUT (V4L2_CID_MPEG_BASE+515) |
Defines the Control ID to indicate to the decoder that the input buffers do not contain complete buffers.
A boolean value must be supplied with this control.
Definition at line 457 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEO_DISABLE_DPB (V4L2_CID_MPEG_BASE+516) |
Defines the Control ID to disable decoder DPB management.
No addtional parameter should be supplied with this control.
Definition at line 469 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEO_ERROR_REPORTING (V4L2_CID_MPEG_BASE+517) |
Defines the Control ID to enable decoder error and metadata reporting.
No additional parameter should be supplied with this control.
Definition at line 479 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEO_SKIP_FRAMES (V4L2_CID_MPEG_BASE+518) |
Defines the Control ID to set the skip frames property of the decoder.
Decoder must be configured to skip certain types of frames. One v4l2_skip_frames_type
must be passed.
Definition at line 491 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEODEC_ENABLE_MVC (V4L2_CID_MPEG_BASE+596) |
Defines the Control ID to enable the AV1 decoder MVC feature.
This will enable the AV1 MVC feature
Definition at line 608 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEODEC_GDR_STREAM (V4L2_CID_MPEG_BASE+591) |
Defines the Control ID to enable GDR stream playback.
A boolean value must be supplied with this control.
Definition at line 578 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEODEC_INPUT_METADATA (V4L2_CID_MPEG_BASE+520) |
Defines the Control ID to get the decoder input header error metadata.
A pointer to a valid v4l2_ctrl_video_metadata
structure must be supplied with this control.
Definition at line 521 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEODEC_METADATA (V4L2_CID_MPEG_BASE+519) |
Defines the Control ID to get the decoder output metadata.
A pointer to a valid v4l2_ctrl_video_metadata
structure must be supplied with this control.
Definition at line 506 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEODEC_NUM_OPERATING_POINTS (V4L2_CID_MPEG_BASE+597) |
Defines the Control ID to get number of operating points in AV1 decoder stream.
This control returns unsigned integer of number of operating points.
Definition at line 618 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEODEC_OPERATING_POINT (V4L2_CID_MPEG_BASE+595) |
Defines the Control ID to set the AV1 decoder operating point.
A int value must be supplied with this control.
Definition at line 598 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEODEC_SAR_HEIGHT (V4L2_CID_MPEG_BASE+581) |
Defines the Control ID to get Sample Aspect Ratio height for decoding.
This control returns unsigned integer of Sample Aspect Ratio height.
Definition at line 558 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEODEC_SAR_WIDTH (V4L2_CID_MPEG_BASE+580) |
Defines the Control ID to get Sample Aspect Ratio width for decoding.
This control returns unsigned integer of Sample Aspect Ratio width.
Definition at line 548 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEOENC_DS_SEI_DATA (V4L2_CID_MPEG_BASE+571) |
Defines the Control ID to embed the SEI data coming from upstream plugins.
This control sets the SEI payload size and SEI data pointer for encoder.
Definition at line 568 of file v4l2_nv_extensions.h.
#define V4L2_CID_MPEG_VIDEOENC_DS_SEI_UUID (V4L2_CID_MPEG_BASE+594) |
Defines the Control ID to set SEI UUID.
A string of size 16 bytes to be suppplied with this control
Definition at line 588 of file v4l2_nv_extensions.h.
#define V4L2_CID_VIDEODEC_DISPLAYDATA_PRESENT (V4L2_CID_MPEG_BASE+521) |
Defines the Control ID to check if display data is present.
This control returns true if HDR metadata is present in the stream.
Definition at line 529 of file v4l2_nv_extensions.h.
#define V4L2_CID_VIDEODEC_HDR_MASTERING_DISPLAY_DATA (V4L2_CID_MPEG_BASE+522) |
Defines the Control ID to get display data if V4L2_CID_VIDEODEC_DISPLAYDATA_PRESENT returns true.
This control returns display data such as display_primaries, white_point and display_parameter_luminance required for display module.
Definition at line 538 of file v4l2_nv_extensions.h.
typedef struct v4l2_ctrl_av1dec_bufmetadata_ v4l2_ctrl_av1dec_bufmetadata |
typedef struct v4l2_ctrl_h264dec_bufmetadata_ v4l2_ctrl_h264dec_bufmetadata |
Holds H.264 specific decoder metadata for the frame.
typedef struct v4l2_ctrl_hevcdec_bufmetadata_ v4l2_ctrl_hevcdec_bufmetadata |
Holds H.265 specific decoder metadata for the frame.
Holds the the frame specific metadata for the current frame.
Holds the decoder DPB info metadata.
Holds the video decoder input header error metadata for a frame.
Holds the video decoder output metadata for a frame.
Holds the the frame specific metadata for a reference frame.
Holds the decoder error status metadata for the frame.
enum v4l2_cuda_mem_type |
Enum v4l2_cuda_mem_type, possible methods for cuda memory tpye.
Enumerator | |
---|---|
V4L2_CUDA_MEM_TYPE_DEVICE | Memory type device. |
V4L2_CUDA_MEM_TYPE_PINNED | Memory type host. |
V4L2_CUDA_MEM_TYPE_UNIFIED | Memory type unified. |
Definition at line 1780 of file v4l2_nv_extensions.h.
Enum v4l2_skip_frames_type, possible methods for decoder skip frames.
Enumerator | |
---|---|
V4L2_SKIP_FRAMES_TYPE_NONE | Do not skip any frame. |
V4L2_SKIP_FRAMES_TYPE_NONREF | Skip all non-reference frames. |
V4L2_SKIP_FRAMES_TYPE_DECODE_IDR_ONLY | Skip all frames except IDR. |
Definition at line 1769 of file v4l2_nv_extensions.h.
Enum v4l2_videodec_input_error_type, possible error types for input stream.
Definition at line 1791 of file v4l2_nv_extensions.h.