net.sf.fmj.media.codec.video.jpeg
Class DePacketizer

java.lang.Object
  extended by net.sf.fmj.media.AbstractControls
      extended by net.sf.fmj.media.AbstractPlugIn
          extended by net.sf.fmj.media.AbstractCodec
              extended by net.sf.fmj.media.codec.video.jpeg.DePacketizer
All Implemented Interfaces:
Codec, Controls, PlugIn

public class DePacketizer
extends AbstractCodec
implements Codec

JPEG/RTP depacketizer Codec. FMJ's functional equivalent of com.sun.media.codec.video.jpeg.DePacketizer. Reassembles JPEG RTP packets into JPEG frames, as per RFC 2035 - RTP Payload Format for JPEG Video. See http://www.rfc-archive.org/getrfc.php?rfc=2035 TODO: support restart markers TODO: support q table headers TODO: lunarphases.mov: when received, JMF puts extra stuff on the end that we don't.

Author:
Ken Larson

Field Summary
 
Fields inherited from class net.sf.fmj.media.AbstractCodec
inputFormat, inputFormats, opened, outputFormat
 
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
DePacketizer()
          Because packets can come out of order, it is possible that some packets for a newer frame may arrive while an older frame is still incomplete.
 
Method Summary
 void close()
           
 java.lang.Object getControl(java.lang.String controlType)
          Retrieve the first object that implements the given Class or Interface.
 java.lang.Object[] getControls()
          Retrieve an array of objects that control the object.
 java.lang.String getName()
           
 Format[] getSupportedInputFormats()
           
 Format[] getSupportedOutputFormats(Format input)
           
 void open()
           
 int process(Buffer input, Buffer output)
           
 void reset()
           
 Format setInputFormat(Format format)
           
 Format setOutputFormat(Format format)
           
 
Methods inherited from class net.sf.fmj.media.AbstractCodec
checkInputBuffer, dump, getInputFormat, getOutputFormat, isEOM, propagateEOM
 
Methods inherited from class net.sf.fmj.media.AbstractControls
addControl, removeControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DePacketizer

public DePacketizer()
Because packets can come out of order, it is possible that some packets for a newer frame may arrive while an older frame is still incomplete. However, in the case where we get nothing but incomplete frames, we don't want to keep all of them around forever.

Method Detail

close

public void close()
Specified by:
close in interface PlugIn
Overrides:
close in class AbstractPlugIn

getControl

public java.lang.Object getControl(java.lang.String controlType)
Description copied from class: AbstractControls
Retrieve the first object that implements the given Class or Interface. The full class name must be used. If the control is not supported then null is returned.

Specified by:
getControl in interface Controls
Overrides:
getControl in class AbstractControls
Returns:
the object that implements the control, or null.

getControls

public java.lang.Object[] getControls()
Description copied from class: AbstractControls
Retrieve an array of objects that control the object. If no controls are supported, a zero length array is returned.

Specified by:
getControls in interface Controls
Overrides:
getControls in class AbstractControls
Returns:
the array of object controls

getName

public java.lang.String getName()
Specified by:
getName in interface PlugIn
Overrides:
getName in class AbstractPlugIn

getSupportedInputFormats

public Format[] getSupportedInputFormats()
Specified by:
getSupportedInputFormats in interface Codec
Overrides:
getSupportedInputFormats in class AbstractCodec

getSupportedOutputFormats

public Format[] getSupportedOutputFormats(Format input)
Specified by:
getSupportedOutputFormats in interface Codec
Specified by:
getSupportedOutputFormats in class AbstractCodec

open

public void open()
          throws ResourceUnavailableException
Specified by:
open in interface PlugIn
Overrides:
open in class AbstractPlugIn
Throws:
ResourceUnavailableException

reset

public void reset()
Specified by:
reset in interface PlugIn
Overrides:
reset in class AbstractPlugIn

setInputFormat

public Format setInputFormat(Format format)
Specified by:
setInputFormat in interface Codec
Overrides:
setInputFormat in class AbstractCodec

setOutputFormat

public Format setOutputFormat(Format format)
Specified by:
setOutputFormat in interface Codec
Overrides:
setOutputFormat in class AbstractCodec

process

public int process(Buffer input,
                   Buffer output)
Specified by:
process in interface Codec
Specified by:
process in class AbstractCodec