{
PROP_0,
PROP_SILENT,
- PROP_SINGLE_STREAM
+ PROP_TENSORPICK
};
/**
g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?",
FALSE, G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class, PROP_TENSORPICK,
+ g_param_spec_int ("tensorpick", "TensorPick",
+ "Choose nth tensor among tensors ?", 0, G_MAXINT, FALSE,
+ G_PARAM_READWRITE));
+
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_tensor_demux_change_state);
tensor_demux->num_tensors = 0;
tensor_demux->num_srcpads = 0;
tensor_demux->silent = FALSE;
- tensor_demux->singleStream = FALSE;
+ tensor_demux->tensorpick = -1;
tensor_demux->have_group_id = FALSE;
tensor_demux->group_id = G_MAXUINT;
tensor_demux->srcpads = NULL;
tensor_type type;
tensorpad = g_new0 (GstTensorPad, 1);
- GST_DEBUG_OBJECT (tensor_demux, "createing pad: %d",
- tensor_demux->num_srcpads);
+ GST_DEBUG_OBJECT (tensor_demux, "createing pad: %d(%dth)",
+ tensor_demux->num_srcpads, nth);
name = g_strdup_printf ("src_%u", tensor_demux->num_srcpads);
pad = gst_pad_new_from_static_template (&src_templ, name);
*created = TRUE;
}
- if (tensor_demux->singleStream) {
+ if (tensor_demux->tensorpick != -1) {
+ GST_DEBUG_OBJECT (tensor_demux, "TensorPick is set! : %dth tensor only\n",
+ tensor_demux->tensorpick);
gst_element_no_more_pads (GST_ELEMENT_CAST (tensor_demux));
}
GST_DEBUG_OBJECT (tensor_demux, " Number or Tensors: %d", num_tensors);
for (i = 0; i < num_tensors; i++) {
+ if (tensor_demux->tensorpick != -1 && tensor_demux->tensorpick != i) {
+ continue;
+ }
+
GstTensorPad *srcpad;
GstBuffer *outbuf;
GstMemory *mem;
case PROP_SILENT:
filter->silent = g_value_get_boolean (value);
break;
- case PROP_SINGLE_STREAM:
- filter->singleStream = g_value_get_boolean (value);
+ case PROP_TENSORPICK:
+ filter->tensorpick = g_value_get_int (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
case PROP_SILENT:
g_value_set_boolean (value, filter->silent);
break;
- case PROP_SINGLE_STREAM:
- g_value_set_boolean (value, filter->singleStream);
+ case PROP_TENSORPICK:
+ g_value_set_int (value, filter->tensorpick);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);