- Rename the files related to tensor common functions.
renamed: gst/nnstreamer/include/nnstreamer_plugin_api_single.h -> gst/nnstreamer/include/nnstreamer_plugin_api_util.h
renamed: gst/nnstreamer/tensor_common.c -> gst/nnstreamer/nnstreamer_plugin_api_impl.c
renamed: gst/nnstreamer/tensor_common_single.c -> gst/nnstreamer/nnstreamer_plugin_api_util_impl.c
- Remove unnecessary pipeline utils from nnstreamer-internal header.
Signed-off-by: gichan <gichan2.jang@samsung.com>
+++ /dev/null
-/usr/include/nnstreamer/nnstreamer_internal_single.h
-/usr/include/nnstreamer/nnstreamer_log.h
-/usr/include/nnstreamer/tensor_filter_single.h
-/usr/lib/*/pkgconfig/nnstreamer-single-internal.pc
/usr/include/nnstreamer/nnstreamer_version.h
/usr/include/nnstreamer/tensor_typedef.h
/usr/include/nnstreamer/nnstreamer_plugin_api_filter.h
-/usr/include/nnstreamer/nnstreamer_plugin_api_single.h
+/usr/include/nnstreamer/nnstreamer_plugin_api_util.h
/usr/lib/*/pkgconfig/nnstreamer-single.pc
/usr/lib/*/libnnstreamer-single.a
#include <unistd.h>
#include <nnstreamer_log.h>
-#include <nnstreamer_plugin_api_single.h>
+#include <nnstreamer_plugin_api_util.h>
#define NO_ANONYMOUS_NESTED_STRUCT
#include <nnstreamer_plugin_api_filter.h>
#undef NO_ANONYMOUS_NESTED_STRUCT
#include <nnstreamer_log.h>
#include <errno.h>
-#include <nnstreamer_plugin_api_single.h>
+#include <nnstreamer_plugin_api_util.h>
#define NO_ANONYMOUS_NESTED_STRUCT
#include <nnstreamer_plugin_api_filter.h>
#undef NO_ANONYMOUS_NESTED_STRUCT
*/
#include <nnstreamer_log.h>
-#include <nnstreamer_plugin_api_single.h>
+#include <nnstreamer_plugin_api_util.h>
#define NO_ANONYMOUS_NESTED_STRUCT
#include <nnstreamer_plugin_api_filter.h>
#undef NO_ANONYMOUS_NESTED_STRUCT
*/
#include <nnstreamer_log.h>
-#include <nnstreamer_plugin_api_single.h>
+#include <nnstreamer_plugin_api_util.h>
#define NO_ANONYMOUS_NESTED_STRUCT
#include <nnstreamer_plugin_api_filter.h>
#undef NO_ANONYMOUS_NESTED_STRUCT
#include <unistd.h>
#include <nnstreamer_log.h>
-#include <nnstreamer_plugin_api_single.h>
+#include <nnstreamer_plugin_api_util.h>
#define NO_ANONYMOUS_NESTED_STRUCT
#include <nnstreamer_plugin_api_filter.h>
#undef NO_ANONYMOUS_NESTED_STRUCT
'nnstreamer_plugin_api_filter.h',
'nnstreamer_plugin_api_decoder.h',
'nnstreamer_plugin_api_converter.h',
- 'nnstreamer_plugin_api_single.h',
+ 'nnstreamer_plugin_api_util.h',
'nnstreamer_plugin_api.h',
'nnstreamer_util.h'
]
/**
* @file nnstreamer_plugin_api.h
* @date 24 Jan 2019
- * @brief Optional/Addtional NNStreamer APIs for sub-plugin writers. (Need Glib)
+ * @brief Optional/Addtional NNStreamer APIs for sub-plugin writers. (Need Gst devel)
* @see https://github.com/nnstreamer/nnstreamer
* @author MyungJoo Ham <myungjoo.ham@samsung.com> and Wook Song <wook16.song@samsung.com>
* @bug No known bugs except for NYI items
#include <gst/gst.h>
#include <tensor_typedef.h>
#include <nnstreamer_version.h>
-#include "nnstreamer_plugin_api_single.h"
+#include "nnstreamer_plugin_api_util.h"
G_BEGIN_DECLS
/* SPDX-License-Identifier: LGPL-2.1-only */
/**
- * NNStreamer API for Tensor_Filter Sub-Plugins
- * Copyright (C) 2021 Gichan Jang <gichan2.jang@samsung.com>
+ * NNStreamer Common API Header for Plug-Ins
+ * Copyright (C) 2022 Gichan Jang <gichan2.jang@samsung.com>
*/
/**
- * @file nnstreamer_plugin_api_single.h
+ * @file nnstreamer_plugin_api_util.h
* @date 28 Jan 2022
- * @brief Optional/Addtional NNStreamer Single-shot APIs for sub-plugin writers. (Need Gst Devel)
+ * @brief Optional/Addtional NNStreamer APIs for sub-plugin writers. (No Gst dep)
* @see https://github.com/nnstreamer/nnstreamer
* @author Gichan Jang <myungjoo.ham@samsung.com>
* @bug No known bugs except for NYI items
*/
-#ifndef __NNS_PLUGIN_API_SINGLE_H__
-#define __NNS_PLUGIN_API_SINGLE_H__
+#ifndef __NNS_PLUGIN_API_UTIL_H__
+#define __NNS_PLUGIN_API_UTIL_H__
#include <glib.h>
#include <tensor_typedef.h>
nnstreamer_version_fetch (guint * major, guint * minor, guint * micro);
G_END_DECLS
-#endif /* __NNS_PLUGIN_API_SINGLE_H__ */
+#endif /* __NNS_PLUGIN_API_UTIL_H__ */
'hw_accel.c',
'nnstreamer_conf.c',
'nnstreamer_subplugin.c',
- 'tensor_common_single.c',
+ 'nnstreamer_plugin_api_util_impl.c',
]
# Add nnstreamer registerer and common sources
nnst_sources = [
'registerer/nnstreamer.c',
- 'tensor_common.c',
+ 'nnstreamer_plugin_api_impl.c',
'tensor_allocator.c',
'tensor_data.c',
'tensor_meta.c'
# Private header for sub-plugins and native APIs
nnstreamer_headers += join_paths(meson.current_source_dir(), 'nnstreamer_log.h')
nnstreamer_headers += join_paths(meson.current_source_dir(), 'nnstreamer_internal.h')
-nnstreamer_headers += join_paths(meson.current_source_dir(), 'nnstreamer_internal_single.h')
nnstreamer_single_shared = shared_library('nnstreamer-single',
nnstreamer_single_sources,
*
* @file nnstreamer_internal.h
* @date 28 Jan 2021
- * @brief Internal header for NNStreamer plugins and native APIs.
+ * @brief Internal header for NNStreamer plugins and native single-shot APIs.
* @see http://github.com/nnstreamer/nnstreamer
* @author Jaeyun Jung <jy1210.jung@samsung.com>
* @bug No known bugs except for NYI items
#define __NNSTREAMER_INTERNAL_H__
#include <glib.h>
-#include <nnstreamer_plugin_api.h>
#include <nnstreamer_plugin_api_filter.h>
-#include "nnstreamer_internal_single.h"
G_BEGIN_DECLS
/**
- * @brief Get pad caps from tensors config and caps of the peer connected to the pad.
- * @param pad GstPad to get possible caps
- * @param config tensors config structure
- * @return caps for given config. Caller is responsible for unreffing the returned caps.
+ * @brief Get the custom configuration value from .ini and envvar.
+ * @detail For predefined configurations defined in this header,
+ * use the given enum for faster configuration processing.
+ * For custom configurations not defined in this header,
+ * you may use this API to access your own custom configurations.
+ * Configuration values may be loaded only once during runtime,
+ * thus, if the values are changed in run-time, the changes are
+ * not guaranteed to be reflected.
+ * The ENVVAR is supposed to be NNSTREAMER_${group}_${key}, which
+ * has higher priority than the .ini configuration.
+ * Be careful not to use special characters in group name ([, ], _).
+ * @param[in] group The group name, [group], in .ini file.
+ * @param[in] key The key name, key = value, in .ini file.
+ * @return The newly allocated string. A caller must free it. NULL if it's not available.
*/
-extern GstCaps *
-gst_tensor_pad_caps_from_config (GstPad * pad, const GstTensorsConfig * config);
+extern gchar *
+nnsconf_get_custom_value_string (const gchar * group, const gchar * key);
/**
- * @brief Get all possible caps from tensors config. Unlike gst_tensor_pad_caps_from_config(), this function does not check peer caps.
- * @param pad GstPad to get possible caps
- * @param config tensors config structure
- * @return caps for given config. Caller is responsible for unreffing the returned caps.
+ * @brief Get the custom configuration value from .ini and envvar.
+ * @detail For predefined configurations defined in this header,
+ * use the given enum for faster configuration processing.
+ * For custom configurations not defined in this header,
+ * you may use this API to access your own custom configurations.
+ * Configuration values may be loaded only once during runtime,
+ * thus, if the values are changed in run-time, the changes are
+ * not guaranteed to be reflected.
+ * The ENVVAR is supposed to be NNSTREAMER_${group}_${key}, which
+ * has higher priority than the .ini configuration.
+ * Be careful not to use special characters in group name ([, ], _).
+ * @param[in] group The group name, [group], in .ini file.
+ * @param[in] key The key name, key = value, in .ini file.
+ * @param[in] def The default return value in case there is no value available.
+ * @return The value interpreted as TRUE/FALSE.
*/
-extern GstCaps *
-gst_tensor_pad_possible_caps_from_config (GstPad * pad, const GstTensorsConfig * config);
+extern gboolean
+nnsconf_get_custom_value_bool (const gchar * group, const gchar * key, gboolean def);
+
+/**
+ * @brief Get neural network framework name from given model file. This does not guarantee the framework is available on the target device.
+ * @param[in] model_files the prediction model paths
+ * @param[in] num_models the number of model files
+ * @param[in] load_conf flag to load configuration for the priority of framework
+ * @return Possible framework name (NULL if it fails to detect automatically). Caller should free returned value using g_free().
+ */
+extern gchar *
+gst_tensor_filter_detect_framework (const gchar * const *model_files, const guint num_models, const gboolean load_conf);
/**
- * @brief Check current pad caps is flexible tensor.
- * @param pad GstPad to check current caps
- * @return TRUE if pad has flexible tensor caps.
+ * @brief Check if the given hw is supported by the framework.
+ * @param[in] name The name of filter sub-plugin.
+ * @param[in] hw Backend accelerator hardware.
+ * @param[in] custom User-defined string to handle detailed hardware option.
+ * @return TRUE if given hw is available.
*/
extern gboolean
-gst_tensor_pad_caps_is_flexible (GstPad * pad);
+gst_tensor_filter_check_hw_availability (const gchar * name, const accl_hw hw, const char *custom);
G_END_DECLS
#endif /* __NNSTREAMER_INTERNAL_H__ */
+++ /dev/null
-/* SPDX-License-Identifier: LGPL-2.1-only */
-/**
- * Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
- *
- * @file nnstreamer_internal_single.h
- * @date 26 Jan 2022
- * @brief Internal header for NNStreamer plugins and native sintgle-shot APIs.
- * @see http://github.com/nnstreamer/nnstreamer
- * @author Gichan Jang <gichan2.jang@samsung.com>
- * @bug No known bugs except for NYI items
- */
-
-#ifndef __NNSTREAMER_INTERNAL_SINGLE_H__
-#define __NNSTREAMER_INTERNAL_SINGLE_H__
-
-#include <glib.h>
-#include <nnstreamer_plugin_api_filter.h>
-
-G_BEGIN_DECLS
-
-/**
- * @brief Get the custom configuration value from .ini and envvar.
- * @detail For predefined configurations defined in this header,
- * use the given enum for faster configuration processing.
- * For custom configurations not defined in this header,
- * you may use this API to access your own custom configurations.
- * Configuration values may be loaded only once during runtime,
- * thus, if the values are changed in run-time, the changes are
- * not guaranteed to be reflected.
- * The ENVVAR is supposed to be NNSTREAMER_${group}_${key}, which
- * has higher priority than the .ini configuration.
- * Be careful not to use special characters in group name ([, ], _).
- * @param[in] group The group name, [group], in .ini file.
- * @param[in] key The key name, key = value, in .ini file.
- * @return The newly allocated string. A caller must free it. NULL if it's not available.
- */
-extern gchar *
-nnsconf_get_custom_value_string (const gchar * group, const gchar * key);
-
-/**
- * @brief Get the custom configuration value from .ini and envvar.
- * @detail For predefined configurations defined in this header,
- * use the given enum for faster configuration processing.
- * For custom configurations not defined in this header,
- * you may use this API to access your own custom configurations.
- * Configuration values may be loaded only once during runtime,
- * thus, if the values are changed in run-time, the changes are
- * not guaranteed to be reflected.
- * The ENVVAR is supposed to be NNSTREAMER_${group}_${key}, which
- * has higher priority than the .ini configuration.
- * Be careful not to use special characters in group name ([, ], _).
- * @param[in] group The group name, [group], in .ini file.
- * @param[in] key The key name, key = value, in .ini file.
- * @param[in] def The default return value in case there is no value available.
- * @return The value interpreted as TRUE/FALSE.
- */
-extern gboolean
-nnsconf_get_custom_value_bool (const gchar * group, const gchar * key, gboolean def);
-
-/**
- * @brief Get neural network framework name from given model file. This does not guarantee the framework is available on the target device.
- * @param[in] model_files the prediction model paths
- * @param[in] num_models the number of model files
- * @param[in] load_conf flag to load configuration for the priority of framework
- * @return Possible framework name (NULL if it fails to detect automatically). Caller should free returned value using g_free().
- */
-extern gchar *
-gst_tensor_filter_detect_framework (const gchar * const *model_files, const guint num_models, const gboolean load_conf);
-
-/**
- * @brief Check if the given hw is supported by the framework.
- * @param[in] name The name of filter sub-plugin.
- * @param[in] hw Backend accelerator hardware.
- * @param[in] custom User-defined string to handle detailed hardware option.
- * @return TRUE if given hw is available.
- */
-extern gboolean
-gst_tensor_filter_check_hw_availability (const gchar * name, const accl_hw hw, const char *custom);
-
-G_END_DECLS
-#endif /* __NNSTREAMER_INTERNAL_SINGLE_H__ */
/* SPDX-License-Identifier: LGPL-2.1-only */
/**
* NNStreamer Common Header's Contents (pipeline extension)
- * Copyright (C) 2018 MyungJoo Ham <myungjoo.ham@samsung.com>
+ * Copyright (C) 2020 MyungJoo Ham <myungjoo.ham@samsung.com>
*/
/**
- * @file tensor_common.c
- * @date 29 May 2018
+ * @file nnstreamer_plugin_api_impl.c
+ * @date 14 Apr 2020
* @brief Common data for NNStreamer, the GStreamer plugin for neural networks
* @see https://github.com/nnstreamer/nnstreamer
* @author MyungJoo Ham <myungjoo.ham@samsung.com>
/**
* Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
*
- * @file tensor_common_single.c
+ * @file nnstreamer_plugin_api_util_impl.c
* @date 28 Jan 2022
* @brief Tensor common util fucntions for NNStreamer. (No gst dependency)
* @see https://github.com/nnstreamer/nnstreamer
* @bug No known bugs except for NYI items
*/
-#include "nnstreamer_plugin_api_single.h"
+#include "nnstreamer_plugin_api_util.h"
#include "nnstreamer_log.h"
/**
#include <glib-object.h>
#include <errno.h>
#include <nnstreamer_subplugin.h>
-#include <nnstreamer_plugin_api_single.h>
+#include <nnstreamer_plugin_api_util.h>
#include <nnstreamer_plugin_api_filter.h>
G_BEGIN_DECLS
#include <glib.h>
#include <tensor_filter_custom_easy.h>
#include <nnstreamer_log.h>
-#include <nnstreamer_plugin_api_single.h>
+#include <nnstreamer_plugin_api_util.h>
#include <nnstreamer_subplugin.h>
#include <nnstreamer_util.h>
$(NNSTREAMER_GST_HOME)/hw_accel.c \
$(NNSTREAMER_GST_HOME)/nnstreamer_conf.c \
$(NNSTREAMER_GST_HOME)/nnstreamer_subplugin.c \
- $(NNSTREAMER_GST_HOME)/tensor_common_single.c \
+ $(NNSTREAMER_GST_HOME)/nnstreamer_plugin_api_util_impl.c \
$(NNSTREAMER_GST_HOME)/tensor_filter/tensor_filter_common.c \
$(NNSTREAMER_GST_HOME)/tensor_filter/tensor_filter_custom.c \
$(NNSTREAMER_GST_HOME)/tensor_filter/tensor_filter_custom_easy.c \
NNSTREAMER_PLUGINS_SRCS := \
$(NNSTREAMER_GST_HOME)/tensor_data.c \
$(NNSTREAMER_GST_HOME)/tensor_meta.c \
- $(NNSTREAMER_GST_HOME)/tensor_common.c \
+ $(NNSTREAMER_GST_HOME)/nnstreamer_plugin_api_impl.c \
$(NNSTREAMER_GST_HOME)/registerer/nnstreamer.c \
$(NNSTREAMER_GST_HOME)/tensor_converter/tensor_converter.c \
$(NNSTREAMER_GST_HOME)/tensor_crop/tensor_crop.c \
install_dir: join_paths(nnstreamer_libdir, 'pkgconfig'),
configuration: nnstreamer_install_conf
)
-configure_file(input: 'nnstreamer-single-internal.pc.in', output: 'nnstreamer-single-internal.pc',
- install_dir: join_paths(nnstreamer_libdir, 'pkgconfig'),
- configuration: nnstreamer_install_conf
-)
# Check whether mqtt broker is running or not.
check_mosquitto = run_command ('bash', './tests/check_broker.sh').stdout()
+++ /dev/null
-# Package Information for pkg-config, for developers using nnstreamer internal details.
-
-prefix=@PREFIX@
-exec_prefix=@EXEC_PREFIX@
-libdir=@LIB_INSTALL_DIR@
-includedir=@INCLUDE_INSTALL_DIR@
-test_templatedir=@TEST_TEMPLATE_DIR@ # test template dir to be used
-
-Name: nnstreamer-internal
-Description: Dev Kit of NNStreamer single-shot API implementation
-Version: @VERSION@
-Requires: nnstreamer-single
-Libs: -L${libdir} -lnnstreamer-single
-Cflags: -I${includedir}/nnstreamer
%package devel
Summary: Development package for custom tensor operator developers (tensor_filter/custom)
Requires: nnstreamer = %{version}-%{release}
-Requires: nnstreamer-single = %{version}-%{release}
+Requires: nnstreamer-single-devel = %{version}-%{release}
Requires: glib2-devel
Requires: gstreamer-devel
%description devel
%package devel-internal
Summary: Development package to access internal functions of NNStreamer
Requires: nnstreamer-devel = %{version}-%{release}
-Requires: nnstreamer-single-devel-internal = %{version}-%{release}
%description devel-internal
Development package to access internal functions of NNStreamer.
This may be used by API packages, which wrap nnstreamer features.
%description single-devel
Development package for NNStreamer single-shot.
-%package single-devel-internal
-Summary: Development package to access internal functions of NNStreamer single-shot
-Requires: nnstreamer-single-devel = %{version}-%{release}
-%description single-devel-internal
-Development package to access internal functions of NNStreamer single-shot.
-This may be used by API packages, which wrap nnstreamer features.
-In most cases, custom-filter or subplugin authors do not need this internal devel package; however, if they want to access more internal functions, they may need this.
-
%package single-devel-static
Summary: Static library for nnstreamer-single-devel package
Requires: nnstreamer-single-devel = %{version}-%{release}
%files devel-internal
%{_includedir}/nnstreamer/nnstreamer_internal.h
+%{_includedir}/nnstreamer/nnstreamer_log.h
+%{_includedir}/nnstreamer/tensor_filter_single.h
%{_libdir}/pkgconfig/nnstreamer-internal.pc
%files devel-static
%files single-devel
%{_includedir}/nnstreamer/tensor_typedef.h
%{_includedir}/nnstreamer/nnstreamer_plugin_api_filter.h
-%{_includedir}/nnstreamer/nnstreamer_plugin_api_single.h
+%{_includedir}/nnstreamer/nnstreamer_plugin_api_util.h
%{_includedir}/nnstreamer/nnstreamer_version.h
%{_libdir}/pkgconfig/nnstreamer-single.pc
-%files single-devel-internal
-%{_includedir}/nnstreamer/nnstreamer_internal_single.h
-%{_includedir}/nnstreamer/nnstreamer_log.h
-%{_includedir}/nnstreamer/tensor_filter_single.h
-%{_libdir}/pkgconfig/nnstreamer-single-internal.pc
-
%files single-devel-static
%{_libdir}/libnnstreamer-single.a
#include <gtest/gtest.h>
#include <glib.h>
-#include <nnstreamer_plugin_api_single.h>
+#include <nnstreamer_plugin_api_util.h>
#include "../gst/nnstreamer/tensor_filter/tensor_filter_single.h"