use of org.jitsi.impl.neomedia.device.AudioSystem in project Spark by igniterealtime.
the class MediaPreferencePanel method setAudioSystem.
public void setAudioSystem(String selectedAudioSystem) {
for (AudioSystem system : vectorAudioSystem) {
if (system.getLocatorProtocol().equals(selectedAudioSystem)) {
System.out.println("setAudioSystem:" + system);
audioSystem.setSelectedIndex(vectorAudioSystem.indexOf(system));
((MediaServiceImpl) LibJitsi.getMediaService()).getDeviceConfiguration().setAudioSystem(system, true);
}
}
System.out.println("AudioSystem:" + ((MediaServiceImpl) LibJitsi.getMediaService()).getDeviceConfiguration().getAudioSystem());
}
use of org.jitsi.impl.neomedia.device.AudioSystem in project Spark by igniterealtime.
the class MediaPreferencePanel method setPlaybackDevice.
public void setPlaybackDevice(String device) {
AudioSystem audioSystem = ((MediaServiceImpl) LibJitsi.getMediaService()).getDeviceConfiguration().getAudioSystem();
for (CaptureDeviceInfo2 infoCaptureDevice : vectorPlaybackDevices) {
if (infoCaptureDevice.getLocator().toExternalForm().equals(device)) {
playbackDevice.setSelectedItem(infoCaptureDevice.getName());
audioSystem.setDevice(DataFlow.PLAYBACK, infoCaptureDevice, true);
audioSystem.setDevice(DataFlow.NOTIFY, infoCaptureDevice, true);
}
}
}
use of org.jitsi.impl.neomedia.device.AudioSystem in project Spark by igniterealtime.
the class MediaPreferencePanel method setAudioDevice.
public void setAudioDevice(String device) {
AudioSystem audioSystem = ((MediaServiceImpl) LibJitsi.getMediaService()).getDeviceConfiguration().getAudioSystem();
for (CaptureDeviceInfo2 infoCaptureDevice : vectorAudioDevices) {
System.out.println(device);
if (infoCaptureDevice.getLocator().toExternalForm().equals(device)) {
audioDevice.setSelectedIndex(vectorAudioDevices.indexOf(infoCaptureDevice));
audioSystem.setDevice(DataFlow.CAPTURE, infoCaptureDevice, true);
}
}
}
use of org.jitsi.impl.neomedia.device.AudioSystem 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