EdgeAI TIOVX Apps Guide
input_block.h
Go to the documentation of this file.
1 #include <tiovx_modules.h>
2 #include <apps/include/info.h>
3 
4 /*
5  *
6  * Copyright (c) 2024 Texas Instruments Incorporated
7  *
8  * All rights reserved not granted herein.
9  *
10  * Limited License.
11  *
12  * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
13  * license under copyrights and patents it now or hereafter owns or controls to make,
14  * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
15  * terms herein. With respect to the foregoing patent license, such license is granted
16  * solely to the extent that any such patent is necessary to Utilize the software alone.
17  * The patent license shall not apply to any combinations which include this software,
18  * other than combinations with devices manufactured by or for TI ("TI Devices").
19  * No hardware patent is licensed hereunder.
20  *
21  * Redistributions must preserve existing copyright notices and reproduce this license
22  * (including the above copyright notice and the disclaimer and (if applicable) source
23  * code license limitations below) in the documentation and/or other materials provided
24  * with the distribution
25  *
26  * Redistribution and use in binary form, without modification, are permitted provided
27  * that the following conditions are met:
28  *
29  * * No reverse engineering, decompilation, or disassembly of this software is
30  * permitted with respect to any software provided in binary form.
31  *
32  * * any redistribution and use are licensed by TI for use only with TI Devices.
33  *
34  * * Nothing shall obligate TI to provide you with source code for the software
35  * licensed and provided to you in object code.
36  *
37  * If software source code is provided to you, modification and redistribution of the
38  * source code are permitted provided that the following conditions are met:
39  *
40  * * any redistribution and use of the source code, including any resulting derivative
41  * works, are licensed by TI for use only with TI Devices.
42  *
43  * * any redistribution and use of any object code compiled from the source code
44  * and any resulting derivative works, are licensed by TI for use only with TI Devices.
45  *
46  * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
47  *
48  * may be used to endorse or promote products derived from this software without
49  * specific prior written permission.
50  *
51  * DISCLAIMER.
52  *
53  * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
54  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
55  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
56  * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
57  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
58  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
59  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
60  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
61  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
62  * OF THE POSSIBILITY OF SUCH DAMAGE.
63  *
64  */
65 
66 #ifndef _TIOVX_APPS_INPUT_BLOCK
67 #define _TIOVX_APPS_INPUT_BLOCK
68 
69 #include <tiovx_modules.h>
70 
71 #if defined(TARGET_OS_LINUX)
72 #include <v4l2_capture_module.h>
73 #include <linux_aewb_module.h>
74 #include <v4l2_decode_module.h>
75 #endif
76 
77 #include <apps/include/info.h>
79 
80 #ifdef __cplusplus
81 extern "C" {
82 #endif
83 
84 #if defined(TARGET_OS_LINUX)
85 /*
86  * V4L2 Information
87  */
88 typedef struct {
89  /* V4L2Capture handle in case input is v4l2 capture */
90  v4l2CaptureHandle *v4l2_capture_handle;
91 
92  /* Aewb handle for v4l2 capture */
93  AewbHandle *aewb_handle;
94 
95  /* AEWB Pad from viss */
96  Pad *aewb_pad;
97 
98  /* H3A Pad from viss */
99  Pad *h3a_pad;
100 
101  /* V4L2Decode handle in case input is video file */
102  v4l2DecodeHandle *v4l2_decode_handle;
103 
104 } V4l2InputObject;
105 #endif
106 
107 /*
108  * Input block information
109  */
110 typedef struct {
111  /* Input pad to the block */
112  Pad *input_pad;
113 
114  /* Output pads from the block */
116 
117  /* Number of outputs to this block. */
118  uint32_t num_outputs;
119 
120  /* InputInfo */
122 
123 #if defined(TARGET_OS_LINUX)
124  /* Handles and pads related to v4l2 */
125  V4l2InputObject v4l2_obj;
126 #endif
127 
128  /* TEE Node config */
130 
131 } InputBlock;
132 
133 void initialize_input_block(InputBlock *input_block);
134 
135 int32_t connect_pad_to_input_block(InputBlock *input_block, Pad* pad);
136 
137 int32_t create_input_block(GraphObj *graph, InputBlock *input_block);
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif
Pad * input_pad
Definition: input_block.h:112
Definition: tiovx_tee_module.h:71
uint32_t num_outputs
Definition: input_block.h:118
TIOVXTeeNodeCfg tee_cfg
Definition: input_block.h:129
int32_t connect_pad_to_input_block(InputBlock *input_block, Pad *pad)
Definition: input_block.c:121
Definition: input_block.h:110
int32_t create_input_block(GraphObj *graph, InputBlock *input_block)
Definition: input_block.c:131
#define TIOVX_MODULES_MAX_NODE_OUTPUTS
Definition: tiovx_modules_types.h:91
void initialize_input_block(InputBlock *input_block)
Definition: input_block.c:106
InputInfo * input_info
Definition: input_block.h:121
Definition: info.h:113