Class DePacketizer
- java.lang.Object
-
- net.sf.fmj.media.AbstractControls
-
- net.sf.fmj.media.AbstractPlugIn
-
- net.sf.fmj.media.AbstractCodec
-
- org.jitsi.impl.neomedia.codec.AbstractCodec2
-
- org.jitsi.impl.neomedia.codec.video.h264.DePacketizer
-
- All Implemented Interfaces:
javax.media.Codec,javax.media.Controls,javax.media.PlugIn
public class DePacketizer extends AbstractCodec2
Implements Codec to represent a depacketizer of H.264 RTP packets into NAL units.- Author:
- Lyubomir Marinov, Damian Minkov
-
-
Field Summary
-
Fields inherited from class org.jitsi.impl.neomedia.codec.AbstractCodec2
BUFFER_FLAG_FEC, BUFFER_FLAG_PLC, EMPTY_FORMATS, features, MAX_AUDIO_SEQUENCE_NUMBERS_TO_PLC, SEQUENCE_MAX, SEQUENCE_MIN
-
-
Constructor Summary
Constructors Constructor Description DePacketizer()Initializes a new DePacketizer instance which is to depacketize H.264 RTP packets into NAL units.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoClose()Close the Codec.protected voiddoOpen()Opens this Codec and acquires the resources that it needs to operate.protected intdoProcess(javax.media.Buffer inBuffer, javax.media.Buffer outBuffer)Processes (depacketizes) a buffer.protected javax.media.Format[]getMatchingOutputFormats(javax.media.Format inputFormat)Gets the Formats which are supported by this Codec as output when the input is in a specific Format.static booleanisKeyFrame(byte[] buf, int off, int len)Returns true if the buffer contains a H264 key frame at offset offset.booleanrequestKeyFrame(boolean urgent)Requests a key frame from the remote peer associated with this DePacketizer using the logic of DePacketizer.voidsetKeyFrameControl(KeyFrameControl keyFrameControl)Sets the KeyFrameControl to be used by this DePacketizer as a means of control over its key frame-related logic.-
Methods inherited from class org.jitsi.impl.neomedia.codec.AbstractCodec2
calculateLostSeqNoCount, close, discardOutputBuffer, getName, getSupportedOutputFormats, incrementSeqNo, matches, open, process, setInputFormat, setOutputFormat, specialize, updateOutput, validateByteArraySize, validateShortArraySize
-
Methods inherited from class net.sf.fmj.media.AbstractCodec
checkInputBuffer, dump, getInputFormat, getOutputFormat, getSupportedInputFormats, isEOM, propagateEOM
-
Methods inherited from class net.sf.fmj.media.AbstractControls
addControl, getControl, getControls, removeControl
-
-
-
-
Method Detail
-
doClose
protected void doClose()
Close the Codec.- Specified by:
doClosein classAbstractCodec2
-
doOpen
protected void doOpen() throws javax.media.ResourceUnavailableExceptionOpens this Codec and acquires the resources that it needs to operate. A call toPlugIn.open()on this instance will result in a call to doOpen only ifAbstractCodec.openedis false. All required input and/or output formats are assumed to have been set on this Codec before doOpen is called.- Specified by:
doOpenin classAbstractCodec2- Throws:
javax.media.ResourceUnavailableException- if any of the resources that this Codec needs to operate cannot be acquired
-
doProcess
protected int doProcess(javax.media.Buffer inBuffer, javax.media.Buffer outBuffer)Processes (depacketizes) a buffer.- Specified by:
doProcessin classAbstractCodec2- Parameters:
inBuffer- input bufferoutBuffer- output buffer- Returns:
- BUFFER_PROCESSED_OK if buffer has been successfully processed
-
isKeyFrame
public static boolean isKeyFrame(byte[] buf, int off, int len)Returns true if the buffer contains a H264 key frame at offset offset.- Parameters:
buf- the byte buffer to checkoff- the offset in the byte buffer where the actuall data startslen- the length of the data in the byte buffer- Returns:
- true if the buffer contains a H264 key frame at offset offset.
-
getMatchingOutputFormats
protected javax.media.Format[] getMatchingOutputFormats(javax.media.Format inputFormat)
Gets the Formats which are supported by this Codec as output when the input is in a specific Format. Makes sure that the format parameters of a ParameterizedVideoFormat input which are of no concern to this DePacketizer get passed on through the output to the next Codec in the codec chain (i.e. JNIDecoder).- Overrides:
getMatchingOutputFormatsin classAbstractCodec2- Parameters:
inputFormat- the Format of the input for which the supported output Formats are to be returned- Returns:
- an array of Formats supported by this Codec as output when the input is in the specified inputFormat
-
requestKeyFrame
public boolean requestKeyFrame(boolean urgent)
Requests a key frame from the remote peer associated with this DePacketizer using the logic of DePacketizer.- Parameters:
urgent- true if the caller has determined that the need for a key frame is urgent and should not obey all constraints with respect to time between two subsequent requests for key frames- Returns:
- true if a key frame was indeed requested in response to the call; otherwise, false
-
setKeyFrameControl
public void setKeyFrameControl(KeyFrameControl keyFrameControl)
Sets the KeyFrameControl to be used by this DePacketizer as a means of control over its key frame-related logic.- Parameters:
keyFrameControl- the KeyFrameControl to be used by this DePacketizer as a means of control over its key frame-related logic
-
-