javax.media
Class ProcessorModel

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

public class ProcessorModel
extends java.lang.Object

Encapsulates the basic information required to create a Processor. A ProcessorModel can be passed to Manager.createRealizedProcessor to construct a Processor.

Extend this class to provide more control over what the output format of each track should be and let the Manager.createRealizedProcessor method do the rest of the work of creating and realizing a suitable Processor.

Since:
JMF 2.0

Constructor Summary
ProcessorModel()
          Creates a ProcessorModel with null properties.
ProcessorModel(DataSource inputDataSource, Format[] formats, ContentDescriptor outputContentDescriptor)
          Creates a ProcessorModel for the specified input DataSource, track formats, and output type.
ProcessorModel(Format[] formats, ContentDescriptor outputContentDescriptor)
          Creates a ProcessorModel for the specified track formats and output content-type.
ProcessorModel(MediaLocator inputLocator, Format[] formats, ContentDescriptor outputContentDescriptor)
          Creates a ProcessorModel for the specified input MediaLocator, track formats, and output type.
 
Method Summary
 ContentDescriptor getContentDescriptor()
          Gets the output content-type specified by this ProcessorModel.
 DataSource getInputDataSource()
          Gets the input DataSource that specifies the media source for this ProcessorModel.
 MediaLocator getInputLocator()
          Gets the input MediaLocator that specifies the media source for this ProcessorModel.
 Format getOutputTrackFormat(int tIndex)
          Gets the preferred Format of the specified track.
 int getTrackCount(int availableTrackCount)
          Gets the number of tracks required as the output of the Processor constructed with this ProcessorModel.
 boolean isFormatAcceptable(int tIndex, Format tFormat)
          Checks whether or not tFormat is an acceptable format for the track tIndex.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessorModel

public ProcessorModel()
Creates a ProcessorModel with null properties.

ProcessorModel

public ProcessorModel(Format[] formats,
                      ContentDescriptor outputContentDescriptor)
Creates a ProcessorModel for the specified track formats and output content-type. This constructor creates a ProcessorModel that can be used to construct a Processor for capturing media data.
Parameters:
formats - An array of Format objects that contains the desired track formats.
outputContentDescriptor - A ContentDescriptor that describes the desired output content-type.

ProcessorModel

public ProcessorModel(DataSource inputDataSource,
                      Format[] formats,
                      ContentDescriptor outputContentDescriptor)
Creates a ProcessorModel for the specified input DataSource, track formats, and output type.
Parameters:
inputDataSource - The DataSource that identifies the media source for the ProcessorModel.
formats - An array of Format objects that contains the desired track formats.
outputContentDescriptor - A ContentDescriptor that describes the desired output content-type.

ProcessorModel

public ProcessorModel(MediaLocator inputLocator,
                      Format[] formats,
                      ContentDescriptor outputContentDescriptor)
Creates a ProcessorModel for the specified input MediaLocator, track formats, and output type.
Parameters:
inputLocator - The MediaLocator that identifies the media source for this ProcessorModel.
formats - An array of Format objects that contains the desired track formats.
outputContentDescriptor - A ContentDescriptor that describes the desired output content-type.
Method Detail

getTrackCount

public int getTrackCount(int availableTrackCount)
Gets the number of tracks required as the output of the Processor constructed with this ProcessorModel.
Parameters:
availableTrackCount - The number of tracks available, as an integer.
Returns:
The number of tracks required, as an integer.

getOutputTrackFormat

public Format getOutputTrackFormat(int tIndex)
Gets the preferred Format of the specified track.
Parameters:
tIndex - The index of the track for which you want to get the preferred Format.
Returns:
The preferred Format for the track.

isFormatAcceptable

public boolean isFormatAcceptable(int tIndex,
                                  Format tFormat)
Checks whether or not tFormat is an acceptable format for the track tIndex.
Parameters:
tIndex - The index of the track you want to check.
tFormat - The Format to check.
Returns:
true if the Format is acceptable, otherwise returns false.

getContentDescriptor

public ContentDescriptor getContentDescriptor()
Gets the output content-type specified by this ProcessorModel.
Returns:
A ContentDescriptor that defines the output content-type. Returns null if the output type is not applicable or the output streams are to contain raw data that doesn't pertain to a specific content-type.

getInputDataSource

public DataSource getInputDataSource()
Gets the input DataSource that specifies the media source for this ProcessorModel. The inputLocator is ignored if this value is non-null.
Returns:
A DataSource that specifies the media source.

getInputLocator

public MediaLocator getInputLocator()
Gets the input MediaLocator that specifies the media source for this ProcessorModel. This value is ignored if an input DataSource is specified.
Returns:
A MediaLocator that specifies the media source.


Submit a bug or feature
Copyright 1999-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. See the Specification License for more details.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.