Wrong plugin name in log
AnsweredIn journalctl -xe, I spotted:
Oct 14 03:50:35 xav1 mediaserver[4214]: [plugin] Created axis_analytics_plugin[0x7f48068470]
Oct 14 03:50:35 xav1 mediaserver[4214]: [plugin] Created dahua_analytics_plugin[0x7f48064a50]
Oct 14 03:50:35 xav1 mediaserver[4214]: [plugin] Created unnamed_lib_context[0x7f48d03a80]
Oct 14 03:50:35 xav1 mediaserver[4214]: [plugin] Created dw_mtt_analytics_plugin[0x7f48dfccd0]
Oct 14 03:50:35 xav1 mediaserver[4214]: [plugin] Created hanwha_analytics_plugin[0x7f4893b730]
Oct 14 03:50:35 xav1 mediaserver[4214]: [plugin] Created hikvision_analytics_plugin[0x7f48e10690]
Oct 14 03:50:35 xav1 mediaserver[4214]: [plugin] Created vca_analytics_plugin[0x7f48e14840]
I guess unnamed_lib_context is my new plugin.
How to turn this template name into my own name (ex. my_app_plugin) ?
Here's my Engine manifest string:
R"json(
{
"id": "com.myapp.nxplugin",
"name": "My App plugin",
"description": "A plugin for AI modules developed by us",
"version": "0.5",
"vendor": "AI Champion"
})json"
-
Can you please check how NX_PLUGIN_API macro is defined in your plugin?
0 -
Here are places containing NX_PLUGIN_API word:
In CMakeLists.txt:
target_compile_definitions(nx_sdk PRIVATE NX_PLUGIN_API="")
target_compile_definitions(df_plugin
PRIVATE NX_PLUGIN_API=${API_EXPORT_MACRO}
INTERFACE NX_PLUGIN_API=${API_IMPORT_MACRO} #< Needed to link unit tests exe to plugin lib.
)In Engine.cpp:
extern "C" NX_PLUGIN_API nx::sdk::IPlugin* createNxPlugin() {
return new nx::sdk::analytics::Plugin(
kPluginManifest,
[](nx::sdk::analytics::Plugin* plugin)
{
return new DFNxEngine(plugin);
});
}0 -
Most of the code sniplets are copied from stub_analytics_plugin sample
0 -
In addition to previous comments:
if(WIN32)
set(API_IMPORT_MACRO "__declspec(dllimport)")
set(API_EXPORT_MACRO "__declspec(dllexport)")
else()
set(API_IMPORT_MACRO "")
set(API_EXPORT_MACRO "__attribute__((visibility(\"default\")))")
endif()0 -
My OS: Ubuntu
0 -
Hi Plain Wu,
I suggest that you check the following:
1. The file lib_context.cpp from the SDK is compiled as part of your plugin project.
2. The following function defined in your plugin is actually being called by the Server (e.g. set a breakpoint):lib_contrext.cpp: /*extern "C"*/ ILibContext* nxLibContext()
For details about how lib_context mechanism works, please see the comments in `lib_context.h`.
0 -
Great! this works!
I added instance.setName() in LibContext& libContext();
Thank you!
0
Please sign in to leave a comment.
Comments
7 comments