public class Decoder extends Coder
Coder.StateavContext, avFrame, avPacket, codec, gotFrame, stateaudioChannels, bitrate, flags, frameRate, gopSize, imageHeight, imageWidth, mediaType, profile, quality, sampleFormat, sampleRate| Constructor and Description |
|---|
Decoder(CodecID codecId)
Create new
Decoder that decodes media with codec with specified CodecID. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this
Coder and free allocated memory. |
AudioFrame |
decodeAudio(MediaPacket mediaPacket)
Decode a media packet with audio samples into an
AudioFrame. |
VideoFrame |
decodeVideo(MediaPacket mediaPacket)
Decode a media packet with video frame data into a
VideoFrame. |
int |
getAudioChannels()
Get audio channels.
|
int |
getImageHeight()
Get the image height.
|
int |
getImageWidth()
Get the image width.
|
PixelFormat |
getPixelFormat()
Get pixel format.
|
SampleFormat |
getSampleFormat()
Get sample format.
|
int |
getSampleRate()
Get sample rate.
|
void |
open(Map<String,String> options)
Initializes the
Coder with codec options that may contain specific
codec parameters. |
void |
setPixelFormat(PixelFormat format)
Set new pixel format.
|
flush, getBitrate, getFramerate, getGOPSize, getMediaType, getProfile, getQualitysetAudioChannels, setBitrate, setFlag, setFramerate, setGOPSize, setImageHeight, setImageWidth, setMediaType, setProfile, setQuality, setSampleFormat, setSampleratepublic Decoder(CodecID codecId) throws JavaAVException
Decoder that decodes media with codec with specified CodecID.codecId - the codec id.JavaAVException - if decoder could not be created.public void open(Map<String,String> options) throws JavaAVException
CoderCoder with codec options that may contain specific
codec parameters.open in class Coderoptions - codec options.JavaAVException - if Coder could not be opened.public void close()
CoderCoder and free allocated memory.public int getImageWidth()
ConfigurablegetImageWidth in class Coderpublic int getImageHeight()
ConfigurablegetImageHeight in class Coderpublic int getAudioChannels()
ConfigurablegetAudioChannels in class Coderpublic int getSampleRate()
ConfigurablegetSampleRate in class Coderpublic SampleFormat getSampleFormat()
ConfigurablegetSampleFormat in class Coderpublic PixelFormat getPixelFormat()
ConfigurablegetPixelFormat in class Coderpublic void setPixelFormat(PixelFormat format)
ConfigurablesetPixelFormat in class Configurableformat - pixel format.public AudioFrame decodeAudio(MediaPacket mediaPacket) throws JavaAVException
AudioFrame.mediaPacket - packet with audio samples.AudioFrame with normalized PCM audio samples.JavaAVException - if audio packet could not be decoded.public VideoFrame decodeVideo(MediaPacket mediaPacket) throws JavaAVException
VideoFrame.mediaPacket - packet with a video frame.VideoFrame in which the decoded video frame will be stored.JavaAVException - if video packet could not be decoded.Copyright © 2013. All Rights Reserved.