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

Commit

Permalink
Merge pull request #405 from DolbyIO/unknown_track_warning
Browse files Browse the repository at this point in the history
Warn if the video track ID is suspicious
  • Loading branch information
Kuba Audykowicz authored Sep 12, 2023
2 parents 486b234 + 1d25892 commit 2ba62ec
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/Subsystem/DolbyIOVideoTracks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,18 @@ UTexture2D* UDolbyIOSubsystem::GetTexture(const FString& VideoTrackID)
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_LOG_BASE(Warning, "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 Expand Up @@ -125,6 +134,7 @@ void UDolbyIOSubsystem::Handle(const remote_video_track_removed& Event)
{
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
1 change: 1 addition & 0 deletions DolbyIO/Source/Public/DolbyIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,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 2ba62ec

Please sign in to comment.