[Filter] python3 helper funciton
authorGichan Jang <gichan2.jang@samsung.com>
Tue, 27 Apr 2021 09:51:35 +0000 (18:51 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 28 Apr 2021 05:44:06 +0000 (14:44 +0900)
nnstreamer_python3 package include python3 helper functiom.
Change it to use by converter and decoder.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
debian/nnstreamer-python3.install
debian/nnstreamer-python3.links
ext/nnstreamer/extra/meson.build
ext/nnstreamer/extra/nnstreamer_python3_helper.c [moved from ext/nnstreamer/tensor_filter/tensor_filter_python3_helper.c with 100% similarity]
ext/nnstreamer/tensor_filter/meson.build
meson.build
packaging/nnstreamer.spec
packaging/run_unittests_binaries.sh
tests/nnstreamer_filter_extensions_common/meson.build
tests/nnstreamer_filter_python3/runTest.sh

index ce02cee..28a4444 100644 (file)
@@ -1,2 +1,2 @@
 /usr/lib/nnstreamer/filters/libnnstreamer_filter_python3.so
-/usr/lib/nnstreamer/filters/nnstreamer_python3.so
+/usr/lib/nnstreamer/extra/nnstreamer_python3.so
index c49efb9..a14d327 100644 (file)
@@ -1 +1 @@
-/usr/lib/nnstreamer/filters/nnstreamer_python3.so /usr/lib/python3/dist-packages/nnstreamer_python.so
+/usr/lib/nnstreamer/extra/nnstreamer_python3.so /usr/lib/python3/dist-packages/nnstreamer_python.so
index 865d64d..fc25f88 100644 (file)
@@ -76,3 +76,15 @@ if grpc_support_is_available
     warning('gRPC/Flatbuf is not supported')
   endif
 endif
+
+if have_python3
+  nnstreamer_python3_deps = [python3_dep, libdl_dep, glib_dep, gst_dep, nnstreamer_dep]
+
+  shared_library('nnstreamer_python3',
+    'nnstreamer_python3_helper.c',
+    name_prefix: '',
+    dependencies: nnstreamer_python3_deps,
+    install: true,
+    install_dir: extra_install_dir
+  )
+endif
index 106fc05..45f7cde 100644 (file)
@@ -302,26 +302,16 @@ if have_python3
     nnstreamer_filter_python3_sources += join_paths(meson.current_source_dir(), s)
   endforeach
 
-  nnstreamer_filter_python3_deps = [python3_dep, libdl_dep, glib_dep, gst_dep, nnstreamer_dep]
-
-  shared_library('nnstreamer_python3',
-    'tensor_filter_python3_helper.c',
-    name_prefix: '',
-    dependencies: nnstreamer_filter_python3_deps,
-    install: true,
-    install_dir: filter_subplugin_install_dir
-  )
-
   shared_library('nnstreamer_filter_python3',
     nnstreamer_filter_python3_sources,
-    dependencies: nnstreamer_filter_python3_deps,
+    dependencies: nnstreamer_python3_deps,
     install: true,
     install_dir: filter_subplugin_install_dir
   )
 
   static_library('nnstreamer_filter_python3',
     nnstreamer_filter_python3_sources,
-    dependencies: nnstreamer_filter_python3_deps,
+    dependencies: nnstreamer_python3_deps,
     install: true,
     install_dir: nnstreamer_libdir
   )
index 874a94f..77eafff 100644 (file)
@@ -99,6 +99,7 @@ filter_subplugin_install_dir = join_paths(subplugin_install_prefix, 'filters')
 decoder_subplugin_install_dir = join_paths(subplugin_install_prefix, 'decoders')
 customfilter_install_dir = join_paths(subplugin_install_prefix, 'customfilters')
 converter_subplugin_install_dir = join_paths(subplugin_install_prefix, 'converters')
+extra_install_dir = join_paths(subplugin_install_prefix, 'extra')
 unittest_base_dir = join_paths(nnstreamer_bindir, 'unittest-nnstreamer')
 
 # Set default configuration
index acbd461..f1ab264 100644 (file)
@@ -721,7 +721,7 @@ popd
 %if 0%{?python3_support}
 mkdir -p %{buildroot}%{python3_sitelib}
 pushd %{buildroot}%{python3_sitelib}
-ln -sf %{_prefix}/lib/nnstreamer/filters/nnstreamer_python3.so nnstreamer_python.so
+ln -sf %{_prefix}/lib/nnstreamer/extra/nnstreamer_python3.so nnstreamer_python.so
 popd
 %endif
 
@@ -813,7 +813,7 @@ cp -r result %{buildroot}%{_datadir}/nnstreamer/unittest/
 %manifest nnstreamer.manifest
 %defattr(-,root,root,-)
 %{_prefix}/lib/nnstreamer/filters/libnnstreamer_filter_python3.so
-%{_prefix}/lib/nnstreamer/filters/nnstreamer_python3.so
+%{_prefix}/lib/nnstreamer/extra/nnstreamer_python3.so
 %{python3_sitelib}/nnstreamer_python.so
 %endif
 
index bf18549..fd2323e 100755 (executable)
@@ -30,7 +30,7 @@ run_entry() {
     TEST_PYTHONPATH=$(pwd)
     export PYTHONPATH=${TEST_PYTHONPATH}
     if [[ ! -f ${TEST_PYTHONPATH}/nnstreamer_python.so ]]; then
-      ln -sf ../nnstreamer_${PY}.so nnstreamer_python.so
+      ln -sf ../../extra/nnstreamer_${PY}.so nnstreamer_python.so
     fi
     popd
     popd
index 7e15198..a466537 100644 (file)
@@ -37,8 +37,8 @@ if caffe2_support_is_available
 endif
 
 if have_python3
-  extensions += [['python3', 'python3', nnstreamer_filter_python3_deps, 'passthrough.py', 'python3-get']]
-  extensions += [['python3', 'python3', nnstreamer_filter_python3_deps, 'scaler.py', 'python3-set']]
+  extensions += [['python3', 'python3', nnstreamer_python3_deps, 'passthrough.py', 'python3-get']]
+  extensions += [['python3', 'python3', nnstreamer_python3_deps, 'scaler.py', 'python3-set']]
 endif
 
 sed_command = find_program('sed', required: true)
@@ -87,20 +87,12 @@ foreach ext : extensions
   filter_ext_common_testenv.set('NNSTREAMER_CONVERTERS', path_nns_plugin_converters)
   filter_ext_common_testenv.set('NNSTREAMER_SOURCE_ROOT_PATH', meson.source_root())
 
-  if ext[0] == 'python2'
-    py2_module_path = join_paths(meson.build_root(), 'tests/' + ext[0] + '_module')
-    run_command('rm', '-rf', py2_module_path, check : true)
-    run_command('mkdir', '-p', py2_module_path, check : true)
-    run_command('ln', '-sf',
-        join_paths(meson.build_root(), 'ext/nnstreamer/tensor_filter/nnstreamer_python2.' + so_ext),
-        py2_module_path + '/nnstreamer_python.so', check : true)
-    filter_ext_common_testenv.set('PYTHONPATH', py2_module_path)
-  elif ext[0] == 'python3'
+  if ext[0] == 'python3'
     py3_module_path = join_paths(meson.build_root(), 'tests/' + ext[0] + '_module')
     run_command('rm', '-rf', py3_module_path, check : true)
     run_command('mkdir', '-p', py3_module_path, check : true)
     run_command('ln', '-sf',
-        join_paths(meson.build_root(), 'ext/nnstreamer/tensor_filter/nnstreamer_python3.' + so_ext),
+        join_paths(meson.build_root(), 'ext/nnstreamer/extra/nnstreamer_python3.' + so_ext),
         py3_module_path + '/nnstreamer_python.so', check : true)
     filter_ext_common_testenv.set('PYTHONPATH', py3_module_path)
   endif
index 56405ed..087ec80 100755 (executable)
@@ -50,7 +50,7 @@ pushd ${TEST_PYTHONPATH}
 # Covert to an absolute path from the relative path
 export PYTHONPATH=$(pwd)
 if [[ ! -f ./nnstreamer_python.so ]]; then
-  ln -s ../nnstreamer_${FRAMEWORK}.so nnstreamer_python.so
+  ln -s ../../extra/nnstreamer_${FRAMEWORK}.so nnstreamer_python.so
 fi
 popd
 popd