Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.codec.video.h264
Class Packetizer

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.AbstractPacketizer
                  extended by net.java.sip.communicator.impl.neomedia.codec.video.h264.Packetizer
All Implemented Interfaces:
javax.media.Codec, javax.media.Controls, javax.media.PlugIn

public class Packetizer
extends net.sf.fmj.media.AbstractPacketizer

Packetizes H.264 encoded data/NAL units into RTP packets in accord with RFC 3984 "RTP Payload Format for H.264 Video".

Author:
Damian Minkov, Lyubomir Marinov

Field Summary
static int MAX_PAYLOAD_SIZE
          Maximum payload size without the headers.
(package private) static javax.media.Format[] SUPPORTED_OUTPUT_FORMATS
          The Formats supported by Packetizer instances as output.
 
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
Packetizer()
          Initializes a new Packetizer instance which is to packetize H.264 encoded data/NAL units into RTP packets in accord with RFC 3984 "RTP Payload Format for H.264 Video".
 
Method Summary
 void close()
          Close this Packetizer.
 String getName()
          Gets the name of this PlugIn.
 javax.media.Format[] getSupportedOutputFormats(javax.media.Format in)
          Return the list of formats supported at the output.
 void open()
          Open this Packetizer.
 int process(javax.media.Buffer inBuffer, javax.media.Buffer outBuffer)
          Processes (packetize) a buffer.
 javax.media.Format setInputFormat(javax.media.Format in)
          Sets the input format.
 javax.media.Format setOutputFormat(javax.media.Format output)
          Sets the Format in which this Codec is to output media data.
 
Methods inherited from class net.sf.fmj.media.AbstractPacketizer
doBuildPacketHeader, setDoNotSpanInputBuffers, setPacketSize, setPacketSizeImpl
 
Methods inherited from class net.sf.fmj.media.AbstractCodec
checkInputBuffer, dump, getInputFormat, getOutputFormat, getSupportedInputFormats, isEOM, propagateEOM
 
Methods inherited from class net.sf.fmj.media.AbstractPlugIn
reset
 
Methods inherited from class net.sf.fmj.media.AbstractControls
addControl, getControl, getControls, removeControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.media.PlugIn
reset
 
Methods inherited from interface javax.media.Controls
getControl, getControls
 

Field Detail

MAX_PAYLOAD_SIZE

public static final int MAX_PAYLOAD_SIZE
Maximum payload size without the headers.

See Also:
Constant Field Values

SUPPORTED_OUTPUT_FORMATS

static final javax.media.Format[] SUPPORTED_OUTPUT_FORMATS
The Formats supported by Packetizer instances as output.

Constructor Detail

Packetizer

public Packetizer()
Initializes a new Packetizer instance which is to packetize H.264 encoded data/NAL units into RTP packets in accord with RFC 3984 "RTP Payload Format for H.264 Video".

Method Detail

close

public void close()
Close this Packetizer.

Specified by:
close in interface javax.media.PlugIn
Overrides:
close in class net.sf.fmj.media.AbstractPlugIn

getName

public String getName()
Gets the name of this PlugIn.

Specified by:
getName in interface javax.media.PlugIn
Overrides:
getName in class net.sf.fmj.media.AbstractPlugIn
Returns:
the name of this PlugIn

getSupportedOutputFormats

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

Specified by:
getSupportedOutputFormats in interface javax.media.Codec
Specified by:
getSupportedOutputFormats in class net.sf.fmj.media.AbstractCodec
Parameters:
in - input Format to determine corresponding output Format/tt>s
Returns:
array of formats supported at output

open

public void open()
          throws javax.media.ResourceUnavailableException
Open this Packetizer.

Specified by:
open in interface javax.media.PlugIn
Overrides:
open in class net.sf.fmj.media.AbstractPlugIn
Throws:
javax.media.ResourceUnavailableException - if something goes wrong during initialization of the Packetizer.

process

public int process(javax.media.Buffer inBuffer,
                   javax.media.Buffer outBuffer)
Processes (packetize) a buffer.

Specified by:
process in interface javax.media.Codec
Overrides:
process in class net.sf.fmj.media.AbstractPacketizer
Parameters:
inBuffer - input buffer
outBuffer - output buffer
Returns:
BUFFER_PROCESSED_OK if buffer has been successfully processed

setInputFormat

public javax.media.Format setInputFormat(javax.media.Format in)
Sets the input format.

Specified by:
setInputFormat in interface javax.media.Codec
Overrides:
setInputFormat in class net.sf.fmj.media.AbstractCodec
Parameters:
in - format to set
Returns:
format

setOutputFormat

public javax.media.Format setOutputFormat(javax.media.Format output)
Sets the Format in which this Codec is to output media data.

Specified by:
setOutputFormat in interface javax.media.Codec
Overrides:
setOutputFormat in class net.sf.fmj.media.AbstractCodec
Parameters:
output - the Format in which this Codec is to output media data
Returns:
the Format in which this Codec is currently configured to output media data or null if format was found to be incompatible with this Codec

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.