Hello, In the deepstream-app, I have enabled the nvds-analytics plugin and trying to access the nvds-analytics meta data. I have modified the all_bbox_generated probe in deepstream_app_main.c similar to the nvdsanalytics_src_pad_buffer_probe in the deepstream_nvdsanalytics_test.cpp. While iterating for each object, I have added the following code:
For this to work, I have to import the nvds_analytics_meta.h library, but this library is written in cpp so I am getting compilation error as follows:
cc -c -o deepstream_app_main.o -DPLATFORM_TEGRA -I./ -I../../apps-common/includes -I../../../includes -DDS_VERSION_MINOR=1 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include deepstream_app_main.c
In file included from deepstream_app_main.c:38:0:
../../../includes/nvds_analytics_meta.h:30:10: fatal error: vector: No such file or directory
#include <vector>
^~~~~~~~
compilation terminated.
Makefile:67: recipe for target 'deepstream_app_main.o' failed
make: *** [deepstream_app_main.o] Error 1
So, how can I access the nvds-analytics meta data now? Also where is the location of the nvds-analytics plugin within the deepstream-app relative to the all_bbox_generated probe? Can I access the nvds-analytics meta data within this or not?
Hi, thanks for the reply. I have casted a lot of pointers as you mentioned. Now, I am stuck. While compiling, I am getting the error
g++ -c -o ../../apps-common/src/deepstream_c2d_msg_util.o -DPLATFORM_TEGRA -I./ -I../../apps-common/includes -I../../../includes -DDS_VERSION_MINOR=1 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include ../../apps-common/src/deepstream_c2d_msg_util.c
../../apps-common/src/deepstream_c2d_msg_util.c:25:0: warning: "__USE_XOPEN" redefined
#define __USE_XOPEN
In file included from /usr/include/aarch64-linux-gnu/bits/libc-header-start.h:33:0,
from /usr/include/stdio.h:27,
from ../../apps-common/src/deepstream_c2d_msg_util.c:23:
/usr/include/features.h:330:0: note: this is the location of the previous definition
# define __USE_XOPEN 1
../../apps-common/src/deepstream_c2d_msg_util.c: In function ‘NvDsC2DMsg* nvds_c2d_parse_cloud_message(gpointer, guint)’:
../../apps-common/src/deepstream_c2d_msg_util.c:97:63: error: invalid conversion from ‘gpointer {aka void*}’ to ‘const gchar* {aka const char*}’ [-fpermissive]
ret = json_parser_load_from_data (parser, data, size, &error);
^
In file included from /usr/include/json-glib-1.0/json-glib/json-glib.h:33:0,
from ../../apps-common/src/deepstream_c2d_msg_util.c:27:
/usr/include/json-glib-1.0/json-glib/json-parser.h:157:13: note: initializing argument 2 of ‘gboolean json_parser_load_from_data(JsonParser*, const gchar*, gssize, GError**)’
gboolean json_parser_load_from_data (JsonParser *parser,
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/glib/glist.h:32:0,
from /usr/include/glib-2.0/glib/ghash.h:33,
from /usr/include/glib-2.0/glib.h:50,
from /usr/include/glib-2.0/gobject/gbinding.h:28,
from /usr/include/glib-2.0/glib-object.h:23,
from /usr/include/json-glib-1.0/json-glib/json-types.h:31,
from /usr/include/json-glib-1.0/json-glib/json-glib.h:29,
from ../../apps-common/src/deepstream_c2d_msg_util.c:27:
/usr/include/glib-2.0/glib/gmem.h:240:74: error: cannot convert ‘gchar* {aka char*}’ to ‘NvDsC2DMsgSR*’ in initialization
((struct_type *) g_##func##_n ((n_structs), sizeof (struct_type)))
^
/usr/include/glib-2.0/glib/gmem.h:279:42: note: in expansion of macro ‘_G_NEW’
#define g_new0(struct_type, n_structs) _G_NEW (struct_type, n_structs, malloc0)
^~~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:190:33: note: in expansion of macro ‘g_new0’
NvDsC2DMsgSR *srMsg =(gchar *)g_new0 (NvDsC2DMsgSR, 1);
^~~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:209:1: error: jump to label ‘error’ [-fpermissive]
error:
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:173:16: note: from here
goto error;
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:190:17: note: crosses initialization of ‘NvDsC2DMsgSR* srMsg’
NvDsC2DMsgSR *srMsg =(gchar *)g_new0 (NvDsC2DMsgSR, 1);
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:209:1: error: jump to label ‘error’ [-fpermissive]
error:
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:156:16: note: from here
goto error;
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:190:17: note: crosses initialization of ‘NvDsC2DMsgSR* srMsg’
NvDsC2DMsgSR *srMsg =(gchar *)g_new0 (NvDsC2DMsgSR, 1);
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:209:1: error: jump to label ‘error’ [-fpermissive]
error:
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:131:16: note: from here
goto error;
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:190:17: note: crosses initialization of ‘NvDsC2DMsgSR* srMsg’
NvDsC2DMsgSR *srMsg =(gchar *)g_new0 (NvDsC2DMsgSR, 1);
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:209:1: error: jump to label ‘error’ [-fpermissive]
error:
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:118:14: note: from here
goto error;
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:190:17: note: crosses initialization of ‘NvDsC2DMsgSR* srMsg’
NvDsC2DMsgSR *srMsg =(gchar *)g_new0 (NvDsC2DMsgSR, 1);
^~~~~
Makefile:67: recipe for target '../../apps-common/src/deepstream_c2d_msg_util.o' failed
make: *** [../../apps-common/src/deepstream_c2d_msg_util.o] Error 1
As you can see I’ve already casted the void pointer returned by g_new0 to gchar* here, If I cast it to NvDsC2DMsgSR *, it is throwing error from different line
g++ -c -o ../../apps-common/src/deepstream_c2d_msg_util.o -DPLATFORM_TEGRA -I./ -I../../apps-common/includes -I../../../includes -DDS_VERSION_MINOR=1 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include ../../apps-common/src/deepstream_c2d_msg_util.c
../../apps-common/src/deepstream_c2d_msg_util.c:25:0: warning: "__USE_XOPEN" redefined
#define __USE_XOPEN
In file included from /usr/include/aarch64-linux-gnu/bits/libc-header-start.h:33:0,
from /usr/include/stdio.h:27,
from ../../apps-common/src/deepstream_c2d_msg_util.c:23:
/usr/include/features.h:330:0: note: this is the location of the previous definition
# define __USE_XOPEN 1
../../apps-common/src/deepstream_c2d_msg_util.c: In function ‘NvDsC2DMsg* nvds_c2d_parse_cloud_message(gpointer, guint)’:
../../apps-common/src/deepstream_c2d_msg_util.c:97:63: error: invalid conversion from ‘gpointer {aka void*}’ to ‘const gchar* {aka const char*}’ [-fpermissive]
ret = json_parser_load_from_data (parser, data, size, &error);
^
In file included from /usr/include/json-glib-1.0/json-glib/json-glib.h:33:0,
from ../../apps-common/src/deepstream_c2d_msg_util.c:27:
/usr/include/json-glib-1.0/json-glib/json-parser.h:157:13: note: initializing argument 2 of ‘gboolean json_parser_load_from_data(JsonParser*, const gchar*, gssize, GError**)’
gboolean json_parser_load_from_data (JsonParser *parser,
^~~~~~~~~~~~~~~~~~~~~~~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:209:1: error: jump to label ‘error’ [-fpermissive]
error:
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:173:16: note: from here
goto error;
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:190:17: note: crosses initialization of ‘NvDsC2DMsgSR* srMsg’
NvDsC2DMsgSR *srMsg =(NvDsC2DMsgSR *)g_new0 (NvDsC2DMsgSR, 1);
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:209:1: error: jump to label ‘error’ [-fpermissive]
error:
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:156:16: note: from here
goto error;
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:190:17: note: crosses initialization of ‘NvDsC2DMsgSR* srMsg’
NvDsC2DMsgSR *srMsg =(NvDsC2DMsgSR *)g_new0 (NvDsC2DMsgSR, 1);
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:209:1: error: jump to label ‘error’ [-fpermissive]
error:
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:131:16: note: from here
goto error;
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:190:17: note: crosses initialization of ‘NvDsC2DMsgSR* srMsg’
NvDsC2DMsgSR *srMsg =(NvDsC2DMsgSR *)g_new0 (NvDsC2DMsgSR, 1);
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:209:1: error: jump to label ‘error’ [-fpermissive]
error:
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:118:14: note: from here
goto error;
^~~~~
../../apps-common/src/deepstream_c2d_msg_util.c:190:17: note: crosses initialization of ‘NvDsC2DMsgSR* srMsg’
NvDsC2DMsgSR *srMsg =(NvDsC2DMsgSR *)g_new0 (NvDsC2DMsgSR, 1);
^~~~~
Makefile:67: recipe for target '../../apps-common/src/deepstream_c2d_msg_util.o' failed
make: *** [../../apps-common/src/deepstream_c2d_msg_util.o] Error 1