gst1-java-core icon indicating copy to clipboard operation
gst1-java-core copied to clipboard

Implement gst_app_sink_try_pull_sample

Open gabrielandrade2 opened this issue 4 years ago • 3 comments

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

gabrielandrade2 avatar Jan 12 '21 18:01 gabrielandrade2

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?

neilcsmith-net avatar Jan 12 '21 18:01 neilcsmith-net

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.

gabrielandrade2 avatar Jan 12 '21 19:01 gabrielandrade2

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

neilcsmith-net avatar Jan 12 '21 19:01 neilcsmith-net