pngdec->color_type = -1;
+ if (pngdec->input_state) {
+ gst_video_codec_state_unref (pngdec->input_state);
+ pngdec->input_state = NULL;
+ }
+ if (pngdec->output_state) {
+ gst_video_codec_state_unref (pngdec->output_state);
+ pngdec->output_state = NULL;
+ }
+
return TRUE;
}
static gboolean gst_pngenc_propose_allocation (GstVideoEncoder * encoder,
GstQuery * query);
+static void gst_pngenc_finalize (GObject * object);
+
static void
user_error_fn (png_structp png_ptr, png_const_charp error_msg)
{
venc_class->set_format = gst_pngenc_set_format;
venc_class->handle_frame = gst_pngenc_handle_frame;
venc_class->propose_allocation = gst_pngenc_propose_allocation;
+ gobject_class->finalize = gst_pngenc_finalize;
GST_DEBUG_CATEGORY_INIT (pngenc_debug, "pngenc", 0, "PNG image encoder");
}
pngenc->compression_level = DEFAULT_COMPRESSION_LEVEL;
}
+static void
+gst_pngenc_finalize (GObject * object)
+{
+ GstPngEnc *pngenc = GST_PNGENC (object);
+
+ if (pngenc->input_state)
+ gst_video_codec_state_unref (pngenc->input_state);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
static void
user_flush_data (png_structp png_ptr G_GNUC_UNUSED)
{