Jetson Linux API Reference

32.7.5 Release
NvVideoConverter.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 
46 #ifndef __NV_VIDEO_CONVERTER_H__
47 #define __NV_VIDEO_CONVERTER_H__
48 
49 #include "NvV4l2Element.h"
50 
65 {
66 public:
67 
82  static NvVideoConverter *createVideoConverter(const char *name, int flags = 0);
83 
97  int setCapturePlaneFormat(uint32_t pixfmt, uint32_t width, uint32_t height,
98  enum v4l2_nv_buffer_layout type);
111  int setOutputPlaneFormat(uint32_t pixfmt, uint32_t width, uint32_t height,
112  enum v4l2_nv_buffer_layout type);
113 
126 
139 
153 
165  int setFlipMethod(enum v4l2_flip_method method);
166 
179  int setTnrAlgorithm(enum v4l2_tnr_algorithm algorithm);
180 
193  int setYUVRescale(enum v4l2_yuv_rescale_method method);
194 
208  int setCropRect(uint32_t left, uint32_t top, uint32_t width,
209  uint32_t height);
210 
224  int setDestRect(uint32_t left, uint32_t top, uint32_t width,
225  uint32_t height);
226 
234  int waitForIdle(uint32_t max_wait_ms);
235 
236 private:
240  NvVideoConverter(const char *name, int flags);
241 
242  static const NvElementProfiler::ProfilerField valid_fields =
246 };
248 #endif
NvV4l2Element
Defines a helper class for V4L2 based components.
Definition: NvV4l2Element.h:65
v4l2_nv_buffer_layout
v4l2_nv_buffer_layout
Enum specifying types of buffer layouts.
Definition: v4l2_nv_extensions.h:2372
NvVideoConverter::setCropRect
int setCropRect(uint32_t left, uint32_t top, uint32_t width, uint32_t height)
Set the cropping rectangle for the converter.
NvVideoConverter::setInterpolationMethod
int setInterpolationMethod(enum v4l2_interpolation_method method)
Sets the interpolation(filter) method used for scaling.
v4l2_tnr_algorithm
v4l2_tnr_algorithm
Specifies the types of TNR algorithms.
Definition: v4l2_nv_extensions.h:2406
NvVideoConverter::setFlipMethod
int setFlipMethod(enum v4l2_flip_method method)
Sets the flip method.
NvVideoConverter::~NvVideoConverter
~NvVideoConverter()
NvVideoConverter::setDestRect
int setDestRect(uint32_t left, uint32_t top, uint32_t width, uint32_t height)
Sets the destnation rectangle for the converter.
NvElementProfiler::ProfilerField
int ProfilerField
Definition: NvElementProfiler.h:79
NvVideoConverter::setTnrAlgorithm
int setTnrAlgorithm(enum v4l2_tnr_algorithm algorithm)
Sets the TNR(Temporal Noise Reduction) algorithm to use.
NvVideoConverter::createVideoConverter
static NvVideoConverter * createVideoConverter(const char *name, int flags=0)
Creates a new V4L2 Video Converter object named name.
NvVideoConverter
Defines a helper class for V4L2 Video Converter.
Definition: NvVideoConverter.h:64
NvVideoConverter::waitForIdle
int waitForIdle(uint32_t max_wait_ms)
Waits until all buffers queued on the output plane are converted and dequeued from the capture plane.
NvVideoConverter::setOutputPlaneFormat
int setOutputPlaneFormat(uint32_t pixfmt, uint32_t width, uint32_t height, enum v4l2_nv_buffer_layout type)
Sets the format on the converter output plane.
NvVideoConverter::setCapturePlaneBufferLayout
int setCapturePlaneBufferLayout(enum v4l2_nv_buffer_layout type)
Sets the buffer layout of the capture plane buffers.
NvVideoConverter::setOutputPlaneBufferLayout
int setOutputPlaneBufferLayout(enum v4l2_nv_buffer_layout type)
Sets the buffer layout of the output plane buffers.
v4l2_yuv_rescale_method
v4l2_yuv_rescale_method
Specifies the types of YUV rescale methods.
Definition: v4l2_nv_extensions.h:2419
NvElementProfiler::PROFILER_FIELD_LATENCIES
static const ProfilerField PROFILER_FIELD_LATENCIES
Definition: NvElementProfiler.h:83
v4l2_interpolation_method
v4l2_interpolation_method
Specifies the types of interpolation methods.
Definition: v4l2_nv_extensions.h:2394
NvElementProfiler::PROFILER_FIELD_FPS
static const ProfilerField PROFILER_FIELD_FPS
Definition: NvElementProfiler.h:84
NvVideoConverter::setYUVRescale
int setYUVRescale(enum v4l2_yuv_rescale_method method)
Sets the YUV Rescale method to use.
NvV4l2Element.h
NvElementProfiler::PROFILER_FIELD_TOTAL_UNITS
static const ProfilerField PROFILER_FIELD_TOTAL_UNITS
Definition: NvElementProfiler.h:81
v4l2_flip_method
v4l2_flip_method
Specifies the types of rotation/flip algorithms.
Definition: v4l2_nv_extensions.h:2380
NvVideoConverter::setCapturePlaneFormat
int setCapturePlaneFormat(uint32_t pixfmt, uint32_t width, uint32_t height, enum v4l2_nv_buffer_layout type)
Sets the format on the converter output plane.