Skip to main content
Version: 2.x

Class PeerEntity

Client/Remote peer

Declaration
public class PeerEntity : IPeer, IDisposable

Implements:
OdinNative.Wrapper.IPeer, System.IDisposable

Properties

Id

Peer id

Declaration
public uint Id { get; }

UserId

Peers user id

Declaration
public string UserId { get; }

UserData

Peer userdata

Declaration
public IUserData UserData { get; }

Medias

Peer output medias

Declaration
public ConcurrentDictionary<ulong, MediaDecoder> Medias { get; }

Parent

Default value null indicates root or not set

Declaration
public IRoom Parent { get; set; }

Tags

Peer tags

Declaration
public List<string> Tags { get; }

AudioParameters

Declaration
protected AudioParametersObject AudioParameters { get; set; }

VideoParameters

Declaration
protected VideoParametersObject VideoParameters { get; set; }

Encoder

Declaration
public MediaEncoder Encoder { get; }

Decoder

Declaration
public MediaDecoder Decoder { get; }

Methods

GetBasePeer()

Get the underlying OdinNative.Wrapper.PeerEntity

Declaration
public PeerEntity GetBasePeer()
Returns

OdinNative.Wrapper.PeerEntity: native wrapper peer

GetRoomApi()

Get the base Room object

Declaration
public Room GetRoomApi()
Returns

OdinNative.Wrapper.Room.Room: Room if this.Parent is set

GetDecoder(ulong, out MediaDecoder)

Get a output media by id.

Declaration
public bool GetDecoder(ulong mediaId, out MediaDecoder decoder)
Returns

System.Boolean: true on found or false

Parameters
TypeNameDescription
System.UInt64mediaIddecoder id
OdinNative.Wrapper.MediaDecoderdecoderoutput media

GetOrCreateDecoder(ulong, uint, bool, out MediaDecoder)

Get a output media by id. If the decoder is not found create a new one that will be added OdinNative.Wrapper.PeerEntity.Medias

Declaration
public bool GetOrCreateDecoder(ulong mediaId, uint samplerate, bool stereo, out MediaDecoder decoder)
Returns

System.Boolean: true on success or false

Parameters
TypeNameDescription
System.UInt64mediaIddecoder id
System.UInt32sampleratesamplerate
System.Booleanstereostereo flag
OdinNative.Wrapper.MediaDecoderdecoderoutput media

CreateDecoder(uint, bool)

Create a new output media that will be added to OdinNative.Wrapper.PeerEntity.Medias

Declaration
public MediaDecoder CreateDecoder(uint samplerate, bool stereo)
Returns

OdinNative.Wrapper.MediaDecoder: output media

Parameters
TypeNameDescription
System.UInt32sampleratesamplerate
System.Booleanstereostereo flag

RemoveDecoder(ulong, out MediaDecoder)

Remove the output media from OdinNative.Wrapper.PeerEntity.Medias

Declaration
public bool RemoveDecoder(ulong mediaId, out MediaDecoder decoder)
Returns

System.Boolean: true if removed or false

Parameters
TypeNameDescription
System.UInt64mediaIddecoder id
OdinNative.Wrapper.MediaDecoderdecoderoutput media that was removed

ToString()

Debug

Declaration
public override string ToString()
Returns

System.String: info

Dispose(bool)

Free peer with all associated medias

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

~PeerEntity()

Finalizer

Declaration
protected ~PeerEntity()

Dispose()

Free peer with all associated medias

Declaration
public void Dispose()

Implements