Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Develop #344

Merged
merged 6 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DolbyIO/DolbyIO.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.2.0-beta.4",
"VersionName": "1.2.0-beta.5",
"FriendlyName": "Dolby.io Virtual Worlds",
"Description": "Plugin integrating Dolby.io Communications.",
"Category": "Communications",
Expand Down
17 changes: 16 additions & 1 deletion DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

#include "Engine/GameInstance.h"
#include "Engine/World.h"
#include "GenericPlatform/GenericPlatformProperties.h"
#include "Interfaces/IPluginManager.h"
#include "Misc/EngineVersion.h"
#include "Misc/Paths.h"
#include "TimerManager.h"

Expand All @@ -37,6 +40,13 @@ void UDolbyIOSubsystem::Initialize(FSubsystemCollectionBase& Collection)
BroadcastEvent(OnTokenNeeded);
}

void UDolbyIOSubsystem::Deinitialize()
{
Sdk.Reset(); // make sure Sdk is dead so it doesn't call handle_frame on VideoSink during game destruction

Super::Deinitialize();
}

void UDolbyIOSubsystem::SetLogSettings(EDolbyIOLogLevel SdkLogLevel, EDolbyIOLogLevel MediaLogLevel,
EDolbyIOLogLevel DvcLogLevel)
{
Expand Down Expand Up @@ -105,7 +115,12 @@ void UDolbyIOSubsystem::Initialize(const FString& Token)
#define DLB_REGISTER_HANDLER(Service, Event) \
[this](event_handler_id) { return Sdk->Service().add_event_handler([this](const Event& Event) { Handle(Event); }); }

Sdk->register_component_version("unreal-sdk", "1.2.0-beta.4")
const FString ComponentName = "unreal-sdk";
const FString ComponentVersion = *IPluginManager::Get().FindPlugin("DolbyIO")->GetDescriptor().VersionName +
FString{"_UE"} + FEngineVersion::Current().ToString(EVersionComponent::Minor) +
"_" + FPlatformProperties::IniPlatformName();
DLB_UE_LOG("Registering component %s %s", *ComponentName, *ComponentVersion);
Sdk->register_component_version(ToStdString(ComponentName), ToStdString(ComponentVersion))
.then(
[this](sdk::component_data)
{
Expand Down
1 change: 1 addition & 0 deletions DolbyIO/Source/Public/DolbyIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ class DOLBYIO_API UDolbyIOSubsystem : public UGameInstanceSubsystem

private:
void Initialize(FSubsystemCollectionBase&) override;
void Deinitialize() override;

bool CanConnect(const FDolbyIOOnErrorDelegate&) const;
bool IsConnected() const;
Expand Down