2016-12-08 08:52:44 -05:00
|
|
|
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
|
2014-06-24 12:11:51 -04:00
|
|
|
#pragma once
|
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "UObject/ObjectMacros.h"
|
|
|
|
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
2014-06-24 12:11:51 -04:00
|
|
|
#include "GameLiveStreamingFunctionLibrary.generated.h"
|
|
|
|
|
|
|
|
|
|
UCLASS()
|
|
|
|
|
class UGameLiveStreamingFunctionLibrary : public UBlueprintFunctionLibrary
|
|
|
|
|
{
|
2015-03-17 05:38:32 -04:00
|
|
|
GENERATED_UCLASS_BODY()
|
2014-06-24 12:11:51 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Checks to see if we are currently broadcasting live video (and possibly audio) from the game's viewport
|
|
|
|
|
*
|
|
|
|
|
* @return True if we are currently transmitting
|
|
|
|
|
*/
|
2014-07-02 11:33:24 -04:00
|
|
|
UFUNCTION( BlueprintPure, Category="LiveStreaming" )
|
2014-06-24 12:11:51 -04:00
|
|
|
static bool IsBroadcastingGame();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Starts broadcasting the game's video (and optionally audio) using an internet streaming service, if one is available
|
|
|
|
|
*
|
|
|
|
|
* @param FrameRate Frame rate to stream video from when broadcasting to services like Twitch.
|
|
|
|
|
* @param ScreenScaling How much to scale the broadcast video resolution down to reduce streaming bandwidth. We recommend broadcasting at resolutions of 1280x720 or lower. Some live streaming providers will not be able to transcode your video to a lower resolution, so using a high resolution stream may prevent low-bandwidth users from having a good viewing experience.
|
2015-10-06 15:59:09 -04:00
|
|
|
* @param bStartWebCam Starts your web camera right away. When the web camera is active, video from your web camera will be captured and displayed while broadcasting, so that your viewers can see your presence.
|
2014-06-24 12:11:51 -04:00
|
|
|
* @param DesiredWebCamWidth Desired web cam capture resolution width. The web cam may only support a limited number of resolutions, so we'll choose one that matches as closely to this as possible
|
|
|
|
|
* @param DesiredWebCamHeight Desired web cam capture resolution height.
|
2014-07-16 07:43:42 -04:00
|
|
|
* @param bMirrorWebCamImage You can enable this to flip the web camera image horizontally, so that it looks like a mirror
|
2015-10-06 15:59:09 -04:00
|
|
|
* @param bDrawSimpleWebCamVideo If enabled, the engine will draw a simple web cam image on top of the game viewport. If you turn this off, it's up to you to draw the web cam image yourself. You can access the web cam texture by calling IGameLiveStreaming::Get().GetWebCamTexture().
|
2014-06-24 12:11:51 -04:00
|
|
|
* @param bCaptureAudioFromComputer Enables broadcast of audio being played by your computer, such as in-game sounds
|
|
|
|
|
* @param bCaptureAudioFromMicrophone Enables broadcast of audio from your default microphone recording device
|
2015-10-06 15:59:09 -04:00
|
|
|
* @param CoverUpImage Optional image to broadcast, instead of what you're looking at on screen. This is useful if you don't want to publicly share the visuals on screen.
|
2014-06-24 12:11:51 -04:00
|
|
|
*/
|
2014-07-24 13:55:31 -04:00
|
|
|
UFUNCTION( BlueprintCallable, Category="LiveStreaming")
|
2014-06-24 12:11:51 -04:00
|
|
|
static void StartBroadcastingGame(
|
2015-10-06 15:59:09 -04:00
|
|
|
const FString& LoginUserName,
|
|
|
|
|
const FString& LoginPassword,
|
2014-07-24 13:55:31 -04:00
|
|
|
int32 FrameRate = 30,
|
|
|
|
|
float ScreenScaling = 1.f,
|
2015-10-06 15:59:09 -04:00
|
|
|
bool bStartWebCam = true,
|
2014-07-24 13:55:31 -04:00
|
|
|
int32 DesiredWebCamWidth = 320,
|
|
|
|
|
int32 DesiredWebCamHeight = 240,
|
|
|
|
|
bool bMirrorWebCamImage = false,
|
2015-10-06 15:59:09 -04:00
|
|
|
bool bDrawSimpleWebCamVideo = true,
|
2014-07-24 13:55:31 -04:00
|
|
|
bool bCaptureAudioFromComputer = true,
|
|
|
|
|
bool bCaptureAudioFromMicrophone = true,
|
2015-10-06 15:59:09 -04:00
|
|
|
class UTexture2D* CoverUpImage = nullptr);
|
2014-06-24 12:11:51 -04:00
|
|
|
|
|
|
|
|
/** Stops broadcasting the game */
|
2014-07-02 11:33:24 -04:00
|
|
|
UFUNCTION( BlueprintCallable, Category="LiveStreaming" )
|
2014-06-24 12:11:51 -04:00
|
|
|
static void StopBroadcastingGame();
|
|
|
|
|
|
2015-10-06 15:59:09 -04:00
|
|
|
/**
|
|
|
|
|
* Returns whether or not the web camera is actively capturing
|
|
|
|
|
*
|
|
|
|
|
* @return True if the web camera is available and currently capturing
|
|
|
|
|
*/
|
|
|
|
|
UFUNCTION( BlueprintPure, Category="LiveStreaming" )
|
|
|
|
|
static bool IsWebCamEnabled();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Starts capturing and displaying web camera video, if one is plugged in
|
|
|
|
|
*
|
|
|
|
|
* @param DesiredWebCamWidth Desired web cam capture resolution width. The web cam may only support a limited number of resolutions, so we'll choose one that matches as closely to this as possible
|
|
|
|
|
* @param DesiredWebCamHeight Desired web cam capture resolution height.
|
|
|
|
|
* @param bMirrorWebCamImage You can enable this to flip the web camera image horizontally, so that it looks like a mirror
|
|
|
|
|
* @param bDrawSimpleWebCamVideo If enabled, the engine will draw a simple web cam image on top of the game viewport. If you turn this off, it's up to you to draw the web cam image yourself. You can access the web cam texture by calling IGameLiveStreaming::Get().GetWebCamTexture().
|
|
|
|
|
*/
|
|
|
|
|
UFUNCTION( BlueprintCallable, Category="LiveStreaming")
|
|
|
|
|
static void StartWebCam(
|
|
|
|
|
int32 DesiredWebCamWidth = 320,
|
|
|
|
|
int32 DesiredWebCamHeight = 240,
|
|
|
|
|
bool bMirrorWebCamImage = false,
|
|
|
|
|
bool bDrawSimpleWebCamVideo = true);
|
|
|
|
|
|
|
|
|
|
/** Stops the web camera, if it's currently capturing */
|
|
|
|
|
UFUNCTION( BlueprintCallable, Category="LiveStreaming" )
|
|
|
|
|
static void StopWebCam();
|
|
|
|
|
|
2014-07-02 11:33:24 -04:00
|
|
|
// @todo livestream: Add Blueprint APIs for chat
|
2014-06-24 12:11:51 -04:00
|
|
|
};
|