Fix build error caused by unused param.
- Ignore auto generated files (flatbuf, protobuf)
Fix different sign compare
Signed-off-by: gichan <gichan2.jang@samsung.com>
if grpc_support_is_available
grpc_common_src = ['nnstreamer_grpc_common.cc']
grpc_util_sources = []
+ ignore_unused_param_auto_generated_files = declare_dependency(compile_args: ['-Wno-unused-parameter'])
foreach s : grpc_common_src
grpc_util_sources += join_paths(meson.current_source_dir(), s)
grpc_util_dep = declare_dependency(
sources: grpc_util_sources,
- dependencies: [nnstreamer_dep, glib_dep, gst_dep, libdl_dep, grpc_support_deps],
+ dependencies: [nnstreamer_dep, glib_dep, gst_dep, libdl_dep, grpc_support_deps, ignore_unused_param_auto_generated_files],
include_directories: include_directories('.')
)
# Don't generate proto files twice
nns_protobuf_grpc_lib = shared_library ('nnstreamer_grpc_protobuf',
sources : [grpc_pb_gen_src, nns_protobuf_grpc_sources],
- dependencies : [grpc_util_dep, nns_protobuf_dep],
+ dependencies : [grpc_util_dep, nns_protobuf_dep, ignore_unused_param_auto_generated_files],
install: true,
install_dir: nnstreamer_libdir
)
nns_flatbuf_grpc_lib = shared_library ('nnstreamer_grpc_flatbuf',
sources : [grpc_fb_gen_src, nns_flatbuf_grpc_sources],
- dependencies : [grpc_util_dep, flatbuf_dep],
+ dependencies : [grpc_util_dep, flatbuf_dep, ignore_unused_param_auto_generated_files],
install: true,
install_dir: nnstreamer_libdir
)
#include <gst/gst.h>
#include <mvnc2/mvnc.h>
#include <nnstreamer_log.h>
+#include <nnstreamer_util.h>
#define NO_ANONYMOUS_NESTED_STRUCT
#include <nnstreamer_plugin_api_filter.h>
#undef NO_ANONYMOUS_NESTED_STRUCT
_mvncsdk2_close (const GstTensorFilterProperties * prop, void **private_data)
{
mvncsdk2_data *pdata = *private_data;
+ UNUSED (prop);
if (pdata != NULL) {
ncGraphDestroy (&(pdata->handle_graph));
mvncsdk2_data *pdata = *private_data;
struct ncTensorDescriptor_t *nc_input_desc = &(pdata->tensor_desc_input);
GstTensorInfo *nns_input_tensor_info;
+ UNUSED (prop);
/** MVNCSDK only supports one tensor at a time */
info->num_tensors = NNS_MVNCSDK2_MAX_NUM_TENOSORS_SUPPORTED;
mvncsdk2_data *pdata = *private_data;
struct ncTensorDescriptor_t *nc_output_desc = &(pdata->tensor_desc_output);
GstTensorInfo *nns_output_info;
+ UNUSED (prop);
/** MVNCSDK only supports one tensor at a time */
info->num_tensors = NNS_MVNCSDK2_MAX_NUM_TENOSORS_SUPPORTED;
return;
}
- input_buffers input_buf = {0};
- output_buffers output_buf = {0};
+ input_buffers input_buf;
+ output_buffers output_buf;
/* feed input data to npu-engine */
feed_input_data (input, &input_buf);
#include <tensor_typedef.h>
#include <nnstreamer_plugin_api.h>
#include <nnstreamer_log.h>
+#include <nnstreamer_util.h>
#include "tensor_src_tizensensor.h"
gst_base_src_set_dynamic_size (GST_BASE_SRC (self), FALSE);
if (NULL == tizensensors) {
- int i;
+ int i, sensor_dim;
tizensensors = g_hash_table_new (g_direct_hash, g_direct_equal);
for (i = 0; tizensensorspecs[i].type != SENSOR_LAST; i++) {
g_assert (g_hash_table_insert (tizensensors,
GINT_TO_POINTER (tizensensorspecs[i].type),
&tizensensorspecs[i].tinfo));
- g_assert (tizensensorspecs[i].value_count ==
- tizensensorspecs[i].tinfo.dimension[0]);
+ sensor_dim = tizensensorspecs[i].tinfo.dimension[0];
+ g_assert (tizensensorspecs[i].value_count == sensor_dim);
}
}
}
static gboolean
gst_tensor_src_tizensensor_is_seekable (GstBaseSrc * src)
{
+ UNUSED (src);
nns_logd ("tensor_src_tizensensor is not seekable");
return FALSE;
}
GstMemory *mem;
guint buffer_size;
GstFlowReturn retval = GST_FLOW_OK;
-
+ UNUSED (size);
_LOCK (self);
if (!self->configured) {
GstFlowReturn retval = GST_FLOW_OK;
GstMemory *mem;
GstMapInfo map;
-
+ int src_dim;
+ UNUSED (offset);
_LOCK (self);
if (!self->configured) {
}
event = &events[count - 1];
- if (event->value_count != self->src_spec->dimension[0]) {
+ src_dim = self->src_spec->dimension[0];
+ if (event->value_count != src_dim) {
GST_ERROR_OBJECT (self,
"The number of values (%d) mismatches the metadata (%d)",
- event->value_count, self->src_spec->dimension[0]);
+ event->value_count, src_dim);
retval = GST_FLOW_ERROR;
goto exit_unmap;
}
int depth = 8;
int color_type;
- if (bitmap->color_format == GRAY8) {
- pixel_size = 1;
- color_type = PNG_COLOR_TYPE_GRAY;
- } else {
- pixel_size = 3;
- color_type = PNG_COLOR_TYPE_RGB;
- }
-
fp = fopen (path, "wb");
if (!fp) {
goto fopen_failed;
}
/** Set image attributes. */
+ if (bitmap->color_format == GRAY8) {
+ pixel_size = 1;
+ color_type = PNG_COLOR_TYPE_GRAY;
+ } else {
+ pixel_size = 3;
+ color_type = PNG_COLOR_TYPE_RGB;
+ }
png_set_IHDR (png_ptr,
info_ptr,
*/
#include "NCSDKTensorFilterTestHelper.hh"
+#include <nnstreamer_util.h>
/* Static member variables for instance management */
std::unique_ptr<NCSDKTensorFilterTestHelper> NCSDKTensorFilterTestHelper::mInstance;
/**
* @brief Get the stage where the NCSDK fails
*/
-const fail_stage_t
+fail_stage_t
NCSDKTensorFilterTestHelper::getFailStage ()
{
return this->mFailStage;
NCSDKTensorFilterTestHelper::ncGraphGetOption (struct ncGraphHandle_t *graphHandle,
int option, void *data, unsigned int *dataLength)
{
+ UNUSED (graphHandle);
switch (option) {
case NC_RO_GRAPH_INPUT_TENSOR_DESCRIPTORS:
if (this->mFailStage == fail_stage_t::FAIL_GRAPH_GET_INPUT_TENSOR_DESC) {
struct ncFifoHandle_t **fifoIn, unsigned int inFifoCount,
struct ncFifoHandle_t **fifoOut, unsigned int outFifoCount)
{
+ UNUSED (graphHandle);
+ UNUSED (fifoIn);
+ UNUSED (inFifoCount);
+ UNUSED (fifoOut);
+ UNUSED (outFifoCount);
if (this->mFailStage == fail_stage_t::FAIL_GRAPH_Q_INFER) {
return NC_ERROR;
}
NCSDKTensorFilterTestHelper::ncFifoCreate (
const char *name, ncFifoType_t type, struct ncFifoHandle_t **fifoHandle)
{
+ UNUSED (type);
+ UNUSED (fifoHandle);
if ((this->mFailStage == fail_stage_t::FAIL_FIFO_CREATE_INPUT)
&& !g_strcmp0 (name, NNS_MVNCSDK2_NAME_INPUT_FIFO)) {
return NC_ERROR;
struct ncDeviceHandle_t *device, struct ncTensorDescriptor_t *tensorDesc,
unsigned int numElem)
{
+ UNUSED (fifoHandle);
+ UNUSED (device);
+ UNUSED (numElem);
if ((this->mFailStage == fail_stage_t::FAIL_FIFO_ALLOC_INPUT)
&& (compareTensorDesc (*tensorDesc, *(this->mTensorDescInput)))) {
return NC_ERROR;
NCSDKTensorFilterTestHelper::ncFifoSetOption (struct ncFifoHandle_t *fifoHandle,
int option, const void *data, unsigned int dataLength)
{
+ UNUSED (fifoHandle);
+ UNUSED (option);
+ UNUSED (data);
+ UNUSED (dataLength);
return NC_OK;
}
NCSDKTensorFilterTestHelper::ncFifoGetOption (struct ncFifoHandle_t *fifoHandle,
int option, void *data, unsigned int *dataLength)
{
+ UNUSED (fifoHandle);
+ UNUSED (option);
+ UNUSED (data);
+ UNUSED (dataLength);
return NC_OK;
}
ncStatus_t
NCSDKTensorFilterTestHelper::ncFifoDestroy (struct ncFifoHandle_t **fifoHandle)
{
+ UNUSED (fifoHandle);
return NC_OK;
}
NCSDKTensorFilterTestHelper::ncFifoWriteElem (struct ncFifoHandle_t *fifoHandle,
const void *inputTensor, unsigned int *inputTensorLength, void *userParam)
{
+ UNUSED (fifoHandle);
+ UNUSED (inputTensor);
+ UNUSED (inputTensorLength);
+ UNUSED (userParam);
if (this->mFailStage == fail_stage_t::FAIL_FIFO_WRT_ELEM) {
return NC_ERROR;
}
NCSDKTensorFilterTestHelper::ncFifoReadElem (struct ncFifoHandle_t *fifoHandle,
void *outputData, unsigned int *outputDataLen, void **userParam)
{
+ UNUSED (fifoHandle);
+ UNUSED (outputData);
+ UNUSED (outputDataLen);
+ UNUSED (userParam);
if (this->mFailStage == fail_stage_t::FAIL_FIFO_RD_ELEM) {
return NC_ERROR;
}
ncStatus_t
NCSDKTensorFilterTestHelper::ncFifoRemoveElem (struct ncFifoHandle_t *fifoHandle)
{
+ UNUSED (fifoHandle);
if (this->mFailStage == fail_stage_t::FAIL_FIFO_RM_ELEM) {
return NC_ERROR;
}
typedef uint32_t ncsdk_ver_t[NC_VERSION_MAX_SIZE];
+/**
+ * @brief A helper class for testing the NCSDK tensor filter.
+ */
class NCSDKTensorFilterTestHelper
{
public:
- /* Make this class as a singletone */
+ /**
+ * @brief Make this class as a singletone
+ */
static NCSDKTensorFilterTestHelper &getInstance () {
call_once (NCSDKTensorFilterTestHelper::mOnceFlag, []() {
mInstance.reset(new NCSDKTensorFilterTestHelper);
void release ();
/* Set/Get fail-stage */
void setFailStage (const fail_stage_t stage);
- const fail_stage_t getFailStage ();
+ fail_stage_t getFailStage ();
/* Mock methods that simulate NCSDK2 APIs */
/* Mock Global APIs */
unittest_mvncsdk_helper = shared_library('mvncsdk_test',
['NCSDKTensorFilterTestHelper.cc'],
- dependencies : [glib_dep, gst_base_dep, gst_dep],
+ dependencies : [glib_dep, gst_base_dep, gst_dep, nnstreamer_unittest_deps],
install: get_option('install-test'),
install_dir: nnstreamer_libdir
)