Class JNIDecoder
- java.lang.Object
-
- net.sf.fmj.media.AbstractControls
-
- net.sf.fmj.media.AbstractPlugIn
-
- net.sf.fmj.media.AbstractCodec
-
- org.jitsi.impl.neomedia.codec.video.h264.JNIDecoder
-
- All Implemented Interfaces:
javax.media.Codec,javax.media.Controls,javax.media.PlugIn
public class JNIDecoder extends net.sf.fmj.media.AbstractCodecDecodes H.264 NAL units and returns the resulting frames as FFmpeg AVFrames (i.e. in YUV format).- Author:
- Damian Minkov, Lyubomir Marinov, Sebastien Vincent
-
-
Constructor Summary
Constructors Constructor Description JNIDecoder()Initializes a new JNIDecoder instance which is to decode H.264 NAL units into frames in YUV format.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckFormat(javax.media.Format format)Check Format.voidclose()Close Codec.protected javax.media.Format[]getMatchingOutputFormats(javax.media.Format inputFormat)Get matching outputs for a specified input Format.StringgetName()Get plugin name.javax.media.Format[]getSupportedOutputFormats(javax.media.Format inputFormat)Get all supported output Formats.voidopen()Inits the codec instances.intprocess(javax.media.Buffer in, javax.media.Buffer out)Decodes H.264 media data read from a specific input Buffer into a specific output Buffer.javax.media.FormatsetInputFormat(javax.media.Format format)Sets the Format of the media data to be input for processing in this Codec.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 net.sf.fmj.media.AbstractCodec
checkInputBuffer, dump, getInputFormat, getOutputFormat, getSupportedInputFormats, isEOM, propagateEOM, setOutputFormat
-
Methods inherited from class net.sf.fmj.media.AbstractControls
addControl, getControl, getControls, removeControl
-
-
-
-
Method Detail
-
checkFormat
public boolean checkFormat(javax.media.Format format)
Check Format.- Parameters:
format- Format to check- Returns:
- true if Format is H264_RTP
-
close
public void close()
Close Codec.- Specified by:
closein interfacejavax.media.PlugIn- Overrides:
closein classnet.sf.fmj.media.AbstractPlugIn
-
getMatchingOutputFormats
protected javax.media.Format[] getMatchingOutputFormats(javax.media.Format inputFormat)
Get matching outputs for a specified input Format.- Parameters:
inputFormat- input Format- Returns:
- array of matching outputs or null if there are no matching outputs.
-
getName
public String getName()
Get plugin name.- Specified by:
getNamein interfacejavax.media.PlugIn- Overrides:
getNamein classnet.sf.fmj.media.AbstractPlugIn- Returns:
- "H.264 Decoder"
-
getSupportedOutputFormats
public javax.media.Format[] getSupportedOutputFormats(javax.media.Format inputFormat)
Get all supported output Formats.- Specified by:
getSupportedOutputFormatsin interfacejavax.media.Codec- Specified by:
getSupportedOutputFormatsin classnet.sf.fmj.media.AbstractCodec- Parameters:
inputFormat- input Format to determine corresponding output Formats- Returns:
- an array of supported output Formats
-
open
public void open() throws javax.media.ResourceUnavailableExceptionInits the codec instances.- Specified by:
openin interfacejavax.media.PlugIn- Overrides:
openin classnet.sf.fmj.media.AbstractPlugIn- Throws:
javax.media.ResourceUnavailableException- if codec initialization failed
-
process
public int process(javax.media.Buffer in, javax.media.Buffer out)Decodes H.264 media data read from a specific input Buffer into a specific output Buffer.- Specified by:
processin interfacejavax.media.Codec- Specified by:
processin classnet.sf.fmj.media.AbstractCodec- Parameters:
in- input Bufferout- output Buffer- Returns:
- BUFFER_PROCESSED_OK if in has been successfully processed
-
setInputFormat
public javax.media.Format setInputFormat(javax.media.Format format)
Sets the Format of the media data to be input for processing in this Codec.- Specified by:
setInputFormatin interfacejavax.media.Codec- Overrides:
setInputFormatin classnet.sf.fmj.media.AbstractCodec- Parameters:
format- the Format of the media data to be input for processing in this Codec- Returns:
- the Format of the media data to be input for processing in this Codec if format is compatible with this Codec; otherwise, null
-
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
-
-