[Single] Remove gst dependency from single-shot
authorgichan <gichan2.jang@samsung.com>
Mon, 9 May 2022 01:54:36 +0000 (10:54 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Mon, 9 May 2022 05:55:43 +0000 (14:55 +0900)
Remove gst dependency from singlep-shot

Signed-off-by: gichan <gichan2.jang@samsung.com>
c/meson.build
c/src/ml-api-inference-internal.c
c/src/ml-api-inference-internal.h
c/src/ml-api-inference-single-internal.h
c/src/ml-api-inference-single.c
meson.build

index 5c92e4b..93897ca 100644 (file)
@@ -43,7 +43,7 @@ endif
 
 
 # Dependencies
-nns_capi_common_deps = [nnstreamer_dep, glib_dep, gmodule_dep, gst_dep]
+nns_capi_common_deps = [glib_dep, gmodule_dep, nnstreamer_single_dep]
 nns_capi_deps = [nnstreamer_dep, glib_dep, gmodule_dep, gst_dep, gst_app_dep, leveldb_dep]
 
 if (get_option('enable-tizen'))
@@ -90,6 +90,7 @@ if get_option('default_library') == 'static'
   nns_capi_common_lib = nns_capi_common_static_lib
 endif
 nns_capi_common_dep = declare_dependency(link_with: nns_capi_common_lib)
+nns_capi_common_deps += nns_capi_common_dep
 nns_capi_deps += nns_capi_common_dep
 nns_capi_test_deps = nns_capi_deps
 
@@ -101,7 +102,7 @@ endif
 # Single-shot API.
 nns_capi_single_shared_lib = shared_library ('capi-ml-inference-single',
   nns_capi_single_srcs,
-  dependencies: nns_capi_deps,
+  dependencies: [nns_capi_common_deps, gobject_dep],
   include_directories: nns_capi_include,
   install: true,
   install_dir: api_install_libdir,
@@ -110,7 +111,7 @@ nns_capi_single_shared_lib = shared_library ('capi-ml-inference-single',
 
 nns_capi_single_static_lib = static_library ('capi-ml-inference-single',
   nns_capi_single_srcs,
-  dependencies: nns_capi_deps,
+  dependencies: [nns_capi_common_deps, gobject_dep],
   include_directories: nns_capi_include,
   install: true,
   install_dir: api_install_libdir,
index ade0037..90a6eda 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <string.h>
 
-#include <nnstreamer_plugin_api.h>
+#include <nnstreamer_plugin_api_util.h>
 #include <tensor_typedef.h>
 #include "ml-api-inference-internal.h"
 #include "ml-api-internal.h"
index 1293410..2df0482 100644 (file)
@@ -15,7 +15,6 @@
 #define __ML_API_INTERNAL_NNSTREAMER_H__
 
 #include <glib.h>
-#include <gst/gst.h>
 #include <nnstreamer_plugin_api_filter.h>
 
 #include "ml-api-internal.h"
index 9f44751..2f9e627 100644 (file)
@@ -15,7 +15,6 @@
 #define __ML_API_INF_SINGLE_INTERNAL_H__
 
 #include <glib.h>
-#include <gst/gst.h>
 
 #include "ml-api-internal.h"
 
index 0504cca..10f16bb 100644 (file)
@@ -16,7 +16,7 @@
 #include <nnstreamer-single.h>
 #include <nnstreamer-tizen-internal.h>  /* Tizen platform header */
 #include <nnstreamer_internal.h>
-#include <nnstreamer_plugin_api.h>
+#include <nnstreamer_plugin_api_util.h>
 #include <tensor_filter_single.h>
 
 #include "ml-api-inference-internal.h"
@@ -154,7 +154,7 @@ _ml_get_nnfw_type_by_subplugin_name (const char *name)
       nnfw_type = ML_NNFW_TYPE_SNAP;
     else
       _ml_error_report ("Cannot find nnfw, %s is an invalid name.",
-          GST_STR_NULL (name));
+          _STR_NULL (name));
   } else {
     nnfw_type = (ml_nnfw_type_e) idx;
   }
@@ -1163,7 +1163,7 @@ ml_single_close (ml_single_h single)
     if (single_h->klass)
       single_h->klass->stop (single_h->filter);
 
-    gst_object_unref (single_h->filter);
+    g_object_unref (single_h->filter);
     single_h->filter = NULL;
   }
 
@@ -1771,7 +1771,7 @@ __ml_validate_model_file (const char *const *model,
     if (!model[i] || !g_file_test (model[i], G_FILE_TEST_IS_REGULAR)) {
       _ml_error_report_return (ML_ERROR_INVALID_PARAMETER,
           "The given param, model path [%d] = \"%s\" is invalid or the file is not found or accessible.",
-          i, GST_STR_NULL (model[i]));
+          i, _STR_NULL (model[i]));
     }
   }
 
index a58396d..af56cc3 100644 (file)
@@ -19,9 +19,11 @@ cxx = meson.get_compiler('cpp')
 
 # Dependencies
 glib_dep = dependency('glib-2.0')
+gobject_dep = dependency('gobject-2.0')
 gmodule_dep = dependency('gmodule-2.0')
 gst_dep = dependency('gstreamer-1.0')
 gst_app_dep = dependency('gstreamer-app-1.0')
+nnstreamer_single_dep = dependency('nnstreamer-single')
 nnstreamer_dep = dependency('nnstreamer')
 leveldb_dep = dependency('leveldb', required: false)
 if (not leveldb_dep.found())