[Bug 731400] pnmdec: PNMDecoder gives sticky event warning

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Jun 9 08:09:25 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 #278132|none                        |needs-work
             status|                            |

--- Comment #1 from Thiago Sousa Santos <thiagossantos at gmail.com> 2014-06-09 15:09:18 UTC ---
Review of attachment 278132:
 --> (https://bugzilla.gnome.org/review?bug=731400&attachment=278132)

Thanks for the patch, it still needs a few adjustments before it can be merged.

Mostly you should remove the chain functions and do the decoding from the
handle_frame function.

You can take a look at gst-plugins-good/ext/libpng/gstpngdec.c for a good
example of _parse and _handle_frame functions. If you feel that the
documentation can be improved to make it easier to understand how to use it,
please let us know how to do so.

::: gst/pnm/gstpnmdec.c
@@ +134,2 @@
   }
 }

You shouldn't need to push buffers from your class anymore, the base class will
handle that for you when you call _finish_frame.

@@ +258,3 @@
+
+  frame->output_buffer = s->buf;
+  return gst_video_decoder_finish_frame (GST_VIDEO_DECODER (s), frame);

This is where you should do the decoding and then call finish_frame with the
output buffer set, instead of having the _chain functions doing the decoding.

The steps that the videodecoder class do are:

1) Get the input data and put into the adapter and then call your _parse
function so that you do the parsing and extract the input PNM buffers, one at a
time.
2) Your _parse function will analyze the input data and decide how many bytes
form a input buffer. It should call "gst_video_decoder_add_to_frame" to add
bytes from the input adapter to the current input buffer. When it has a full
input frame added, you should call _have_frame.
3) At this point, the videodecoder will get this amount of data and call your
_handle_frame with this input buffer, now you should do the decoding and set it
to the output of the VideoFrame struct, then call _finish_frame so that the
base class gets this output data and pushes downstream.

@@ +335,2 @@
     r = gst_pnmdec_chain_raw (s, src, data);
+  }

You shouldn't call the _chain functions that would push the buffers themselves.
Instead, just use the gst_video_decoder_add_to_frame and
gst_video_decoder_have_frame when you have a full input frame added. Then do
the decoding on the handle_frame function.

-- 
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