SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

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

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.java.sip.communicator.impl.neomedia.codec.video.h264.JNIEncoder
All Implemented Interfaces:
javax.media.Codec, javax.media.Controls, javax.media.PlugIn, RTCPFeedbackListener

public class JNIEncoder
extends net.sf.fmj.media.AbstractCodec
implements RTCPFeedbackListener

Implements a H.264 encoder.

Author:
Damian Minkov, Lubomir Marinov, Sebastien Vincent

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
JNIEncoder()
          Initializes a new JNIEncoder instance.
 
Method Summary
 void close()
          Close the Codec.
 void feedbackReceived(RTCPFeedbackEvent event)
          Event fired when RTCP feedback message is received.
 String getName()
          Get codec name.
 javax.media.Format[] getSupportedOutputFormats(javax.media.Format in)
          Return the list of formats supported at the output.
 void open()
          Inits Codec instance.
 int process(javax.media.Buffer inBuffer, javax.media.Buffer outBuffer)
          Processes (encode) a buffer.
 javax.media.Format setInputFormat(javax.media.Format in)
          Sets the input format.
 javax.media.Format setOutputFormat(javax.media.Format out)
          Sets the Format in which this Codec is to output media data.
 
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
 

Constructor Detail

JNIEncoder

public JNIEncoder()
Initializes a new JNIEncoder instance.

Method Detail

close

public void close()
Close the Codec.

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

getName

public String getName()
Get codec name.

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

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
Inits Codec instance.

Specified by:
open in interface javax.media.PlugIn
Overrides:
open in class net.sf.fmj.media.AbstractPlugIn
Throws:
javax.media.ResourceUnavailableException

process

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

Specified by:
process in interface javax.media.Codec
Specified by:
process in class net.sf.fmj.media.AbstractCodec
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 out)
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:
out - 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

feedbackReceived

public void feedbackReceived(RTCPFeedbackEvent event)
Event fired when RTCP feedback message is received.

Specified by:
feedbackReceived in interface RTCPFeedbackListener
Parameters:
event - RTCPFeedbackEvent

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

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