platform/upstream/nnstreamer.git
2 years ago[Query] fix invalid socket mode
Jaeyun [Wed, 1 Dec 2021 09:42:29 +0000 (18:42 +0900)]
[Query] fix invalid socket mode

Fix socket op mode, blocking IO is unnecessary with multi-threaded server node.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Doc] Fix bad links
yelini-jeong [Wed, 1 Dec 2021 06:56:26 +0000 (15:56 +0900)]
[Doc] Fix bad links

This patch fixes bad links in documentation.

Signed-off-by: yelini-jeong <yelini.jeong@samsung.com>
**Self evaluation:**
1. Build test: [ ]Passed [ ]Failed [X]Skipped
2. Run test: [ ]Passed [ ]Failed [X]Skipped

2 years ago[fix/query] Fix the order of calling `g_socket_listener_set_backlog`
Yongjoo Ahn [Tue, 30 Nov 2021 06:22:50 +0000 (15:22 +0900)]
[fix/query] Fix the order of calling `g_socket_listener_set_backlog`

- backlog should be set before adding address or socket to listener.
REF:
https://people.gnome.org/~ebassi/docs/_build/Gio/method.SocketListener.set_backlog.html#description

- This commit should remove the following error logs:
```
...
GLib-GIO-CRITICAL **: 15:20:18.773: g_socket_set_listen_backlog: assertion '!socket->priv->listening' failed
...
```

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Filter/TFLite] Fix XNNPACK fixed-address buffer handling
Julien Vuillaumier [Thu, 25 Nov 2021 10:27:06 +0000 (11:27 +0100)]
[Filter/TFLite] Fix XNNPACK fixed-address buffer handling

XNNPACK delegate requires fixed addresses for input and output tensors,
for consecutive invoke().
Therefore input and output tensors data coming from GStreamer buffers has
to copied into tensors buffer allocated by TFLite runtime.

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
2 years ago[Filter/TFLite] Add XNNPACK meson build option
Julien Vuillaumier [Wed, 24 Nov 2021 11:09:39 +0000 (12:09 +0100)]
[Filter/TFLite] Add XNNPACK meson build option

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
2 years ago[Filter/TFLite] Disable default delegates usage
Julien Vuillaumier [Wed, 10 Nov 2021 15:45:19 +0000 (16:45 +0100)]
[Filter/TFLite] Disable default delegates usage

TFLite libray may be built to use default delegates when
no delegate is explicitly bound to the interpreter.

In case default delegates are not supported by TFLite filter,
system may crash.

Make sure that no default delegate is applied by using relevant
interpreter builder API available from TFLite 2.4 onward.

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
2 years ago[Elements] handle single mem chunk
Jaeyun [Wed, 3 Nov 2021 04:54:31 +0000 (13:54 +0900)]
[Elements] handle single mem chunk

If incoming buffer has single memory (case with gst-plugins), nnstreamer elements cannot generate output buffer (invalid memory chunks).

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Query] detach option on msg thread
Jaeyun [Wed, 17 Nov 2021 08:46:58 +0000 (17:46 +0900)]
[Query] detach option on msg thread

Add attr to create message thread, to release thread resource.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Flexbuf] Support flexible tensors for flexbuf. accepted/tizen/unified/20211129.035253 submit/tizen/20211126.064049
gichan [Fri, 29 Oct 2021 04:12:47 +0000 (13:12 +0900)]
[Flexbuf] Support flexible tensors for flexbuf.

Support flexible tensors for flexbuf.

Signed-off-by: gichan <gichan2.jang@samsung.com>
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[Protobuf] Support flextensors for protobuf.
gichan [Fri, 29 Oct 2021 01:38:37 +0000 (10:38 +0900)]
[Protobuf] Support flextensors for protobuf.

 Support flexible tensors for protobuf.

Signed-off-by: gichan <gichan2.jang@samsung.com>
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[Query] null ptr in finalize callback accepted/tizen/unified/20211116.130323 submit/tizen/20211116.052326 submit/tizen/20211116.063435
Jaeyun [Mon, 15 Nov 2021 09:14:13 +0000 (18:14 +0900)]
[Query] null ptr in finalize callback

Clearly check the handles in finalize callback.
(e.g., gst-inspect shows gst-log if given handle is null.)

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Android/mqtt] Add mqtt sources to nnstreamer.mk
Yongjoo Ahn [Tue, 16 Nov 2021 00:34:43 +0000 (09:34 +0900)]
[Android/mqtt] Add mqtt sources to nnstreamer.mk

- Add mqtt sources to nnstreamer.mk
- Android api will build the gst element

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[fix/mqttsrc] Set MQTTClient persistence mode to None
Yongjoo Ahn [Mon, 15 Nov 2021 08:37:04 +0000 (17:37 +0900)]
[fix/mqttsrc] Set MQTTClient persistence mode to None

- Default persistence mode have not been tested on various targets.
- Set it to None mode sync-ing with mqttsink.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[fix/mqttsrc] Fix data type of GstQueryType
Yongjoo Ahn [Mon, 15 Nov 2021 08:31:38 +0000 (17:31 +0900)]
[fix/mqttsrc] Fix data type of GstQueryType

- Fix to proper type.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Doc] Add nnstreamer tutorials
Gichan Jang [Wed, 3 Nov 2021 07:26:13 +0000 (16:26 +0900)]
[Doc] Add nnstreamer tutorials

 - Add NNStreamer tutorials.
 - Change sitemap of the nnstreamer.github.io

Signed-off-by: gichan <gichan2.jang@samsung.com>
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[TEST] Add flatbuf for flexible tensors
gichan [Thu, 28 Oct 2021 15:33:10 +0000 (00:33 +0900)]
[TEST] Add flatbuf for flexible tensors

Add flatbuf test for flexible tensors.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Converter] Support flextensor for flatbuf converter
gichan [Thu, 28 Oct 2021 15:21:55 +0000 (00:21 +0900)]
[Converter] Support flextensor for flatbuf converter

Support flextensor for flatbuf converter.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Decoder] Support flexible tensors for flatbuf decoder
gichan [Thu, 28 Oct 2021 13:06:20 +0000 (22:06 +0900)]
[Decoder] Support flexible tensors for flatbuf decoder

Support flexible tensors for flatbuf decoder.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Spec] Enable SNPE filter on both In-House and public infra
Sangjung Woo [Fri, 29 Oct 2021 12:42:24 +0000 (21:42 +0900)]
[Spec] Enable SNPE filter on both In-House and public infra

To support NNStreamer filter for SNPE on both In-House build infra and
those of the public, this patch conditionally enables nnstreamer-snpe
rpm package when existing actual snpe library. (i.e. snpe.pc). In case
of the dummy SNPE package, nnstreamer-snpe rpm contains no files.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[Converter] convert bytes or flex-tensor without properties
Jaeyun [Fri, 22 Oct 2021 07:30:11 +0000 (16:30 +0900)]
[Converter] convert bytes or flex-tensor without properties

1. convert bytes (octet stream) to flex-tensor when input info (type and dimension) is not denoted.
2. parse tensor-mata and convert to static when input is flexible tensor.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Query] Add data receving thread for server.
Gichan Jang [Tue, 19 Oct 2021 05:48:20 +0000 (14:48 +0900)]
[Query] Add data receving thread for server.

Query server is changed to receive data by generating threads for each client.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[Filter/TFLite] Add external delegate support
Julien Vuillaumier [Tue, 2 Nov 2021 13:58:59 +0000 (14:58 +0100)]
[Filter/TFLite] Add external delegate support

Implementation for support of TFLite framework external delegate.
External delegate usage requires possibility to configure:
- library name or path for the external delegate
- optional key/values pairs for delegate configuration

External delegate mode and associated configurations are setup at pipeline
definition time using tflite subplugin custom option.

Relevant custom variables:
- Delegate:External
- ExtDelegateLib:<delegate library name or full path>
Optional variable below:
- ExtDelegateKeyVal:<key1 name>#<value1>[;<key2 name>#<value2>[;...]]

Example:
custom=Delegate:External,ExtDelegateLib:libdelegate.so,ExtDelegateKeyVal:fookey#fooval;barkey#barval

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
2 years ago[Filter/TFLite] Add external delegate meson build option
Julien Vuillaumier [Tue, 2 Nov 2021 13:49:08 +0000 (14:49 +0100)]
[Filter/TFLite] Add external delegate meson build option

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
2 years ago[Common] util function to handle tensors
Jaeyun [Wed, 3 Nov 2021 04:42:51 +0000 (13:42 +0900)]
[Common] util function to handle tensors

With gstreamer plugins, nnstreamer element may receive gst-buffer with invalid memory chunks.
nnstreamer internally checks the number of tensors using the mem blocks in gst-buffer.

To handle multi tensors, add util function to separate memories in gst-buffer.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[TEST] Disable MQTT Test when broker is not abvailable.
Gichan Jang [Thu, 4 Nov 2021 01:35:59 +0000 (10:35 +0900)]
[TEST] Disable MQTT Test when broker is not abvailable.

If the broker is not available, the mqtt element cannot be changed to the playing state.
However, harnesses are used in the mqtt test, and errors occur if harnesses cannot be changed to the playing state.
So, if there's no broker on the test environment, the test fails.
For example, the build on the lunch pad failed.
https://launchpadlibrarian.net/566158157/buildlog_ubuntu-bionic-amd64.nnstreamer_2.1.0.0-0~202110290743~ubuntu18.04.1_BUILDING.txt.gz

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Build] Add g_memdup2() support for glib >= 2.68
Julien Vuillaumier [Wed, 3 Nov 2021 13:46:09 +0000 (14:46 +0100)]
[Build] Add g_memdup2() support for glib >= 2.68

Update to fix build with glib version 2.68 and later

Legacy function:
  gpointer g_memdup ( gconstpointer mem, guint byte_size )
is deprecated since version 2.68 and replaced by:
  gpointer g_memdup2 ( gconstpointer mem, gsize byte_size )

Difference is byte_size argument type changed from guint to gsize.

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
2 years ago[test/tf2lite] Add filter extension test for tf2lite sub-plugin
Yongjoo Ahn [Thu, 4 Nov 2021 04:32:51 +0000 (13:32 +0900)]
[test/tf2lite] Add filter extension test for tf2lite sub-plugin

- Add those unittest when tflite2_support is available

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[test/tf2-lite] Add unittest for tensorflow2-lite
Yongjoo Ahn [Thu, 4 Nov 2021 04:25:56 +0000 (13:25 +0900)]
[test/tf2-lite] Add unittest for tensorflow2-lite

- Add gtest based unittests for tensorflow2-lite sub-plugin
  They test the result of mobilenet models when the orange image is given
- Add a float type tflite model "mobilenet_v2_1.0_224.tflite"

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Converter/Doc] doc to convert octet stream
Jaeyun [Thu, 28 Oct 2021 04:44:09 +0000 (13:44 +0900)]
[Converter/Doc] doc to convert octet stream

Update document to convert octet stream to static or flexible tensor.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Test] Fix build issue with GCC 11 [-Werror=maybe-uninitialized]
Julien Vuillaumier [Wed, 3 Nov 2021 14:19:04 +0000 (15:19 +0100)]
[Test] Fix build issue with GCC 11 [-Werror=maybe-uninitialized]

Correction for build issue showing up with GCC 11

unittest_common.cc:953:51:
error: 'structure' may be used uninitialized [-Werror=maybe-uninitialized]

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
2 years ago[UNITTEST] Handle the error case of run_unittests_binaries.sh
Wook Song [Thu, 28 Oct 2021 05:31:10 +0000 (14:31 +0900)]
[UNITTEST] Handle the error case of run_unittests_binaries.sh

This patch handles the error case when the target is not given.

Signed-off-by: Wook Song <wook16.song@samsung.com>
2 years ago[UNITTEST] Revise header comments of run_unittests_binaries.sh
Wook Song [Thu, 28 Oct 2021 05:06:17 +0000 (14:06 +0900)]
[UNITTEST] Revise header comments of run_unittests_binaries.sh

This patch revises file description header comments in the script that
runs unit test binaries as follows:
- Apply the change of the script name
- Use more portable shebang

Signed-off-by: Wook Song <wook16.song@samsung.com>
2 years ago[UNITTEST] Add a skip option to the script running test cases
Wook Song [Thu, 28 Oct 2021 04:49:19 +0000 (13:49 +0900)]
[UNITTEST] Add a skip option to the script running test cases

This patch adds an option to skip specific test cases to
run_unittests_binaries.sh.

Signed-off-by: Wook Song <wook16.song@samsung.com>
2 years ago[trivial] Fix sub-plugin check in TensorRT test
Yongjoo Ahn [Wed, 3 Nov 2021 01:08:11 +0000 (10:08 +0900)]
[trivial] Fix sub-plugin check in TensorRT test

- Fix to check proper so file

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[fix/test] Build edgetpu test when tflite2 is available
Yongjoo Ahn [Fri, 29 Oct 2021 03:52:49 +0000 (12:52 +0900)]
[fix/test] Build edgetpu test when tflite2 is available

- Build edgetpu when the tflite2 (not only tflite) support is available

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[fix/edgetpu] Handle unused variable in edgetpu filter
Yongjoo Ahn [Fri, 29 Oct 2021 03:51:51 +0000 (12:51 +0900)]
[fix/edgetpu] Handle unused variable in edgetpu filter

- Handle unused variables in the edgetpu filter source

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[fix/openvino] Handle unused var in openvino filer
Yongjoo Ahn [Fri, 29 Oct 2021 03:55:34 +0000 (12:55 +0900)]
[fix/openvino] Handle unused var in openvino filer

- Handle unused variables in tensor_filter_openvino.cc

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[TEST] Add test for multiple query server src and sink
gichan [Mon, 18 Oct 2021 01:31:53 +0000 (10:31 +0900)]
[TEST] Add test for multiple query server src and sink

Add test for multiple query server src and sink.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Query] Use hash table for shared data of query server.
gichan [Mon, 18 Oct 2021 01:08:01 +0000 (10:08 +0900)]
[Query] Use hash table for shared data of query server.

Use hash table for shared data of query server.
By assigning the id, multiple servers src and sinks may be used.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years agoparser: disable if it's macos.
MyungJoo Ham [Wed, 27 Oct 2021 14:37:03 +0000 (23:37 +0900)]
parser: disable if it's macos.

The parser code is not comaptible with macos.
Reenable after fixing them.
This is probably because of parser library versions.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agotensor-filter:lua Lua >= 5.3 is not supported.
MyungJoo Ham [Wed, 27 Oct 2021 14:32:34 +0000 (23:32 +0900)]
tensor-filter:lua Lua >= 5.3 is not supported.

Disable lua subplugin build if lua is >= 5.3

Reenable Lua >= 5.3 build if #3531 is fixed.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agotensor-query: cross-platform compatibility (non-Linux)
MyungJoo Ham [Wed, 27 Oct 2021 14:17:17 +0000 (23:17 +0900)]
tensor-query: cross-platform compatibility (non-Linux)

EREMOTEIO is Linux-specific error code.
For the compatibility with non-Linux systems,
define it if it's undefined.

This partially addresses #3440

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agotensor-filter-common: unnecessary usage of volatile
MyungJoo Ham [Wed, 27 Oct 2021 14:04:49 +0000 (23:04 +0900)]
tensor-filter-common: unnecessary usage of volatile

GLib-Once (g_once_init_enter/leave) have already taken
care of concurrency.
Its users do not need to worry about cache coherency or
concurrency issues for the initialization.

Actually, as #3440 is showing, the volatile keyword
is neglected by g_once_init_enter function, making
the usage of volatile meaningless anyway.

Remove volatile keyword and mitigate the first
compiler warning-error of #3440

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years ago[MQTT] Wait until connection is established.
gichan [Mon, 11 Oct 2021 10:59:10 +0000 (19:59 +0900)]
[MQTT] Wait until connection is established.

Change to wait until connection is successfully established within timeout
limit.

This patch fix the error:
ERROR: MQTTSrc: cb_mqtt_on_connect_failure: failed to connect to the broker: TCP/TLS connect failure.

Test pipeline:
Publisher
```bash
$ gst-launch-1.0 videotestsrc is-live=true ! video/x-raw,format=RGB,width=640,height=480,framerate=5/1 ! mqttsink pub-topic=test/videotestsrc
```
Subscriber
```bash
$ gst-launch-1.0 mqttsrc sub-topic=test/videotestsrc ! video/x-raw,format=RGB,width=640,height=480,framerate=5/1 ! videoconvert ! ximagesink
```

Signed-off-by: gichan <gichan2.jang@samsung.com>
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[svace] fix svace issue
Jaeyun [Tue, 19 Oct 2021 07:22:42 +0000 (16:22 +0900)]
[svace] fix svace issue

Fix svace issue
- allocation with invalid size param
- possible int underflow

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Query] separate hybrid feature
Jaeyun [Wed, 13 Oct 2021 02:44:44 +0000 (11:44 +0900)]
[Query] separate hybrid feature

Separate query-hybrid functions and fix build error.
- add new file for query-hybrid feature.
- change property name (mqtt-host > broker-host).
- function declaration on old ubuntu.
- mqtt-c library (downloaded from github released) requires thread.
- fix indent and code style.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[build/fix] Add Android log lib in meson
Yongjoo Ahn [Fri, 8 Oct 2021 06:44:14 +0000 (15:44 +0900)]
[build/fix] Add Android log lib in meson

- Add android log lib dep when the platform is android.
- This resolves #3515

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[build/fix] Fix sign-unsign compare
Yongjoo Ahn [Fri, 8 Oct 2021 06:37:58 +0000 (15:37 +0900)]
[build/fix] Fix sign-unsign compare

- Fix sing-unsign value comapre in tensordec-pose

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[armnn] compilation error - unused parameter
Julien Vuillaumier [Thu, 14 Oct 2021 08:20:38 +0000 (10:20 +0200)]
[armnn] compilation error - unused parameter

correction for occurences of compilation error below, when compilation
switch ENABLE_ARMNN_CAFFE is disabled.

error: unused parameter '[parameter name]' [-Werror=unused-parameter]

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
2 years ago[Doc] Fix the simple typo in tensor_quey doc
Sangjung Woo [Tue, 12 Oct 2021 06:17:30 +0000 (15:17 +0900)]
[Doc] Fix the simple typo in tensor_quey doc

This patch fixes the simple typoes in tensor_quey README file.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[Query] Set TCP_NODELAY option to avoid buffering algorithm
Sangjung Woo [Wed, 13 Oct 2021 03:32:55 +0000 (12:32 +0900)]
[Query] Set TCP_NODELAY option to avoid buffering algorithm

Basically, the Nagle algorithm is enabled in TCP, which means that data
is buffered until there is a sufficient amount to send out. However, the
payload of Query should be sent as soon as possible, even if there is
only a small amount of data. This patch sets TCP_NODELAY option to avoid
buffering algorithm.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[Query][NEED REVERT] Exclude tensor query from android build.
Gichan Jang [Wed, 6 Oct 2021 01:32:14 +0000 (10:32 +0900)]
[Query][NEED REVERT] Exclude tensor query from android build.

Exclude tensor query from android build until mqtt-hybrid is separated.
After the separation works, please revert this commit.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[TEST] Add MQTT-hybrid test
gichan [Fri, 1 Oct 2021 02:21:44 +0000 (11:21 +0900)]
[TEST] Add MQTT-hybrid test

Test robustness of the query pipeline.
Server 1 stops when it receivces 3 buffers and the client reconnects to server 2.

Signed-off-by: gichan <gichan2.jang@samsung.com>
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[Query] Add mqtt state change callback.
gichan [Thu, 30 Sep 2021 09:45:46 +0000 (18:45 +0900)]
[Query] Add mqtt state change callback.

Add mqtt state change callback instead of uncertain sleep.

Signed-off-by: gichan <gichan2.jang@samsung.com>
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[Query] Add meson option.
gichan [Thu, 30 Sep 2021 07:02:13 +0000 (16:02 +0900)]
[Query] Add meson option.

Exclude tensor_query from nnstreamer plugins if nnsquery is not available.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[QUERY] Robustness support of MQTT-hybrid
Gichan Jang [Wed, 29 Sep 2021 01:25:49 +0000 (10:25 +0900)]
[QUERY] Robustness support of MQTT-hybrid

Releated issue: #3508
Robustness support of MQTT-hybrid.
If the connected server is stop, re-connect to another availabe server.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[test/snpe] Add snpe unittest for uint8 input/output model
Yongjoo Ahn [Fri, 17 Sep 2021 07:50:09 +0000 (16:50 +0900)]
[test/snpe] Add snpe unittest for uint8 input/output model

- Add a snpe model `add2_uint8.dlc` which takes
  a single uint8 value as input.
- Add a unittest with it.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[filter/snpe] Support uint8 input/output type
Yongjoo Ahn [Fri, 17 Sep 2021 07:47:17 +0000 (16:47 +0900)]
[filter/snpe] Support uint8 input/output type

- If custom prop "InputType:uint8,OutputType:uint8" is given,
  run the model as uint8 input/output type mode.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Build] fix build warning
Jaeyun [Tue, 5 Oct 2021 03:04:42 +0000 (12:04 +0900)]
[Build] fix build warning

Fix build warning (missing-braces, uninitialized).

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years agoREADME update: add recent papers
MyungJoo Ham [Thu, 30 Sep 2021 08:24:08 +0000 (17:24 +0900)]
README update: add recent papers

1. ICSE 2021 SEIP (published)
2. ICSE 2022 SEIP (submitted)

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years ago[test/mqtt] Fix and add negative testcases for mqttsink's invalid prop
Yongjoo Ahn [Fri, 1 Oct 2021 05:20:45 +0000 (14:20 +0900)]
[test/mqtt] Fix and add negative testcases for mqttsink's invalid prop

- Test invalid properties of mqttsink with `gst_harness_new_parse`
  instead of `g_object_set`.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[test/mqtt] Remove a testcase which assumes no broker
Yongjoo Ahn [Fri, 1 Oct 2021 05:17:48 +0000 (14:17 +0900)]
[test/mqtt] Remove a testcase which assumes no broker

- Remove a testcase which assumes no broker.
- When a broker running in the test env, it fails.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Gst/MQTT] Introduce the Unix epoch synchronization using NTP
Wook Song [Wed, 28 Jul 2021 09:30:57 +0000 (18:30 +0900)]
[Gst/MQTT] Introduce the Unix epoch synchronization using NTP

This patch introduces the self-synchronization mechanism of the Unix
epoch timestamps. Note that if the 'ntp-sync' property is set to true
(which means that if this feature is enabled), the pipeline would be
stuck after a while. This is because most of the public NTP servers
restrict clients not to poll too frequently. To fix it, polling
intervals and caching mechanisms should be applied to the NPT utility
functions.

Signed-off-by: Wook Song <wook16.song@samsung.com>
2 years ago[Gst/MQTT] Add utility functions to get timestamps from NTP server
Wook Song [Thu, 15 Jul 2021 08:49:12 +0000 (17:49 +0900)]
[Gst/MQTT] Add utility functions to get timestamps from NTP server

This patch adds the implementation of the basic utility functions to get
timestamps from the given or public NTP servers.

Signed-off-by: Wook Song <wook16.song@samsung.com>
2 years agoStart development of 2.1.0 (2.2 RC1)
MyungJoo Ham [Tue, 28 Sep 2021 07:52:55 +0000 (16:52 +0900)]
Start development of 2.1.0 (2.2 RC1)

This is the version marking for the 2.1.0 development start.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agoRelease of 2.0 Long-Term-Stable accepted/tizen/6.5/unified/20211028.224127 accepted/tizen/unified/20211001.001307 submit/tizen/20210930.052115 submit/tizen_6.5/20211028.163601 tizen_6.5.m2_release
MyungJoo Ham [Mon, 9 Aug 2021 00:34:38 +0000 (09:34 +0900)]
Release of 2.0 Long-Term-Stable

This is NNStreamer 2.0 Long-Term-Stable release.

2.0's main features after 1.8 release include:
- Edge-AI capability (among-device AI) with pub/sub and query. In 2.0, this capability is an initial release without performance optimizations or feature extensions. We will eventually implement the promised optimizations and extensions with later (2.1+) versions.
- Tensor stream types updated: flexible tensors and sparse tensors are now supported. Single-tensor (other/tensor) is being obsoleted. Please use other/tensors instead.
- New H/W accelerators and AI frameworks supported
- Tensor-converter/decoder with subplugins and custom functions
- New elements: Tensor-IF, Join, Tensor-crop, Tensor-rate

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years ago[Doc] Add security policy
Taras Drozdovskyi [Fri, 24 Sep 2021 07:33:04 +0000 (10:33 +0300)]
[Doc] Add security policy

Benefits:
    * Improve github profile
    * One of the requirements of the CII Best Practices

Signed-off-by: Taras Drozdovskyi <t.drozdovsky@samsung.com>
2 years ago[build/fix] Fix meson.build to skip snpe build when it's unavailable
Yongjoo Ahn [Mon, 27 Sep 2021 04:05:06 +0000 (13:05 +0900)]
[build/fix] Fix meson.build to skip snpe build when it's unavailable

- Change `error` with `message` to skip snpe build when it's unavailable

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Doc] Refactore badges in README.md
Taras Drozdovskyi [Thu, 23 Sep 2021 07:35:03 +0000 (10:35 +0300)]
[Doc] Refactore badges in README.md

Changes are as follows:
1) Gitter - no change
2) DailyBuild - the project is successfully build
3) CII Best Practices - the project applies the best practices
4) LGTM Alerts - vulnerabilities found
5) Coverage - Test Coverage
6) Coverity - Defect Display
7) GitHub Repo Size - Repository Size
-) GitHub Issues - removed (indicated above on the page, has a negative shade)
-) GitHub Pull Requests - deleted (indicated above on the page, can be examined as not processed requests)

Signed-off-by: Taras Drozdovskyi <t.drozdovsky@samsung.com>
2 years ago[Filter/openvino] fix invalid args
Jaeyun [Tue, 21 Sep 2021 01:33:40 +0000 (10:33 +0900)]
[Filter/openvino] fix invalid args

As mentioned in another PR, openvino subplugin calls accel function with invalid args.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Doc] Add LGTM badge
Taras Drozdovskyi [Wed, 22 Sep 2021 07:53:40 +0000 (10:53 +0300)]
[Doc] Add LGTM badge

* In accordance with the requirement of the CII Best Practices: all achievements must be specified.
* Display the LGTM current status of the project.

Signed-off-by: Taras Drozdovskyi <t.drozdovsky@samsung.com>
2 years ago[test/snpe] Add unittest for SNPE subplugin
Yongjoo Ahn [Thu, 16 Sep 2021 08:09:04 +0000 (17:09 +0900)]
[test/snpe] Add unittest for SNPE subplugin

- Add unittest for SNPE subplugin.
- Add a sample model file `add2_float.dlc` for the test.
It takes a single float value and returns a single float value
with plus 2.0.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[build/snpe] Check host_machine and fix join_paths
Yongjoo Ahn [Thu, 16 Sep 2021 08:05:50 +0000 (17:05 +0900)]
[build/snpe] Check host_machine and fix join_paths

- Check host_machine when using SNPE SDK.
- Use `join_paths` properly`

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[armnn] compilation error - unused parameter
Julien Vuillaumier [Thu, 16 Sep 2021 20:27:17 +0000 (20:27 +0000)]
[armnn] compilation error - unused parameter

correction for multiple occurences of compilation error:

error: unused parameter '[parameter name]' [-Werror=unused-parameter]

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
2 years ago[armnn] compilation error - missing initializer
Julien Vuillaumier [Thu, 16 Sep 2021 20:20:44 +0000 (20:20 +0000)]
[armnn] compilation error - missing initializer

correction for compilation error:

tensor_filter_armnn.cc: In function 'int armnn_open(const GstTensorFilterProperties*, void**)':
nnstreamer_plugin_api_filter.h:568:76: error: missing initializer for member 'parse_accl_args::auto_accl' [-Werror=missing-field-initializers]
    #define parse_accl_hw(...) parse_accl_hw_fill((parse_accl_args){__VA_ARGS__})
                                                                               ^
tensor_filter_armnn.cc:672:8: note: in expansion of macro 'parse_accl_hw'
    hw = parse_accl_hw (prop->accl_str, armnn_accl_support);
         ^~~~~~~~~~~~~

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
2 years agoFinal fix LGTM alerts
Taras Drozdovskyi [Thu, 16 Sep 2021 14:30:52 +0000 (17:30 +0300)]
Final fix LGTM alerts

Final correction of alerts found by the LGTM, one of which is marked as false-positive

Signed-off-by: Taras Drozdovskyi <t.drozdovsky@samsung.com>
2 years ago[Bug] Fix config from structure function
gichan [Wed, 15 Sep 2021 11:28:50 +0000 (20:28 +0900)]
[Bug] Fix config from structure function

Wrong forat variable is used at L908.
If tensors format is not given, defualt format should be static.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[TEST] Adjust state change timeout.
gichan [Thu, 16 Sep 2021 02:43:22 +0000 (11:43 +0900)]
[TEST] Adjust state change timeout.

cppFilterObj.base03 test fail intermittenly on armv7l during state change to GST_STATE_PLAYING.
When measuring the state change tome, it took around 600~800ms on armv7l.
The current timeout is 1000ms, which is close to the boundary.
The test failure did not occur when repeated 1000 times.
Previously, it occurred about once in 20 times.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years agoFix some alerts that were detected by the LGTM system
Taras Drozdovskyi [Wed, 15 Sep 2021 09:58:22 +0000 (12:58 +0300)]
Fix some alerts that were detected by the LGTM system

nnstream project was analyzed by the LGTM system

Signed-off-by: Taras Drozdovskyi <t.drozdovsky@samsung.com>
2 years ago[build/snpe] Build snpe subplugin when the platform supports the lib accepted/tizen/unified/20210915.100110 submit/tizen/20210915.065224
Yongjoo Ahn [Wed, 8 Sep 2021 09:09:26 +0000 (18:09 +0900)]
[build/snpe] Build snpe subplugin when the platform supports the lib

- If the build platform supports snpe lib, use it to build snpe subplugin
- Add snpe related packages in spec

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[query] Handle different framerate of clients
Gichan Jang [Mon, 13 Sep 2021 05:20:50 +0000 (14:20 +0900)]
[query] Handle different framerate of clients

If data is not available in the socket, check the next socket.
So, server can hanlde different framerate of clients.

Todo:
 - Create threads for each client.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[Filter/SharedModel] fix svace
Jaeyun [Mon, 13 Sep 2021 07:52:02 +0000 (16:52 +0900)]
[Filter/SharedModel] fix svace

Fix svace issue,
- set next node when releasing the list item
- use macro to define local lock for shared table

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Svace] fix res leak case
Jaeyun [Mon, 13 Sep 2021 08:31:31 +0000 (17:31 +0900)]
[Svace] fix res leak case

Fix svace issue,
- fix invalid condition to check the args.
- possible res leak in query close function.
- condition to free strings for test models.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Test/CodeClean] improve coverage
Jaeyun [Mon, 6 Sep 2021 10:29:53 +0000 (19:29 +0900)]
[Test/CodeClean] improve coverage

Update testcase to improve test coverage.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Query] Identify client using id
gichan [Fri, 13 Aug 2021 05:55:54 +0000 (14:55 +0900)]
[Query] Identify client using id

currently, ip address of the client is only used to distinguish client which will receive buffers.
In this case, server cannot distinguish if more than one client with the sampe ip is connected.
So instead of ip address, changed it to use the client's unique id.

Signed-off-by: gichan <gichan2.jang@samsung.com>
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[Test/Sparse] add testcase for common functions
Jaeyun [Mon, 6 Sep 2021 07:06:59 +0000 (16:06 +0900)]
[Test/Sparse] add testcase for common functions

Add new testcase for sparse tensor utils.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Sparse] change util function param
Jaeyun [Mon, 6 Sep 2021 07:03:00 +0000 (16:03 +0900)]
[Sparse] change util function param

Change param - gst-memory to convert tensor data.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Meson] feature for supported plugins
Jaeyun [Tue, 7 Sep 2021 08:26:14 +0000 (17:26 +0900)]
[Meson] feature for supported plugins

Add feature for supported plugins in meson script.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[test/py] Fix test related python sources to increase SAM score
Yongjoo Ahn [Tue, 7 Sep 2021 09:42:55 +0000 (18:42 +0900)]
[test/py] Fix test related python sources to increase SAM score

- Refactor complex functions to increase FME score
- Total python SAM score 3.82 -> 4.66

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[tvm/test] Add negative testcase for invalid custom prop
Yongjoo Ahn [Mon, 6 Sep 2021 10:36:53 +0000 (19:36 +0900)]
[tvm/test] Add negative testcase for invalid custom prop

- Add negative testcases for invalid custom props
- Add valid custom prop in the positive launch testcase.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Doc] Add tensor_quey README.md
gichan [Fri, 3 Sep 2021 09:00:34 +0000 (18:00 +0900)]
[Doc] Add tensor_quey README.md

Add tensor query documentation.
 - How to run examples.
 - How to run test.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[lua/test] Add tc for multiple tensor types in lua filter
Yongjoo Ahn [Fri, 3 Sep 2021 07:32:40 +0000 (16:32 +0900)]
[lua/test] Add tc for multiple tensor types in lua filter

- Add a testcase which covers all tensor types in tensor_filter::lua
- Add a negative case of invalid data type.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Test] aggregator from multi clients
Jaeyun [Fri, 27 Aug 2021 09:27:13 +0000 (18:27 +0900)]
[Test] aggregator from multi clients

Add testcase - aggregator from multiple clients using query meta.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Common/Adapter] aggregation from multi clients
Jaeyun [Fri, 27 Aug 2021 05:37:15 +0000 (14:37 +0900)]
[Common/Adapter] aggregation from multi clients

Use hashtable to aggregate buffers from multiple clients.
- create gst-adapter for each client id
- for normal case, set default adaptor (no meta in gst-buffer)

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Test/CodeClean] new testcases for coverage
Jaeyun [Tue, 31 Aug 2021 05:22:18 +0000 (14:22 +0900)]
[Test/CodeClean] new testcases for coverage

Add new cases to improve test coverage and fix some minor comment.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[TEST] Add tensor query tests
Gichan Jang [Wed, 25 Aug 2021 09:29:50 +0000 (18:29 +0900)]
[TEST] Add tensor query tests

Add tensor query tests.
line coverage increased from 6.6% to 77.6%.

Signed-off-by: gichan <gichan2.jang@samsung.com>
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[Test/Filter] testcase for filter-single
Jaeyun [Mon, 30 Aug 2021 08:18:41 +0000 (17:18 +0900)]
[Test/Filter] testcase for filter-single

Add new testcases for tensor-filter single.
filter-single class is used only for ML single API. For coverage report, we need to run and test this class.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[tensor_sparse] Add SSAT test for tensor_sparse
Yongjoo Ahn [Tue, 27 Jul 2021 03:11:41 +0000 (12:11 +0900)]
[tensor_sparse] Add SSAT test for tensor_sparse

- Add SSAT test for tensor_sparse_enc and tensor_sparse_dec

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[tensor_sparse] Implement tensor_sparse_enc and tensor_sparse_dec
Yongjoo Ahn [Tue, 27 Jul 2021 03:10:58 +0000 (12:10 +0900)]
[tensor_sparse] Implement tensor_sparse_enc and tensor_sparse_dec

- tensor_sparse_enc: encoding static tensors into sparse tensors
- tensor_sparse_dec: decoding sparse tensors into stsatic tensors

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[tensor_sparse] Implement util functions for sparse tensors
Yongjoo Ahn [Tue, 27 Jul 2021 03:07:56 +0000 (12:07 +0900)]
[tensor_sparse] Implement util functions for sparse tensors

- Implement util functions for enc/decoding sparse tensors
- Allow sparse format caps in tensor_sink

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>