diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b1ee6fb..4082f9b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ permissions: packages: write env: - PLUGIN_VERSION: "1.2.0-beta.9" + PLUGIN_VERSION: "1.2.0-beta.10" CPP_SDK_VERSION: "2.6.1" CPP_SDK_URL: "https://github.com/DolbyIO/comms-sdk-cpp/releases/download" PLUGIN_SOURCE_DIR: "DolbyIO" diff --git a/DolbyIO/DolbyIO.uplugin b/DolbyIO/DolbyIO.uplugin index 2305bce2..09e7df29 100644 --- a/DolbyIO/DolbyIO.uplugin +++ b/DolbyIO/DolbyIO.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "1.2.0-beta.9", + "VersionName": "1.2.0-beta.10", "FriendlyName": "Dolby.io Virtual Worlds", "Description": "Plugin integrating Dolby.io Communications.", "Category": "Communications", diff --git a/DolbyIO/Source/Private/DolbyIOModule.cpp b/DolbyIO/Source/Private/DolbyIOModule.cpp index df31bf19..a75adda6 100644 --- a/DolbyIO/Source/Private/DolbyIOModule.cpp +++ b/DolbyIO/Source/Private/DolbyIOModule.cpp @@ -24,7 +24,7 @@ class FDolbyIOModule final : public IModuleInterface [](std::size_t Count, std::size_t Al) { return ::operator new(Count, static_cast(Al)); }, ::operator delete, [](void* Ptr, std::size_t Al) { ::operator delete(Ptr, static_cast(Al)); }}; - BaseDir = FPaths::Combine(BaseDir, "bin"); + BaseDir = FPaths::Combine(BaseDir, TEXT("bin")); LoadDll(BaseDir, "avutil-57.dll"); LoadDll(BaseDir, "avcodec-59.dll"); LoadDll(BaseDir, "dvclient.dll"); @@ -39,13 +39,13 @@ class FDolbyIOModule final : public IModuleInterface LoadDll(BaseDir, "video_processor.dll"); dolbyio::comms::plugin::video_processor::set_app_allocator(Allocator); #elif PLATFORM_MAC - BaseDir = FPaths::Combine(BaseDir, "lib"); + BaseDir = FPaths::Combine(BaseDir, TEXT("lib")); LoadDll(BaseDir, "libdolbyio_comms_media.dylib"); LoadDll(BaseDir, "libdolbyio_comms_sdk.dylib"); LoadDll(BaseDir, "libvideo_processor.dylib"); #elif PLATFORM_LINUX BaseDir += "-ubuntu-20.04-clang10-libc++10"; - BaseDir = FPaths::Combine(BaseDir, "lib"); + BaseDir = FPaths::Combine(BaseDir, TEXT("lib")); LoadDll(BaseDir, "libavutil.so.57"); LoadDll(BaseDir, "libavcodec.so.59"); LoadDll(BaseDir, "libavformat.so.59"); diff --git a/DolbyIO/Source/Private/Subsystem/DolbyIOConference.cpp b/DolbyIO/Source/Private/Subsystem/DolbyIOConference.cpp index 08512c51..bd7e0ae7 100644 --- a/DolbyIO/Source/Private/Subsystem/DolbyIOConference.cpp +++ b/DolbyIO/Source/Private/Subsystem/DolbyIOConference.cpp @@ -245,6 +245,7 @@ void UDolbyIOSubsystem::Handle(const remote_participant_added& Event) } BroadcastEvent(OnParticipantAdded, Info.Status, Info); + BroadcastRemoteParticipantConnectedIfNecessary(Info); ProcessBufferedVideoTracks(Info.UserID); } @@ -264,6 +265,26 @@ void UDolbyIOSubsystem::Handle(const remote_participant_updated& Event) } BroadcastEvent(OnParticipantUpdated, Info.Status, Info); + BroadcastRemoteParticipantConnectedIfNecessary(Info); + BroadcastRemoteParticipantDisconnectedIfNecessary(Info); +} + +void UDolbyIOSubsystem::BroadcastRemoteParticipantConnectedIfNecessary(const FDolbyIOParticipantInfo& ParticipantInfo) +{ + if (ParticipantInfo.Status == EDolbyIOParticipantStatus::OnAir) + { + BroadcastEvent(OnRemoteParticipantConnected, ParticipantInfo); + } +} + +void UDolbyIOSubsystem::BroadcastRemoteParticipantDisconnectedIfNecessary( + const FDolbyIOParticipantInfo& ParticipantInfo) +{ + if (ParticipantInfo.Status == EDolbyIOParticipantStatus::Left || + ParticipantInfo.Status == EDolbyIOParticipantStatus::Kicked) + { + BroadcastEvent(OnRemoteParticipantDisconnected, ParticipantInfo); + } } void UDolbyIOSubsystem::Handle(const local_participant_updated& Event) diff --git a/DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp b/DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp index ac8e59cb..fda0d9d0 100644 --- a/DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp +++ b/DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp @@ -228,8 +228,9 @@ void UDolbyIOObserver::InitializeComponent() DLB_BIND(OnUnmuteParticipantError); DLB_BIND(OnParticipantAdded); - DLB_BIND(OnParticipantUpdated); + DLB_BIND(OnRemoteParticipantConnected); + DLB_BIND(OnRemoteParticipantDisconnected); DLB_BIND(OnLocalParticipantUpdated); diff --git a/DolbyIO/Source/Public/DolbyIO.h b/DolbyIO/Source/Public/DolbyIO.h index cf9d1d9c..e84d3faf 100644 --- a/DolbyIO/Source/Public/DolbyIO.h +++ b/DolbyIO/Source/Public/DolbyIO.h @@ -21,6 +21,10 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FDolbyIOOnParticipantAddedDelegate, Status, const FDolbyIOParticipantInfo&, ParticipantInfo); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FDolbyIOOnParticipantUpdatedDelegate, const EDolbyIOParticipantStatus, Status, const FDolbyIOParticipantInfo&, ParticipantInfo); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDolbyIOOnRemoteParticipantConnectedDelegate, + const FDolbyIOParticipantInfo&, ParticipantInfo); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDolbyIOOnRemoteParticipantDisconnectedDelegate, + const FDolbyIOParticipantInfo&, ParticipantInfo); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FDolbyIOOnLocalParticipantUpdatedDelegate, const EDolbyIOParticipantStatus, Status, const FDolbyIOParticipantInfo&, ParticipantInfo); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDolbyIOOnVideoTrackAddedDelegate, const FDolbyIOVideoTrack&, VideoTrack); @@ -309,6 +313,10 @@ class DOLBYIO_API UDolbyIOSubsystem : public UGameInstanceSubsystem UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnParticipantUpdatedDelegate OnParticipantUpdated; UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") + FDolbyIOOnRemoteParticipantConnectedDelegate OnRemoteParticipantConnected; + UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") + FDolbyIOOnRemoteParticipantDisconnectedDelegate OnRemoteParticipantDisconnected; + UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnLocalParticipantUpdatedDelegate OnLocalParticipantUpdated; UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnVideoTrackAddedDelegate OnVideoTrackAdded; @@ -341,6 +349,9 @@ class DOLBYIO_API UDolbyIOSubsystem : public UGameInstanceSubsystem void ToggleInputMute(); void ToggleOutputMute(); + void BroadcastRemoteParticipantConnectedIfNecessary(const FDolbyIOParticipantInfo& ParticipantInfo); + void BroadcastRemoteParticipantDisconnectedIfNecessary(const FDolbyIOParticipantInfo& ParticipantInfo); + void BroadcastVideoTrackAdded(const FDolbyIOVideoTrack& VideoTrack); void BroadcastVideoTrackEnabled(const FDolbyIOVideoTrack& VideoTrack); void ProcessBufferedVideoTracks(const FString& ParticipantID); @@ -475,7 +486,15 @@ class DOLBYIO_API UDolbyIOObserver : public UActorComponent UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnErrorDelegate OnUnmuteParticipantError; - /** Triggered when a remote participant is added to the conference. */ + /** Triggered when a remote participant is added to the conference. + * + * This event is triggered for all participants who were present in the conference at any time, including + * participants who joined and left and are no longer in the conference. The status of the participant provided by + * this event should be taken into account when handling this event. + * + * Users who are only interested in tracking whether a participant is currently connected to the conference are + * encouraged to use On Remote Participant Connected and On Remote Participant Disconnected for simplicity. + */ UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnParticipantAddedDelegate OnParticipantAdded; @@ -483,6 +502,14 @@ class DOLBYIO_API UDolbyIOObserver : public UActorComponent UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnParticipantUpdatedDelegate OnParticipantUpdated; + /** Triggered when a remote participant is connected to the conference. */ + UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") + FDolbyIOOnRemoteParticipantConnectedDelegate OnRemoteParticipantConnected; + + /** Triggered when a remote participant is disconnected from the conference. */ + UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") + FDolbyIOOnRemoteParticipantDisconnectedDelegate OnRemoteParticipantDisconnected; + /** Triggered when the local participant's status is updated. */ UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnLocalParticipantUpdatedDelegate OnLocalParticipantUpdated; @@ -711,6 +738,14 @@ class DOLBYIO_API UDolbyIOObserver : public UActorComponent void FwdOnParticipantUpdated(const EDolbyIOParticipantStatus Status, const FDolbyIOParticipantInfo& ParticipantInfo) DLB_DEFINE_FORWARDER(OnParticipantUpdated, Status, ParticipantInfo); + UFUNCTION() + void FwdOnRemoteParticipantConnected(const FDolbyIOParticipantInfo& ParticipantInfo) + DLB_DEFINE_FORWARDER(OnRemoteParticipantConnected, ParticipantInfo); + + UFUNCTION() + void FwdOnRemoteParticipantDisconnected(const FDolbyIOParticipantInfo& ParticipantInfo) + DLB_DEFINE_FORWARDER(OnRemoteParticipantDisconnected, ParticipantInfo); + UFUNCTION() void FwdOnLocalParticipantUpdated(const EDolbyIOParticipantStatus Status, const FDolbyIOParticipantInfo& ParticipantInfo) diff --git a/README.md b/README.md index 6d62c2cf..c259c4e8 100644 --- a/README.md +++ b/README.md @@ -6,25 +6,4 @@ 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. -You can find the plugin documentation here: [Online documentation](https://api-references.dolby.io/comms-sdk-unreal/) - -## Supported platforms - -The plugin is compatible with the following operating systems: -- Windows 10 or later -- macOS 10.14 or later if you use UE4 -- macOS 12.5 or later if you use UE5 -- Ubuntu 20.04 or later - -## Prerequisites - -Before you start, make sure that you have: -- Unreal Engine 4.27 or later installed on your computer. For more details, see the [Unreal Engine download](https://www.unrealengine.com/en-US/download) page and the [4.27](https://docs.unrealengine.com/4.27/en-US/Basics/InstallingUnrealEngine/) or [5.2](https://docs.unrealengine.com/5.2/en-US/installing-unreal-engine/) installation manuals. -- A [Dolby.io](https://dolby.io) account. If you do not have an account, [sign up](https://dolby.io/signup) for free. -- A client access token or an app key and an app secret copied from the Communications & Media [Dolby.io Dashboard](https://dashboard.dolby.io/). - -## Installation - -1. Make sure that your project contains a `Plugins` folder in the root of your game folder. If you do not have this folder, create it. -2. Download the latest plugin [release](https://github.com/DolbyIO/comms-sdk-unreal/releases) for your platform and unpack the plugin to the `Plugins` folder. -3. Launch your project using the Unreal Editor and select `Edit > Plugins` from the menu to enable the plugin manually. This step requires restarting the editor. +You can find the plugin documentation [here](https://api-references.dolby.io/comms-sdk-unreal/). diff --git a/docs/docs/blueprints/events.md b/docs/docs/blueprints/events.md index 9c5441e4..ba0ee9f3 100644 --- a/docs/docs/blueprints/events.md +++ b/docs/docs/blueprints/events.md @@ -192,6 +192,10 @@ Triggered automatically when a message is received. Triggered automatically when a remote participant is added to the conference. +This event is triggered for all participants who were present in the conference at any time, including participants who joined and left and are no longer in the conference. The status of the participant provided by this event should be taken into account when handling this event. For more information, refer to the [graph of possible status changes](../../static/img/participant-status-changes.png). + +Users who are only interested in tracking whether a participant is currently connected to the conference are encouraged to use [On Remote Participant Connected](#on-remote-participant-connected) and [On Remote Participant Disconnected](#on-remote-participant-disconnected) for simplicity. + #### Data provided | Provides | Type | Description | |----------------------|:--------------------------------------------------------------------|:-----------------------------------| @@ -212,6 +216,28 @@ Triggered automatically when a remote participant's status is updated. For more --- +## On Remote Participant Connected + +Triggered automatically when a remote participant is connected to the conference. + +#### Data provided +| Provides | Type | Description | +|----------------------|:--------------------------------------------------------------------|:-----------------------------------| +| **Participant Info** | [Dolby.io Participant Info](types.mdx#dolbyio-participant-info) | Information about the participant. | + +--- + +## On Remote Participant Disconnected + +Triggered automatically when a remote participant is disconnected from the conference. + +#### Data provided +| Provides | Type | Description | +|----------------------|:--------------------------------------------------------------------|:-----------------------------------| +| **Participant Info** | [Dolby.io Participant Info](types.mdx#dolbyio-participant-info) | Information about the participant. | + +--- + ## On Screenshare Sources Received Triggered by [**Dolby.io Get Screenshare Sources**](functions.md#dolbyio-get-screenshare-sources) when screen share sources are received.