ptolemy.actor.lib.jmf
Class VideoCamera.PreAccessCodec

java.lang.Object
  extended by ptolemy.actor.lib.jmf.VideoCamera.PreAccessCodec
All Implemented Interfaces:
javax.media.Codec, javax.media.Controls, javax.media.PlugIn
Enclosing class:
VideoCamera

public class VideoCamera.PreAccessCodec
extends java.lang.Object
implements javax.media.Codec

A pass-through codec to access to individual frames.


Field Summary
(package private)  javax.media.Format input
          The input format.
(package private)  javax.media.Format output
          The output format.
 
Fields inherited from interface javax.media.PlugIn
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED, PLUGIN_TERMINATED
 
Constructor Summary
VideoCamera.PreAccessCodec()
          Construct a PreAccessCodec.
 
Method Summary
(package private)  void accessFrame(javax.media.Buffer frame)
          Callback to access individual video frames.
 void close()
          In this class, do nothing.
 java.lang.Object getControl(java.lang.String type)
          Get the control for a type.
 java.lang.Object[] getControls()
          Return the controls, in this case, an empty array of size 0.
(package private)  javax.media.Buffer getFrame()
          The code for a pass through codec.
 java.lang.String getName()
          Return the name of this codec.
 javax.media.Format[] getSupportedInputFormats()
          Return the supported input formats, which are YUV and RGB.
 javax.media.Format[] getSupportedOutputFormats(javax.media.Format in)
          Return the supported output formats.
 void open()
          In this class, do nothing.
 int process(javax.media.Buffer in, javax.media.Buffer out)
          Process a individual frame.
 void reset()
          In this class, do nothing.
 javax.media.Format setInputFormat(javax.media.Format format)
          Set the input format.
 javax.media.Format setOutputFormat(javax.media.Format format)
          Set the output format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

javax.media.Format input
The input format.


output

javax.media.Format output
The output format.

Constructor Detail

VideoCamera.PreAccessCodec

public VideoCamera.PreAccessCodec()
                           throws IllegalActionException
Construct a PreAccessCodec.

Throws:
IllegalActionException - Not thrown in this base class.
Method Detail

accessFrame

void accessFrame(javax.media.Buffer frame)
Callback to access individual video frames.

Parameters:
frame - The individual video frame.

getFrame

javax.media.Buffer getFrame()
                      throws IllegalActionException
The code for a pass through codec.

Returns:
the frame.
Throws:
IllegalActionException

getName

public java.lang.String getName()
Return the name of this codec.

Specified by:
getName in interface javax.media.PlugIn
Returns:
Always return "Pre-Access Codec".

open

public void open()
In this class, do nothing.

Specified by:
open in interface javax.media.PlugIn

close

public void close()
In this class, do nothing.

Specified by:
close in interface javax.media.PlugIn

reset

public void reset()
In this class, do nothing.

Specified by:
reset in interface javax.media.PlugIn

getSupportedInputFormats

public javax.media.Format[] getSupportedInputFormats()
Return the supported input formats, which are YUV and RGB.

Specified by:
getSupportedInputFormats in interface javax.media.Codec
Returns:
the supported input formats.

getSupportedOutputFormats

public javax.media.Format[] getSupportedOutputFormats(javax.media.Format in)
Return the supported output formats.

Specified by:
getSupportedOutputFormats in interface javax.media.Codec
Parameters:
in - The input format. If the input format is null, then YUV and RGB format are returned. If the input format is non-null, then it is returned.
Returns:
the supported output formats.

setInputFormat

public javax.media.Format setInputFormat(javax.media.Format format)
Set the input format.

Specified by:
setInputFormat in interface javax.media.Codec
Parameters:
format - The input format.
Returns:
the input format.

setOutputFormat

public javax.media.Format setOutputFormat(javax.media.Format format)
Set the output format.

Specified by:
setOutputFormat in interface javax.media.Codec
Parameters:
format - The output format.
Returns:
the output format.

process

public int process(javax.media.Buffer in,
                   javax.media.Buffer out)
Process a individual frame.

Specified by:
process in interface javax.media.Codec
Parameters:
in - The input buffer.
out - The output buffer.
Returns:
BUFFER_PROCESSED_OK if no exceptin was thrown.

getControls

public java.lang.Object[] getControls()
Return the controls, in this case, an empty array of size 0.

Specified by:
getControls in interface javax.media.Controls
Returns:
The controls.

getControl

public java.lang.Object getControl(java.lang.String type)
Get the control for a type.

Specified by:
getControl in interface javax.media.Controls
Parameters:
type - The type, which is ignored.
Returns:
Always return null.