use of com.sun.media.ExclusiveUse in project Smack by igniterealtime.
the class JMFInit method detectS8DirectAudio.
private static void detectS8DirectAudio() {
Class<?> cls;
int plType = PlugInManager.RENDERER;
String dar = "com.sun.media.renderer.audio.DirectAudioRenderer";
try {
// Check if this is the solaris Performance Pack - hack
cls = Class.forName("SunVideoAuto");
// Find the renderer class and instantiate it.
cls = Class.forName(dar);
Renderer rend = (Renderer) cls.getConstructor().newInstance();
if (rend instanceof ExclusiveUse && !((ExclusiveUse) rend).isExclusive()) {
// sol8+, DAR supports mixing
@SuppressWarnings("unchecked") Vector<String> rendList = PlugInManager.getPlugInList(null, null, plType);
int listSize = rendList.size();
boolean found = false;
String rname;
for (int i = 0; i < listSize; i++) {
rname = rendList.elementAt(i);
if (rname.equals(dar)) {
// DAR is in the registry
found = true;
rendList.removeElementAt(i);
break;
}
}
if (found) {
rendList.insertElementAt(dar, 0);
PlugInManager.setPlugInList(rendList, plType);
PlugInManager.commit();
}
}
} catch (Throwable tt) {
// Do nothing.
}
}
use of com.sun.media.ExclusiveUse in project Spark by igniterealtime.
the class JMFInit method detectS8DirectAudio.
private void detectS8DirectAudio() {
Class<?> cls;
int plType = PlugInManager.RENDERER;
String dar = "com.sun.media.renderer.audio.DirectAudioRenderer";
try {
// Check if this is the solaris Performance Pack - hack
Class.forName("SunVideoAuto");
// Find the renderer class and instantiate it.
cls = Class.forName(dar);
Renderer rend = (Renderer) cls.newInstance();
if (rend instanceof ExclusiveUse && !((ExclusiveUse) rend).isExclusive()) {
// sol8+, DAR supports mixing
Vector<String> rendList = PlugInManager.getPlugInList(null, null, plType);
int listSize = rendList.size();
boolean found = false;
String rname;
for (int i = 0; i < listSize; i++) {
rname = rendList.elementAt(i);
if (rname.equals(dar)) {
// DAR is in the registry
found = true;
rendList.removeElementAt(i);
break;
}
}
if (found) {
rendList.insertElementAt(dar, 0);
PlugInManager.setPlugInList(rendList, plType);
PlugInManager.commit();
}
}
} catch (Throwable tt) {
// Nothing to do
}
}
Aggregations