From 6714f18cb3cfcbea6c9da5625528f6d947103be0 Mon Sep 17 00:00:00 2001 From: gichan Date: Mon, 9 May 2022 10:54:36 +0900 Subject: [PATCH] [Single] Remove gst dependency from single-shot Remove gst dependency from singlep-shot Signed-off-by: gichan --- c/meson.build | 7 ++++--- c/src/ml-api-inference-internal.c | 2 +- c/src/ml-api-inference-internal.h | 1 - c/src/ml-api-inference-single-internal.h | 1 - c/src/ml-api-inference-single.c | 8 ++++---- meson.build | 2 ++ 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/c/meson.build b/c/meson.build index 5c92e4b..93897ca 100644 --- a/c/meson.build +++ b/c/meson.build @@ -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, diff --git a/c/src/ml-api-inference-internal.c b/c/src/ml-api-inference-internal.c index ade0037..90a6eda 100644 --- a/c/src/ml-api-inference-internal.c +++ b/c/src/ml-api-inference-internal.c @@ -12,7 +12,7 @@ #include -#include +#include #include #include "ml-api-inference-internal.h" #include "ml-api-internal.h" diff --git a/c/src/ml-api-inference-internal.h b/c/src/ml-api-inference-internal.h index 1293410..2df0482 100644 --- a/c/src/ml-api-inference-internal.h +++ b/c/src/ml-api-inference-internal.h @@ -15,7 +15,6 @@ #define __ML_API_INTERNAL_NNSTREAMER_H__ #include -#include #include #include "ml-api-internal.h" diff --git a/c/src/ml-api-inference-single-internal.h b/c/src/ml-api-inference-single-internal.h index 9f44751..2f9e627 100644 --- a/c/src/ml-api-inference-single-internal.h +++ b/c/src/ml-api-inference-single-internal.h @@ -15,7 +15,6 @@ #define __ML_API_INF_SINGLE_INTERNAL_H__ #include -#include #include "ml-api-internal.h" diff --git a/c/src/ml-api-inference-single.c b/c/src/ml-api-inference-single.c index 0504cca..10f16bb 100644 --- a/c/src/ml-api-inference-single.c +++ b/c/src/ml-api-inference-single.c @@ -16,7 +16,7 @@ #include #include /* Tizen platform header */ #include -#include +#include #include #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])); } } diff --git a/meson.build b/meson.build index a58396d..af56cc3 100644 --- a/meson.build +++ b/meson.build @@ -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()) -- 2.7.4