nnstreamer / nnstreamer

:twisted_rightwards_arrows: Neural Network (NN) Streamer, Stream Processing Paradigm for Neural Network Apps/Devices.
https://nnstreamer.ai
GNU Lesser General Public License v2.1
683 stars 170 forks source link

Use tensor filter framework v1 in nnstreamer_plugin_api_filter #4425

Open niley7464 opened 3 months ago

niley7464 commented 3 months ago

Change tensor_filter plugin which uses v0 GstTensorFilterFramework.

v0 is supposed to be used by old subplugins for backward compatibilty and any new subplugins should use v1, which is simpler and richers in features.

4424

To use event handler, we need to use v1 in tensor_filter plugin

v0

int (*handleEvent) (event_ops ops, GstTensorFilterFrameworkEventData * data);

v1

int (*eventHandler) (const GstTensorFilterFramework * self, const GstTensorFilterProperties * prop,
          void *private_data, event_ops ops, GstTensorFilterFrameworkEventData * data);

Only v1 can use GstTensorFilterProperties.

Also, after changing every subplugin to v1, we can remove the NO_ANONYMOUS_NESTED_STRUCT macro.

Todo

taos-ci commented 3 months ago

:octocat: cibot: Thank you for posting issue #4425. The person in charge will reply soon.

myungjoo commented 2 months ago

If you do not want to reimplement near-obsolete subplugins (e.g., no one uses CAFFE2 or NCSDK2), you may create a compatibility-wrapper (common macros or static inline functions that call v0 callback functions from v1 invocations) for such near-obsolete subplugins. You can minimize the workload.

Then, you can focus on "modernizing" actively used v0-subplugins. It is usually better to use C++ subplugin class if the framework's interface is in C++.