[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:45:05 PST 2015


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

--- Comment #5 from Simon Farnsworth <simon at farnz.org.uk> 2015-01-22 13:45:00 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > Review of attachment 295127 [details] [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.

The documentation for GstVideoMeta says that the stride array may not always be
valid. Is this a case where it's guaranteed to be valid?

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