Files
UnrealEngine/Engine/Plugins/Media/PixelStreaming2/Source/PixelStreaming2RTC/Private/EpicRtcAudioTrackObserverFactory.cpp
2025-05-18 13:04:45 +08:00

25 lines
913 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "EpicRtcAudioTrackObserverFactory.h"
#include "EpicRtcAudioTrackObserver.h"
namespace UE::PixelStreaming2
{
FEpicRtcAudioTrackObserverFactory::FEpicRtcAudioTrackObserverFactory(TObserverVariant<IPixelStreaming2AudioTrackObserver> UserObserver)
: UserObserver(UserObserver)
{
}
EpicRtcErrorCode FEpicRtcAudioTrackObserverFactory::CreateAudioTrackObserver(const EpicRtcStringView ParticipantId, const EpicRtcStringView AudioTrackId, EpicRtcAudioTrackObserverInterface** OutAudioTrackObserver)
{
EpicRtcAudioTrackObserverInterface* AudioTrackObserver = new FEpicRtcAudioTrackObserver(UserObserver);
// Because the ptr was created with new, we need to call AddRef ourself (ms spec compliant)
AudioTrackObserver->AddRef();
*OutAudioTrackObserver = AudioTrackObserver;
return EpicRtcErrorCode::Ok;
}
} // namespace UE::PixelStreaming2