javax.media
Class PlugInManager

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

public class PlugInManager
extends java.lang.Object

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 = 1
CODEC = 2
EFFECT = 3
RENDERER = 4
MULTIPLEXER = 5
This PlugInManager is just a wrapper for the actual implementation which it expects to find in the classpath as javax.media.pim.PlugInManager. If such a class is found and is an instance of javax.media.PlugInManager, all calls to the javax.media.PlugInManager are redirected to javax.media.pim.PlugInManager. If no such class is found, then all method calls in this class will fail and return null or false values.

Since:
JMF 2.0

Field Summary
static int CODEC
          Codec plug-in type.
static int DEMULTIPLEXER
          Demultiplexer plug-in type.
static int EFFECT
          Effect plug-in type.
static int MULTIPLEXER
          Multiplexer plug-in type.
static int RENDERER
          Renderer plug-in type.
 
Constructor Summary
PlugInManager()
           
 
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.
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 and the specified plug-in type.
static Format[] getSupportedInputFormats(java.lang.String className, int type)
          Returns an array of Format objects that the specified plug-in can accept as input.
static Format[] getSupportedOutputFormats(java.lang.String className, int type)
          Returns an array of Format objects that the specified plug-in can generate as output.
static boolean removePlugIn(java.lang.String classname, int type)
          Removes an existing plug-in from the registry.
static void setPlugInList(java.util.Vector plugins, int type)
          Sets the search order for the list of plug-ins for a certain type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEMULTIPLEXER

public static final int DEMULTIPLEXER
Demultiplexer plug-in type.

CODEC

public static final int CODEC
Codec plug-in type.

EFFECT

public static final int EFFECT
Effect plug-in type.

RENDERER

public static final int RENDERER
Renderer plug-in type.

MULTIPLEXER

public static final int MULTIPLEXER
Multiplexer plug-in type.
Constructor Detail

PlugInManager

public PlugInManager()
Method Detail

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 and the specified plug-in type. 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.

setPlugInList

public static void setPlugInList(java.util.Vector plugins,
                                 int type)
Sets the search order for the list of plug-ins for a certain type. This list is valid for the duration of the session only, unless commit is called.
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.

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
dynamic - true if the input and output formats need to be determined at runtime by the plug-in rather than from the registry.

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.

getSupportedInputFormats

public static Format[] getSupportedInputFormats(java.lang.String className,
                                                int type)
Returns an array of Format objects that the specified plug-in can accept as input. If the plug-in is not registered or has no inputs, then this method returns an array of zero elements.
Parameters:
className - the class name of the plug-in. eg. com.sun.media.codec.MPEG
type - the plug-in type

getSupportedOutputFormats

public static Format[] getSupportedOutputFormats(java.lang.String className,
                                                 int type)
Returns an array of Format objects that the specified plug-in can generate as output. If the plug-in is not registered or has no outputs, then this method returns an array of zero elements.
Parameters:
className - the class name of the plug-in. eg. com.sun.media.codec.MPEG
type - the plug-in type