o = clazz.newInstance();
if (o instanceof Demultiplexer)
{
if (TRACE) logger.fine("PlugInUtility: Registering demultiplexer: " + className);
final Demultiplexer oCast = (Demultiplexer) o;
final ContentDescriptor[] contentDescriptors = oCast.getSupportedInputContentDescriptors();
final Format[] formats = new Format[contentDescriptors.length];
for (int i = 0; i < contentDescriptors.length; ++i)
{
if (TRACE) logger.fine("\t" + contentDescriptors[i]);
formats[i] = contentDescriptors[i];
}
return new PlugInInfo(className, formats, new Format[] {}, PlugInManager.DEMULTIPLEXER);
}
else if (o instanceof Codec)
{
if (TRACE) logger.fine("PlugInUtility: Registering codec: " + className);
final Codec oCast = (Codec) o;
final Format[] inputFormats = oCast.getSupportedInputFormats();
final Format[] outputFormats = oCast.getSupportedOutputFormats(null); // this is what JMRegistry does
return new PlugInInfo(className, inputFormats, outputFormats, (o instanceof Effect) ? PlugInManager.EFFECT : PlugInManager.CODEC);
}
else if (o instanceof Renderer)
{
if (TRACE) logger.fine("PlugInUtility: Registering renderer: " + className);
final Renderer oCast = (Renderer) o;
final Format[] inputFormats = oCast.getSupportedInputFormats();
return new PlugInInfo(className, inputFormats, new Format[] {}, PlugInManager.RENDERER);
}
else if (o instanceof Multiplexer)
{
if (TRACE) logger.fine("PlugInUtility: Registering Multiplexer: " + className);
final Multiplexer oCast = (Multiplexer) o;
// JMF Multiplexers always have nothing for the input formats.
return new PlugInInfo(className, new Format[] {}, oCast.getSupportedOutputContentDescriptors(null), PlugInManager.MULTIPLEXER);
}
else
{
logger.warning("PlugInUtility: Unknown or unsupported plug-in: " + o.getClass());
return null;