[Bug 743311] mpeg2dec does not cope if downstream buffer allocation has stride != width

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Jan 22 05:32:11 PST 2015


https://bugzilla.gnome.org/show_bug.cgi?id=743311
  GStreamer | gst-plugins-ugly | git master

Nicolas Dufresne (stormer) <nicolas.dufresne> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |nicolas.dufresne at collabora.
                   |                            |co.uk
     Ever Confirmed|0                           |1

--- Comment #4 from Nicolas Dufresne (stormer) <nicolas.dufresne at collabora.co.uk> 2015-01-22 13:32:09 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > Review of attachment 295127 [details] [details]:
> > 
> > ::: ext/mpeg2dec/gstmpeg2dec.c
> > @@ +559,3 @@
> > +  g_assert (GST_VIDEO_FRAME_PLANE_STRIDE (&vframe, 1) == chroma_stride);
> > +  g_assert (GST_VIDEO_FRAME_PLANE_STRIDE (&vframe, 2) == chroma_stride);
> > +  mpeg2_stride (mpeg2dec->decoder, GST_VIDEO_FRAME_PLANE_STRIDE (&vframe, 0));
> > 
> > A buffer could be allocated during decide_allocation(), this way you can check
> > this and reject the pool if not met ?
> 
> I'm not clear on how I'd do that safely.
> 
> Can I assume that the pool is active during decide_allocation? If not, is it
> safe for me to active and deactivate it?

The element that implement the decide_allocation is also the one the will
enable the pool. It is safe to activate the pool in decide_allocation,
activating a second time later in the base class will simply return success.
Don't forget to deactivate it if you reject the pool.

> 
> Can I use the GstVideoDecoder allocation functions to get a buffer and release
> it at this point, or do I not have enough state set up yet (what *is* "enough
> state" in this context)?

You could, but ideally you would make that test before chaining the
decide_allocation().

> 
> If I can't use the GstVideoDecoder allocation functions, where do I get my
> GstVideoInfo from?

You don't really need that. From the allocated buffer, you will extract the
GstVideoMeta. This structure contains a stride array. If there is no
GstVideoMeta, you can assume that the stride will match your expectation.

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