Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load library: gstinterfaces when using PropertyProbe #54

Closed
sarxos opened this issue Dec 4, 2016 · 6 comments
Closed

Could not load library: gstinterfaces when using PropertyProbe #54

sarxos opened this issue Dec 4, 2016 · 6 comments
Milestone

Comments

@sarxos
Copy link
Contributor

sarxos commented Dec 4, 2016

Hello,

I wanted to test if PropertyProbe works well with v4l2src factory in 1.0. When I was working with 0.10 it was giving me error "element does not implement interface". In 1.0, however, gstreamer-java is trying to load library which is missing:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load library: gstinterfaces
	at org.freedesktop.gstreamer.lowlevel.GstNative.load(GstNative.java:56)
	at org.freedesktop.gstreamer.lowlevel.GstPropertyProbeAPI.<clinit>(GstPropertyProbeAPI.java:30)
	at org.freedesktop.gstreamer.interfaces.PropertyProbe.<init>(PropertyProbe.java:55)
	at org.freedesktop.gstreamer.interfaces.PropertyProbe.wrap(PropertyProbe.java:46)
	at com.github.sarxos.webcam.ds.gst1.ListUvcDevices.main(ListUvcDevices.java:25)

Here is my code:

import org.freedesktop.gstreamer.Element;
import org.freedesktop.gstreamer.ElementFactory;
import org.freedesktop.gstreamer.Gst;
import org.freedesktop.gstreamer.interfaces.PropertyProbe;


public class ListUvcDevices {

	static {
		String[] args = new String[] {};
		Gst.init(ListUvcDevices.class.getSimpleName(), args);
		Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {

			@Override
			public void run() {
				Gst.deinit();
			}
		}));
	}

	public static void main(String[] args) throws InterruptedException {
		Element source = ElementFactory.make("v4l2src", "source");
		PropertyProbe probe = PropertyProbe.wrap(source);
		for (Object name : probe.getValues("device")) {
			System.out.println(name.toString());
		}
	}
}

I tried to find this library in my filesystem and found only these for 0.10 from libgstreamer-plugins-base package.

sarxos@sarxos-comp:~/workspace/gst1-java-core$ dpkg -S /usr/lib/x86_64-linux-gnu/libgstinterfaces-0.10.so.0
libgstreamer-plugins-base0.10-0:amd64: /usr/lib/x86_64-linux-gnu/libgstinterfaces-0.10.so.0

In GStreamer 1.0 this library seems to be removed or it has been renamed to a different name.

My system is Ubuntu 14.04, gstreamer-java is the HEAD of master branch, JNA 4.2.2, JDK 1.8.0_51.

@neilcsmith-net
Copy link
Member

neilcsmith-net commented Dec 4, 2016

AFAIK it's been removed and replaced by https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-device-probing.html

We need to remove the old mappings and look at mapping the new API!?

@sarxos
Copy link
Contributor Author

sarxos commented Dec 6, 2016

I think we need to remove it since there is no need to keep dead code in a project. Not sure if we need to map new API now (at least from my perspective, but there may be users who will need it). On Linux and Mac I can iterate over source elements using integer number, but on Windows, with dshowvideosrc, device is mapped by name and it may be impossible to predict it. However, I read about ksvideosrc which takes device-index as an argument, so maybe it can be used instead, but I never use it before and need to verify.

@neilcsmith-net
Copy link
Member

@sarxos Yes, absolutely we need to remove the dead code! The question bit was more about the device probing. We need to think about how we handle the addition of new API's in GStreamer while making sure the bindings keep working with older versions.

I'm using ksvideosrc in Praxis LIVE. I actually don't device probe at all. I use Bin.launch and provide a series of default launch strings for each platform, but allow the user to override them if required. Lots of benefits to doing that, like allowing for edge cases or alternative source elements.

@judoka1000
Copy link

Well i need to use the DeviceMonitor to get a list of devices(webcams in particular). But the problem is that i don't know how to start working on the implementation of DeviceMonitor in Gstreamer-Java.

Do you have any tips/tricks to do that?

@neilcsmith-net neilcsmith-net added this to the 1.0.0 milestone Jun 20, 2017
@neilcsmith-net
Copy link
Member

Device probing has been merged and will be in 0.9.1. Some work ongoing to remove dead API.

@neilcsmith-net
Copy link
Member

Closing this as the enhancements are in and the removals are covered in other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants