use of org.jitsi.impl.neomedia.codec.video.AVFrameFormat in project Spark by igniterealtime.
the class MediaPreferencePanel method scanDevices.
@SuppressWarnings("unchecked")
public void scanDevices() {
// Remove all Items
audioDevice.removeAllItems();
videoDevice.removeAllItems();
playbackDevice.removeAllItems();
audioSystem.removeAllItems();
vectorPlaybackDevices.removeAllElements();
vectorAudioSystem.removeAllElements();
// FMJ
System.setProperty(ConfigurationService.PNAME_SC_HOME_DIR_LOCATION, Spark.getUserHome());
System.setProperty(ConfigurationService.PNAME_SC_HOME_DIR_NAME, ".");
System.setProperty(ConfigurationService.PNAME_SC_CACHE_DIR_LOCATION, Spark.getUserHome());
System.setProperty(ConfigurationService.PNAME_SC_LOG_DIR_LOCATION, Spark.getUserHome());
LibJitsi.start();
MediaType[] mediaTypes = MediaType.values();
MediaService mediaService = LibJitsi.getMediaService();
for (MediaType mediaType : mediaTypes) {
System.err.println("================================");
System.err.println("MediaType: " + mediaType);
System.out.println(mediaService);
MediaDevice device = mediaService.getDefaultDevice(mediaType, MediaUseCase.CALL);
if (device != null) {
System.out.println(device.getDirection());
}
System.err.println("Device: " + device);
System.err.println("================================");
}
vectorAudioDevices = CaptureDeviceManager.getDeviceList(new AudioFormat(AudioFormat.LINEAR));
for (CaptureDeviceInfo infoCaptureDevice : vectorAudioDevices) {
String protocol = infoCaptureDevice.getLocator().getProtocol();
audioDevice.addItem("[" + protocol + "]" + convertSysString(infoCaptureDevice.getName()));
}
vectorVideoDevices = CaptureDeviceManager.getDeviceList(new AVFrameFormat());
for (CaptureDeviceInfo infoCaptureDevice : vectorVideoDevices) {
videoDevice.addItem(convertSysString(infoCaptureDevice.getName()));
}
vectorVideoDevices.add(null);
videoDevice.addItem("<None>");
AudioSystem mediaAudioSystem = ((MediaServiceImpl) LibJitsi.getMediaService()).getDeviceConfiguration().getAudioSystem();
for (AudioSystem system : AudioSystem.getAudioSystems()) {
System.out.println(system);
vectorAudioSystem.add(system);
audioSystem.addItem(system);
}
for (CaptureDeviceInfo2 device : mediaAudioSystem.getDevices(DataFlow.PLAYBACK)) {
playbackDevice.addItem(convertSysString(device.getName()));
vectorPlaybackDevices.add(device);
}
}
Aggregations