javax.media.pim
Class PlugInManager

java.lang.Object
  |
  +--javax.media.PlugInManager
        |
        +--javax.media.pim.PlugInManager

public class PlugInManager
extends PlugInManager

This is a PlugIn manager used to search for installed plug-ins and to register new plug-ins.

Plug-in types

Plug-ins can be of different types such as codecs, demultiplexers, renderers, etc.

The recognized plug-in types are listed below. Other custom plug-in types can also be registered.

"demultiplexer"
"codec"
"renderer"
"multiplexer"
"effect"

Since:
JMF 2.0

Field Summary
 
Fields inherited from class javax.media.PlugInManager
CODEC, DEMULTIPLEXER, EFFECT, MULTIPLEXER, RENDERER
 
Constructor Summary
PlugInManager()
          PlugInManager implementation
 
Method Summary
static boolean addPlugIn(java.lang.String className, Format[] in, Format[] out, int type)
          Registers a new plug-in.
static void commit()
          Commits any changes made to the plug-in list.
(package private) static java.lang.Class getClassForName(java.lang.String className)
           
static java.util.Vector getPlugInList(Format input, Format output, int type)
          Builds a list of plug-ins that satisfy the specified input and output formats.
static Format[] getSupportedInputFormats(java.lang.String className, int type)
          Gets a list of the input formats that the specified plug-in supports.
static Format[] getSupportedOutputFormats(java.lang.String className, int type)
          Gets a list of the output formats that the specified plug-in supports.
static boolean removePlugIn(java.lang.String className, int type)
          Removes an existing plug-in from the registry.
static void setPlugInList(java.util.Vector pluginList, int type)
          Sets the search order for the list of plug-ins.
 
Methods inherited from class javax.media.PlugInManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlugInManager

public PlugInManager()
PlugInManager implementation

Method Detail

getClassForName

static java.lang.Class getClassForName(java.lang.String className)
                                throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException

getPlugInList

public static java.util.Vector getPlugInList(Format input,
                                             Format output,
                                             int type)
Builds a list of plug-ins that satisfy the specified input and output formats. Either or both of the formats could be null if they are to be ignored. So, if input is null, then it returns a list of plug-ins that match the output format and vice-versa.

Parameters:
input - The input Format to be supported by the plug-in.
output - The output Format to be generated by the plug-in.
type - The type of plug-in to search for, for example: DEMULTIPLEXER, CODEC, EFFECT, MULTIPLEXER, or RENDERER.
Returns:
A Vector that contains the plug-in list.

setPlugInList

public static void setPlugInList(java.util.Vector pluginList,
                                 int type)
Sets the search order for the list of plug-ins. This list is valid for the duration of the session only, unless commit is called.

Parameters:
pluginList - A Vector that lists the plug-ins in the order that they should be searched.
type - The type of plug-in contained in the search list, for example: DEMULTIPLEXER, CODEC, EFFECT, MULTIPLEXER, or RENDERER.
See Also:
commit()

commit

public static void commit()
                   throws java.io.IOException
Commits any changes made to the plug-in list. Also required when a new plug-in is added or a plug-in is removed.

java.io.IOException

addPlugIn

public static boolean addPlugIn(java.lang.String className,
                                Format[] in,
                                Format[] out,
                                int type)
Registers a new plug-in. This plug-in is automatically appended to the list of plug-ins. Returns false if the new plug-in could not be registered. The reason could be that a plug-in by that name already exists. commit has to be called to make this addition permanent.

Parameters:
className - class name of the plug-in class
in - list of supported input formats
out - list of supported output formats
type - the plug-in type
Returns:
true if the plug-in is registered successfully, false if it could not be registered.

removePlugIn

public static boolean removePlugIn(java.lang.String className,
                                   int type)
Removes an existing plug-in from the registry. Returns false if a plug-in by that name couldn't be found. commit has to be called to make this change permanent.

Parameters:
className - A String that contains the class name of the plug-in to be removed.
type - The type of the new plug-in, for example: DEMULTIPLEXER, CODEC, EFFECT, MULTIPLEXER, or RENDERER.
Returns:
true if the plug-in is succesfully removed, false if no plug-in with the specified name could be found.

getSupportedInputFormats

public static Format[] getSupportedInputFormats(java.lang.String className,
                                                int type)
Description copied from class: PlugInManager
Gets a list of the input formats that the specified plug-in supports.

Parameters:
className - The plug-in class name. For example: com.sun.media.codec.MPEG
type - The type of the specified plug-in, for example: DEMULTIPLEXER, CODEC, EFFECT, MULTIPLEXER, or RENDERER.
Returns:
An array of Format objects that the specified plug-in can accept as input. Returns an array of zero elements if specified plug-in is not registered or has no inputs.

getSupportedOutputFormats

public static Format[] getSupportedOutputFormats(java.lang.String className,
                                                 int type)
Description copied from class: PlugInManager
Gets a list of the output formats that the specified plug-in supports.

Parameters:
className - The plug-in class name. For example: com.sun.media.codec.MPEG
type - The type of the specified plug-in, for example: DEMULTIPLEXER, CODEC, EFFECT, MULTIPLEXER, or RENDERER.
Returns:
An array of Format objects that the specified plug-in can generate as output. Returns an array of zero elements if specified plug-in is not registered or has no outputs.