
public class Coder extends Configurable
| Modifier and Type | Class and Description |
|---|---|
static class |
Coder.Flag |
static class |
Coder.Flag2 |
static class |
Coder.State
The state that a Coder can be in.
|
| Modifier and Type | Method and Description |
|---|---|
Coder |
copyReference()
Create a new Coder object that is actually referring to the
exact same underlying native object.
|
boolean |
equals(Object obj)
Compares two values, returning true if the underlying objects in native code are the same object.
|
AudioChannel.Layout |
getChannelLayout()
Get the channel layout.
|
int |
getChannels()
Get the number of channels in this audio stream
|
Codec |
getCodec()
The Codec this StreamCoder will use.
|
Codec.ID |
getCodecID()
A short hand for getCodec().getID().
|
MediaDescriptor.Type |
getCodecType()
A short hand for getCodec().getType().
|
int |
getFlag(Coder.Flag flag)
Check if a given flag is set.
|
int |
getFlag2(Coder.Flag2 flag)
Check if a given flag2 flag is set.
|
int |
getFlags()
Get the 32-bit compliment of all flags.
|
int |
getFlags2()
Get the 32-bit compliment of all flags 2 flags
|
int |
getFrameCount()
Get the number of frames encoded/decoded so far.
If encoding or decoding has an error, this count is not incremented. |
int |
getFrameSize()
Number of samples per channel in an audio frame.
- encoding: Each submitted frame except the last must contain exactly frame_size samples per channel. May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the frame size is not restricted. - decoding: may be set by some decoders to indicate constant frame size |
int |
getHeight()
The height, in pixels.
|
PixelFormat.Type |
getPixelFormat()
For Video streams, get the Pixel Format in use by the stream.
|
AudioFormat.Type |
getSampleFormat()
Get the audio sample format.
|
int |
getSampleRate()
Get the sample rate we use for this coder.
|
Coder.State |
getState()
Get the state of this coder.
|
Rational |
getTimeBase()
Get the time base this stream will ENCODE in, or the time base we
detect while DECODING. |
int |
getWidth()
The width, in pixels.
|
int |
hashCode()
Get a hashable value for this object.
|
void |
open(KeyValueBag inputOptions,
KeyValueBag unsetOptions)
Open this Coder, using the given bag of Codec-specific options.
|
void |
setChannelLayout(AudioChannel.Layout layout)
Set the channel layout
|
void |
setChannels(int channels)
Set the number of channels to use when ENCODING.
|
void |
setFlag(Coder.Flag flag,
boolean value)
Set a flag to true or false.
|
void |
setFlag2(Coder.Flag2 flag,
boolean value)
Set a flag2 to true or false.
|
void |
setFlags(int newVal)
Set a new bitmask of all Flag values (bit xored together).
|
void |
setFlags2(int newVal)
Set a new bitmask of all Flag2 values (bit xored together).
|
void |
setHeight(int height)
Set the height, in pixels.
|
void |
setPixelFormat(PixelFormat.Type pixelFmt)
Set the pixel format to ENCODE with.
|
void |
setSampleFormat(AudioFormat.Type format)
Set the sample format when ENCODING.
|
void |
setSampleRate(int sampleRate)
Set the sample rate to use when ENCODING.
|
void |
setTimeBase(Rational newTimeBase)
Set the time base we'll use to ENCODE with.
|
void |
setWidth(int width)
Set the width, in pixels
|
String |
toString() |
getNumProperties, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsInt, getPropertyAsLong, getPropertyAsRational, getPropertyAsString, getPropertyMetaData, getPropertyMetaData, setProperty, setProperty, setProperty, setProperty, setProperty, setPropertydelete, getCurrentRefCountpublic Coder copyReference()
copyReference in class Configurablepublic boolean equals(Object obj)
equals in class Configurablepublic int hashCode()
hashCode in class Configurablepublic void open(KeyValueBag inputOptions, KeyValueBag unsetOptions)
inputOptions - If non-null, a bag of codec-specific options.unsetOptions - If non-null, the bag will be emptied and then filled withinputOptions that were not set.public Codec getCodec()
public MediaDescriptor.Type getCodecType()
public Codec.ID getCodecID()
public int getHeight()
public void setHeight(int height)
height - Sets the height of video frames we'll encode. No-op when DECODING.
public int getWidth()
public void setWidth(int width)
width - Sets the width of video frames we'll encode. No-op when DECODING.
public PixelFormat.Type getPixelFormat()
public void setPixelFormat(PixelFormat.Type pixelFmt)
pixelFmt - Pixel format to use.public int getSampleRate()
public void setSampleRate(int sampleRate)
sampleRate - New sample rate (in Hz) to use.public AudioFormat.Type getSampleFormat()
public void setSampleFormat(AudioFormat.Type format)
format - The sample format.public int getChannels()
public void setChannels(int channels)
channels - The number of channels we'll encode with.public AudioChannel.Layout getChannelLayout()
public void setChannelLayout(AudioChannel.Layout layout)
public Rational getTimeBase()
public void setTimeBase(Rational newTimeBase)
newTimeBase - The new time base to use.
public Coder.State getState()
public int getFrameCount()
public int getFrameSize()
public int getFlags()
public int getFlag(Coder.Flag flag)
public int getFlags2()
public int getFlag2(Coder.Flag2 flag)
public void setFlags(int newVal)
public void setFlag(Coder.Flag flag, boolean value)
public void setFlags2(int newVal)
public void setFlag2(Coder.Flag2 flag, boolean value)
Copyright © 2018 Humble Software. All rights reserved.