int x1, y1, x2, y2;
uint32_t *pos1, *pos2;
- guint i, j, label_len;
+ guint i;
guint pose_size = data->total_labels;
char *label;
for (i = 0; i < pose_size; i++) {
if (xydata[i].valid) {
pose_metadata_t *md = pose_get_metadata_by_id (data, i);
+ gsize j, label_len;
+
x1 = xydata[i].x;
y1 = xydata[i].y;
if (md == NULL)
continue;
label = md->label;
- label_len = strlen (label);
+ label_len = label ? strlen (label) : 0;
y1 = MAX (0, (y1 - 14));
pos1 = &frame[y1 * data->width + x1];
for (j = 0; j < label_len; j++) {
/**
* 5. Get the tensor desciptions for input and output form allocated model
*/
- len = sizeof (tensor_desc_input);
+ len = (guint32) sizeof (tensor_desc_input);
ret_code =
ncGraphGetOption (handle_graph, NC_RO_GRAPH_INPUT_TENSOR_DESCRIPTORS,
&tensor_desc_input, &len);
goto err_destroy_graph_h;
}
- len = sizeof (tensor_desc_output);
+ len = (guint32) sizeof (tensor_desc_output);
ret_code =
ncGraphGetOption (handle_graph, NC_RO_GRAPH_OUTPUT_TENSOR_DESCRIPTORS,
&tensor_desc_output, &len);
gssize read_size;
guint8 *data;
guint tensor_count;
- guint tensor_size;
+ gsize tensor_size;
g_return_val_if_fail (src->fd != 0, GST_FLOW_ERROR);
g_return_val_if_fail (src->shuffled_index_array != NULL, GST_FLOW_ERROR);
if (prop->is_signed) { \
DTYPE_SIGNED value_signed; \
guint shift_value; \
- \
- shift_value = (sizeof (DTYPE_UNSIGNED) * 8) - prop->used_bits; \
- value_signed = ((DTYPE_SIGNED) (value_unsigned << shift_value)) >> \
- shift_value; \
+ shift_value = ((guint) (sizeof (DTYPE_UNSIGNED) * 8)) - prop->used_bits; \
+ value_signed = ((DTYPE_SIGNED) (value_unsigned << shift_value)) >> shift_value; \
value_float = ((gfloat) value_signed + prop->offset) * prop->scale; \
} else { \
value_float = ((gfloat) value_unsigned + prop->offset) * prop->scale; \
guint size, GstBuffer ** buffer)
{
GstTensorSrcIIO *self;
+ GstFlowReturn ret = GST_FLOW_ERROR;
GstBuffer *buf;
GstMemory *mem;
GstTensorInfo *_info;
- guint buffer_size;
+ gsize buffer_size;
guint idx = 0;
UNUSED (size);
mem = gst_allocator_alloc (NULL, buffer_size, NULL);
if (mem == NULL) {
GST_ERROR_OBJECT (self, "Error allocating memory for buffer.");
- goto error_buffer_unref;
+ goto error;
}
gst_tensor_buffer_append_memory (buf, mem, _info);
}
- if (gst_tensor_src_iio_fill (src, offset, buffer_size, buf) != GST_FLOW_OK) {
- goto error_buffer_unref;
- }
+ ret = gst_tensor_src_iio_fill (src, offset, (guint) buffer_size, buf);
- *buffer = buf;
- return GST_FLOW_OK;
+error:
+ if (ret == GST_FLOW_OK)
+ *buffer = buf;
+ else
+ gst_buffer_unref (buf);
-error_buffer_unref:
- gst_buffer_unref (buf);
- return GST_FLOW_ERROR;
+ return ret;
}
/**
track_latency (GstTensorFilter * self)
{
GstTensorFilterPrivate *priv = &self->priv;
- gdouble estimated, reported, deviation;
+ gint64 estimated, reported;
+ gdouble deviation;
GST_OBJECT_LOCK (self);
estimated = priv->prop.latency * GST_USECOND;
deviation = 0;
if ((estimated > reported) || (deviation > LATENCY_REPORT_THRESHOLD)) {
-
- ml_logd ("[%s] latency reported:%.0f estimated:%.0f deviation:%.4f",
+ ml_logd
+ ("[%s] latency reported:%" G_GINT64_FORMAT " estimated:%" G_GINT64_FORMAT " deviation:%.4f",
TF_MODELNAME (&(priv->prop)), reported, estimated, deviation);
gst_element_post_message (GST_ELEMENT_CAST (self),
GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
GST_TIME_ARGS (min), GST_TIME_ARGS (max));
- latency = (gdouble) estimated *GST_USECOND *
+ latency = (gdouble) estimated * GST_USECOND *
(1 + LATENCY_REPORT_HEADROOM);
priv->latency_reported = (gint64) latency;
gint latency_mode; /**< latency profiling mode (0: off, 1: on, ...) */
gint throughput_mode; /**< throughput profiling mode (0: off, 1: on, ...) */
gboolean latency_reporting; /**< reporting of estimated filter latency is enabled */
- guint64 latency_reported; /**< latency value reported (ns) in last LATENCY query */
+ gint64 latency_reported; /**< latency value reported (ns) in last LATENCY query */
GstTensorFilterCombination combi;
} GstTensorFilterPrivate;