args = Gst.init("TypeFind Test", args);
/* create elements */
Pipeline pipeline = new Pipeline("my_pipeline");
Element source = ElementFactory.make("filesrc", "source");
source.set("location", args[0]);
TypeFind typefind = new TypeFind("typefinder");
/* you would normally check that the elements were created properly */
/* put together a pipeline */
pipeline.addMany(source, typefind);
Element.linkMany(source, typefind);
/* listen for types found */
typefind.connect(new TypeFind.HAVE_TYPE() {
public void typeFound(Element elem, int probability, Caps caps) {
System.out.printf("New type found: probability=%d caps=%s\n",
probability, caps.toString());
}