[jitsi-dev] [libjitsi] how to detect PC camera with libjitsi in Win 7 bit64 (#2)


#1

Dear team,

my win 7 64 bit installed jitsi and it can find my web camera and video preview is OK. installing folder: D:\javaApp\SIP\Jitsi

and I clone libjitsi to import it to eclipse. and I wrote one class to detect web camera as following:

···

------------------------------------------------
package org.jitsi.demo.video;
import java.util.List;
import javax.media.CaptureDeviceInfo;
import org.jitsi.impl.neomedia.MediaServiceImpl;
import org.jitsi.impl.neomedia.device.DeviceConfiguration;
import org.jitsi.impl.neomedia.jmfext.media.protocol.directshow.DSCaptureDevice;
import org.jitsi.impl.neomedia.jmfext.media.protocol.directshow.DSManager;
import org.jitsi.service.libjitsi.LibJitsi;
import org.jitsi.service.neomedia.MediaType;
import org.jitsi.service.neomedia.MediaUseCase;
import org.jitsi.service.neomedia.device.MediaDevice;

public class MediaTest {
  public static void main(String[] args){
    LibJitsi.start();
    MediaServiceImpl mediaService
      = (MediaServiceImpl) LibJitsi.getMediaService();
    DeviceConfiguration deviceConfiguration = mediaService.getDeviceConfiguration();
    List<? extends CaptureDeviceInfo> infos = deviceConfiguration.getAvailableVideoCaptureDevices(
                MediaUseCase.CALL);
    System.out.println("infos="+infos);
    List<MediaDevice> devices = mediaService.getDevices(MediaType.VIDEO,
        MediaUseCase.CALL);
// DSManager ds = new DSManager();
// DSCaptureDevice[] devs = ds.getCaptureDevices();
// System.out.println("devs="+devs);
  }
}
-----------------------------------------------------
and I set -Djava.library.path=D:\javaApp\SIP\Jitsi\native in eclipse "Run Configuration--->Arguments--->VM arguments.
but got the following error:

---------------------------------------ERROR
INFO: Initializing video devices
六月 07, 2013 10:09:34 下午 org.jitsi.util.Logger warn
WARNING: Failed to initialize org.jitsi.impl.neomedia.device.DirectShowSystem
java.lang.reflect.UndeclaredThrowableException
  at org.jitsi.impl.neomedia.device.DeviceSystem.invokeDeviceSystemInitialize(DeviceSystem.java:431)
  at org.jitsi.impl.neomedia.device.DeviceSystem.invokeDeviceSystemInitialize(DeviceSystem.java:338)
  at org.jitsi.impl.neomedia.device.DeviceSystem.<init>(DeviceSystem.java:483)
  at org.jitsi.impl.neomedia.device.DeviceSystem.<init>(DeviceSystem.java:465)
  at org.jitsi.impl.neomedia.device.DirectShowSystem.<init>(DirectShowSystem.java:52)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
  at java.lang.Class.newInstance0(Class.java:374)
  at java.lang.Class.newInstance(Class.java:327)
  at org.jitsi.impl.neomedia.device.DeviceSystem.initializeDeviceSystems(DeviceSystem.java:278)
  at org.jitsi.impl.neomedia.device.DeviceSystem.initializeDeviceSystems(DeviceSystem.java:224)
  at org.jitsi.impl.neomedia.device.DeviceSystem.initializeDeviceSystems(DeviceSystem.java:173)
  at org.jitsi.impl.neomedia.device.DeviceConfiguration.<init>(DeviceConfiguration.java:350)
  at org.jitsi.impl.neomedia.MediaServiceImpl.<init>(MediaServiceImpl.java:133)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
  at java.lang.Class.newInstance0(Class.java:374)
  at java.lang.Class.newInstance(Class.java:327)
  at org.jitsi.impl.libjitsi.LibJitsiImpl.getService(LibJitsiImpl.java:133)
  at org.jitsi.service.libjitsi.LibJitsi.invokeGetServiceOnImpl(LibJitsi.java:163)
  at org.jitsi.service.libjitsi.LibJitsi.getMediaService(LibJitsi.java:115)
  at org.jitsi.demo.video.MediaTest.main(MediaTest.java:20)
Caused by: java.lang.UnsatisfiedLinkError: org.jitsi.impl.neomedia.jmfext.media.protocol.directshow.DSManager.init()J
  at org.jitsi.impl.neomedia.jmfext.media.protocol.directshow.DSManager.init(Native Method)
  at org.jitsi.impl.neomedia.jmfext.media.protocol.directshow.DSManager.<init>(DSManager.java:68)
  at org.jitsi.impl.neomedia.device.DirectShowSystem.doInitialize(DirectShowSystem.java:59)
  at org.jitsi.impl.neomedia.device.DeviceSystem.initialize(DeviceSystem.java:632)
  at org.jitsi.impl.neomedia.device.DeviceSystem$1.run(DeviceSystem.java:383)

六月 07, 2013 10:09:34 下午 org.jitsi.util.Logger info
INFO: Looking for configured audio devices.
六月 07, 2013 10:09:34 下午 org.jitsi.util.Logger info
INFO: Scanning for configured Video Devices.
六月 07, 2013 10:09:34 下午 org.jitsi.util.Logger info
INFO: Found Desktop Streaming 0 as a AVFRAME, class org.jitsi.impl.neomedia.codec.video.AVFrame video capture device.
六月 07, 2013 10:09:34 下午 org.jitsi.util.Logger error
SEVERE: Failed to register custom Renderer org.jitsi.impl.neomedia.jmfext.media.renderer.video.JAWTRenderer with JMF.
java.lang.UnsatisfiedLinkError: D:\IDE\java\jdk1.7.0_21\jre\bin\jnawtrenderer.dll: Can't find dependent libraries
  at java.lang.ClassLoader$NativeLibrary.load(Native Method)
  at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
  at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
  at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1846)
  at java.lang.Runtime.loadLibrary0(Runtime.java:845)
  at java.lang.System.loadLibrary(System.java:1084)
  at org.jitsi.impl.neomedia.jmfext.media.renderer.video.JAWTRenderer.<clinit>(JAWTRenderer.java:90)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:188)
  at org.jitsi.impl.neomedia.device.DeviceConfiguration.registerCustomRenderers(DeviceConfiguration.java:1062)
  at org.jitsi.impl.neomedia.device.DeviceConfiguration.<init>(DeviceConfiguration.java:368)
  at org.jitsi.impl.neomedia.MediaServiceImpl.<init>(MediaServiceImpl.java:133)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
  at java.lang.Class.newInstance0(Class.java:374)
  at java.lang.Class.newInstance(Class.java:327)
  at org.jitsi.impl.libjitsi.LibJitsiImpl.getService(LibJitsiImpl.java:133)
  at org.jitsi.service.libjitsi.LibJitsi.invokeGetServiceOnImpl(LibJitsi.java:163)
  at org.jitsi.service.libjitsi.LibJitsi.getMediaService(LibJitsi.java:115)
  at org.jitsi.demo.video.MediaTest.main(MediaTest.java:20)

infos=[]
六月 07, 2013 10:09:34 下午 org.jitsi.util.Logger warn
WARNING: Failed to initialize org.jitsi.impl.neomedia.device.DirectShowSystem
java.lang.reflect.UndeclaredThrowableException
  at org.jitsi.impl.neomedia.device.DeviceSystem.invokeDeviceSystemInitialize(DeviceSystem.java:431)
  at org.jitsi.impl.neomedia.device.DeviceSystem.invokeDeviceSystemInitialize(DeviceSystem.java:338)
  at org.jitsi.impl.neomedia.device.DeviceSystem.<init>(DeviceSystem.java:483)
  at org.jitsi.impl.neomedia.device.DeviceSystem.<init>(DeviceSystem.java:465)
  at org.jitsi.impl.neomedia.device.DirectShowSystem.<init>(DirectShowSystem.java:52)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
  at java.lang.Class.newInstance0(Class.java:374)
  at java.lang.Class.newInstance(Class.java:327)
  at org.jitsi.impl.neomedia.device.DeviceSystem.initializeDeviceSystems(DeviceSystem.java:278)
  at org.jitsi.impl.neomedia.device.DeviceSystem.initializeDeviceSystems(DeviceSystem.java:224)
  at org.jitsi.impl.neomedia.MediaServiceImpl.getDevices(MediaServiceImpl.java:529)
  at org.jitsi.demo.video.MediaTest.main(MediaTest.java:25)
Caused by: java.lang.UnsatisfiedLinkError: org.jitsi.impl.neomedia.jmfext.media.protocol.directshow.DSManager.init()J
  at org.jitsi.impl.neomedia.jmfext.media.protocol.directshow.DSManager.init(Native Method)
  at org.jitsi.impl.neomedia.jmfext.media.protocol.directshow.DSManager.<init>(DSManager.java:68)
  at org.jitsi.impl.neomedia.device.DirectShowSystem.doInitialize(DirectShowSystem.java:59)
  at org.jitsi.impl.neomedia.device.DeviceSystem.initialize(DeviceSystem.java:632)
  at org.jitsi.impl.neomedia.device.DeviceSystem$1.run(DeviceSystem.java:383)

Pa_StartStream: waveInStart returned = 0x0.
六月 07, 2013 10:09:36 下午 org.jitsi.util.Logger info
INFO: GatherEntropy got: 176400 bytes
warning: The VAD has been replaced by a hack pending a complete rewrite
-----------------------------------------------------

do I missing something or configuration is error?

would you please tell me how to detect camera with libjitsi?

thx a lot

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/issues/2


#2

-Djava.library.path=D:\javaApp\SIP\Jitsi\native

I'm not really sure whether I understand what you're doing but, presuming that D:\javaApp\SIP\Jitsi\native contains the .dll files for the same architecture as your Java, you may way to add D:\javaApp\SIP\Jitsi\native to the PATH in the Eclipse run configuration (https://jitsi.org/Documentation/ConfigureEclipseNew).

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/issues/2#issuecomment-19114836


#3

Closed #2.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/issues/2


#4

Closing this issue because it was opened more than a month ago, more information was requested at about the same time and no response was provided ever since.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/issues/2#issuecomment-20658014