Jetson Linux API Reference

36.4 Release
NvVideoDecoder.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: BSD-3-Clause
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice, this
9  * list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its
16  * contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
47 #ifndef __NV_VIDEO_DECODER_H__
48 #define __NV_VIDEO_DECODER_H__
49 
50 #include "NvV4l2Element.h"
51 
61 {
62 public:
77  static NvVideoDecoder *createVideoDecoder(const char *name, int flags = 0);
78 
90  int setCapturePlaneFormat(uint32_t pixfmt, uint32_t width, uint32_t height);
101  int setOutputPlaneFormat(uint32_t pixfmt, uint32_t sizeimage);
102 
113 
124  int setFrameInputMode(unsigned int ctrl_value);
125 
136  int setSliceMode(unsigned int ctrl_value);
137 
147  int disableDPB();
148 
161  int getMinimumCapturePlaneBuffers(int & num);
162 
175  int setSkipFrames(enum v4l2_skip_frames_type skip_frames);
176 
189  int setMaxPerfMode(int flag);
190 
201 
204 
220  int getMetadata(uint32_t buffer_index,
222 
238  int getInputMetadata(uint32_t buffer_index,
239  v4l2_ctrl_videodec_inputbuf_metadata &input_metadata);
240 
253  int getSAR(uint32_t &sar_width, uint32_t &sar_height);
254 
261  int DevicePoll(v4l2_ctrl_video_device_poll *devicepoll);
262 
267  int SetPollInterrupt();
268 
273  int ClearPollInterrupt();
274 
284  int enableGDRStream();
285 
296  int setAV1OperatingPoint(int ctrl_value);
297 
306  int enableAV1MVC();
307 
320  int getAV1NumOperatingPoints(uint8_t &num_operating_points);
321 
322 private:
326  NvVideoDecoder(const char *name, const char* dev_node, int flags);
327 
328  static const NvElementProfiler::ProfilerField valid_fields =
331 };
333 #endif
NvVideoDecoder::SetPollInterrupt
int SetPollInterrupt()
Sets the polling interrupt, now if the application calls Poll, the device should not block,...
NvVideoDecoder::setCapturePlaneFormat
int setCapturePlaneFormat(uint32_t pixfmt, uint32_t width, uint32_t height)
Sets the format on the decoder output plane.
NvVideoDecoder::getMetadata
int getMetadata(uint32_t buffer_index, v4l2_ctrl_videodec_outputbuf_metadata &metadata)
Gets metadata for the decoded capture plane buffer.
v4l2_ctrl_videodec_inputbuf_metadata_
Holds the video decoder input header error metadata for a frame.
Definition: v4l2_nv_extensions.h:1960
NvV4l2Element
Defines a helper class for V4L2 based components.
Definition: NvV4l2Element.h:65
v4l2_ctrl_video_displaydata_
Definition: v4l2_nv_extensions.h:3028
NvVideoDecoder::disableDPB
int disableDPB()
Disables the display picture buffer.
NvVideoDecoder::setSliceMode
int setSliceMode(unsigned int ctrl_value)
Enable slice level decoding for HEVC.
NvVideoDecoder::MasteringDisplayData
int MasteringDisplayData(v4l2_ctrl_video_hdrmasteringdisplaydata *hdrmasteringdisplaydata)
NvVideoDecoder::getInputMetadata
int getInputMetadata(uint32_t buffer_index, v4l2_ctrl_videodec_inputbuf_metadata &input_metadata)
Gets metadata for the decoder output plane buffer.
v4l2_skip_frames_type
v4l2_skip_frames_type
Enum v4l2_skip_frames_type, possible methods for decoder skip frames.
Definition: v4l2_nv_extensions.h:1769
NvElementProfiler::ProfilerField
int ProfilerField
Definition: NvElementProfiler.h:79
NvVideoDecoder::checkifMasteringDisplayDataPresent
int checkifMasteringDisplayDataPresent(v4l2_ctrl_video_displaydata &displaydata)
_v4l2_ctrl_video_device_poll
Poll device.
Definition: v4l2_nv_extensions.h:3052
NvVideoDecoder::setAV1OperatingPoint
int setAV1OperatingPoint(int ctrl_value)
Set the operating point for AV1 decoder.
NvVideoDecoder::setSkipFrames
int setSkipFrames(enum v4l2_skip_frames_type skip_frames)
Sets the skip-frames parameter of the decoder.
NvVideoDecoder::ClearPollInterrupt
int ClearPollInterrupt()
Clears the polling interrupt, now if the application calls Poll, the device should block until the ev...
NvVideoDecoder::DevicePoll
int DevicePoll(v4l2_ctrl_video_device_poll *devicepoll)
Issues Poll on the device which blocks until : a) Either there is something to dequeue from capture o...
NvVideoDecoder::disableCompleteFrameInputBuffer
int disableCompleteFrameInputBuffer()
Informs the decoder that input buffers may not contain complete frames.
NvVideoDecoder::setFrameInputMode
int setFrameInputMode(unsigned int ctrl_value)
Informs the decoder that input buffers may not contain complete frames.
NvVideoDecoder::enableMetadataReporting
int enableMetadataReporting()
Enables video decoder output metadata reporting.
_v4l2_ctrl_video_hdrmasteringdisplaydata
HDR Metadata.
Definition: v4l2_nv_extensions.h:3037
NvElementProfiler::PROFILER_FIELD_FPS
static const ProfilerField PROFILER_FIELD_FPS
Definition: NvElementProfiler.h:84
NvVideoDecoder::createVideoDecoder
static NvVideoDecoder * createVideoDecoder(const char *name, int flags=0)
Creates a new V4L2 Video Decoder object named name.
NvVideoDecoder
Defines a helper class for V4L2 Video Decoder.
Definition: NvVideoDecoder.h:60
v4l2_ctrl_videodec_outputbuf_metadata_
Holds the video decoder output metadata for a frame.
Definition: v4l2_nv_extensions.h:1972
NvVideoDecoder::getSAR
int getSAR(uint32_t &sar_width, uint32_t &sar_height)
Gets Sample Aspect Ratio (SAR) width and height for decoder.
NvVideoDecoder::enableAV1MVC
int enableAV1MVC()
Enable the MVC feature for AV1 decoder.
NvV4l2Element.h
NvVideoDecoder::setMaxPerfMode
int setMaxPerfMode(int flag)
Sets the decoder for maximum performance.
NvElementProfiler::PROFILER_FIELD_TOTAL_UNITS
static const ProfilerField PROFILER_FIELD_TOTAL_UNITS
Definition: NvElementProfiler.h:81
NvVideoDecoder::getAV1NumOperatingPoints
int getAV1NumOperatingPoints(uint8_t &num_operating_points)
Gets number of operating points for AV1 decoder stream.
NvVideoDecoder::enableGDRStream
int enableGDRStream()
Enables GDR stream playback.
NvVideoDecoder::setOutputPlaneFormat
int setOutputPlaneFormat(uint32_t pixfmt, uint32_t sizeimage)
Sets the format on the decoder output plane.
NvVideoDecoder::getMinimumCapturePlaneBuffers
int getMinimumCapturePlaneBuffers(int &num)
Gets the minimum number of buffers to be requested on the decoder capture plane.
NvVideoDecoder::~NvVideoDecoder
~NvVideoDecoder()