UOdinSubsystem
A subsystem for managing rooms, encoders, and decoders in Odin.
Provides global access to Odin-related operations including room registration, audio data processing, and encoder/decoder management. This class extends UEngineSubsystem to tie its lifecycle to the engine's initialization and deinitialization.
- Header:
#include "OdinSubsystem.h" - Module:
Odin - Inherits from:
UEngineSubsystem - Blueprint: Reflected (UCLASS)
Overview
Functions
| Name | Description |
|---|---|
Get | |
GlobalIsRoomValid | |
OnWorldBeginTearDown | Rooms owned by a world that is torn down would be garbage collected without ever leaving gracefully, and their peer left events would reach nobody. |
LinkEncoder | |
UnlinkEncoder | |
PushAudioToEncoder | |
GetRoomsForEncoder | |
RegisterEncoder | |
DeregisterEncoder | |
GetEncoderByHandle | Resolves the owning encoder UObject for a native handle. |
GetEncoderRegistrationId | Registration id of the handle's current registry entry, 0 if not registered. |
GetEncoderByRegistration | Resolves the owning encoder UObject only if the handle is still registered under the given registration id, so deferred events for a freed handle cannot reach a new encoder that happens to reuse the same handle value. |
RegisterRoom | |
DeregisterRoom | |
SwapRoomHandle | |
GetRoomByHandle | |
GetDecoderByHandle | |
GetRoomsByName | |
IsRoomRegistered | |
LinkDecoderToPeer | |
RegisterDecoderObject | |
DeregisterDecoder | |
GetDecoderHandlesFor | |
GetDecodersFor | |
GetAllDecoderHandlesByPeer | |
GetAllDecodersByPeer | |
HandleDatagram |
Functions
Get
Static
Returns UOdinSubsystem*
GlobalIsRoomValid
Static
| Parameter | Type | Description |
|---|---|---|
Handle | const OdinRoom* |
Returns bool
OnWorldBeginTearDown
Rooms owned by a world that is torn down would be garbage collected without ever leaving gracefully, and their peer left events would reach nobody. Reports the announced peers of every registered room of that world as left while its actors are still alive and starts a graceful close, so our own peer leaves the server before the world goes away.
| Parameter | Type | Description |
|---|---|---|
World | UWorld* |
LinkEncoder
| Parameter | Type | Description |
|---|---|---|
Encoder | TWeakObjectPtr<UOdinEncoder> | |
TargetRoom | TWeakObjectPtr<UOdinRoom> |
UnlinkEncoder
Overload 1
| Parameter | Type | Description |
|---|---|---|
Encoder | TWeakObjectPtr<UOdinEncoder> |
Overload 2
| Parameter | Type | Description |
|---|---|---|
Encoder | OdinEncoder* |
PushAudioToEncoder
| Parameter | Type | Description |
|---|---|---|
Encoder | OdinEncoder* | |
Audio | TArray<float>&& |
GetRoomsForEncoder
Const
| Parameter | Type | Description |
|---|---|---|
Encoder | OdinEncoder* |
Returns TArray<TWeakObjectPtr<UOdinRoom>>
RegisterEncoder
| Parameter | Type | Description |
|---|---|---|
Handle | OdinEncoder* | |
Encoder | UOdinEncoder* |
DeregisterEncoder
| Parameter | Type | Description |
|---|---|---|
Handle | OdinEncoder* |
GetEncoderByHandle
Const
Resolves the owning encoder UObject for a native handle. Used by native callbacks that may only carry the handle across threads and resolve the UObject on the game thread.
| Parameter | Type | Description |
|---|---|---|
Handle | OdinEncoder* |
Returns TWeakObjectPtr<UOdinEncoder>
GetEncoderRegistrationId
Const
Registration id of the handle's current registry entry, 0 if not registered. Safe to call from any thread; only registry data is touched, no UObjects.
| Parameter | Type | Description |
|---|---|---|
Handle | OdinEncoder* |
Returns uint64
GetEncoderByRegistration
Const
Resolves the owning encoder UObject only if the handle is still registered under the given registration id, so deferred events for a freed handle cannot reach a new encoder that happens to reuse the same handle value.
| Parameter | Type | Description |
|---|---|---|
Handle | OdinEncoder* | |
RegistrationId | uint64 |
Returns TWeakObjectPtr<UOdinEncoder>
RegisterRoom
| Parameter | Type | Description |
|---|---|---|
Handle | OdinRoom* | |
Room | UOdinRoom* |
DeregisterRoom
| Parameter | Type | Description |
|---|---|---|
Handle | OdinRoom* |
SwapRoomHandle
| Parameter | Type | Description |
|---|---|---|
OldHandle | OdinRoom* | |
NewHandle | OdinRoom* |
GetRoomByHandle
Const
| Parameter | Type | Description |
|---|---|---|
Handle | OdinRoom* |
Returns TWeakObjectPtr<UOdinRoom>
GetDecoderByHandle
Const
| Parameter | Type | Description |
|---|---|---|
Handle | OdinDecoder* |
Returns TWeakObjectPtr<UOdinDecoder>
GetRoomsByName
Const
| Parameter | Type | Description |
|---|---|---|
RoomId | const FString& |
Returns TArray<TWeakObjectPtr<UOdinRoom>>
IsRoomRegistered
Const
| Parameter | Type | Description |
|---|---|---|
Handle | const OdinRoom* |
Returns bool
LinkDecoderToPeer
| Parameter | Type | Description |
|---|---|---|
Decoder | const UOdinDecoder* | |
TargetRoom | OdinRoom* | |
PeerId | uint32 |
RegisterDecoderObject
| Parameter | Type | Description |
|---|---|---|
Decoder | const TWeakObjectPtr<UOdinDecoder> |
DeregisterDecoder
Overload 1
| Parameter | Type | Description |
|---|---|---|
OdinDecoder | const UOdinDecoder* |
Overload 2
| Parameter | Type | Description |
|---|---|---|
Handle | const OdinDecoder* |
GetDecoderHandlesFor
Overload 1
Const
| Parameter | Type | Description |
|---|---|---|
TargetRoom | OdinRoom* | |
PeerId | uint32 |
Returns TArray<OdinDecoder*>
Overload 2
Const
| Parameter | Type | Description |
|---|---|---|
TargetRoom | OdinRoom* | |
PeerId | uint32 | |
ChannelMask | uint64 |
Returns TArray<OdinDecoder*>
GetDecodersFor
Overload 1
Const
| Parameter | Type | Description |
|---|---|---|
TargetRoom | OdinRoom* | |
PeerId | uint32 |
Returns TArray<UOdinDecoder*>
Overload 2
Const
| Parameter | Type | Description |
|---|---|---|
TargetRoom | OdinRoom* | |
PeerId | uint32 | |
ChannelMask | uint64 |
Returns TArray<UOdinDecoder*>
GetAllDecoderHandlesByPeer
Const
| Parameter | Type | Description |
|---|---|---|
PeerId | uint32 |
Returns TArray<OdinDecoder*>
GetAllDecodersByPeer
Const
| Parameter | Type | Description |
|---|---|---|
PeerId | uint32 |
Returns TArray<UOdinDecoder*>
HandleDatagram
| Parameter | Type | Description |
|---|---|---|
RoomHandle | OdinRoom* | |
PeerId | uint32 | |
ChannelMask | uint64 | |
SsrcId | uint32 | |
Datagram | TArray<uint8>&& |