Jetson Linux API Reference

32.7.5 Release
NvV4l2Element.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_V4L2_ELEMENT_H__
47 #define __NV_V4L2_ELEMENT_H__
48 
49 #include "NvElement.h"
50 #include "NvV4l2ElementPlane.h"
51 
52 #include "v4l2_nv_extensions.h"
53 
66 {
67 public:
68  virtual ~NvV4l2Element();
69 
80  int subscribeEvent(uint32_t type, uint32_t id, uint32_t flags);
93  int dqEvent(struct v4l2_event &event, uint32_t max_wait_ms);
94 
104  int setControl(uint32_t id, int32_t value);
115  int getControl(uint32_t id, int32_t &value);
116 
125  int setExtControls(struct v4l2_ext_controls &ctl);
134  int getExtControls(struct v4l2_ext_controls &ctl);
135 
136  virtual int isInError();
137 
156  int abort();
157 
167  virtual int waitForIdle(uint32_t max_wait_ms);
168 
169  void *app_data;
176  void enableProfiling();
177 
178 protected:
179  int fd;
198  NvV4l2Element(const char *comp_name, const char *dev_node, int flags, NvElementProfiler::ProfilerField fields);
199 };
201 #endif
NvV4l2Element
Defines a helper class for V4L2 based components.
Definition: NvV4l2Element.h:65
NvV4l2Element::abort
int abort()
Terminates processing of queued buffers immediately.
NvV4l2Element::capture_plane_pixfmt
uint32_t capture_plane_pixfmt
Pixel format of capture plane buffers.
Definition: NvV4l2Element.h:182
NvV4l2Element::setExtControls
int setExtControls(struct v4l2_ext_controls &ctl)
Sets the value of several controls.
NvElement::comp_name
const char * comp_name
Specifies the name of the component, for debugging.
Definition: NvElement.h:122
NvElementProfiler::ProfilerField
int ProfilerField
Definition: NvElementProfiler.h:79
NvV4l2Element::waitForIdle
virtual int waitForIdle(uint32_t max_wait_ms)
Waits until the element processes all the output plane buffers.
NvV4l2Element::enableProfiling
void enableProfiling()
Enables profiling for the V4l2Element.
NvV4l2Element::getControl
int getControl(uint32_t id, int32_t &value)
Gets the value of a control.
NvV4l2Element::NvV4l2Element
NvV4l2Element(const char *comp_name, const char *dev_node, int flags, NvElementProfiler::ProfilerField fields)
Creates a new V4l2Element named name.
NvV4l2Element::isInError
virtual int isInError()
NvV4l2ElementPlane.h
NvV4l2Element::fd
int fd
Specifies the FD of the device opened using v4l2_open.
Definition: NvV4l2Element.h:179
NvV4l2Element::~NvV4l2Element
virtual ~NvV4l2Element()
NvV4l2Element::subscribeEvent
int subscribeEvent(uint32_t type, uint32_t id, uint32_t flags)
Subscribes to an V4L2 event.
NvV4l2ElementPlane
Defines a helper class for operations performed on a V4L2 Element plane.
Definition: NvV4l2ElementPlane.h:104
NvV4l2Element::getExtControls
int getExtControls(struct v4l2_ext_controls &ctl)
Gets the value of several controls.
NvV4l2Element::dqEvent
int dqEvent(struct v4l2_event &event, uint32_t max_wait_ms)
Dequeues an event from the element.
NvElement
Every element has a unique name that can be used for identifying the element in debug logs.
Definition: NvElement.h:63
v4l2_nv_extensions.h
NvV4l2Element::output_plane_pixfmt
uint32_t output_plane_pixfmt
Pixel format of output plane buffers.
Definition: NvV4l2Element.h:181
NvV4l2Element::capture_plane
NvV4l2ElementPlane capture_plane
Sets the capture plane.
Definition: NvV4l2Element.h:145
NvElement.h
NvV4l2Element::setControl
int setControl(uint32_t id, int32_t value)
Sets the value of a control.
NvV4l2Element::output_plane
NvV4l2ElementPlane output_plane
Sets the output plane.
Definition: NvV4l2Element.h:141
NvV4l2Element::app_data
void * app_data
A pointer to the application-specific data.
Definition: NvV4l2Element.h:169