gst-plugins-good: gst_v4l2_object_get_nearest_size bug

Nicolas Dufresne nicolas.dufresne at collabora.co.uk
Fri Sep 28 13:34:43 PDT 2012


Same here, you should file a bug. You will then be able to attach your
patches to that bug. Before doing so, check that this bug does not
already exist, e.g. https://bugzilla.gnome.org/show_bug.cgi?id=604434
seems slightly similar.

https://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer

Component is gst-plugins-good.

best regards,
Nicolas

Le vendredi 28 septembre 2012 à 17:17 -0300, Henrique Camargo a écrit : 
> I was investigating a bug that is happening on a v4l2 driver (Davinci
> VPFE Capture device) I was working on, that investigation led me to
> the gstreamer code.
> 
> I think I found a bug in the function
> gst_v4l2_object_get_nearest_size inside the v4l2 plugin
> (gstv4l2object.c).  I'm running gst-plugins-good-0.10.31 and
> gstreamer-0.10.36 compiled using Buildroot with a ARM9 target. Maybe
> someone can answer me some questions?
> 
> As I understood from the code, this function tries to find the nearest
> frame size and it does it using the TRY_FMT ioctl. If the TRY_FMT is
> not implemented in the device it uses S_FMT. But, S_FMT has the side
> effect of changing the device's operation mode. So the first thing
> that gst_v4l2_object_get_nearest_size does is to do a G_FMT to save
> the previous format so it can restore it latter (after the S_FMT
> call).
> 
> It saves the format in a variable called prevfmt. But it forgets to
> set the type of the format, so the call:
> 
> prevfmt_valid = (v4l2_ioctl (fd, VIDIOC_G_FMT, &prevfmt) >= 0);
> 
> Always fails.
> 
> If TRY_FMT is not implemented,  gst_v4l2_object_get_nearest_size will
> use S_FMT and will change the device's operation mode, since it failed
> to save the previous format it will be unable to restore it.
> 
> Am I correct? If needed, I can provide a patch (I already made the
> necessary modification).
> 
> Thank you,
> 
> --
> Henrique Camargo
> 
> Email: henrique at henriquecamargo.com
> Phone: +55 41 99152915
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




More information about the gstreamer-devel mailing list