L4T Multimedia API Reference

31.1 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
virtual ~NvV4l2Element()
NvV4l2Element(const char *comp_name, const char *dev_node, int flags, NvElementProfiler::ProfilerField fields)
Creates a new V4l2Element named name.
Defines a helper class for V4L2 based components.
Definition: NvV4l2Element.h:65
int dqEvent(struct v4l2_event &event, uint32_t max_wait_ms)
Dequeues an event from the element.
Defines a helper class for operations performed on a V4L2 Element plane.
NVIDIA Multimedia API: V4L2 Element Plane
int abort()
Terminates processing of queued buffers immediately.
int fd
Specifies the FD of the device opened using v4l2_open.
NVIDIA Multimedia API: NvElement Base Class
NvV4l2ElementPlane capture_plane
Sets the capture plane.
Every element has a unique name that can be used for identifying the element in debug logs...
Definition: NvElement.h:63
void * app_data
A pointer to the application-specific data.
NvV4l2ElementPlane output_plane
Sets the output plane.
NVIDIA V4L2 API Extensions
int setControl(uint32_t id, int32_t value)
Sets the value of a control.
const char * comp_name
Specifies the name of the component, for debugging.
Definition: NvElement.h:122
virtual int isInError()
int getControl(uint32_t id, int32_t &value)
Gets the value of a control.
uint32_t output_plane_pixfmt
Pixel format of output plane buffers.
uint32_t capture_plane_pixfmt
Pixel format of capture plane buffers.
int setExtControls(struct v4l2_ext_controls &ctl)
Sets the value of several controls.
virtual int waitForIdle(uint32_t max_wait_ms)
Waits until the element processes all the output plane buffers.
void enableProfiling()
Enables profiling for the V4l2Element.
int subscribeEvent(uint32_t type, uint32_t id, uint32_t flags)
Subscribes to an V4L2 event.
int getExtControls(struct v4l2_ext_controls &ctl)
Gets the value of several controls.