gboolean ret;
GstTensor_Converter bogusFilter = {0};
bogusFilter.tensorConfigured = FALSE;
+ GstTensor_Converter *obj = GST_TENSOR_CONVERTER_CAST(trans);
/* @TODO: Verify if direction == GST_PAD_SINK means caps is sink pad */
if (direction == GST_PAD_SINK) {
else
g_sprintf(colors, "{3, 4}");
- g_printerr("Structure from caps = %s\n", str);
+ if (obj->silent == FALSE)
+ g_printerr("Structure from caps = %s\n", str);
g_sprintf(str2,
"other/tensor, "
"dim4 = (int) 1"
, framerate, colors, width, height);
tmp = gst_caps_from_string(str2);
- g_printerr("Structure from caps to = %s\n", str2);
+ if (obj->silent == FALSE)
+ g_printerr("Structure from caps to = %s\n", str2);
/* If given caps are in range for width/height,
we cannot configure tensor, however, we may return proper srcpad caps */
tmp = gst_caps_new_empty();
return tmp; /* Empty Cap */
}
- g_printerr("transform_caps SINK specific\n");
g_assert(bogusFilter.tensorConfigured == TRUE);
gst_caps_unref(tmp);
tmp = tmp2;
}
+ if (obj->silent == FALSE) {
structure = gst_caps_get_structure(caps, 0);
str = gst_structure_to_string(structure);
g_printerr("From = %s\n", str);
+ g_free(str);
structure = gst_caps_get_structure(tmp, 0);
str = gst_structure_to_string(structure);
g_printerr("To = %s\n", str);
+ g_free(str);
+ }
GST_DEBUG_OBJECT(trans, "SINK transformed %" GST_PTR_FORMAT " into %"
GST_PTR_FORMAT, caps, tmp);
"height = (int)[1, 65535]");
tmp = gst_static_caps_get(&staticcap);
- structure = gst_caps_get_structure(caps, 0);
- str = gst_structure_to_string(structure);
- g_printerr("Structure from src = %s\n", str);
+ if (obj->silent == FALSE) {
+ structure = gst_caps_get_structure(caps, 0);
+ str = gst_structure_to_string(structure);
+ g_printerr("Structure from src = %s\n", str);
+ g_free(str);
+ }
if (filter) {
GstCaps *tmp2;
- structure = gst_caps_get_structure(filter, 0);
- str = gst_structure_to_string(structure);
- g_printerr("Structure from filter = %s\n", str);
+ if (obj->silent == FALSE) {
+ structure = gst_caps_get_structure(filter, 0);
+ str = gst_structure_to_string(structure);
+ g_printerr("Structure from filter = %s\n", str);
+ g_free(str);
+ }
tmp2 = gst_caps_intersect_full(filter, tmp, GST_CAPS_INTERSECT_FIRST);
- structure = gst_caps_get_structure(tmp2, 0);
- str = gst_structure_to_string(structure);
- g_printerr("Structure from intersection = %s\n", str);
+ if (obj->silent == FALSE) {
+ structure = gst_caps_get_structure(tmp2, 0);
+ str = gst_structure_to_string(structure);
+ g_printerr("Structure from intersection = %s\n", str);
+ g_free(str);
+ }
gst_caps_unref(tmp);
tmp = tmp2;
PROP_OUTPUT,
PROP_OUTPUTTYPE,
PROP_DEBUG,
+ PROP_CUSTOM,
};
/**
}
if (targetCaps) {
- gchar *str = gst_caps_to_string(targetCaps);
- g_printerr("targetCaps: %s\n", str);
- g_free(str);
+ gchar *str;
+ if (filter->debug == TRUE) {
+ str = gst_caps_to_string(targetCaps);
+ g_printerr("targetCaps: %s\n", str);
+ g_free(str);
+ }
tmp2 = gst_caps_intersect_full(targetCaps, tmp, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref(tmp);
tmp = tmp2;
- str = gst_caps_to_string(tmp);
- g_printerr("resultCaps: %s\n", str);
- g_free(str);
+ if (filter->debug == TRUE) {
+ str = gst_caps_to_string(tmp);
+ g_printerr("resultCaps: %s\n", str);
+ g_free(str);
+ }
} else {
- gchar *str = gst_caps_to_string(tmp);
- g_printerr("resultCaps w/o targetCaps: %s\n", str);
- g_free(str);
+ if (filter->debug == TRUE) {
+ gchar *str = gst_caps_to_string(tmp);
+ g_printerr("resultCaps w/o targetCaps: %s\n", str);
+ g_free(str);
+ }
}
/* @TODO 3. Check if tmp ( = targetCap \cap tmp(from dim)) is not \null-set. */
int rank = get_tensor_dimension(g_value_get_string(value), filter->outputDimension);
g_assert(rank > 0 && rank <= NNS_TENSOR_RANK_LIMIT);
filter->outputConfigured = TRUE;
+ if (filter->debug == TRUE)
+ g_printerr("Output Prop: %d:%d:%d:%d Rank %d\n", filter->outputDimension[0], filter->outputDimension[1], filter->outputDimension[2], filter->outputDimension[3], rank);
}
if (filter->outputType != _NNS_END && filter->debug == TRUE)
g_assert(filter->inputType == _NNS_END && value);
/* Once configures, it cannot be changed in runtime */
filter->inputType = get_tensor_type(g_value_get_string(value));
+ if (filter->debug == TRUE)
+ g_printerr("Output Type: %s -> %d\n", g_value_get_string(value), filter->inputType);
g_assert(filter->inputType != _NNS_END);
if (filter->inputConfigured == TRUE && filter->debug == TRUE)
gst_tensor_filter_fix_caps(filter, TRUE, NULL, TRUE);