gst-plugins-good: gst_v4l2_object_get_nearest_size bug
Henrique Camargo
henrique at henriquecamargo.com
Fri Sep 28 13:17:43 PDT 2012
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
More information about the gstreamer-devel
mailing list