static gboolean gst_edgedetect_set_caps (GstPad * pad, GstCaps * caps);
static GstFlowReturn gst_edgedetect_chain (GstPad * pad, GstBuffer * buf);
-/* GObject vmethod implementations */
+/* Clean up */
+static void
+gst_edgedetect_finalize (GObject * obj)
+{
+ Gstedgedetect *filter = GST_EDGEDETECT (obj);
+
+ if (filter->cvImage != NULL)
+ {
+ cvReleaseImage (&filter->cvImage);
+ cvReleaseImage (&filter->cvCEdge);
+ cvReleaseImage (&filter->cvGray);
+ cvReleaseImage (&filter->cvEdge);
+ }
+ G_OBJECT_CLASS (parent_class)->finalize (obj);
+}
+
+/* GObject vmethod implementations */
static void
gst_edgedetect_base_init (gpointer gclass)
{
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ parent_class = g_type_class_peek_parent (klass);
+ gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_edgedetect_finalize);
gobject_class->set_property = gst_edgedetect_set_property;
gobject_class->get_property = gst_edgedetect_get_property;
return gst_pad_push (filter->srcpad, buf);
}
-
/* entry point to initialize the plug-in
* initialize the plug-in itself
* register the element factories and other features
static void gst_facedetect_load_profile (GObject * object);
-/* GObject vmethod implementations */
+/* Clean up */
+static void
+gst_facedetect_finalize (GObject * obj)
+{
+ Gstfacedetect *filter = GST_FACEDETECT(obj);
+
+ if (filter->cvImage)
+ {
+ cvReleaseImage (&filter->cvImage);
+ cvReleaseImage (&filter->cvGray);
+ }
+ G_OBJECT_CLASS (parent_class)->finalize (obj);
+}
+
+
+/* GObject vmethod implementations */
static void
gst_facedetect_base_init (gpointer gclass)
{
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ parent_class = g_type_class_peek_parent (klass);
+ gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_facedetect_finalize);
gobject_class->set_property = gst_facedetect_set_property;
gobject_class->get_property = gst_facedetect_get_property;
static gboolean gst_pyramidsegment_set_caps (GstPad * pad, GstCaps * caps);
static GstFlowReturn gst_pyramidsegment_chain (GstPad * pad, GstBuffer * buf);
-/* GObject vmethod implementations */
+/* Clean up */
+static void
+gst_pyramidsegment_finalize (GObject * obj)
+{
+ Gstpyramidsegment *filter = GST_PYRAMIDSEGMENT(obj);
+
+ if (filter->cvImage != NULL)
+ {
+ cvReleaseImage (&filter->cvImage);
+ cvReleaseImage (&filter->cvSegmentedImage);
+ }
+
+ G_OBJECT_CLASS (parent_class)->finalize (obj);
+}
+/* GObject vmethod implementations */
static void
gst_pyramidsegment_base_init (gpointer gclass)
{
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ parent_class = g_type_class_peek_parent (klass);
+ gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_pyramidsegment_finalize);
gobject_class->set_property = gst_pyramidsegment_set_property;
gobject_class->get_property = gst_pyramidsegment_get_property;