I would like to use appsink in my gnome shell extension but it causes the error: 'JS ERROR: too much recursion'.
My code is quite simple:
Gst.init(null);
this._pipeline = Gst.Pipeline.new("bin");
const src = Gst.ElementFactory.make("ximagesrc", "src");
const convert = Gst.ElementFactory.make("videoconvert", "convert");
const sink = Gst.ElementFactory.make("appsink", "sink");
this._pipeline.add(src);
this._pipeline.add(convert);
this._pipeline.add(sink);
sink.set_property("emit-signals", true);
sink.connect("new-sample", () => {
console.log("new-sample");
});
if (!src.link(convert) || !convert.link(sink)) {
console.log('GStreamer failed to link');
}
this._pipeline.set_state(Gst.State.PLAYING);
I tried to add miscellaneous elements between src and sink like queue or remove the videoconvert. Everytime, I add the handler for new-sample signal the error 'JS ERROR: too much recursion' hits me.