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

Commit

Permalink
Warn if the video track ID is suspicious
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Audykowicz committed Sep 12, 2023
1 parent bbde173 commit d2298f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions DolbyIO/Source/Private/DolbyIOSubsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ void UDolbyIOSubsystem::Initialize(const FString& Token)
const FDolbyIOVideoTrack VideoTrack = ToFDolbyIOVideoTrack(Event.track);
DLB_UE_LOG("Video track removed: TrackID=%s ParticipantID=%s", *VideoTrack.TrackID,
*VideoTrack.ParticipantID);
WarnIfVideoTrackSuspicious(VideoTrack.TrackID);

FScopeLock Lock{&VideoSinksLock};
if (std::shared_ptr<DolbyIO::FVideoSink>* Sink = VideoSinks.Find(VideoTrack.TrackID))
Expand Down Expand Up @@ -632,9 +633,18 @@ void UDolbyIOSubsystem::DisableVideo()
void UDolbyIOSubsystem::BroadcastVideoTrackAdded(const FDolbyIOVideoTrack& VideoTrack)
{
DLB_UE_LOG("Video track added: TrackID=%s ParticipantID=%s", *VideoTrack.TrackID, *VideoTrack.ParticipantID);
WarnIfVideoTrackSuspicious(VideoTrack.TrackID);
BroadcastEvent(OnVideoTrackAdded, VideoTrack);
}

void UDolbyIOSubsystem::WarnIfVideoTrackSuspicious(const FString& VideoTrackID)
{
if (VideoTrackID == "{-}")
{
DLB_UE_WARN("Suspicious video track ID added, things may not work as expected");
}
}

void UDolbyIOSubsystem::BroadcastVideoTrackEnabled(const FDolbyIOVideoTrack& VideoTrack)
{
DLB_UE_LOG("Video track enabled: TrackID=%s ParticipantID=%s", *VideoTrack.TrackID, *VideoTrack.ParticipantID);
Expand Down
1 change: 1 addition & 0 deletions DolbyIO/Source/Public/DolbyIOSubsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ class DOLBYIO_API UDolbyIOSubsystem : public UGameInstanceSubsystem
void BroadcastVideoTrackAdded(const FDolbyIOVideoTrack& VideoTrack);
void BroadcastVideoTrackEnabled(const FDolbyIOVideoTrack& VideoTrack);
void ProcessBufferedVideoTracks(const FString& ParticipantID);
void WarnIfVideoTrackSuspicious(const FString& VideoTrackID);

void SetLocationUsingFirstPlayer();
void SetLocalPlayerLocationImpl(const FVector& Location);
Expand Down

0 comments on commit d2298f3

Please sign in to comment.