[Bug 731400] pnmdec: PNMDecoder gives sticky event warning

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Jun 10 05:02:28 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=731400
  GStreamer | gst-plugins-bad | unspecified

Thiago Sousa Santos <thiagossantos> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #278196|none                        |needs-work
             status|                            |

--- Comment #3 from Thiago Sousa Santos <thiagossantos at gmail.com> 2014-06-10 12:02:22 UTC ---
Review of attachment 278196:
 --> (https://bugzilla.gnome.org/review?bug=731400&attachment=278196)

Thanks for the quick update, still needs some more work on the parsing part.

::: gst/pnm/gstpnmdec.c
@@ +108,1 @@
   }

You should remove this function, it isn't needed. Also remove the 'buf' from
the instance struct. All of the data storage can be done by the videodecoder
baseclass

@@ +197,1 @@
 }

Remove this function, too. You should just use the add_to_frame from the base
class.

@@ +232,3 @@
+    gst_buffer_unref (buf);
+    s->buf = obuf;
+      o_rowstride = GST_ROUND_UP_4 (i_rowstride);

After handling a buffer you should reset the s->size to its initial state so
you get ready to parse the next image.

@@ +255,3 @@
+  if (size < 8)
+    goto need_more_data;
+  data = gst_adapter_take_buffer (adapter, size);

Instead of using gst_adapter_take_buffer, use gst_adapter_map to avoid removing
all data from the adapter. Remember to call gst_adapter_unmap when you are done
with the data.

@@ +312,3 @@
+  } else {
+    gst_pnmdec_add_to_frame (s, data);
+  }

For parsing the data you have 3 states:

1) You are starting a new frame. Just return NEED_DATA until you have enough
bytes to read the headers (the data type and the width and height)

2) You have enough data to read the headers, read it and store the total size
of the input frame. Keep returning NEED_DATA until you have that size in your
adapter.

3) You have enough data for a full frame, call _add_to_frame with this amount
of data and then call have_frame to signal you have a full frame.


In this patch, you are mixing baseclass handling of data with your own custom
one and that is not needed.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list