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

Commit

Permalink
Merge pull request #362 from DolbyIO/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Kuba Audykowicz authored Aug 15, 2023
2 parents 8d6d3a2 + e9c7cc8 commit 53dcb0f
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:

env:
CPP_SDK_TAG: "2.5.5"
CPP_SDK_TAG: "2.6.0-beta.2"
CPP_SDK_DESTINATION: "DolbyIO"
CPP_SDK_URL: "https://github.com/DolbyIO/comms-sdk-cpp/releases/download"
UNREAL_PLUGIN_OUTPUT: "Build/DolbyIO"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
packages: write

env:
CPP_SDK_TAG: "2.5.5"
CPP_SDK_TAG: "2.6.0-beta.2"
CPP_SDK_DESTINATION: "DolbyIO"
CPP_SDK_URL: "https://github.com/DolbyIO/comms-sdk-cpp/releases/download"
UNREAL_PLUGIN_OUTPUT: "Build/DolbyIO"
Expand Down
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.5",
"VersionName": "1.2.0-beta.7",
"FriendlyName": "Dolby.io Virtual Worlds",
"Description": "Plugin integrating Dolby.io Communications.",
"Category": "Communications",
Expand Down
26 changes: 25 additions & 1 deletion DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,31 @@ void UDolbyIOSubsystem::Deinitialize()
Super::Deinitialize();
}

namespace
{
class FSdkLogCallback : public logger_sink_callback
{
public:
void log(log_level Level, std::string_view Message) const override
{
#define DLB_UE_LOG_SDK_BASE(Verbosity) \
DLB_UE_LOG_BASE(Verbosity, "%s", *ToFText(std::string{Message}).ToString()); \
return;
switch (Level)
{
case log_level::ERROR:
DLB_UE_LOG_SDK_BASE(Error);
case log_level::WARNING:
DLB_UE_LOG_SDK_BASE(Warning);
default:
DLB_UE_LOG_SDK_BASE(Log);
}
}
};
}

void UDolbyIOSubsystem::SetLogSettings(EDolbyIOLogLevel SdkLogLevel, EDolbyIOLogLevel MediaLogLevel,
EDolbyIOLogLevel DvcLogLevel)
EDolbyIOLogLevel DvcLogLevel, bool bLogToConsole)
{
const FString& LogDir = FPaths::ProjectLogDir();
DLB_UE_LOG("Logs will be saved in directory %s", *LogDir);
Expand All @@ -58,6 +81,7 @@ void UDolbyIOSubsystem::SetLogSettings(EDolbyIOLogLevel SdkLogLevel, EDolbyIOLog
LogSettings.dvc_log_level = ToSdkLogLevel(DvcLogLevel);
LogSettings.log_directory = ToStdString(LogDir);
LogSettings.suppress_stdout_logs = true;
LogSettings.log_callback = bLogToConsole ? std::make_shared<FSdkLogCallback>() : nullptr;
try
{
sdk::set_log_settings(LogSettings);
Expand Down
10 changes: 5 additions & 5 deletions DolbyIO/Source/Private/Subsystem/DolbyIOScreenshare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ void UDolbyIOSubsystem::GetScreenshareSources()
Sdk->device_management()
.get_screen_share_sources()
.then(
[this](const std::vector<screen_share_source>& ScreenShareSource)
[this](const std::vector<screen_share_source>& Sources)
{
TArray<FDolbyIOScreenshareSource> Sources;
for (const screen_share_source& Source : ScreenShareSource)
TArray<FDolbyIOScreenshareSource> Ret;
for (const screen_share_source& Source : Sources)
{
Sources.Add(ToFDolbyIOScreenshareSource(Source));
Ret.Add(ToFDolbyIOScreenshareSource(Source));
}
BroadcastEvent(OnScreenshareSourcesReceived, Sources);
BroadcastEvent(OnScreenshareSourcesReceived, Ret);
})
.on_error(DLB_ERROR_HANDLER(OnGetScreenshareSourcesError));
}
Expand Down
2 changes: 1 addition & 1 deletion DolbyIO/Source/Public/DolbyIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class DOLBYIO_API UDolbyIOSubsystem : public UGameInstanceSubsystem
UFUNCTION(BlueprintCallable, Category = "Dolby.io Comms")
void SetLogSettings(EDolbyIOLogLevel SdkLogLevel = EDolbyIOLogLevel::Info,
EDolbyIOLogLevel MediaLogLevel = EDolbyIOLogLevel::Info,
EDolbyIOLogLevel DvcLogLevel = EDolbyIOLogLevel::Info);
EDolbyIOLogLevel DvcLogLevel = EDolbyIOLogLevel::Info, bool bLogToConsole = false);
UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms")
FDolbyIOOnErrorDelegate OnSetLogSettingsError;

Expand Down
2 changes: 1 addition & 1 deletion DolbyIO/Source/Public/DolbyIOAuthentication.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DOLBYIO_API UDolbyIOGetTokenFromURL : public UBlueprintAsyncActionBase
*
* @param URL - The URL to use to obtain the token.
*/
UFUNCTION(BlueprintCallable, Category = "Dolby.io Demo",
UFUNCTION(BlueprintCallable, Category = "Dolby.io Comms",
Meta = (BlueprintInternalUseOnly = "true", DisplayName = "Dolby.io Get Token From URL"))
static UDolbyIOGetTokenFromURL* DolbyIOGetTokenFromURL(const FString& URL);

Expand Down
4 changes: 2 additions & 2 deletions DolbyIO/Source/Public/DolbyIOBlueprints.h
Original file line number Diff line number Diff line change
Expand Up @@ -1046,9 +1046,9 @@ class UDolbyIOBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
Meta = (WorldContext = "WorldContextObject", DisplayName = "Dolby.io Set Log Settings"))
static void SetLogSettings(const UObject* WorldContextObject, EDolbyIOLogLevel SdkLogLevel = EDolbyIOLogLevel::Info,
EDolbyIOLogLevel MediaLogLevel = EDolbyIOLogLevel::Info,
EDolbyIOLogLevel DvcLogLevel = EDolbyIOLogLevel::Info)
EDolbyIOLogLevel DvcLogLevel = EDolbyIOLogLevel::Info, bool bLogToConsole = false)
{
DLB_EXECUTE_SUBSYSTEM_METHOD(SetLogSettings, SdkLogLevel, MediaLogLevel, DvcLogLevel);
DLB_EXECUTE_SUBSYSTEM_METHOD(SetLogSettings, SdkLogLevel, MediaLogLevel, DvcLogLevel, bLogToConsole);
}

/** Sets the audio input device.
Expand Down
15 changes: 10 additions & 5 deletions docs/docs/blueprints/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,18 +482,23 @@ Calling this function even once disables the default behavior, which is to autom

## Dolby.io Set Log Settings

:::info 🚀 Beta
The **Log to Console** parameter is a part of the [Beta program](https://docs.dolby.io/communications-apis/docs/overview-beta-programs).
:::

Sets what to log in the Dolby.io C++ SDK. The logs will be saved to the default project log directory (likely Saved/Logs).

This function should be called before the first call to [Set Token](#dolbyio-set-token) if the user needs logs about the plugin's operation. Calling this function more than once has no effect.

![](../../static/img/generated/DolbyIOBlueprintFunctionLibrary/img/nd_img_SetLogSettings.png)

#### Inputs and outputs
| Name | Direction | Type | Default value | Description |
|---------------------|:----------|:--------------------------------------------------|:--------------|:---------------------------------|
| **Sdk Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for SDK logs. |
| **Media Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for Media Engine logs. |
| **Dvc Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for DVC logs. |
| Name | Direction | Type | Default value | Description |
|---------------------|:----------|:--------------------------------------------------|:--------------|:--------------------------------------------------------------------------|
| **Sdk Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for SDK logs. |
| **Media Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for Media Engine logs. |
| **Dvc Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for DVC logs. |
| **Log to Console** | Input | bool | false | Sets whether the C++ SDK logs should also be displayed in the Output Log. |

---

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 53dcb0f

Please sign in to comment.