Class MediaEncoder
Odin Capture Media
Implements:
OdinNative.Wrapper.Media.IMedia, System.IDisposable
Properties
Id
Media id
Samplerate
Input samplerate
Stereo
Input channel flag
IsAlive
Flag if the native encoder handle is still usable, e.g. false after the owning room was disposed
Pipeline
Odin effect pipeline
ChannelMask
Channels the encoder currently has a position for and therefore transmits on
Position
Last position set with OdinNative.Wrapper.MediaEncoder.SetPosition(OdinNative.Core.Utility.ChannelMask,OdinNative.Core.Imports.NativeBindings.OdinPosition)
AddtionalData
GuardSilence
Silence guard flag
Parent
Default value null indicates root or not set
Methods
Create(uint, uint, bool)
Create a new dangling input media.
Returns
OdinNative.Wrapper.MediaEncoder: input media
Parameters
| Type | Name | Description |
|---|---|---|
System.UInt32 | peerId | peer id |
System.UInt32 | samplerate | samplerate |
System.Boolean | stereo | stereo flag |
GetPipeline()
Get native effect pipeline
Returns
OdinNative.Wrapper.MediaPipeline: managed effect pipeline
SetPosition(ChannelMask, OdinPosition)
Set native position in channel
Returns
OdinNative.Core.Imports.NativeBindings.OdinPosition: 3d position
Parameters
| Type | Name | Description |
|---|---|---|
| OdinNative.Core.Utility.ChannelMask | mask | channels to set the position for |
| OdinNative.Core.Imports.NativeBindings.OdinPosition | position | 3d position |
ClearPosition(ChannelMask)
Clear native position in channel
Returns
System.Boolean: true on success or false
Parameters
| Type | Name | Description |
|---|---|---|
| OdinNative.Core.Utility.ChannelMask | mask | channels to clear the position of |
SetChannels(ChannelMask)
Set active native channels
Returns
OdinNative.Core.Utility.ChannelMask: channel mask
Parameters
| Type | Name |
|---|---|
| OdinNative.Core.Utility.ChannelMask | mask |
GetIsSilent()
This reflects the internal silence detection state of the encoder, which updates as audio is processed
Returns
System.Boolean: Returns whether the encoder is currently processing silence
PopAll(ref ConcurrentStack<byte[]>)
Pop all audio datagrams into the stack
Returns
System.Boolean: true on success or false
Parameters
| Type | Name | Description |
|---|---|---|
System.Collections.Concurrent.ConcurrentStack<System.Byte[]> | datagrams | datagram stack |
Pop(out byte[])
Pop one datagram from the media
Returns
OdinNative.Core.Imports.NativeBindings.OdinError: OdinNative.Core.Imports.NativeBindings.OdinError.ODIN_ERROR_SUCCESS/OdinNative.Core.Imports.NativeBindings.OdinError.ODIN_ERROR_NO_DATA as OK or error
Parameters
| Type | Name |
|---|---|
System.Byte[] | datagram |
Push(float[])
Push samples to the media
Returns
OdinNative.Core.Imports.NativeBindings.OdinError: OdinNative.Core.Imports.NativeBindings.OdinError.ODIN_ERROR_SUCCESS as OK or error
Parameters
| Type | Name | Description |
|---|---|---|
System.Single[] | samples | audio samples |
Dispose(bool)
Parameters
| Type | Name |
|---|---|
System.Boolean | disposing |
Dispose()
Free native media encoder
Implements
- OdinNative.Wrapper.Media.IMedia
System.IDisposable