Jetson Linux API Reference

35.2.1 Release
NvVideoDecoder.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of NVIDIA CORPORATION nor the names of its
13  * contributors may be used to endorse or promote products derived
14  * from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
45 #ifndef __NV_VIDEO_DECODER_H__
46 #define __NV_VIDEO_DECODER_H__
47 
48 #include "NvV4l2Element.h"
49 
59 {
60 public:
75  static NvVideoDecoder *createVideoDecoder(const char *name, int flags = 0);
76 
88  int setCapturePlaneFormat(uint32_t pixfmt, uint32_t width, uint32_t height);
99  int setOutputPlaneFormat(uint32_t pixfmt, uint32_t sizeimage);
100 
111 
122  int setFrameInputMode(unsigned int ctrl_value);
123 
133  int disableDPB();
134 
147  int getMinimumCapturePlaneBuffers(int & num);
148 
161  int setSkipFrames(enum v4l2_skip_frames_type skip_frames);
162 
175  int setMaxPerfMode(int flag);
176 
187 
190 
206  int getMetadata(uint32_t buffer_index,
208 
224  int getInputMetadata(uint32_t buffer_index,
225  v4l2_ctrl_videodec_inputbuf_metadata &input_metadata);
226 
239  int getSAR(uint32_t &sar_width, uint32_t &sar_height);
240 
247  int DevicePoll(v4l2_ctrl_video_device_poll *devicepoll);
248 
253  int SetPollInterrupt();
254 
259  int ClearPollInterrupt();
260 
261 private:
265  NvVideoDecoder(const char *name, int flags);
266 
267  static const NvElementProfiler::ProfilerField valid_fields =
270 };
272 #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:1804
NvV4l2Element
Defines a helper class for V4L2 based components.
Definition: NvV4l2Element.h:65
v4l2_ctrl_video_displaydata_
Definition: v4l2_nv_extensions.h:2655
NvVideoDecoder::disableDPB
int disableDPB()
Disables the display picture buffer.
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:1657
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:2679
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:2664
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:58
v4l2_ctrl_videodec_outputbuf_metadata_
Holds the video decoder output metadata for a frame.
Definition: v4l2_nv_extensions.h:1814
NvVideoDecoder::getSAR
int getSAR(uint32_t &sar_width, uint32_t &sar_height)
Gets Sample Aspect Ratio (SAR) width and height for 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::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()