gstreamer-java / gst1-java-core

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

Question about multithreading with multiple pipelines. #241

Closed vzxxbacq closed 3 years ago

vzxxbacq commented 3 years ago

Hello, I'm using gstreamer-java to serve my text-to-speech model. So, I need to create a separate pipeline every time the server gets a new init request. I call Gst.init() when the Server class was created and every time the Server gets a init request a new Worker will be created. The creation steps of the pipeline in the constructor of Worker class, so I think pipelines in the different objects are separate, but during the creation of the second pipeline, I got warnings as below, it seems the properties were changed.

(gst1-java-core:13165): GLib-GObject-WARNING **: 19:10:16.909: When installing property: type 'Gstkaldinnet2onlinedecoder' already has a property named 'endpoint-silence-phones'
(gst1-java-core:13165): GLib-GObject-WARNING **: 19:10:16.909: When installing property: type 'Gstkaldinnet2onlinedecoder' already has a property named 'endpoint-rule1-must-contain-nonsilence'
(gst1-java-core:13165): GLib-GObject-WARNING **: 19:10:16.909: When installing property: type 'Gstkaldinnet2onlinedecoder' already has a property named 'endpoint-rule1-min-trailing-silence'
.....

Could you teach me what's the right way to create multiple pipelines? Thanks!

neilcsmith-net commented 3 years ago

Please use the mailing list for usage questions, thanks! https://groups.google.com/forum/#!forum/gstreamer-java

Brief reply, but hard to answer without seeing any code. There should only be one call to Gst.init() in a process (further calls should be ignored though). Never call Gst.deinit().

Any Pipeline object is a top-level pipeline, so independent. Either you're mixing references to elements in different pipelines, or the element in question is buggy. Without further info, not possible to say more.