android: Make it ready for androgenizer
[platform/upstream/gst-plugins-good.git] / gst / flx / gstflxdec.c
index ec7f198..627aad1 100644 (file)
 /**
  * SECTION:element-flxdec
  *
- * <refsect2>
- * <para>
  * This element decodes fli/flc/flx-video into raw video
- * </refsect2>
  */
 /*
  * http://www.coolutils.com/Formats/FLI
 GST_DEBUG_CATEGORY_STATIC (flxdec_debug);
 #define GST_CAT_DEFAULT flxdec_debug
 
-/* flx element information */
-static const GstElementDetails flxdec_details =
-GST_ELEMENT_DETAILS ("FLX audio decoder",
-    "Codec/Decoder/Video",
-    "FLC/FLI/FLX video decoder",
-    "Sepp Wijnands <mrrazz@garbage-coderz.net>, Zeeshan Ali <zeenix@gmail.com>");
-
 /* input */
 static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
@@ -68,6 +58,7 @@ static GstStaticPadTemplate src_video_factory = GST_STATIC_PAD_TEMPLATE ("src",
 static void gst_flxdec_class_init (GstFlxDecClass * klass);
 static void gst_flxdec_base_init (GstFlxDecClass * klass);
 static void gst_flxdec_init (GstFlxDec * flxdec);
+static void gst_flxdec_dispose (GstFlxDec * flxdec);
 
 static GstFlowReturn gst_flxdec_chain (GstPad * pad, GstBuffer * buf);
 
@@ -116,7 +107,10 @@ gst_flxdec_base_init (GstFlxDecClass * klass)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
 
-  gst_element_class_set_details (gstelement_class, &flxdec_details);
+  gst_element_class_set_details_simple (gstelement_class, "FLX video decoder",
+      "Codec/Decoder/Video",
+      "FLC/FLI/FLX video decoder",
+      "Sepp Wijnands <mrrazz@garbage-coderz.net>, Zeeshan Ali <zeenix@gmail.com>");
   gst_element_class_add_pad_template (gstelement_class,
       gst_static_pad_template_get (&sink_factory));
   gst_element_class_add_pad_template (gstelement_class,
@@ -134,6 +128,8 @@ gst_flxdec_class_init (GstFlxDecClass * klass)
 
   parent_class = g_type_class_peek_parent (klass);
 
+  gobject_class->dispose = (GObjectFinalizeFunc) gst_flxdec_dispose;
+
   GST_DEBUG_CATEGORY_INIT (flxdec_debug, "flxdec", 0, "FLX video decoder");
 
   gstelement_class->change_state = gst_flxdec_change_state;
@@ -160,6 +156,17 @@ gst_flxdec_init (GstFlxDec * flxdec)
   flxdec->adapter = gst_adapter_new ();
 }
 
+static void
+gst_flxdec_dispose (GstFlxDec * flxdec)
+{
+  if (flxdec->adapter) {
+    g_object_unref (flxdec->adapter);
+    flxdec->adapter = NULL;
+  }
+
+  G_OBJECT_CLASS (parent_class)->dispose ((GObject *) flxdec);
+}
+
 static gboolean
 gst_flxdec_src_query_handler (GstPad * pad, GstQuery * query)
 {
@@ -348,7 +355,7 @@ flx_decode_brun (GstFlxDec * flxdec, guchar * data, guchar * dest)
 static void
 flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest)
 {
-  gulong count, packets, lines, start_line, start_l;
+  gulong count, packets, lines, start_line;
   guchar *start_p, x;
 
   g_return_if_fail (flxdec != NULL);
@@ -365,7 +372,6 @@ flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest)
   /* start position of delta */
   dest += (flxdec->hdr.width * start_line);
   start_p = dest;
-  start_l = lines;
 
   while (lines--) {
     /* packet count */