/* the capabilities of the outputs
*
* In v0.0.1, this is 3-d tensor, [color][height][width]
+ *
+ * @TODO Note: I'm not sure of this.
*/
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
/* GstElement vmethod implementations */
+/* Configure tensor metadata from sink caps */
+static gboolean
+gst_convert2tensor_configure_tensor(const GstCaps *caps, GstConvert2Tensor *myself) {
+}
+
+
/* this function handles sink events */
static gboolean
gst_convert2tensor_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
GstCaps * caps;
gst_event_parse_caps (event, &caps);
- /* do something with the caps */
+ /* @TODO Construct tensor metadata from sink caps */
+ ret = gst_convert2tensor_configure_tensor(caps, filter);
+
/* and forward */
ret = gst_pad_event_default (pad, parent, event);
if (filter->silent == FALSE)
g_print ("I'm plugged, therefore I'm in.\n");
+ /*
+ * @TODO: Convert video/x-raw frame to tensor instance.
+ */
+
/* just push out the incoming buffer without touching it */
return gst_pad_push (filter->srcpad, buf);
}
GstPad *sinkpad; /**< Media stream input */
GstPad *srcpad; /**< Tensor stream output */
gboolean silent; /**< True if logging is minimized */
+ gboolean tensorConfigured; /**< True if sinkpad has successfully configured tensor metadata */
+ int rank; /**< Tensor Rank (# dimensions) */
+ int dimension[4]; /**< Dimensions. We support up to 4th ranks */
+ enum {
+ _C2T_INT32 = 0,
+ _C2T_UINT32,
+ _C2T_INT16,
+ _C2T_UINT16,
+ _C2T_INT8,
+ _C2T_UINT8,
+ _C2T_FLOAT64,
+ _C2T_FLOAT32,
+ } type; /**< Type of each element in the tensor. User must designate this. Otherwise, this is UINT8 for video/x-raw byte stream */
+};
+unsigned int GstConvert2TensorDataSize[] = {
+ [_C2T_INT32] = 4,
+ [_C2T_UINT32] = 4,
+ [_C2T_INT16] = 2,
+ [_C2T_UINT16] = 2,
+ [_C2T_INT8] = 1,
+ [_C2T_UINT8] = 1,
+ [_C2T_FLOAT64] = 8,
+ [_C2T_FLOAT32] = 4,
};
struct _GstConvert2TensorClass