[gst-devel] problem when getting the data of a frame

Vincent Torri Vincent.Torri at iecn.u-nancy.fr
Tue Jul 19 21:17:38 CEST 2005


Here is a small prog test that does what my prog does.

It suppose that the video is in YV12 4:2:0 or I420 format. It displays
the Y plane i the terminal.

maybe it can help you in finding the problem

thank you

Vincent Torri

On Tue, 19 Jul 2005, Vincent Torri wrote:

>
>
> On Tue, 19 Jul 2005, Ronald S. Bultje wrote:
>
> > Hi Vincent,
> >
> > On Tue, 2005-07-19 at 17:51, Vincent Torri wrote:
> > > a) I seek to frame #n (with DEFAULT type, it works as it returns true)
> > > b) I set the pipeline to PLAY state
> > > c) I iterate ( while (iterate) { })
> > > d) the calback is executed
> > >    1) I set the state of the pipeline to PAUSED to stop the iteration
> > >    2) I store the data of the buffer
> > > e) I draw the Y plane in a .ppm file
> >
> > You don't own the data that you received in the handoff callback! So in
> > order to keep it for later use, be sure to take a reference
> > (gst_buffer_ref()) in step d2. After use, you can remove the reference
> > again using gst_buffer_unref() (in step e).
> >
> > I'm surprised it doesn't crash. :).
>
> I do reference the buffer ;) (and i unref it) It's not the problem :) I
> wrap the buffer in a c++ class where the constructor ref the buffer and
> the destructor unref it.
>
> any other possible error ?
>
> Vincent
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 3925 bytes
Desc: 
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20050719/596e2e52/attachment.c>


More information about the gstreamer-devel mailing list