Search in sources :

Example 6 with MediaLocator

use of javax.media.MediaLocator in project Spark by igniterealtime.

the class PhoneManager method getMediaLocator.

public static MediaLocator getMediaLocator(String locator) {
    MediaLocator auxLocator;
    System.out.println("--------------------------------");
    System.out.println("locator: " + locator);
    Vector<CaptureDeviceInfo> vectorAudioDevices = CaptureDeviceManager.getDeviceList(new AudioFormat(AudioFormat.LINEAR));
    for (CaptureDeviceInfo infoCaptureDevice : vectorAudioDevices) {
        System.out.println(infoCaptureDevice.getLocator() + "-" + locator);
        if (infoCaptureDevice.getLocator().toString().equals(locator)) {
            System.out.println("Found: " + locator);
            return infoCaptureDevice.getLocator();
        }
    }
    Vector<CaptureDeviceInfo> vectorVideoDevices = CaptureDeviceManager.getDeviceList(new VideoFormat(VideoFormat.RGB));
    for (CaptureDeviceInfo infoCaptureDevice : vectorVideoDevices) {
        System.out.println(infoCaptureDevice.getLocator() + "-" + locator);
        if (infoCaptureDevice.getLocator().toString().equals(locator)) {
            System.out.println("Found: " + locator);
            return infoCaptureDevice.getLocator();
        }
    }
    if (useStaticLocator) {
        if (mediaLocator == null) {
            mediaLocator = new MediaLocator(locator);
        }
        auxLocator = mediaLocator;
    // usingMediaLocator=true;
    } else {
        auxLocator = new MediaLocator(locator);
    }
    return auxLocator;
}
Also used : MediaLocator(javax.media.MediaLocator) CaptureDeviceInfo(javax.media.CaptureDeviceInfo) AudioFormat(javax.media.format.AudioFormat) VideoFormat(javax.media.format.VideoFormat)

Aggregations

MediaLocator (javax.media.MediaLocator)6 AudioFormat (javax.media.format.AudioFormat)5 UnknownHostException (java.net.UnknownHostException)3 InetAddress (java.net.InetAddress)2 CaptureDeviceInfo (javax.media.CaptureDeviceInfo)2 Format (javax.media.Format)2 VideoFormat (javax.media.format.VideoFormat)2 XMPPException (org.jivesoftware.smack.XMPPException)2 AudioChannel (org.jivesoftware.smackx.jingle.mediaimpl.jmf.AudioChannel)2 IOException (java.io.IOException)1 Codec (javax.media.Codec)1 NoProcessorException (javax.media.NoProcessorException)1 UnsupportedPlugInException (javax.media.UnsupportedPlugInException)1 PacketSizeControl (javax.media.control.PacketSizeControl)1 TrackControl (javax.media.control.TrackControl)1 ContentDescriptor (javax.media.protocol.ContentDescriptor)1 DataSource (javax.media.protocol.DataSource)1 PushBufferDataSource (javax.media.protocol.PushBufferDataSource)1 InvalidSessionAddressException (javax.media.rtp.InvalidSessionAddressException)1 MediaFormat (org.jitsi.service.neomedia.format.MediaFormat)1