NVIDIA DeepStream SDK API Reference

6.4 Release
deepstream_ucx_test_app.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef DEEPSTREAM_UCX_TEST_APP_H
24 #define DEEPSTREAM_UCX_TEST_APP_H
25 
26 #include <glib.h>
27 #include <stdio.h>
28 
29 /* Constants definitions */
30 #define MUXER_OUTPUT_WIDTH 1920
31 #define MUXER_OUTPUT_HEIGHT 1080
32 #define MUXER_BATCH_TIMEOUT_USEC 40000
33 #define GST_CAPS_FEATURES_NVMM "memory:NVMM"
34 #define NVINFER_PLUGIN "nvinfer"
35 #define NVINFERSERVER_PLUGIN "nvinferserver"
36 
37 
38 /* Server Arguments */
39 
40 typedef struct {
41  gchar *addr;
42  gint64 port;
43  gint64 width;
44  gint64 height;
45  gchar *uri;
47 
48 typedef struct {
49  gchar *addr;
50  gint64 port;
51  gint64 width;
52  gint64 height;
53  gchar *libpath;
54  gchar *output;
56 
57 typedef struct {
58  gchar *addr;
59  gint64 port;
60  gchar *libpath;
61  gchar *uri;
63 
64 /* Client Arguments */
65 
66 typedef struct {
67  gchar *addr;
68  gint64 port;
69  gint64 width;
70  gint64 height;
71  gchar *outfile;
73 
74 typedef struct {
75  gchar *addr;
76  gint64 port;
77  gchar *inferpath;
78  gchar *libpath;
79  gchar *uri;
81 
82 typedef struct {
83  gchar *addr;
84  gint64 port;
85  gchar *libpath;
86  gchar *outfile;
88 
89 /* Common Structs */
90 
91 typedef enum {
95 } Role;
96 
97 typedef struct {
98  int test_id;
99  GMainLoop *loop;
100  GstElement *pipeline;
103 
104  union {
111  } args;
112 } UcxTest;
113 
114 /* Function prototypes */
115 
116 // Test 1
117 int test1_client_parse_args(int argc, char *argv[], UcxTest *t);
119 
120 int test1_server_parse_args(int argc, char *argv[], UcxTest *t);
122 
123 // Test 2
124 int test2_client_parse_args(int argc, char *argv[], UcxTest *t);
126 
127 int test2_server_parse_args(int argc, char *argv[], UcxTest *t);
129 
130 // Test 3
131 int test3_client_parse_args(int argc, char *argv[], UcxTest *t);
133 
134 int test3_server_parse_args(int argc, char *argv[], UcxTest *t);
136 
137 
138 typedef struct {
139  int (*parse_args)(int argc, char *argv[], UcxTest *t);
140  int (*setup_pipeline)(UcxTest *t);
142 
143 typedef struct {
146 } TestOps;
147 
149  {
152  },
153  {
156  },
157  {
160  }
161 };
162 
163 
164 
165 #endif // DEEPSTREAM_UCX_TEST_APP_H
test1_client_setup_pipeline
int test1_client_setup_pipeline(UcxTest *t)
UcxTest::test_id
int test_id
Definition: deepstream_ucx_test_app.h:98
INIT
@ INIT
Definition: deepstream_ucx_test_app.h:94
Role
Role
Definition: deepstream_ucx_test_app.h:91
ServerTest1Args
Definition: deepstream_ucx_test_app.h:40
ServerTest1Args::width
gint64 width
Definition: deepstream_ucx_test_app.h:43
ClientTest3Args::outfile
gchar * outfile
Definition: deepstream_ucx_test_app.h:86
UcxTest::server_test2
ServerTest2Args server_test2
Definition: deepstream_ucx_test_app.h:106
test2_client_setup_pipeline
int test2_client_setup_pipeline(UcxTest *t)
OperationFunctions
Definition: deepstream_ucx_test_app.h:138
test3_server_parse_args
int test3_server_parse_args(int argc, char *argv[], UcxTest *t)
UcxTest
Definition: deepstream_ucx_test_app.h:97
ClientTest2Args::inferpath
gchar * inferpath
Definition: deepstream_ucx_test_app.h:77
ServerTest1Args::height
gint64 height
Definition: deepstream_ucx_test_app.h:44
test2_server_parse_args
int test2_server_parse_args(int argc, char *argv[], UcxTest *t)
ClientTest1Args
Definition: deepstream_ucx_test_app.h:66
ClientTest1Args::height
gint64 height
Definition: deepstream_ucx_test_app.h:70
test1_server_setup_pipeline
int test1_server_setup_pipeline(UcxTest *t)
test2_client_parse_args
int test2_client_parse_args(int argc, char *argv[], UcxTest *t)
UcxTest::pipeline
GstElement * pipeline
Definition: deepstream_ucx_test_app.h:100
ClientTest2Args::addr
gchar * addr
Definition: deepstream_ucx_test_app.h:75
ServerTest1Args::addr
gchar * addr
Definition: deepstream_ucx_test_app.h:41
ServerTest3Args::libpath
gchar * libpath
Definition: deepstream_ucx_test_app.h:60
ServerTest3Args
Definition: deepstream_ucx_test_app.h:57
TestOps::server
OperationFunctions server
Definition: deepstream_ucx_test_app.h:145
ServerTest3Args::uri
gchar * uri
Definition: deepstream_ucx_test_app.h:61
TestOps::client
OperationFunctions client
Definition: deepstream_ucx_test_app.h:144
ServerTest2Args::port
gint64 port
Definition: deepstream_ucx_test_app.h:50
ClientTest3Args
Definition: deepstream_ucx_test_app.h:82
ClientTest1Args::width
gint64 width
Definition: deepstream_ucx_test_app.h:69
UcxTest::client_test3
ClientTest3Args client_test3
Definition: deepstream_ucx_test_app.h:110
ServerTest3Args::port
gint64 port
Definition: deepstream_ucx_test_app.h:59
ClientTest2Args::port
gint64 port
Definition: deepstream_ucx_test_app.h:76
UcxTest::server_test1
ServerTest1Args server_test1
Definition: deepstream_ucx_test_app.h:105
UcxTest::server_test3
ServerTest3Args server_test3
Definition: deepstream_ucx_test_app.h:107
ServerTest2Args::addr
gchar * addr
Definition: deepstream_ucx_test_app.h:49
UcxTest::loop
GMainLoop * loop
Definition: deepstream_ucx_test_app.h:99
ClientTest3Args::libpath
gchar * libpath
Definition: deepstream_ucx_test_app.h:85
SERVER
@ SERVER
Definition: deepstream_ucx_test_app.h:92
test1_client_parse_args
int test1_client_parse_args(int argc, char *argv[], UcxTest *t)
test2_server_setup_pipeline
int test2_server_setup_pipeline(UcxTest *t)
ClientTest2Args::libpath
gchar * libpath
Definition: deepstream_ucx_test_app.h:78
UcxTest::client_test2
ClientTest2Args client_test2
Definition: deepstream_ucx_test_app.h:109
ServerTest1Args::port
gint64 port
Definition: deepstream_ucx_test_app.h:42
ClientTest3Args::addr
gchar * addr
Definition: deepstream_ucx_test_app.h:83
ServerTest2Args::height
gint64 height
Definition: deepstream_ucx_test_app.h:52
ServerTest2Args
Definition: deepstream_ucx_test_app.h:48
CLIENT
@ CLIENT
Definition: deepstream_ucx_test_app.h:93
test3_client_setup_pipeline
int test3_client_setup_pipeline(UcxTest *t)
ServerTest2Args::output
gchar * output
Definition: deepstream_ucx_test_app.h:54
TestOps
Definition: deepstream_ucx_test_app.h:143
ServerTest3Args::addr
gchar * addr
Definition: deepstream_ucx_test_app.h:58
UcxTest::client_test1
ClientTest1Args client_test1
Definition: deepstream_ucx_test_app.h:108
ClientTest1Args::outfile
gchar * outfile
Definition: deepstream_ucx_test_app.h:71
ClientTest1Args::port
gint64 port
Definition: deepstream_ucx_test_app.h:68
test3_server_setup_pipeline
int test3_server_setup_pipeline(UcxTest *t)
UcxTest::is_nvinfer_server
gboolean is_nvinfer_server
Definition: deepstream_ucx_test_app.h:102
ServerTest1Args::uri
gchar * uri
Definition: deepstream_ucx_test_app.h:45
ClientTest1Args::addr
gchar * addr
Definition: deepstream_ucx_test_app.h:67
ClientTest2Args
Definition: deepstream_ucx_test_app.h:74
testOperations
TestOps testOperations[]
Definition: deepstream_ucx_test_app.h:148
UcxTest::role
Role role
Definition: deepstream_ucx_test_app.h:101
ServerTest2Args::width
gint64 width
Definition: deepstream_ucx_test_app.h:51
ClientTest3Args::port
gint64 port
Definition: deepstream_ucx_test_app.h:84
test3_client_parse_args
int test3_client_parse_args(int argc, char *argv[], UcxTest *t)
test1_server_parse_args
int test1_server_parse_args(int argc, char *argv[], UcxTest *t)
ClientTest2Args::uri
gchar * uri
Definition: deepstream_ucx_test_app.h:79
ServerTest2Args::libpath
gchar * libpath
Definition: deepstream_ucx_test_app.h:53