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

Commit

Permalink
Android - Remove checking for whether RTP communication was started
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Audykowicz committed Sep 11, 2023
1 parent b48ad7f commit a5efbcc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 52 deletions.
4 changes: 0 additions & 4 deletions DolbyIO/Source/Private/Subsystem/DolbyIOConference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ void UDolbyIOSubsystem::Disconnect()

void UDolbyIOSubsystem::UpdateStatus(conference_status Status)
{
#if PLATFORM_ANDROID
bIsRtpStarted = false;
#endif

ConferenceStatus = Status;
DLB_UE_LOG("Conference status: %s", *ToString(ConferenceStatus));

Expand Down
29 changes: 3 additions & 26 deletions DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ void UDolbyIOSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
Super::Initialize(Collection);

#if PLATFORM_ANDROID
SetLogSettings(EDolbyIOLogLevel::Info, EDolbyIOLogLevel::Off, EDolbyIOLogLevel::Debug, true);
#endif

ConferenceStatus = conference_status::destroyed;

VideoSinks.Emplace(LocalCameraTrackID, std::make_shared<FVideoSink>(LocalCameraTrackID));
Expand All @@ -54,13 +50,11 @@ void UDolbyIOSubsystem::Deinitialize()
Super::Deinitialize();
}

namespace DolbyIO
namespace
{
class FSdkLogCallback : public logger_sink_callback
{
public:
FSdkLogCallback(UDolbyIOSubsystem& Subsystem) : Subsystem(Subsystem) {}

void log(log_level Level, std::string_view Message) const override
{
#define DLB_UE_LOG_SDK_BASE(Verbosity) \
Expand All @@ -72,33 +66,16 @@ namespace DolbyIO
DLB_UE_LOG_SDK_BASE(Error);
case log_level::WARNING:
DLB_UE_LOG_SDK_BASE(Warning);
case log_level::DEBUG:
#if PLATFORM_ANDROID
if (Message.find("DVC_StartRtpCommunication ") != Message.npos)
{
Subsystem.bIsRtpStarted = true;
DLB_UE_LOG_BASE(Warning, "bIsRtpStarted = true");
}
#endif
default:;
default:
DLB_UE_LOG_SDK_BASE(Log);
}
}

private:
UDolbyIOSubsystem& Subsystem;
};
}

void UDolbyIOSubsystem::SetLogSettings(EDolbyIOLogLevel SdkLogLevel, EDolbyIOLogLevel MediaLogLevel,
EDolbyIOLogLevel DvcLogLevel, bool bLogToConsole, bool bLogToFile)
{
#if PLATFORM_ANDROID
DvcLogLevel = EDolbyIOLogLevel::Debug;
bLogToConsole = true;
bLogToFile = false;
#endif

sdk::log_settings LogSettings;
LogSettings.sdk_log_level = ToSdkLogLevel(SdkLogLevel);
LogSettings.media_log_level = ToSdkLogLevel(MediaLogLevel);
Expand All @@ -107,7 +84,7 @@ void UDolbyIOSubsystem::SetLogSettings(EDolbyIOLogLevel SdkLogLevel, EDolbyIOLog

if (bLogToConsole)
{
LogSettings.log_callback = std::make_shared<FSdkLogCallback>(*this);
LogSettings.log_callback = std::make_shared<FSdkLogCallback>();
}
if (bLogToFile)
{
Expand Down
14 changes: 0 additions & 14 deletions DolbyIO/Source/Private/Subsystem/DolbyIOTransforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ void UDolbyIOSubsystem::SetLocalPlayerLocationImpl(const FVector& Location)
return;
}

#if PLATFORM_ANDROID
if (!bIsRtpStarted)
{
return;
}
#endif

Sdk->conference()
.set_spatial_position(ToStdString(LocalParticipantID), {Location.X, Location.Y, Location.Z})
.on_error(DLB_ERROR_HANDLER(OnSetLocalPlayerLocationError));
Expand All @@ -60,13 +53,6 @@ void UDolbyIOSubsystem::SetLocalPlayerRotationImpl(const FRotator& Rotation)
return;
}

#if PLATFORM_ANDROID
if (!bIsRtpStarted)
{
return;
}
#endif

// The SDK expects the direction values to mean rotations around the {x,y,z} axes as specified by the
// environment. In Unreal, rotation around x is roll (because x is forward), y is pitch and z is yaw.
Sdk->conference()
Expand Down
8 changes: 0 additions & 8 deletions DolbyIO/Source/Public/DolbyIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ namespace DolbyIO
class FErrorHandler;
class FVideoFrameHandler;
class FVideoSink;

#if PLATFORM_ANDROID
class FSdkLogCallback;
#endif
}

UCLASS(DisplayName = "Dolby.io Subsystem")
Expand Down Expand Up @@ -488,10 +484,6 @@ class DOLBYIO_API UDolbyIOSubsystem : public UGameInstanceSubsystem
bool bIsInputMuted = false;
bool bIsOutputMuted = false;
bool bIsVideoEnabled = false;
#if PLATFORM_ANDROID
friend class DolbyIO::FSdkLogCallback;
bool bIsRtpStarted = false;
#endif

FTimerHandle LocationTimerHandle;
FTimerHandle RotationTimerHandle;
Expand Down

0 comments on commit a5efbcc

Please sign in to comment.