Class Encoder
A libopus-based encoder.
Inheritance
Implements
Inherited Members
Namespace: FM.LiveSwitch.Opus
Assembly: FM.LiveSwitch.Opus.dll
Syntax
public class Encoder : AudioEncoder, IAudioInput, IMediaInput<IAudioOutput, IAudioInput, AudioFrame, AudioBuffer, AudioBufferCollection, AudioFormat>, IInput<IAudioOutput, IAudioInput, AudioFrame, AudioBuffer, AudioBufferCollection, AudioFormat>, IAudioOutput, IMediaOutput<IAudioOutput, IAudioInput, AudioFrame, AudioBuffer, AudioBufferCollection, AudioFormat>, IOutput<IAudioOutput, IAudioInput, AudioFrame, AudioBuffer, AudioBufferCollection, AudioFormat>, IAudioElement, IMediaElement, IElement
Constructors
Encoder()
Initializes a new instance of the Encoder class.
Declaration
public Encoder()
Encoder(AudioConfig)
Initializes a new instance of the Encoder class.
Declaration
public Encoder(AudioConfig config)
Parameters
Type | Name | Description |
---|---|---|
AudioConfig | config | The configuration. |
Encoder(IAudioOutput)
Initializes a new instance of the Encoder class.
Declaration
public Encoder(IAudioOutput input)
Parameters
Type | Name | Description |
---|---|---|
IAudioOutput | input | The input. |
Properties
CodecConfig
Gets a copy of the encoder codec's config.
Declaration
public EncoderConfig CodecConfig { get; }
Property Value
Type | Description |
---|---|
EncoderConfig |
DisableFec
Gets or sets a value indicating whether FEC is disabled.
Declaration
public bool DisableFec { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Label
Gets a label that identifies this class.
Declaration
public override string Label { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
PercentLossToTriggerFEC
Gets or sets the loss percentage (0-100) before forward error correction (FEC) is activated (only if supported by the remote peer). Affects encoded data only.
Declaration
public int PercentLossToTriggerFEC { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Quality
Gets or sets the quality.
Declaration
public double Quality { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
DoDestroy()
Destroys this instance.
Declaration
protected override void DoDestroy()
Overrides
DoProcessControlFrames(MediaControlFrame[])
Processes the control frames.
Declaration
protected override void DoProcessControlFrames(MediaControlFrame[] controlFrames)
Parameters
Type | Name | Description |
---|---|---|
MediaControlFrame[] | controlFrames | The control frames. |
Overrides
DoProcessFrame(AudioFrame, AudioBuffer)
Processes a frame.
Declaration
protected override void DoProcessFrame(AudioFrame frame, AudioBuffer inputBuffer)
Parameters
Type | Name | Description |
---|---|---|
AudioFrame | frame | The frame. |
AudioBuffer | inputBuffer | The input buffer. |
Overrides
DoProcessSdpMediaDescription(MediaDescription, Boolean, Boolean)
Processes a SDP media description.
Declaration
protected override Error DoProcessSdpMediaDescription(MediaDescription mediaDescription, bool isOffer, bool isLocalDescription)
Parameters
Type | Name | Description |
---|---|---|
MediaDescription | mediaDescription | The media description. |
System.Boolean | isOffer | if set to |
System.Boolean | isLocalDescription | if set to |
Returns
Type | Description |
---|---|
Error |
Overrides
SetCodecConfig(EncoderConfig)
Sets the encoder configuration.
Declaration
public int SetCodecConfig(EncoderConfig config)
Parameters
Type | Name | Description |
---|---|---|
EncoderConfig | config |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success, non-zero on failure. |