v4l2src not closing the video device properly

mariannasb mariannasb at yahoo.com.br
Fri Sep 4 06:30:04 PDT 2015


Hi,

I'm running a gstreamer application from the Java server side (using JNI) of
a GWT application.

My pipeline constists of a v4l2src and some custom sinks which perform
calibration of camera parameters.
One of my calibration elements returns an EOS if everything went fine or a
GST_ELEMENT_ERROR if there was an error.

I can see that when my element returns the error the v4l2src will
occasionlly not release the video device and then the rest of my application
(GWT) which try to read images from the device will fail with
"VIDIOC_REQBUFS error 16, Device or resource busy".

In my gst application I have the main loop running and a watch on the bus.
In case of GST_MESSAGE_ERROR I do a g_main_loop_quit (loop)
Then I set the pipeline to NULL state and unref it.

As far as I can see the problem is when the v4l2src is supposed to go to
NULL state.

The times everything goes fine I see:
0:02:27.382090528  1592       0xe18b70 INFO                 v4l2src
gstv4l2src.c:813:gst_v4l2src_create:<video-source> sync to 0:00:01.000000000
out ts 0:00:02.180522683

And when I end up with a still open video device:
0:02:36.911510291  1592       0x76c050 DEBUG                v4l2src
gstv4l2src.c:866:gst_v4l2src_create:<video-source> error processing buffer
-2 (flushing)

Could this be a bug in the v4l2src?
Or I'm doing something wrong in my gst application?

Best regards
Marianna S Buschle



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/v4l2src-not-closing-the-video-device-properly-tp4673478.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list