public abstract class Coder extends Configurable
Coder is an abstract representation of an encoder or decoder. This class
provides basic functionality to initialize and close this Coders codec.
For an implementation see Encoder and Decoder.| Modifier and Type | Class and Description |
|---|---|
static class |
Coder.State
Coder state indicates whether the
Coder is opened or closed. |
| Modifier and Type | Field and Description |
|---|---|
protected com.googlecode.javacv.cpp.avcodec.AVCodecContext |
avContext
The codec context.
|
protected com.googlecode.javacv.cpp.avutil.AVFrame |
avFrame
Output data of decoder.
|
protected com.googlecode.javacv.cpp.avcodec.AVPacket |
avPacket
Input data for decoder.
|
protected Codec |
codec
The chosen codec.
|
protected int[] |
gotFrame
Indicates whether last frame was encoded or decoded.
|
protected Coder.State |
state
Current coder state.
|
audioChannels, bitrate, flags, frameRate, gopSize, imageHeight, imageWidth, mediaType, pixelFormat, profile, quality, sampleFormat, sampleRate| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this
Coder and free allocated memory. |
void |
flush()
Flush buffers, should be called when seeking or switching to a
different stream.
|
int |
getAudioChannels()
Get audio channels.
|
int |
getBitrate()
Get bitrate.
|
double |
getFramerate()
Get the frame rate.
|
int |
getGOPSize()
Get group of pictures.
|
int |
getImageHeight()
Get the image height.
|
int |
getImageWidth()
Get the image width.
|
MediaType |
getMediaType()
Get the media type, audio, video, etc.
|
PixelFormat |
getPixelFormat()
Get pixel format.
|
int |
getProfile()
Get profile.
|
double |
getQuality()
Get quality.
|
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. |
setAudioChannels, setBitrate, setFlag, setFramerate, setGOPSize, setImageHeight, setImageWidth, setMediaType, setPixelFormat, setProfile, setQuality, setSampleFormat, setSamplerateprotected int[] gotFrame
protected com.googlecode.javacv.cpp.avcodec.AVCodecContext avContext
protected com.googlecode.javacv.cpp.avutil.AVFrame avFrame
protected com.googlecode.javacv.cpp.avcodec.AVPacket avPacket
protected final Codec codec
protected Coder.State state
public void open(Map<String,String> options) throws JavaAVException
Coder with codec options that may contain specific
codec parameters.options - codec options.JavaAVException - if Coder could not be opened.public void close()
Coder and free allocated memory.public void flush()
public MediaType getMediaType()
ConfigurablegetMediaType in class Configurablepublic int getImageWidth()
ConfigurablegetImageWidth in class Configurablepublic int getImageHeight()
ConfigurablegetImageHeight in class Configurablepublic int getGOPSize()
ConfigurablegetGOPSize in class Configurablepublic PixelFormat getPixelFormat()
ConfigurablegetPixelFormat in class Configurablepublic SampleFormat getSampleFormat()
ConfigurablegetSampleFormat in class Configurablepublic int getBitrate()
ConfigurablegetBitrate in class Configurablepublic double getFramerate()
ConfigurablegetFramerate in class Configurablepublic int getSampleRate()
ConfigurablegetSampleRate in class Configurablepublic int getAudioChannels()
ConfigurablegetAudioChannels in class Configurablepublic double getQuality()
ConfigurablegetQuality in class Configurablepublic int getProfile()
ConfigurablegetProfile in class ConfigurableCopyright © 2013. All Rights Reserved.