fm.liveswitch.opus.Encoder Class Reference

A libopus-based encoder. More...

Public Member Functions

 Encoder ()
 Initializes a new instance of the fm.liveswitch.opus.Encoder class. More...
 
 Encoder (fm.liveswitch.AudioConfig config)
 Initializes a new instance of the fm.liveswitch.opus.Encoder class. More...
 
 Encoder (fm.liveswitch.IAudioOutput input)
 Initializes a new instance of the fm.liveswitch.opus.Encoder class. More...
 
fm.liveswitch.opus.EncoderConfig getCodecConfig ()
 Gets a copy of the encoder codec's config. More...
 
boolean getDisableFec ()
 Gets a value indicating whether FEC is disabled. More...
 
String getLabel ()
 Gets a label that identifies this class. More...
 
int getPercentLossToTriggerFEC ()
 Gets the loss percentage (0-100) before forward error correction (FEC) is activated (only if supported by the remote peer). More...
 
double getQuality ()
 Gets the quality. More...
 
int setCodecConfig (fm.liveswitch.opus.EncoderConfig config)
 Sets the encoder configuration. More...
 
void setDisableFec (boolean value)
 Sets a value indicating whether FEC is disabled. More...
 
void setPercentLossToTriggerFEC (int value)
 Sets the loss percentage (0-100) before forward error correction (FEC) is activated (only if supported by the remote peer). More...
 
void setQuality (double value)
 Sets the quality. More...
 
- Public Member Functions inherited from fm.liveswitch.AudioEncoder
void addOnBitrateChange (fm.liveswitch.IAction0 value)
 Adds a handler that is raised when the bitrate changes. More...
 
 AudioEncoder (fm.liveswitch.AudioFormat inputFormat, fm.liveswitch.AudioFormat outputFormat)
 Initializes a new instance of the fm.liveswitch.AudioEncoder class. More...
 
int getBitrate ()
 Gets the current bitrate, in kbps. More...
 
long getFramesEncoded ()
 Gets the number of encoded frames. More...
 
int getMaxBitrate ()
 Gets the maximum bitrate, in kbps. More...
 
int getMaxCodecBitrate ()
 Gets the maximum possible codec bitrate, in kbps. More...
 
int getMaxOutputBitrate ()
 Gets the maximum output bitrate, in kbps. More...
 
int getMinBitrate ()
 Gets the minimum bitrate, in kbps. More...
 
int getMinCodecBitrate ()
 Gets the minimum possible codec bitrate, in kbps. More...
 
int getMinOutputBitrate ()
 Gets the minimum output bitrate, in kbps. More...
 
boolean getStaticOutputBitrate ()
 Gets whether fm.liveswitch.AudioEncoder#getMinOutputBitrate and fm.liveswitch.AudioEncoder#getMaxOutputBitrate should return fm.liveswitch.AudioEncoder#getMinCodecBitrate and fm.liveswitch.AudioEncoder#getMaxCodecBitrate, respectively, or response to changes in fm.liveswitch.AudioEncoder#getMinBitrate and fm.liveswitch.AudioEncoder#getMaxBitrate. More...
 
int getTargetBitrate ()
 Gets the target bitrate, in kbps. More...
 
int getTargetOutputBitrate ()
 Gets the target output bitrate, in kbps. More...
 
void removeOnBitrateChange (fm.liveswitch.IAction0 value)
 Removes a handler that is raised when the bitrate changes. More...
 
void setMaxBitrate (int value)
 Sets the maximum bitrate, in kbps. More...
 
void setMinBitrate (int value)
 Sets the minimum bitrate, in kbps. More...
 
void setStaticOutputBitrate (boolean value)
 Sets whether fm.liveswitch.AudioEncoder#getMinOutputBitrate and fm.liveswitch.AudioEncoder#getMaxOutputBitrate should return fm.liveswitch.AudioEncoder#getMinCodecBitrate and fm.liveswitch.AudioEncoder#getMaxCodecBitrate, respectively, or response to changes in fm.liveswitch.AudioEncoder#getMinBitrate and fm.liveswitch.AudioEncoder#getMaxBitrate. More...
 
void setTargetBitrate (int value)
 Sets the target bitrate, in kbps. More...
 
- Public Member Functions inherited from fm.liveswitch.AudioPipe
 AudioPipe (fm.liveswitch.AudioFormat inputFormat, fm.liveswitch.AudioFormat outputFormat)
 Initializes a new instance of the fm.liveswitch.AudioPipe class. More...
 
 AudioPipe (fm.liveswitch.AudioFormat outputFormat)
 Initializes a new instance of the fm.liveswitch.AudioPipe class. More...
 
fm.liveswitch.AudioConfig getConfig ()
 Gets the output configuration. More...
 
double getGain ()
 Gets a value indicating the gain (input amplification) of this sink. More...
 
fm.liveswitch.AudioConfig getInputConfig ()
 Gets the input configuration. More...
 
fm.liveswitch.AudioConfig getOutputConfig ()
 Gets the output configuration. More...
 
double getVolume ()
 Gets a value indicating the volume (output resistance) of this source. More...
 
boolean processFrame (fm.liveswitch.AudioFrame frame)
 Processes a frame. More...
 
void setGain (double value)
 Sets a value indicating the gain (input amplification) of this sink. More...
 
void setVolume (double value)
 Sets a value indicating the volume (output resistance) of this source. More...
 
- Public Member Functions inherited from fm.liveswitch.Dynamic
java.util.HashMap< String, Object > getDynamicProperties ()
 Gets all dynamic properties on this instance. More...
 
Object getDynamicValue (String key)
 Gets a property value from the local cache. More...
 
void setDynamicValue (String key, Object value)
 Sets a property value in the local cache. More...
 
boolean unsetDynamicValue (String key)
 Removes a property value from the local cache. More...
 
- Public Member Functions inherited from fm.liveswitch.IElement
abstract String getExternalId ()
 Gets the external identifier. More...
 
abstract String getId ()
 Gets the identifier. More...
 
abstract String getPipelineJson ()
 Gets the pipeline JSON with this as the central point. More...
 
abstract void setExternalId (String value)
 Sets the external identifier. More...
 
- Public Member Functions inherited from fm.liveswitch.IMediaElement
abstract boolean destroy ()
 Destroys this instance. More...
 
abstract boolean getDeactivated ()
 Gets a value indicating whether this instance is deactivated. More...
 
abstract boolean getDisabled ()
 Gets a value indicating whether this instance is disabled. More...
 
abstract boolean getMuted ()
 Gets a value indicating whether this instance is muted. More...
 
abstract boolean getPaused ()
 Gets a value indicating whether this instance is paused. More...
 
abstract boolean getPersistent ()
 Gets a value indicating whether this instance is persistent. More...
 
abstract void setDeactivated (boolean value)
 Sets a value indicating whether this instance is deactivated. More...
 
abstract void setMuted (boolean value)
 Sets a value indicating whether this instance is muted. More...
 

Protected Member Functions

void doDestroy ()
 Destroys this instance. More...
 
void doProcessControlFrames (fm.liveswitch.MediaControlFrame[] controlFrames)
 Processes the control frames. More...
 
void doProcessFrame (fm.liveswitch.AudioFrame frame, fm.liveswitch.AudioBuffer inputBuffer)
 Processes a frame. More...
 
fm.liveswitch.Error doProcessSdpMediaDescription (fm.liveswitch.sdp.MediaDescription mediaDescription, boolean isOffer, boolean isLocalDescription)
 Processes a SDP media description. More...
 
- Protected Member Functions inherited from fm.liveswitch.AudioEncoder
void doProcessTrackStatsFromOutput (fm.liveswitch.MediaTrackStats trackStats)
 Processes track stats from an output. More...
 
boolean getCanChangeBitrate ()
 Gets whether this pipe can change the output bitrate. More...
 
void raiseFrame (fm.liveswitch.AudioFrame frame)
 Raises the frame. More...
 
void setBitrate (int value)
 Sets the current bitrate, in kbps. More...
 
void setMaxOutputBitrate (int value)
 Sets the maximum output bitrate, in kbps. More...
 
void setMinOutputBitrate (int value)
 Sets the minimum output bitrate, in kbps. More...
 
void setTargetOutputBitrate (int value)
 Sets the target output bitrate, in kbps. More...
 
- Protected Member Functions inherited from fm.liveswitch.AudioPipe
fm.liveswitch.AudioFrame createFrame (fm.liveswitch.AudioBuffer buffer)
 Creates a frame. More...
 
fm.liveswitch.IAudioInputCollection createInputCollection (fm.liveswitch.IAudioOutput output)
 Creates an input collection. More...
 
fm.liveswitch.IAudioOutputCollection createOutputCollection (fm.liveswitch.IAudioInput input)
 Creates an output collection. More...
 
- Protected Member Functions inherited from fm.liveswitch.Dynamic
 Dynamic ()
 
- Protected Member Functions inherited from fm.liveswitch.Serializable
boolean getIsDirty ()
 Gets a value indicating whether this instance is dirty. More...
 
 Serializable ()
 Initializes a new instance of the fm.liveswitch.Serializable class. More...
 
void setIsDirty (boolean value)
 Sets a value indicating whether this instance is dirty. More...
 

Detailed Description

A libopus-based encoder.

Constructor & Destructor Documentation

◆ Encoder() [1/3]

fm.liveswitch.opus.Encoder.Encoder ( )

Initializes a new instance of the fm.liveswitch.opus.Encoder class.

◆ Encoder() [2/3]

fm.liveswitch.opus.Encoder.Encoder ( fm.liveswitch.AudioConfig  config)

Initializes a new instance of the fm.liveswitch.opus.Encoder class.

Parameters
configThe configuration.

◆ Encoder() [3/3]

fm.liveswitch.opus.Encoder.Encoder ( fm.liveswitch.IAudioOutput  input)

Initializes a new instance of the fm.liveswitch.opus.Encoder class.

Parameters
inputThe input.

Member Function Documentation

◆ doDestroy()

void fm.liveswitch.opus.Encoder.doDestroy ( )
protected

Destroys this instance.

◆ doProcessControlFrames()

void fm.liveswitch.opus.Encoder.doProcessControlFrames ( fm.liveswitch.MediaControlFrame[]  controlFrames)
protected

Processes the control frames.

Parameters
controlFramesThe control frames.

◆ doProcessFrame()

void fm.liveswitch.opus.Encoder.doProcessFrame ( fm.liveswitch.AudioFrame  frame,
fm.liveswitch.AudioBuffer  inputBuffer 
)
protected

Processes a frame.

Parameters
frameThe frame.
inputBufferThe input buffer.

◆ doProcessSdpMediaDescription()

fm.liveswitch.Error fm.liveswitch.opus.Encoder.doProcessSdpMediaDescription ( fm.liveswitch.sdp.MediaDescription  mediaDescription,
boolean  isOffer,
boolean  isLocalDescription 
)
protected

Processes a SDP media description.

Parameters
mediaDescriptionThe media description.
isOfferif set to
true
[is offer].
isLocalDescriptionif set to
true
[is local description].

◆ getCodecConfig()

fm.liveswitch.opus.EncoderConfig fm.liveswitch.opus.Encoder.getCodecConfig ( )

Gets a copy of the encoder codec's config.

◆ getDisableFec()

boolean fm.liveswitch.opus.Encoder.getDisableFec ( )

Gets a value indicating whether FEC is disabled.

◆ getLabel()

String fm.liveswitch.opus.Encoder.getLabel ( )

Gets a label that identifies this class.

Implements fm.liveswitch.IMediaElement.

◆ getPercentLossToTriggerFEC()

int fm.liveswitch.opus.Encoder.getPercentLossToTriggerFEC ( )

Gets the loss percentage (0-100) before forward error correction (FEC) is activated (only if supported by the remote peer).

Affects encoded data only.

◆ getQuality()

double fm.liveswitch.opus.Encoder.getQuality ( )

Gets the quality.

◆ setCodecConfig()

int fm.liveswitch.opus.Encoder.setCodecConfig ( fm.liveswitch.opus.EncoderConfig  config)

Sets the encoder configuration.

Returns
0 on success, non-zero on failure.

◆ setDisableFec()

void fm.liveswitch.opus.Encoder.setDisableFec ( boolean  value)

Sets a value indicating whether FEC is disabled.

◆ setPercentLossToTriggerFEC()

void fm.liveswitch.opus.Encoder.setPercentLossToTriggerFEC ( int  value)

Sets the loss percentage (0-100) before forward error correction (FEC) is activated (only if supported by the remote peer).

Affects encoded data only.

◆ setQuality()

void fm.liveswitch.opus.Encoder.setQuality ( double  value)

Sets the quality.