So I've been setting up multiple pipelines which I'm feeding various
media files to run some stability tests.
This is all done through junit, but I'm having trouble running more
that one test at a time probably because of lack of understanding of
the init/deinit procedure.
I'm currently doing this in each test
......
private void init() {
Gst.init()
pipeline = new Pipeline();
Bus bus = pipeline.getBus();
bus.connect(new Bus.ERROR() {
public void errorMessage(GstObject source, int code, String
message) {
logger.error("Error: code=" + code + " message=" + message);
pipeline.setState(State.NULL);
setError(true);
setErrorMessage(message);
Gst.quit();
}
});
bus.connect(new Bus.EOS() {
public void endOfStream(GstObject source) {
pipeline.setState(State.NULL);
logger.info("End of stream reached exiting normally");
Gst.quit();
}
});
}
****************************
then I set up the pipeline with the different element and call
.....
pipeline.play();
Gst.main();
// make sure to remove all references before deinitializing
.... //freeing all element stuff
pipeline = null;
Gst.deinit();
if (error)
throw new Exception(getErrorMessage());
.....
// end of test
***************************
So everything runs great in the first unittest but the second time I
try to create a pipeline I get this
java.lang.IllegalArgumentException: Invalid native pointer
at org.gstreamer.lowlevel.NativeObject.initializer(NativeObject.java:
66)
at org.gstreamer.GstObject.initializer(GstObject.java:62)
at org.gstreamer.Pipeline.<init>(Pipeline.java:99)
Any help appreciated...
/Thor