2016-01-07 08:17:16 -05:00
|
|
|
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
2014-06-24 12:11:51 -04:00
|
|
|
#include "GameLiveStreamingModule.h"
|
|
|
|
|
#include "GameLiveStreamingFunctionLibrary.h"
|
|
|
|
|
#include "Public/IGameLiveStreaming.h"
|
|
|
|
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "GameLiveStreaming"
|
|
|
|
|
|
|
|
|
|
|
2014-10-14 10:29:11 -04:00
|
|
|
UGameLiveStreamingFunctionLibrary::UGameLiveStreamingFunctionLibrary( const FObjectInitializer& ObjectInitializer )
|
|
|
|
|
: Super(ObjectInitializer)
|
2014-06-24 12:11:51 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool UGameLiveStreamingFunctionLibrary::IsBroadcastingGame()
|
|
|
|
|
{
|
|
|
|
|
return IGameLiveStreaming::Get().IsBroadcastingGame();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UGameLiveStreamingFunctionLibrary::StartBroadcastingGame(
|
2015-10-06 15:59:09 -04:00
|
|
|
const FString& LoginUserName,
|
|
|
|
|
const FString& LoginPassword,
|
2014-06-24 12:11:51 -04:00
|
|
|
int32 FrameRate,
|
|
|
|
|
float ScreenScaling,
|
2015-10-06 15:59:09 -04:00
|
|
|
bool bStartWebCam,
|
2014-06-24 12:11:51 -04:00
|
|
|
int32 DesiredWebCamWidth,
|
|
|
|
|
int32 DesiredWebCamHeight,
|
2014-07-16 07:43:42 -04:00
|
|
|
bool bMirrorWebCamImage,
|
2015-10-06 15:59:09 -04:00
|
|
|
bool bDrawSimpleWebCamVideo,
|
2014-06-24 12:11:51 -04:00
|
|
|
bool bCaptureAudioFromComputer,
|
|
|
|
|
bool bCaptureAudioFromMicrophone,
|
2015-10-06 15:59:09 -04:00
|
|
|
UTexture2D* CoverUpImage )
|
2014-06-24 12:11:51 -04:00
|
|
|
{
|
|
|
|
|
FGameBroadcastConfig Config;
|
2015-10-06 15:59:09 -04:00
|
|
|
Config.LoginUserName = LoginUserName;
|
|
|
|
|
Config.LoginPassword = LoginPassword;
|
2014-06-24 12:11:51 -04:00
|
|
|
Config.FrameRate = FrameRate;
|
|
|
|
|
Config.ScreenScaling = ScreenScaling;
|
2015-10-06 15:59:09 -04:00
|
|
|
Config.bStartWebCam = bStartWebCam;
|
|
|
|
|
Config.WebCamConfig.DesiredWebCamWidth = DesiredWebCamWidth;
|
|
|
|
|
Config.WebCamConfig.DesiredWebCamHeight = DesiredWebCamHeight;
|
|
|
|
|
Config.WebCamConfig.bMirrorWebCamImage = bMirrorWebCamImage;
|
|
|
|
|
Config.WebCamConfig.bDrawSimpleWebCamVideo = bDrawSimpleWebCamVideo;
|
2014-06-24 12:11:51 -04:00
|
|
|
Config.bCaptureAudioFromComputer = bCaptureAudioFromComputer;
|
|
|
|
|
Config.bCaptureAudioFromMicrophone = bCaptureAudioFromMicrophone;
|
2015-10-06 15:59:09 -04:00
|
|
|
Config.CoverUpImage = CoverUpImage;
|
2014-06-24 12:11:51 -04:00
|
|
|
IGameLiveStreaming::Get().StartBroadcastingGame( Config );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UGameLiveStreamingFunctionLibrary::StopBroadcastingGame()
|
|
|
|
|
{
|
|
|
|
|
IGameLiveStreaming::Get().StopBroadcastingGame();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-10-06 15:59:09 -04:00
|
|
|
bool UGameLiveStreamingFunctionLibrary::IsWebCamEnabled()
|
|
|
|
|
{
|
|
|
|
|
return IGameLiveStreaming::Get().IsWebCamEnabled();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UGameLiveStreamingFunctionLibrary::StartWebCam(
|
|
|
|
|
int32 DesiredWebCamWidth,
|
|
|
|
|
int32 DesiredWebCamHeight,
|
|
|
|
|
bool bMirrorWebCamImage,
|
|
|
|
|
bool bDrawSimpleWebCamVideo )
|
|
|
|
|
{
|
|
|
|
|
FGameWebCamConfig Config;
|
|
|
|
|
Config.DesiredWebCamWidth = DesiredWebCamWidth;
|
|
|
|
|
Config.DesiredWebCamHeight = DesiredWebCamHeight;
|
|
|
|
|
Config.bMirrorWebCamImage = bMirrorWebCamImage;
|
|
|
|
|
Config.bDrawSimpleWebCamVideo = bDrawSimpleWebCamVideo;
|
|
|
|
|
IGameLiveStreaming::Get().StartWebCam( Config );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UGameLiveStreamingFunctionLibrary::StopWebCam()
|
|
|
|
|
{
|
|
|
|
|
IGameLiveStreaming::Get().StopWebCam();
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-24 12:11:51 -04:00
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|