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

Commit

Permalink
Fix screen share close crash
Browse files Browse the repository at this point in the history
- Enum class was trying to be logged as string directly
- For some reason this compiles? But it would crash in the handler
- Add proper conversion to string
  • Loading branch information
djova-dolby committed Oct 9, 2023
1 parent 7137b16 commit 4e7bf98
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DolbyIO/Source/Private/Subsystem/DolbyIOScreenshare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void UDolbyIOSubsystem::GetCurrentScreenshareSource()
void UDolbyIOSubsystem::Handle(const screen_share_error& Event)
{
DLB_UE_LOG_BASE(Warning, "Received screen_share_error event source=%s type=%s description=%s force_stopped=%d",
*ToString(Event.source), Event.type, *ToFString(Event.description), Event.force_stopped);
*ToString(Event.source), *ToString(Event.type), *ToFString(Event.description), Event.force_stopped);
if (Event.force_stopped)
{
StopScreenshare();
Expand Down
12 changes: 12 additions & 0 deletions DolbyIO/Source/Private/Utils/DolbyIOConversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ namespace DolbyIO
*(ToFText(Source.title).ToString()));
}

FString ToString(dolbyio::comms::screen_share_error::error_type err_type) {
switch (err_type) {
case dolbyio::comms::screen_share_error::error_type::continuos_temporary:
return "Continuous but temporary";
case dolbyio::comms::screen_share_error::error_type::permanent:
return "Permanent";
default:
return "";
}
}


EDolbyIOParticipantStatus ToEDolbyIOParticipantStatus(std::optional<participant_status> Status)
{
if (Status)
Expand Down
1 change: 1 addition & 0 deletions DolbyIO/Source/Private/Utils/DolbyIOConversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace DolbyIO
FString ToString(enum dolbyio::comms::audio_device::direction Direction);
FString ToString(const dolbyio::comms::camera_device& Device);
FString ToString(const dolbyio::comms::screen_share_source& Source);
FString ToString(dolbyio::comms::screen_share_error::error_type err_type);

EDolbyIOParticipantStatus ToEDolbyIOParticipantStatus(std::optional<dolbyio::comms::participant_status> Status);
FDolbyIOParticipantInfo ToFDolbyIOParticipantInfo(const dolbyio::comms::participant_info& Info);
Expand Down

0 comments on commit 4e7bf98

Please sign in to comment.