return camera_calibration_pattern_type;
}
-G_DEFINE_TYPE (GstCameraCalibrate, gst_camera_calibrate,
- GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstCameraCalibrate, gst_camera_calibrate,
+ GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_camera_calibrate_debug, "cameracalibrate", 0,
+ "Performs camera calibration");
+ );
+GST_ELEMENT_REGISTER_DEFINE (cameracalibrate, "cameracalibrate", GST_RANK_NONE,
+ GST_TYPE_CAMERA_CALIBRATE);
static void gst_camera_calibrate_dispose (GObject * object);
static void gst_camera_calibrate_set_property (GObject * object, guint prop_id,
templ = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, caps);
gst_element_class_add_pad_template (element_class, templ);
- gst_type_mark_as_plugin_api (GST_TYPE_CAMERA_CALIBRATION_PATTERN, (GstPluginAPIFlags) 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_CAMERA_CALIBRATION_PATTERN,
+ (GstPluginAPIFlags) 0);
}
/* initialize the new element
calib->flags =
cv::fisheye::CALIB_FIX_SKEW | cv::fisheye::CALIB_RECOMPUTE_EXTRINSIC |
/*cv::fisheye::CALIB_FIX_K1 | */
- cv::fisheye::CALIB_FIX_K2 | cv::fisheye::CALIB_FIX_K3 | cv::
- fisheye::CALIB_FIX_K4;
+ cv::fisheye::CALIB_FIX_K2 | cv::fisheye::CALIB_FIX_K3 | cv::fisheye::
+ CALIB_FIX_K4;
}
calib->mode = CAPTURING; //DETECTION;
return ok;
}
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_camera_calibrate_plugin_init (GstPlugin * plugin)
-{
- /* debug category for filtering log messages */
- GST_DEBUG_CATEGORY_INIT (gst_camera_calibrate_debug, "cameracalibrate",
- 0, "Performs camera calibration");
-
- return gst_element_register (plugin, "cameracalibrate", GST_RANK_NONE,
- GST_TYPE_CAMERA_CALIBRATE);
-}
GType gst_camera_calibrate_get_type (void);
-gboolean gst_camera_calibrate_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (cameracalibrate);
G_END_DECLS
#endif /* __GST_CAMERA_CALIBRATE_H__ */
PROP_SETTINGS
};
-G_DEFINE_TYPE (GstCameraUndistort, gst_camera_undistort,
- GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstCameraUndistort, gst_camera_undistort,
+ GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_camera_undistort_debug, "cameraundistort", 0,
+ "Performs camera undistortion");
+ );
+GST_ELEMENT_REGISTER_DEFINE (cameraundistort, "cameraundistort", GST_RANK_NONE,
+ GST_TYPE_CAMERA_UNDISTORT);
static void gst_camera_undistort_dispose (GObject * object);
static void gst_camera_undistort_set_property (GObject * object, guint prop_id,
GST_BASE_TRANSFORM_CLASS (gst_camera_undistort_parent_class)->src_event
(trans, event);
}
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_camera_undistort_plugin_init (GstPlugin * plugin)
-{
- /* debug category for filtering log messages */
- GST_DEBUG_CATEGORY_INIT (gst_camera_undistort_debug, "cameraundistort",
- 0, "Performs camera undistortion");
-
- return gst_element_register (plugin, "cameraundistort", GST_RANK_NONE,
- GST_TYPE_CAMERA_UNDISTORT);
-}
GType gst_camera_undistort_get_type (void);
-gboolean gst_camera_undistort_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (cameraundistort);
G_END_DECLS
GST_DEBUG_CATEGORY_STATIC (gst_cv_dilate_debug);
#define GST_CAT_DEFAULT gst_cv_dilate_debug
-G_DEFINE_TYPE (GstCvDilate, gst_cv_dilate, GST_TYPE_CV_DILATE_ERODE);
+G_DEFINE_TYPE_WITH_CODE (GstCvDilate, gst_cv_dilate, GST_TYPE_CV_DILATE_ERODE,
+ GST_DEBUG_CATEGORY_INIT (gst_cv_dilate_debug, "cvdilate", 0, "cvdilate");
+ );
+GST_ELEMENT_REGISTER_DEFINE (cvdilate, "cvdilate", GST_RANK_NONE,
+ GST_TYPE_CV_DILATE);
static GstFlowReturn gst_cv_dilate_transform_ip (GstOpencvVideoFilter *
filter, GstBuffer * buf, cv::Mat img);
return GST_FLOW_OK;
}
-
-gboolean
-gst_cv_dilate_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_cv_dilate_debug, "cvdilate", 0, "cvdilate");
-
- return gst_element_register (plugin, "cvdilate", GST_RANK_NONE,
- GST_TYPE_CV_DILATE);
-}
GType gst_cv_dilate_get_type (void);
-gboolean gst_cv_dilate_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (cvdilate);
G_END_DECLS
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("GRAY8")));
-G_DEFINE_TYPE (GstCvEqualizeHist, gst_cv_equalize_hist,
- GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstCvEqualizeHist, gst_cv_equalize_hist,
+ GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_cv_equalize_hist_debug, "cvequalizehist", 0,
+ "cvequalizehist");
+ );
+GST_ELEMENT_REGISTER_DEFINE (cvequalizehist, "cvequalizehist", GST_RANK_NONE,
+ GST_TYPE_CV_EQUALIZE_HIST);
static GstFlowReturn gst_cv_equalize_hist_transform (GstOpencvVideoFilter *
filter, GstBuffer * buf, cv::Mat img, GstBuffer * outbuf, cv::Mat outimg);
cv::equalizeHist (img, outimg);
return GST_FLOW_OK;
}
-
-gboolean
-gst_cv_equalize_hist_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_cv_equalize_hist_debug, "cvequalizehist", 0,
- "cvequalizehist");
- return gst_element_register (plugin, "cvequalizehist", GST_RANK_NONE,
- GST_TYPE_CV_EQUALIZE_HIST);
-}
GType gst_cv_equalize_hist_get_type (void);
-gboolean gst_cv_equalize_hist_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (cvequalizehist);
G_END_DECLS
GST_DEBUG_CATEGORY_STATIC (gst_cv_erode_debug);
#define GST_CAT_DEFAULT gst_cv_erode_debug
-G_DEFINE_TYPE (GstCvErode, gst_cv_erode, GST_TYPE_CV_DILATE_ERODE);
+G_DEFINE_TYPE_WITH_CODE (GstCvErode, gst_cv_erode, GST_TYPE_CV_DILATE_ERODE,
+ GST_DEBUG_CATEGORY_INIT (gst_cv_erode_debug, "cverode", 0, "cverode");
+ );
+GST_ELEMENT_REGISTER_DEFINE (cverode, "cverode", GST_RANK_NONE,
+ GST_TYPE_CV_ERODE);
static GstFlowReturn gst_cv_erode_transform_ip (GstOpencvVideoFilter *
filter, GstBuffer * buf, cv::Mat img);
return GST_FLOW_OK;
}
-
-gboolean
-gst_cv_erode_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_cv_erode_debug, "cverode", 0, "cverode");
-
- return gst_element_register (plugin, "cverode", GST_RANK_NONE,
- GST_TYPE_CV_ERODE);
-}
GType gst_cv_erode_get_type (void);
-gboolean gst_cv_erode_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (cverode);
G_END_DECLS
#define DEFAULT_SHIFT 0.0
#define DEFAULT_MASK TRUE
-G_DEFINE_TYPE (GstCvLaplace, gst_cv_laplace, GST_TYPE_OPENCV_VIDEO_FILTER);
-
+G_DEFINE_TYPE_WITH_CODE (GstCvLaplace, gst_cv_laplace,
+ GST_TYPE_OPENCV_VIDEO_FILTER, GST_DEBUG_CATEGORY_INIT (gst_cv_laplace_debug,
+ "cvlaplace", 0, "cvlaplace");
+ );
+GST_ELEMENT_REGISTER_DEFINE (cvlaplace, "cvlaplace", GST_RANK_NONE,
+ GST_TYPE_CV_LAPLACE);
static void gst_cv_laplace_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_cv_laplace_get_property (GObject * object, guint prop_id,
return GST_FLOW_OK;
}
-
-gboolean
-gst_cv_laplace_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_cv_laplace_debug, "cvlaplace", 0, "cvlaplace");
-
- return gst_element_register (plugin, "cvlaplace", GST_RANK_NONE,
- GST_TYPE_CV_LAPLACE);
-}
GType gst_cv_laplace_get_type (void);
-gboolean gst_cv_laplace_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (cvlaplace);
G_END_DECLS
#define DEFAULT_WIDTH G_MAXINT
#define DEFAULT_HEIGHT G_MAXINT
-G_DEFINE_TYPE (GstCvSmooth, gst_cv_smooth, GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstCvSmooth, gst_cv_smooth,
+ GST_TYPE_OPENCV_VIDEO_FILTER, GST_DEBUG_CATEGORY_INIT (gst_cv_smooth_debug,
+ "cvsmooth", 0, "cvsmooth");
+ );
+GST_ELEMENT_REGISTER_DEFINE (cvsmooth, "cvsmooth", GST_RANK_NONE,
+ GST_TYPE_CV_SMOOTH);
static void gst_cv_smooth_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
return GST_FLOW_OK;
}
-
-gboolean
-gst_cv_smooth_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_cv_smooth_debug, "cvsmooth", 0, "cvsmooth");
-
- return gst_element_register (plugin, "cvsmooth", GST_RANK_NONE,
- GST_TYPE_CV_SMOOTH);
-}
GType gst_cv_smooth_get_type (void);
-gboolean gst_cv_smooth_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (cvsmooth);
G_END_DECLS
#define DEFAULT_APERTURE_SIZE 3
#define DEFAULT_MASK TRUE
-G_DEFINE_TYPE (GstCvSobel, gst_cv_sobel, GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstCvSobel, gst_cv_sobel, GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_cv_sobel_debug, "cvsobel", 0, "cvsobel");
+ );
+GST_ELEMENT_REGISTER_DEFINE (cvsobel, "cvsobel", GST_RANK_NONE,
+ GST_TYPE_CV_SOBEL);
static void gst_cv_sobel_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
return GST_FLOW_OK;
}
-
-gboolean
-gst_cv_sobel_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_cv_sobel_debug, "cvsobel", 0, "cvsobel");
-
- return gst_element_register (plugin, "cvsobel", GST_RANK_NONE,
- GST_TYPE_CV_SOBEL);
-}
GType gst_cv_sobel_get_type (void);
-gboolean gst_cv_sobel_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (cvsobel);
G_END_DECLS
return dewarp_interpolation_mode_type;
}
-G_DEFINE_TYPE (GstDewarp, gst_dewarp, GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstDewarp, gst_dewarp, GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_dewarp_debug, "dewarp", 0,
+ "Dewarp fisheye images");
+ );
+GST_ELEMENT_REGISTER_DEFINE (dewarp, "dewarp", GST_RANK_NONE, GST_TYPE_DEWARP);
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
return ret;
}
-
-gboolean
-gst_dewarp_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_dewarp_debug, "dewarp",
- 0, "Dewarp fisheye images");
-
- return gst_element_register (plugin, "dewarp", GST_RANK_NONE,
- GST_TYPE_DEWARP);
-}
GType gst_dewarp_get_type (void);
-gboolean gst_dewarp_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (dewarp);
G_END_DECLS
#endif /* __GST_DEWARP_H__ */
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("RGB"))
);
-G_DEFINE_TYPE (GstDisparity, gst_disparity, GST_TYPE_ELEMENT);
+G_DEFINE_TYPE_WITH_CODE (GstDisparity, gst_disparity, GST_TYPE_ELEMENT,
+ GST_DEBUG_CATEGORY_INIT (gst_disparity_debug, "disparity", 0,
+ "Stereo image disparity (depth) map calculation");
+ );
+GST_ELEMENT_REGISTER_DEFINE (disparity, "disparity", GST_RANK_NONE,
+ GST_TYPE_DISPARITY);
static void gst_disparity_finalize (GObject * object);
static void gst_disparity_set_property (GObject * object, guint prop_id,
return ret;
}
-
-
-
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_disparity_plugin_init (GstPlugin * disparity)
-{
- GST_DEBUG_CATEGORY_INIT (gst_disparity_debug, "disparity", 0,
- "Stereo image disparity (depth) map calculation");
- return gst_element_register (disparity, "disparity", GST_RANK_NONE,
- GST_TYPE_DISPARITY);
-}
-
-
static void
initialise_disparity (GstDisparity * fs, int width, int height, int nchannels)
{
GType gst_disparity_get_type (void);
-gboolean gst_disparity_plugin_init (GstPlugin * disparity);
+GST_ELEMENT_REGISTER_DECLARE (disparity);
G_END_DECLS
#endif /* __GST_DISPARITY_H__ */
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("RGB"))
);
-G_DEFINE_TYPE (GstEdgeDetect, gst_edge_detect, GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstEdgeDetect, gst_edge_detect,
+ GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_edge_detect_debug, "edgedetect", 0,
+ "Performs canny edge detection on videos and images"););
+GST_ELEMENT_REGISTER_DEFINE (edgedetect, "edgedetect", GST_RANK_NONE,
+ GST_TYPE_EDGE_DETECT);
static void gst_edge_detect_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
return GST_FLOW_OK;
}
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_edge_detect_plugin_init (GstPlugin * plugin)
-{
- /* debug category for fltering log messages */
- GST_DEBUG_CATEGORY_INIT (gst_edge_detect_debug, "edgedetect",
- 0, "Performs canny edge detection on videos and images");
-
- return gst_element_register (plugin, "edgedetect", GST_RANK_NONE,
- GST_TYPE_EDGE_DETECT);
-}
GType gst_edge_detect_get_type (void);
-gboolean gst_edge_detect_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (edgedetect);
G_END_DECLS
#endif /* __GST_EDGE_DETECT_H__ */
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("RGB"))
);
-G_DEFINE_TYPE (GstFaceBlur, gst_face_blur, GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstFaceBlur, gst_face_blur,
+ GST_TYPE_OPENCV_VIDEO_FILTER, GST_DEBUG_CATEGORY_INIT (gst_face_blur_debug,
+ "faceblur", 0, "Blurs faces in images and videos"););
+GST_ELEMENT_REGISTER_DEFINE (faceblur, "faceblur", GST_RANK_NONE,
+ GST_TYPE_FACE_BLUR);
static void gst_face_blur_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
}
return cascade;
}
-
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_face_blur_plugin_init (GstPlugin * plugin)
-{
- /* debug category for filtering log messages */
- GST_DEBUG_CATEGORY_INIT (gst_face_blur_debug, "faceblur",
- 0, "Blurs faces in images and videos");
-
- return gst_element_register (plugin, "faceblur", GST_RANK_NONE,
- GST_TYPE_FACE_BLUR);
-}
GType gst_face_blur_get_type (void);
-gboolean gst_face_blur_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (faceblur);
G_END_DECLS
#endif /* __GST_FACE_BLUR_H__ */
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("RGB"))
);
-G_DEFINE_TYPE (GstFaceDetect, gst_face_detect, GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstFaceDetect, gst_face_detect,
+ GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_face_detect_debug, "facedetect", 0,
+ "Performs face detection on videos and images, providing detected positions via bus messages"););
+GST_ELEMENT_REGISTER_DEFINE (facedetect, "facedetect", GST_RANK_NONE,
+ GST_TYPE_FACE_DETECT);
static void gst_face_detect_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
return cascade;
}
-
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_face_detect_plugin_init (GstPlugin * plugin)
-{
- /* debug category for fltering log messages */
- GST_DEBUG_CATEGORY_INIT (gst_face_detect_debug, "facedetect",
- 0,
- "Performs face detection on videos and images, providing detected positions via bus messages");
-
- return gst_element_register (plugin, "facedetect", GST_RANK_NONE,
- GST_TYPE_FACE_DETECT);
-}
GType gst_face_detect_get_type (void);
-gboolean gst_face_detect_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (facedetect);
G_END_DECLS
#endif /* __GST_FACE_DETECT_H__ */
#define DEFAULT_TEST_MODE FALSE
#define DEFAULT_SCALE 1.6
-G_DEFINE_TYPE (GstGrabcut, gst_grabcut, GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstGrabcut, gst_grabcut, GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_grabcut_debug, "grabcut", 0,
+ "Grabcut image segmentation on either input alpha or input bounding box"););
+GST_ELEMENT_REGISTER_DEFINE (grabcut, "grabcut", GST_RANK_NONE,
+ GST_TYPE_GRABCUT);
+
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
return GST_FLOW_OK;
}
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_grabcut_plugin_init (GstPlugin * plugin)
-{
- /* debug category for fltering log messages
- *
- */
- GST_DEBUG_CATEGORY_INIT (gst_grabcut_debug, "grabcut",
- 0,
- "Grabcut image segmentation on either input alpha or input bounding box");
-
- return gst_element_register (plugin, "grabcut", GST_RANK_NONE,
- GST_TYPE_GRABCUT);
-}
void
compose_matrix_from_image (Mat output, Mat input)
GType gst_grabcut_get_type (void);
-gboolean gst_grabcut_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (grabcut);
G_END_DECLS
#endif /* __GST_GRABCUT_H__ */
G_DEFINE_TYPE_WITH_CODE (GstHanddetect, gst_handdetect,
GST_TYPE_OPENCV_VIDEO_FILTER,
G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION,
- gst_handdetect_navigation_interface_init););
+ gst_handdetect_navigation_interface_init);
+ GST_DEBUG_CATEGORY_INIT (gst_handdetect_debug,
+ "handdetect", 0, "opencv hand gesture detection"));
+GST_ELEMENT_REGISTER_DEFINE (handdetect, "handdetect", GST_RANK_NONE,
+ GST_TYPE_HANDDETECT);
static void
gst_handdetect_navigation_interface_init (GstNavigationInterface * iface)
return cascade;
}
-
-/* Entry point to initialize the plug-in
- * Initialize the plug-in itself
- * Register the element factories and other features
- */
-gboolean
-gst_handdetect_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_handdetect_debug,
- "handdetect", 0, "opencv hand gesture detection");
- return gst_element_register (plugin, "handdetect", GST_RANK_NONE,
- GST_TYPE_HANDDETECT);
-}
GType gst_handdetect_get_type (void);
-gboolean gst_handdetect_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (handdetect);
G_END_DECLS
#endif /* __GST_HANDDETECT_H__ */
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("RGB")));
-G_DEFINE_TYPE (GstMotioncells, gst_motion_cells, GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstMotioncells, gst_motion_cells,
+ GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_motion_cells_debug, "motioncells", 0,
+ "Performs motion detection on videos, providing detected positions via bus messages"););
+GST_ELEMENT_REGISTER_DEFINE (motioncells, "motioncells", GST_RANK_NONE,
+ GST_TYPE_MOTIONCELLS);
static void gst_motion_cells_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
}
return GST_FLOW_OK;
}
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_motion_cells_plugin_init (GstPlugin * plugin)
-{
- /* debug category for fltering log messages */
- GST_DEBUG_CATEGORY_INIT (gst_motion_cells_debug,
- "motioncells",
- 0,
- "Performs motion detection on videos, providing detected positions via bus messages");
-
- return gst_element_register (plugin, "motioncells", GST_RANK_NONE,
- GST_TYPE_MOTIONCELLS);
-}
GType gst_motion_cells_get_type (void);
-gboolean gst_motion_cells_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (motioncells);
G_END_DECLS
#endif /* __GST_MOTION_CELLS_H__ */
#include "gstcameracalibrate.h"
#include "gstcameraundistort.h"
+
static gboolean
plugin_init (GstPlugin * plugin)
{
- if (!gst_cv_dilate_plugin_init (plugin))
- return FALSE;
-
- if (!gst_cv_equalize_hist_plugin_init (plugin))
- return FALSE;
-
- if (!gst_cv_erode_plugin_init (plugin))
- return FALSE;
-
- if (!gst_cv_laplace_plugin_init (plugin))
- return FALSE;
-
- if (!gst_cv_smooth_plugin_init (plugin))
- return FALSE;
-
- if (!gst_cv_sobel_plugin_init (plugin))
- return FALSE;
-
- if (!gst_edge_detect_plugin_init (plugin))
- return FALSE;
-
- if (!gst_face_blur_plugin_init (plugin))
- return FALSE;
-
- if (!gst_face_detect_plugin_init (plugin))
- return FALSE;
-
- if (!gst_motion_cells_plugin_init (plugin))
- return FALSE;
-
- if (!gst_template_match_plugin_init (plugin))
- return FALSE;
-
- if (!gst_opencv_text_overlay_plugin_init (plugin))
- return FALSE;
-
- if (!gst_handdetect_plugin_init (plugin))
- return FALSE;
-
- if (!gst_skin_detect_plugin_init (plugin))
- return FALSE;
-
- if (!gst_retinex_plugin_init (plugin))
- return FALSE;
-
- if (!gst_segmentation_plugin_init (plugin))
- return FALSE;
-
- if (!gst_grabcut_plugin_init (plugin))
- return FALSE;
-
- if (!gst_disparity_plugin_init (plugin))
- return FALSE;
-
- if (!gst_dewarp_plugin_init (plugin))
- return FALSE;
-
- if (!gst_camera_calibrate_plugin_init (plugin))
- return FALSE;
-
- if (!gst_camera_undistort_plugin_init (plugin))
- return FALSE;
-
- return TRUE;
+ gboolean ret = FALSE;
+
+ ret |= GST_ELEMENT_REGISTER (cvdilate, plugin);
+ ret |= GST_ELEMENT_REGISTER (cvequalizehist, plugin);
+ ret |= GST_ELEMENT_REGISTER (cverode, plugin);
+ ret |= GST_ELEMENT_REGISTER (cvlaplace, plugin);
+ ret |= GST_ELEMENT_REGISTER (cvsmooth, plugin);
+ ret |= GST_ELEMENT_REGISTER (cvsobel, plugin);
+ ret |= GST_ELEMENT_REGISTER (edgedetect, plugin);
+ ret |= GST_ELEMENT_REGISTER (faceblur, plugin);
+ ret |= GST_ELEMENT_REGISTER (facedetect, plugin);
+ ret |= GST_ELEMENT_REGISTER (motioncells, plugin);
+ ret |= GST_ELEMENT_REGISTER (templatematch, plugin);
+ ret |= GST_ELEMENT_REGISTER (opencvtextoverlay, plugin);
+ ret |= GST_ELEMENT_REGISTER (handdetect, plugin);
+ ret |= GST_ELEMENT_REGISTER (skindetect, plugin);
+ ret |= GST_ELEMENT_REGISTER (retinex, plugin);
+ ret |= GST_ELEMENT_REGISTER (segmentation, plugin);
+ ret |= GST_ELEMENT_REGISTER (grabcut, plugin);
+ ret |= GST_ELEMENT_REGISTER (disparity, plugin);
+ ret |= GST_ELEMENT_REGISTER (dewarp, plugin);
+ ret |= GST_ELEMENT_REGISTER (cameracalibrate, plugin);
+ ret |= GST_ELEMENT_REGISTER (cameraundistort, plugin);
+
+ return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
return etype;
}
-G_DEFINE_TYPE (GstRetinex, gst_retinex, GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstRetinex, gst_retinex, GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_retinex_debug, "retinex", 0,
+ "Multiscale retinex for colour image enhancement");
+ );
+GST_ELEMENT_REGISTER_DEFINE (retinex, "retinex", GST_RANK_NONE,
+ GST_TYPE_RETINEX);
+
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
return GST_FLOW_OK;
}
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_retinex_plugin_init (GstPlugin * plugin)
-{
- /* debug category for fltering log messages
- *
- */
- GST_DEBUG_CATEGORY_INIT (gst_retinex_debug, "retinex",
- 0, "Multiscale retinex for colour image enhancement");
-
- return gst_element_register (plugin, "retinex", GST_RANK_NONE,
- GST_TYPE_RETINEX);
-}
GType gst_retinex_get_type (void);
-gboolean gst_retinex_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (retinex);
G_END_DECLS
#endif /* __GST_RETINEX_H__ */
return etype;
}
-G_DEFINE_TYPE (GstSegmentation, gst_segmentation, GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstSegmentation, gst_segmentation,
+ GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_segmentation_debug, "segmentation", 0,
+ "Performs Foreground/Background segmentation in video sequences");
+ );
+GST_ELEMENT_REGISTER_DEFINE (segmentation, "segmentation", GST_RANK_NONE,
+ GST_TYPE_SEGMENTATION);
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
return GST_FLOW_OK;
}
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_segmentation_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_segmentation_debug, "segmentation",
- 0, "Performs Foreground/Background segmentation in video sequences");
-
- return gst_element_register (plugin, "segmentation", GST_RANK_NONE,
- GST_TYPE_SEGMENTATION);
-}
-
-
#ifdef CODE_FROM_OREILLY_BOOK /* See license at the beginning of the page */
/*
GType gst_segmentation_get_type (void);
-gboolean gst_segmentation_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (segmentation);
G_END_DECLS
#endif /* __GST_SEGMENTATION_H__ */
return etype;
}
-G_DEFINE_TYPE (GstSkinDetect, gst_skin_detect, GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstSkinDetect, gst_skin_detect,
+ GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_skin_detect_debug, "skindetect", 0,
+ "Performs skin detection on videos and images");
+ );
+GST_ELEMENT_REGISTER_DEFINE (skindetect, "skindetect", GST_RANK_NONE,
+ GST_TYPE_SKIN_DETECT);
+
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
return GST_FLOW_OK;
}
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_skin_detect_plugin_init (GstPlugin * plugin)
-{
- /* debug category for fltering log messages
- *
- */
- GST_DEBUG_CATEGORY_INIT (gst_skin_detect_debug, "skindetect",
- 0, "Performs skin detection on videos and images");
-
- return gst_element_register (plugin, "skindetect", GST_RANK_NONE,
- GST_TYPE_SKIN_DETECT);
-}
GType gst_skin_detect_get_type (void);
-gboolean gst_skin_detect_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (skindetect);
G_END_DECLS
#endif /* __GST_SKIN_DETECT_H__ */
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGR"))
);
-G_DEFINE_TYPE (GstTemplateMatch, gst_template_match,
- GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstTemplateMatch, gst_template_match,
+ GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_template_match_debug, "templatematch", 0,
+ "Performs template matching on videos and images, providing detected positions via bus messages");
+ );
+GST_ELEMENT_REGISTER_DEFINE (templatematch, "templatematch",
+ GST_RANK_NONE, GST_TYPE_TEMPLATE_MATCH);
static void gst_template_match_finalize (GObject * object);
static void gst_template_match_set_property (GObject * object, guint prop_id,
}
return GST_FLOW_OK;
}
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_template_match_plugin_init (GstPlugin * templatematch)
-{
- /* debug category for fltering log messages */
- GST_DEBUG_CATEGORY_INIT (gst_template_match_debug, "templatematch",
- 0,
- "Performs template matching on videos and images, providing detected positions via bus messages");
-
- return gst_element_register (templatematch, "templatematch", GST_RANK_NONE,
- GST_TYPE_TEMPLATE_MATCH);
-}
GType gst_template_match_get_type (void);
-gboolean gst_template_match_plugin_init (GstPlugin * templatematch);
+GST_ELEMENT_REGISTER_DECLARE (templatematch);
G_END_DECLS
#endif /* __GST_TEMPLATE_MATCH_H__ */
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("RGB"))
);
-G_DEFINE_TYPE (GstOpencvTextOverlay, gst_opencv_text_overlay,
- GST_TYPE_OPENCV_VIDEO_FILTER);
+G_DEFINE_TYPE_WITH_CODE (GstOpencvTextOverlay, gst_opencv_text_overlay,
+ GST_TYPE_OPENCV_VIDEO_FILTER,
+ GST_DEBUG_CATEGORY_INIT (gst_opencv_text_overlay_debug, "opencvtextoverlay",
+ 0, "Template opencvtextoverlay");
+ );
+GST_ELEMENT_REGISTER_DEFINE (opencvtextoverlay, "opencvtextoverlay",
+ GST_RANK_NONE, GST_TYPE_OPENCV_TEXT_OVERLAY);
static void gst_opencv_text_overlay_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
return GST_FLOW_OK;
}
-
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_opencv_text_overlay_plugin_init (GstPlugin * plugin)
-{
- /* debug category for fltering log messages
- *
- * exchange the string 'Template opencvtextoverlay' with your description
- */
- GST_DEBUG_CATEGORY_INIT (gst_opencv_text_overlay_debug, "opencvtextoverlay",
- 0, "Template opencvtextoverlay");
-
- return gst_element_register (plugin, "opencvtextoverlay", GST_RANK_NONE,
- GST_TYPE_OPENCV_TEXT_OVERLAY);
-}
};
GType gst_opencv_text_overlay_get_type (void);
-gboolean gst_opencv_text_overlay_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (opencvtextoverlay);
G_END_DECLS