
public class Decoder extends Coder
Coder.Flag, Coder.Flag2, Coder.State| Modifier and Type | Method and Description |
|---|---|
Decoder |
copyReference()
Create a new Decoder object that is actually referring to the
exact same underlying native object.
|
int |
decode(MediaSampled output,
MediaPacket packet,
int byteOffset)
Decode this packet into output.
|
int |
decodeAudio(MediaAudio output,
MediaPacket packet,
int byteOffset)
Decode this packet into output.
|
int |
decodeVideo(MediaPicture output,
MediaPacket packet,
int byteOffset)
Decode this packet into output.
The caller is responsible for allocating the MediaPicture object. |
boolean |
equals(Object obj)
Compares two values, returning true if the underlying objects in native code are the same object.
|
void |
flush()
Flush this Decoder, getting rid of any cached packets (call after seek).
Next packet given to decode should be a key packet. |
int |
hashCode()
Get a hashable value for this object.
|
static Decoder |
make(Codec codec)
Create a Decoder that will use the given Codec.
|
static Decoder |
make(Coder src)
Creates a Decoder from a given Coder (either an encoder or a decoder).
|
getChannelLayout, getChannels, getCodec, getCodecID, getCodecType, getFlag, getFlag2, getFlags, getFlags2, getFrameCount, getFrameSize, getHeight, getPixelFormat, getSampleFormat, getSampleRate, getState, getTimeBase, getWidth, open, setChannelLayout, setChannels, setFlag, setFlag2, setFlags, setFlags2, setHeight, setPixelFormat, setSampleFormat, setSampleRate, setTimeBase, setWidth, toStringgetNumProperties, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsInt, getPropertyAsLong, getPropertyAsRational, getPropertyAsString, getPropertyMetaData, getPropertyMetaData, setProperty, setProperty, setProperty, setProperty, setProperty, setPropertydelete, getCurrentRefCountpublic Decoder copyReference()
copyReference in class Coderpublic boolean equals(Object obj)
public int hashCode()
public static Decoder make(Codec codec)
InvalidArgument - if codec is null or codec cannot decode.public static Decoder make(Coder src)
InvalidArgument - if src is nullpublic void flush()
public int decodeAudio(MediaAudio output, MediaPacket packet, int byteOffset)
The caller is responsible for allocating the
MediaAudio object. This function will overwrite
any data in the samples object.
output - The MediaAudio we decode to. Caller must check if it is complete on return.packet - The packet we're attempting to decode from.byteOffset - Where in the packet payload to start decodingpublic int decodeVideo(MediaPicture output, MediaPacket packet, int byteOffset)
Note on memory for MediaPicture: For a multitude of reasons,
if you created MediaPicture from a buffer, decodeVideo will discard
it and replace it with a buffer that is aligned correctly for different
CPUs and different codecs. If you must have a copy of the image data
in memory managed by you, then pass in a MediaPicture allocated without
a buffer to DecodeVideo, and then copy that into your own media picture.
output - The MediaPicture we decode. Caller must check if it is complete on return.packet - The packet we're attempting to decode from.byteOffset - Where in the packet payload to start decodingpublic int decode(MediaSampled output, MediaPacket packet, int byteOffset)
The caller is responsible for allocating the
correct underlying Media object. This function will overwrite
any data in the samples object.
output - The Media we decode to. Caller must check if it is complete on return.packet - The packet we're attempting to decode from.byteOffset - Where in the packet payload to start decodingInvalidArgument - if the media type is not compatible with this decoder.decodeVideo
,
decodeAudioCopyright © 2018 Humble Software. All rights reserved.