Files
Brandyn / Techy fcc1b09210 init
2026-04-04 15:40:51 -05:00

25 lines
897 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "EpicRtcDataTrackObserverFactory.h"
#include "EpicRtcDataTrackObserver.h"
namespace UE::PixelStreaming2
{
FEpicRtcDataTrackObserverFactory::FEpicRtcDataTrackObserverFactory(TObserverVariant<IPixelStreaming2DataTrackObserver> UserObserver)
: UserObserver(UserObserver)
{
}
EpicRtcErrorCode FEpicRtcDataTrackObserverFactory::CreateDataTrackObserver(const EpicRtcStringView ParticipantId, const EpicRtcStringView DataTrackId, EpicRtcDataTrackObserverInterface** OutDataTrackObserver)
{
EpicRtcDataTrackObserverInterface* DataTrackObserver = new FEpicRtcDataTrackObserver(UserObserver);
// Because the ptr was created with new, we need to call AddRef ourself (ms spec compliant)
DataTrackObserver->AddRef();
*OutDataTrackObserver = DataTrackObserver;
return EpicRtcErrorCode::Ok;
}
} // namespace UE::PixelStreaming2