On Mon, 23 Jan 2023 at 18:24, Noux Ha <
nou...@gmail.com> wrote:
>
> I think that we can't use two listeners to the AppSink as you mentioned.
> I tried to put the unmap of the buffer before the dispose of the sample but the result was the same.
>
> My goal is to analyze the frames of the stream received from the pullSample method. Any Idea to do that ??
Mostly like you are doing.
Simplify down the code so you have no GUI and a simple listener - eg.
print the buffer size, or similar, and check you're getting multiple
frames.
Check how both the Swing and JavaFX components hand over the data to a
separate processing thread, in slightly different ways. Move your
analysis off of GStreamer's callback thread as much as you can.
If you still want to display the video in a GUI, you'll have to
consider rendering it yourself. You could use a pipeline with two
appsinks, but that's probably a bad idea.
You could also adapt the Swing component to support accessing the
image via a listener - a PR could be merged upstream to allow that.
Good luck!