Skip to main content
Version: 2.x

Class PeerEntity

Client/Remote peer

Assembly: cs.temp.dll.dll
Declaration
public class PeerEntity : IPeer, IDisposable

Implements:
OdinNative.Wrapper.IPeer, Odin.IDisposable

Properties

Id

Peer id

Declaration
public ulong 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<ushort, MediaDecoder> Medias { get; }

Parent

Default value

null
indicates root or not set

Declaration
public IRoom Parent { get; set; }

Methods

GetBasePeer()

Declaration
public PeerEntity GetBasePeer()
Returns

OdinNative.Wrapper.PeerEntity

GetRoomApi()

Get the base Room object

Declaration
public Room GetRoomApi()
Returns

OdinNative.Wrapper.Room.Room: Room if this.Parent is set### GetDecoder(ushort, out MediaDecoder) Get a output media by id.

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

System.Boolean: true on found or false

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

GetOrCreateDecoder(ushort, 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(ushort mediaId, uint samplerate, bool stereo, out MediaDecoder decoder)
Returns

System.Boolean: true on success or false

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

CreateDecoder(ushort, uint, bool)

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

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

OdinNative.Wrapper.MediaDecoder: output media

Parameters
TypeNameDescription
System.UInt16mediaIddecoder id
System.UInt32sampleratesamplerate
System.Booleanstereostereo flag

RemoveDecoder(ushort, out MediaDecoder)

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

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

System.Boolean: true if removed or false

Parameters
TypeNameDescription
System.UInt16mediaIddecoder 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()

Default deconstructor

Declaration
protected ~PeerEntity()

Dispose()

Free peer with all associated medias

Declaration
public void Dispose()

Implements