com.sun.media
类 SimpleGraphBuilder

java.lang.Object
  继承者 com.sun.media.SimpleGraphBuilder

public class SimpleGraphBuilder
extends java.lang.Object

This is the Graph builder to generate the data flow graph for rendering an input format. It contains 3 parts: 1) Routines to search for all the supported output formats; 2) Routines to build a default flow graph -- buildGraph; A default graph is such that no customised option is specified on the TrackControl. It operates on a breath-first search algorithm until the final target is reached as defined by the findTarget() method. Intermediate search paths are stored as GraphNode's in the "candidates" vector.


字段摘要
protected static GraphInspector inspector
           
protected  java.util.Hashtable plugIns
           
protected  int STAGES
           
protected  java.util.Vector targetPluginNames
           
protected  com.sun.media.GraphNode[] targetPlugins
           
protected  int targetType
           
 
构造方法摘要
SimpleGraphBuilder()
           
 
方法摘要
protected  com.sun.media.GraphNode buildTrackFromGraph(BasicTrackControl tc, com.sun.media.GraphNode node)
          When the graph build finds a viable graph to build, this callback will be invoked to see if the graph can actually be built.
static PlugIn createPlugIn(java.lang.String name, int type)
           
static Codec findCodec(Format in, Format out, Format[] selectedIn, Format[] selectedOut)
          Find a codec that can handle the given input and output.
static Renderer findRenderer(Format in)
          Find a renderer that can handle the given input and output.
static java.util.Vector findRenderingChain(Format in, java.util.Vector formats)
          Return a chain of codecs and renderer to render to input format.
static com.sun.media.GraphNode getPlugInNode(java.lang.String name, int type, java.util.Hashtable plugIns)
          Given a codec class name, instantiate the codec and query it dynamically to see if it supports the given input and output formats.
static Format matches(Format[] outs, Format[] ins, PlugIn up, PlugIn down)
          Choose a format among the two input arrays that matches and verify that if the given upstream and downstream plugins accept the matched format as output (for the upstream) or as input (for the downstream).
static Format matches(Format[] outs, Format in, PlugIn up, PlugIn down)
           
static Format matches(Format out, Format[] ins, PlugIn up, PlugIn down)
          Choose a format among the two input arrays that matches and verify that if the given upstream and downstream plugins accept the matched format as output (for the upstream) or as input (for the downstream).
 void reset()
          Reset local cache and reuse the same instance for graph building.
static void setGraphInspector(GraphInspector insp)
           
static boolean verifyClass(java.lang.Object obj, int type)
           
protected  com.sun.media.GraphNode verifyGraph(com.sun.media.GraphNode node)
          Given a protential graph, verify it.
static Format verifyInput(PlugIn p, Format in)
          Check if the given plugin supports the given input.
static Format verifyOutput(PlugIn p, Format out)
          Check if the given plugin supports the given output.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

STAGES

protected int STAGES

plugIns

protected java.util.Hashtable plugIns

targetPlugins

protected com.sun.media.GraphNode[] targetPlugins

targetPluginNames

protected java.util.Vector targetPluginNames

targetType

protected int targetType

inspector

protected static GraphInspector inspector
构造方法详细信息

SimpleGraphBuilder

public SimpleGraphBuilder()
方法详细信息

setGraphInspector

public static void setGraphInspector(GraphInspector insp)

reset

public void reset()
Reset local cache and reuse the same instance for graph building.


buildTrackFromGraph

protected com.sun.media.GraphNode buildTrackFromGraph(BasicTrackControl tc,
                                                      com.sun.media.GraphNode node)
When the graph build finds a viable graph to build, this callback will be invoked to see if the graph can actually be built. Subclass should implement this.


verifyGraph

protected com.sun.media.GraphNode verifyGraph(com.sun.media.GraphNode node)
Given a protential graph, verify it.


getPlugInNode

public static com.sun.media.GraphNode getPlugInNode(java.lang.String name,
                                                    int type,
                                                    java.util.Hashtable plugIns)
Given a codec class name, instantiate the codec and query it dynamically to see if it supports the given input and output formats.


findCodec

public static Codec findCodec(Format in,
                              Format out,
                              Format[] selectedIn,
                              Format[] selectedOut)
Find a codec that can handle the given input and output. The output argument can be null if no specific output format is required.


findRenderer

public static Renderer findRenderer(Format in)
Find a renderer that can handle the given input and output. The output argument can be null if no specific output format is required.


findRenderingChain

public static java.util.Vector findRenderingChain(Format in,
                                                  java.util.Vector formats)
Return a chain of codecs and renderer to render to input format. Unlike findCodec and findRenderer, it uses the same graph building algorithm that the media engine uses to determine the best rendering path for a particular input format. The return value is a vector of plugins of all the codecs and the renderer. The plugin list is in reverse order starting from the renderer. The list of the corresponding input formats for each codec is also returned as an argument to the function.


createPlugIn

public static PlugIn createPlugIn(java.lang.String name,
                                  int type)

verifyClass

public static boolean verifyClass(java.lang.Object obj,
                                  int type)

matches

public static Format matches(Format[] outs,
                             Format[] ins,
                             PlugIn up,
                             PlugIn down)
Choose a format among the two input arrays that matches and verify that if the given upstream and downstream plugins accept the matched format as output (for the upstream) or as input (for the downstream). Either of the plugin arguments can be null. In which case the verification step will be skipped accordingly.

参数:
outs - the supported output formats from the upstream node.
ints - the supported input formats from the downstream node.
up - the upstream node.
down - the downstream node.
返回:
a matching format.

matches

public static Format matches(Format out,
                             Format[] ins,
                             PlugIn up,
                             PlugIn down)
Choose a format among the two input arrays that matches and verify that if the given upstream and downstream plugins accept the matched format as output (for the upstream) or as input (for the downstream). Either of the plugin arguments can be null. In which case the verification step will be skipped accordingly.

返回:
a matching format.

matches

public static Format matches(Format[] outs,
                             Format in,
                             PlugIn up,
                             PlugIn down)

verifyInput

public static Format verifyInput(PlugIn p,
                                 Format in)
Check if the given plugin supports the given input.


verifyOutput

public static Format verifyOutput(PlugIn p,
                                  Format out)
Check if the given plugin supports the given output.