Cannot get devices

Hi,

I cannot get devices using CaptureDeviceManager.getDeviceList(null) in my code. This returns just empty vector. If I run JMFRegistry and click Capture Devices -> Detect Capture Devices, I get JavaSound audio capture. Does anybody know what am I doing wrong? I am on linux running sun-jdk-1.6.

[312 byte] By [fordfroga] at [2007-11-26 21:10:19]
# 1

Just the code that doesn't work for me:

package cz.startnet.utils.javax.rtp;

import org.junit.Assert;

import org.junit.Test;

import java.util.Vector;

import javax.media.CaptureDeviceManager;

import javax.sound.sampled.AudioSystem;

import javax.sound.sampled.DataLine;

import javax.sound.sampled.TargetDataLine;

public class RTPMediaManagerTest {

@Test()

public void testDetectSupportedCodecs() {

final DataLine.Info info =

new DataLine.Info(

TargetDataLine.class,

null,

AudioSystem.NOT_SPECIFIED);

final boolean supported = AudioSystem.isLineSupported(info);

System.out.println("JavaSound supported = " + supported);

Assert.assertTrue(supported);

final Vector devices = CaptureDeviceManager.getDeviceList(null);

Assert.assertTrue(devices.size() > 0);

}

}

fordfroga at 2007-7-10 2:46:54 > top of Java-index,Security,Cryptography...
# 2

Well, it should work. Howeer try this.

final Vector devices = CaptureDeviceManager.getDeviceList(new AudioFormat();

And try this too

import javax.media.*;

import javax.media.protocol.*;

import java.net.*;

import java.io.*;

import javax.media.format.*;

import javax.swing.*;

public class JMFCapture3

{

public static void main(String args[]) throws Exception

{

System.out.println(CaptureDeviceManager.getDeviceList(null));

}

}

qUesT_foR_knOwLeDgea at 2007-7-10 2:46:54 > top of Java-index,Security,Cryptography...
# 3
Thank you for your answer. I finally found out that the problem was in me overlooking docs that says that I should create custom jmf.jar. In fact I used first two steps from this message: http://archives.java.sun.com/cgi-bin/wa?A2=ind0402&L=jmf-interest&P=9085
fordfrog2a at 2007-7-10 2:46:54 > top of Java-index,Security,Cryptography...