Skip to main content
Version: 2.x

Class MediaEncoder

Odin Capture Media

Assembly: cs.temp.dll.dll
Declaration
public class MediaEncoder : IMedia, IDisposable

Implements:
Odin.IDisposable

Properties

Id

Media id

Declaration
public ushort Id { get; }

MediaProperties

Arbitrary media data

Declaration
public MediaRpcProperties MediaProperties { get; }

Samplerate

Input samplerate

Declaration
public uint Samplerate { get; }

Stereo

Input channel flag

Declaration
public bool Stereo { get; }

Pipeline

Odin effect pipeline

Declaration
public MediaPipeline Pipeline { get; set; }

GuardSilence

On true OdinNative.Wrapper.MediaEncoder.Push(System.Single[])

isSilent = true
will not push data to the native encoder

Declaration
public bool GuardSilence { get; set; }

Parent

Default value

null
indicates root or not set

Declaration
public IPeer Parent { get; set; }

Methods

Create(ushort, uint, bool)

Create a new dangling input media.

Declaration
public static MediaEncoder Create(ushort mediaId, uint samplerate, bool stereo)
Returns

OdinNative.Wrapper.MediaEncoder: input media

Parameters
TypeNameDescription
System.UInt16mediaIdinput media id
System.UInt32sampleratesamplerate
System.Booleanstereostereo flag

GetPipeline()

Get native effect pipeline

Declaration
public MediaPipeline GetPipeline()
Returns

OdinNative.Wrapper.MediaPipeline: managed effect pipeline### PopAll(ref ConcurrentStack<byte[]>) Pop all audio datagrams into the stack

Declaration
public bool PopAll(ref ConcurrentStack<byte[]> datagrams)
Returns

System.Boolean: true on success or false

Parameters
TypeNameDescription
Odin.ConcurrentStack<System.Byte[]>datagramsdatagram stack

Pop(out byte[])

Pop one datagram from the media

Declaration
public OdinError Pop(out byte[] datagram)
Returns

Odin.OdinError: OdinNative.Core.Imports.NativeBindings.OdinError.ODIN_ERROR_SUCCESS/OdinNative.Core.Imports.NativeBindings.OdinError.ODIN_ERROR_NO_DATA or error

Parameters
TypeName
System.Byte[]datagram

Push(float[])

Push samples to the media

Declaration
public OdinError Push(float[] samples)
Returns

Odin.OdinError: OdinNative.Core.Imports.NativeBindings.OdinError.ODIN_ERROR_SUCCESS or error

Parameters
TypeNameDescription
System.Single[]samplesaudio samples

Dispose(bool)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
TypeName
System.Booleandisposing

Dispose()

Free native media encoder

Declaration
public void Dispose()

Implements

  • Odin.IDisposable