gstreamer-java / gst1-java-core

Java bindings for GStreamer 1.x
GNU Lesser General Public License v3.0
188 stars 72 forks source link

Implement gst_app_sink_try_pull_sample #238

Open gabrielandrade2 opened 3 years ago

gabrielandrade2 commented 3 years ago

Is there a reason why the library does not implement gst_app_sink_try_pull_sample and gst_app_sink_try_pull_preroll?

I am having some issues with a camera that gives a SOF timeout and my Java code is getting stuck while I try to pull a sample from a camera that is not responding.

Thanks

neilcsmith-net commented 3 years ago

No reason other than no-one has felt the need to map them as yet.

Are you using the signal callbacks to trigger when to pull?

gabrielandrade2 commented 3 years ago

No, I configure the pipeline so that the camera is always streaming to my appsink and then I pull the a frame when the user press a key. I believe that when I get this SOF timeout, the stream does not even open, but I do not get any error when I play the pipeline, it just hangs.

neilcsmith-net commented 3 years ago

I would look at the code for the Swing component at https://github.com/gstreamer-java/gst1-java-swing/blob/master/src/main/java/org/freedesktop/gstreamer/swing/GstVideoComponent.java#L380 and either have the camera playing continuously and just take the last sample from the signal callback on key press, or start the pipeline and wait for that signal before trying to pull the sample.

I'll leave this issue open to cover mapping those two functions. If you have questions about how to implement what you need without them, please ask on the mailing list - https://groups.google.com/forum/#!forum/gstreamer-java