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;
}
Aggregations