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

Commit ba41451

Browse files
author
Kuba Audykowicz
authored
Merge pull request #409 from DolbyIO/develop
Develop
2 parents bf95173 + c7b444a commit ba41451

20 files changed

+213
-93
lines changed

.github/workflows/build.yml

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99
packages: write
1010

1111
env:
12-
PLUGIN_VERSION: "1.2.0-beta.11"
12+
PLUGIN_VERSION: "1.2.0"
1313
CPP_SDK_VERSION: "2.6.1"
1414
CPP_SDK_URL: "https://github.com/DolbyIO/comms-sdk-cpp/releases/download"
1515
PLUGIN_SOURCE_DIR: "DolbyIO"
@@ -209,3 +209,60 @@ jobs:
209209
working-directory: ${{ env.PLUGIN_BUILD_DIR }}
210210
run: |
211211
${{ github.workspace }}\\.github\\actions\\upload_assets\\upload_release_asset.ps1 -File DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip
212+
213+
214+
build-android:
215+
if: false
216+
strategy:
217+
fail-fast: false
218+
matrix:
219+
version: ["5.2"]
220+
runs-on: ["self-hosted", "X64", "macOS"]
221+
222+
env:
223+
BUILD_PLATFORM: 'android'
224+
225+
steps:
226+
- name: Check out code
227+
uses: actions/checkout@v3
228+
229+
- name: Download C++ SDK
230+
uses: ./.github/actions/download_cppsdk/bash
231+
with:
232+
tag: ${{ env.CPP_SDK_VERSION }}
233+
asset_suffix: "${{ env.BUILD_PLATFORM }}64.zip"
234+
235+
- name: Repackage AARs
236+
env:
237+
AAR_PATH_BASE: "${{ github.workspace }}/${{ env.PLUGIN_SOURCE_DIR }}/comms-sdk-android-cppsdk-"
238+
AAR_PATH: "${{ env.AAR_PATH_BASE }}${{ env.CPP_SDK_VERSION }}.aar"
239+
AAR_NO_PREFAB_PATH: "${{ env.AAR_PATH_BASE }}noprefab-${{ env.CPP_SDK_VERSION }}.aar"
240+
AAR_SHARED_PATH: "${{ env.AAR_PATH_BASE }}shared-${{ env.CPP_SDK_VERSION }}.aar"
241+
run: |
242+
./scripts/android.sh ${{ env.AAR_PATH }} ${{ env.AAR_NO_PREFAB_PATH }} ${{ env.AAR_SHARED_PATH }}
243+
244+
- name: Build plugin
245+
env:
246+
BUILD_COMMAND: "/Users/Shared/Epic\\ Games/UE_${{ matrix.version }}/Engine/Build/BatchFiles/RunUAT.sh"
247+
BUILD_ARGS_PLATFORM: "-TargetPlatforms=Android -NoHostPlatform"
248+
NDKROOT: "/Users/dolbyio/Library/Android/sdk/ndk/25.1.8937393"
249+
run: |
250+
${{ env.BUILD_COMMAND }} ${{ env.BUILD_ARGS_COMMON }} ${{ env.BUILD_ARGS_PLATFORM }}
251+
252+
- name: Zip plugin
253+
working-directory: Build
254+
run: |
255+
zip -rq DolbyIO/DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip DolbyIO/
256+
257+
- name: Upload artifact
258+
uses: actions/upload-artifact@v3
259+
with:
260+
name: DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}
261+
path: "${{ env.PLUGIN_BUILD_DIR }}/DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip"
262+
retention-days: ${{ env.RETENTION }}
263+
264+
- name: Release plugin 🎉
265+
if: startsWith(github.ref, 'refs/tags/')
266+
working-directory: ${{ env.PLUGIN_BUILD_DIR }}
267+
run: |
268+
${GITHUB_WORKSPACE}/.github/actions/upload_assets/upload_release_asset.sh DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[FilterPlugin]
2+
/sdk-release-android/...

DolbyIO/DolbyIO.uplugin

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"FileVersion": 3,
33
"Version": 1,
4-
"VersionName": "1.2.0-beta.11",
4+
"VersionName": "1.2.0",
55
"FriendlyName": "Dolby.io Virtual Worlds",
66
"Description": "Plugin integrating Dolby.io Communications.",
77
"Category": "Communications",
@@ -12,14 +12,14 @@
1212
"SupportURL": "https://github.com/DolbyIO/comms-sdk-unreal/issues",
1313
"EnabledByDefault": true,
1414
"CanContainContent": true,
15-
"IsBetaVersion": true,
15+
"IsBetaVersion": false,
1616
"Installed": false,
1717
"Modules": [
1818
{
1919
"Name": "DolbyIO",
2020
"Type": "Runtime",
2121
"LoadingPhase": "PreDefault",
22-
"WhitelistPlatforms": [ "Linux", "Mac", "Win64" ]
22+
"WhitelistPlatforms": [ "Android", "Linux", "Mac", "Win64" ]
2323
}
2424
]
2525
}

DolbyIO/Source/DolbyIO.Build.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public DolbyIO(ReadOnlyTargetRules Target) : base(Target)
2020
{
2121
ReleaseDir += "-ubuntu-20.04-clang10-libc++10";
2222
}
23+
else if (Target.Platform == UnrealTargetPlatform.Android)
24+
{
25+
ReleaseDir += "-android";
26+
}
2327
string SdkDir = Path.Combine("$(PluginDir)", ReleaseDir);
2428
PublicIncludePaths.Add(Path.Combine(SdkDir, "include"));
2529
string LibDir = Path.Combine(SdkDir, "lib");
@@ -97,5 +101,16 @@ public DolbyIO(ReadOnlyTargetRules Target) : base(Target)
97101
RuntimeDependencies.Add(Path.Combine(LibDir, "libcac_dvdnr.so"));
98102
RuntimeDependencies.Add(Path.Combine(LibDir, "model.dnr"));
99103
}
104+
else if (Target.Platform == UnrealTargetPlatform.Android)
105+
{
106+
LibDir = Path.Combine(SdkDir, "libs", "android.arm64-v8a");
107+
string[] Libs = new string[] { Path.Combine(LibDir, "libdolbyio_comms_media.so"),
108+
Path.Combine(LibDir, "libdolbyio_comms_sdk.so") };
109+
PublicAdditionalLibraries.AddRange(Libs);
110+
111+
AdditionalPropertiesForReceipt.Add(
112+
"AndroidPlugin",
113+
Path.Combine(Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath), "DolbyIO_UPL.xml"));
114+
}
100115
}
101116
}

DolbyIO/Source/DolbyIO_UPL.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root xmlns:android="http://schemas.android.com/apk/res/android">
3+
<init>
4+
<log text="DolbyIO plugin init"/>
5+
</init>
6+
7+
<baseBuildGradleAdditions>
8+
<insert>
9+
allprojects {
10+
repositories {
11+
flatDir {
12+
</insert>
13+
<insertValue value="dirs '$S(AbsPluginDir)/../sdk-release-android'"/>
14+
<insertNewline/>
15+
<insert>}}}</insert>
16+
</baseBuildGradleAdditions>
17+
18+
<buildGradleAdditions>
19+
<insert>
20+
dependencies {
21+
implementation name: 'comms-sdk-android-cppsdk-noprefab-2.7.0', ext: 'aar'
22+
implementation name: 'comms-sdk-android-cppsdk-shared-2.7.0', ext: 'aar'
23+
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.7.20'
24+
}
25+
android {
26+
packagingOptions {
27+
pickFirst 'assets/model.dnr'
28+
}
29+
}
30+
</insert>
31+
</buildGradleAdditions>
32+
33+
<soLoadLibrary>
34+
<loadLibrary
35+
name="dolbyio_comms_sdk_android_cppsdk" failmsg="Failed to load libdolbyio_comms_sdk_android_cppsdk.so" />
36+
</soLoadLibrary>
37+
38+
</root>

DolbyIO/Source/Private/Utils/DolbyIOConversions.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ namespace DolbyIO
160160
const dolbyio::comms::utils::participant_track_map::value_type& TrackMapItem)
161161
{
162162
FDolbyIOVideoTrack Ret;
163+
#if PLATFORM_ANDROID // SDK 2.7
164+
Ret.TrackID = ToFString(TrackMapItem.second.sdp_track_id);
165+
#else // SDK 2.6
163166
Ret.TrackID = ToFString(std::get<1>(TrackMapItem.second));
167+
#endif
164168
Ret.ParticipantID = ToFString(TrackMapItem.first);
165169
Ret.bIsScreenshare = false;
166170
return Ret;

DolbyIO/Source/Private/Utils/DolbyIOErrorHandler.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ namespace DolbyIO
2626

2727
void FErrorHandler::operator()(std::exception_ptr&& ExcPtr) const
2828
{
29+
#if PLATFORM_ANDROID
30+
HandleErrorOnGameThread(MoveTemp(ExcPtr));
31+
#else
2932
HandleError([ExcP = MoveTemp(ExcPtr)] { std::rethrow_exception(ExcP); });
33+
#endif
3034
}
3135

3236
void FErrorHandler::HandleError() const
@@ -79,6 +83,22 @@ namespace DolbyIO
7983
LogException("unknown exception", "");
8084
}
8185

86+
void FErrorHandler::HandleErrorOnGameThread(std::exception_ptr&& ExcPtr) const
87+
{
88+
AsyncTask(ENamedThreads::GameThread,
89+
[ExcP = MoveTemp(ExcPtr), CopySelf = *this]
90+
{
91+
try
92+
{
93+
std::rethrow_exception(ExcP);
94+
}
95+
catch (...)
96+
{
97+
CopySelf.HandleError();
98+
}
99+
});
100+
}
101+
82102
void FErrorHandler::LogException(const FString& Type, const FString& What) const
83103
{
84104
const FString ErrorMsg = Type + ": " + What;

DolbyIO/Source/Private/Utils/DolbyIOErrorHandler.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ namespace DolbyIO
2828

2929
private:
3030
void HandleError(TFunction<void()> Callee) const;
31+
void HandleErrorOnGameThread(std::exception_ptr&& ExcPtr) const;
3132
void LogException(const FString& Type, const FString& What) const;
3233

33-
FString File;
34-
int Line;
35-
UDolbyIOSubsystem& DolbyIOSubsystem;
34+
const FString File;
35+
const int Line;
36+
const UDolbyIOSubsystem& DolbyIOSubsystem;
3637
const FDolbyIOOnErrorDelegate* const OnError{};
3738
};
3839
}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
With the Dolby.io Virtual Worlds plugin for Unreal Engine, you can easily integrate [Dolby.io](https://dolby.io) Spatial Audio, powered by Dolby Atmos technology into your virtual world applications.
88

99
You can find the plugin documentation [here](https://api-references.dolby.io/comms-sdk-unreal/).
10+
11+
This project is no longer maintained.

docs/docs/Intro.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The plugin is compatible with the following operating systems:
1414
- macOS 10.14 or later if you use UE4
1515
- macOS 12.5 or later if you use UE5
1616
- Ubuntu 20.04 or later
17+
- Android 8 or later if you use UE5.3 or later (experimental, arm64-v8a devices only)
1718

1819
## Prerequisites
1920

0 commit comments

Comments
 (0)