*/
/**
+ * @mainpage nnstreamer
+ * @section intro Introduction
+ * - Introduction : Neural Network Streamer for AI Projects
+ * @section Program Program Name
+ * - Program Name : nnstreamer
+ * - Program Details : It provides a neural network framework connectivities (e.g., tensorflow, caffe) for gstreamer streams.
+ * Efficient Streaming for AI Projects: Neural network models wanted to use efficient and flexible streaming management as well.
+ * Intelligent Media Filters!: Use a neural network model as a media filter / converter.
+ * Composite Models!: Allow to use multiple neural network models in a single stream instance.
+ * Multi Model Intelligence!: Allow to use multiple sources for neural network models.
+ * @section INOUTPUT Input/output data
+ * - INPUT : None
+ * - OUTPUT : None
+ * @section CREATEINFO Code information
+ * - Initial date : 2018/06/14
+ * - Version : 0.1
+ */
+
+/**
* @file nnstreamer.c
* @date 11 Oct 2018
* @brief Registers all nnstreamer plugins for gstreamer so that we can have a single big binary
* @bug No known bugs except for NYI items
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <gst/gst.h>
#include <gst/gstplugin.h>
}
/**
- * @brief Determine if we need zero-padding
- * @return 1 if we need to add (or remove) stride per row from the stream data. 0 otherwise.
- */
-gint
-gst_tensor_video_stride_padding_per_row (GstVideoFormat format, gint width)
-{
- /** @todo The actual list is much longer. fill them (read https://gstreamer.freedesktop.org/documentation/design/mediatype-video-raw.html ) */
- switch (format) {
- case GST_VIDEO_FORMAT_GRAY8:
- case GST_VIDEO_FORMAT_RGB:
- case GST_VIDEO_FORMAT_BGR:
- case GST_VIDEO_FORMAT_I420:
- if (width % 4) {
- return 1;
- }
- break;
- default:
- break;
- }
-
- return 0;
-}
-
-/**
* @brief Get tensor_type from string tensor_type input
* @return Corresponding tensor_type. _NNS_END if unrecognized value is there.
* @param typestr The string type name, supposed to be one of tensor_element_typename[]
gst_tensors_caps_from_config (const GstTensorsConfig * config);
/**
- * @brief Determine if we need zero-padding
- * @return 1 if we need to add (or remove) stride per row from the stream data. 0 otherwise.
- */
-extern gint
-gst_tensor_video_stride_padding_per_row (GstVideoFormat format, gint width);
-
-/**
* @brief Get tensor_type from string tensor_type input
* @return Corresponding tensor_type. _NNS_END if unrecognized value is there.
* @param typestr The string type name, supposed to be one of tensor_element_typename[]
*/
/**
- * @mainpage nnstreamer
- * @section intro Introduction
- * - Introduction : Neural Network Streamer for AI Projects
- * @section Program Program Name
- * - Program Name : nnstreamer
- * - Program Details : It provides a neural network framework connectivities (e.g., tensorflow, caffe) for gstreamer streams.
- * Efficient Streaming for AI Projects: Neural network models wanted to use efficient and flexible streaming management as well.
- * Intelligent Media Filters!: Use a neural network model as a media filter / converter.
- * Composite Models!: Allow to use multiple neural network models in a single stream instance.
- * Multi Model Intelligence!: Allow to use multiple sources for neural network models.
- * @section INOUTPUT Input/output data
- * - INPUT : None
- * - OUTPUT : None
- * @section CREATEINFO Code information
- * - Initial date : 2018/06/14
- * - Version : 0.1
- */
-
-/**
* SECTION:element-tensor_converter
*
* A filter that converts media stream to tensor stream for NN frameworks.
}
/**
+ * @brief Determine if we need zero-padding
+ * @return TRUE if we need to add (or remove) stride per row from the stream data.
+ */
+static gboolean
+gst_tensor_converter_video_stride (GstVideoFormat format, gint width)
+{
+ /**
+ * @todo The actual list is much longer, fill them.
+ * (read https://gstreamer.freedesktop.org/documentation/design/mediatype-video-raw.html)
+ */
+ switch (format) {
+ case GST_VIDEO_FORMAT_GRAY8:
+ case GST_VIDEO_FORMAT_RGB:
+ case GST_VIDEO_FORMAT_BGR:
+ case GST_VIDEO_FORMAT_I420:
+ if (width % 4) {
+ return TRUE;
+ }
+ break;
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
+/**
* @brief Get supported format list.
*/
static void
* Emit Warning if RSTRIDE = RU4 (3BPP) && Width % 4 > 0
* @todo Add more conditions!
*/
- if (gst_tensor_video_stride_padding_per_row (GST_VIDEO_INFO_FORMAT
- (&info), GST_VIDEO_INFO_WIDTH (&info))) {
+ if (gst_tensor_converter_video_stride (GST_VIDEO_INFO_FORMAT (&info),
+ GST_VIDEO_INFO_WIDTH (&info))) {
self->remove_padding = TRUE;
silent_debug ("Set flag to remove padding, width = %d",
GST_VIDEO_INFO_WIDTH (&info));
GST_WARNING_OBJECT (self,
- "\nYOUR STREAM CONFIGURATION INCURS PERFORMANCE DETERIORATION!\nPlease use 4 x n as image width for inputs.\n");
+ "\nYOUR STREAM CONFIGURATION INCURS PERFORMANCE DETERIORATION!\n"
+ "Please use 4 x n as image width for inputs.\n");
}
frames_dim = 3;