Files
UnrealEngineUWP/Engine/Source/ThirdParty/WebRTC/WebRTC.Build.cs
William Belcher fe31211473 Early Pixel Streaming features, bugfixes, and refactors that benefit main.
This change list is a collation of work from multiple authors.

********Features*******
* Add a ForceKeyFrame blueprints and cpp method which forces the modules default streamer to send a keyframe.
* Add support for use of WebRTC version 96 with Pixel Streaming. NOTE: There are noticeable performance regressions introduced with this version that are being investigated. Version 84 remains the default.
* Add the ability to stream the main Level Editor window to the browser.
* Add a Pixel Streaming specific toolbar for starting and stopping streaming in the editor, as well as configuring some basic plugin settings.
* Add ARKit transform support for controlling PixelStreamingVCam cameras with ARKit transform data received from the LiveLink app. See PixelStreamingVCamSession for handling of this data.


********Bugfixes*******
* Fix backwards compatibility break where offers from players wouldn't result in a connection.
* Fix a deadlock scenario that could be triggered with rapid peer connects/disconnects.
* Fix a crash in WebRTC caused by not removing the audio sink when a peer disconnects.
* Fix streams being capped at 30fps by default.
* Fix incorrect WebRTC headers being included in public header.


********Refactors*******
* Refactor Pixel Streaming start-up logic to be a more uniform code path.
* Refactor Pixel Streaming URL to use settings function like PixelStreamingIP and Port.
* Moved ECodec to public so the module can expose a method to select what codec the user would like to use.
* Modified packaging of a PixelStreaming project so that ps-infra files are placed in a nicer location.
* Refactor handling of input so mouse and touch events don't affect windows in front of or around the target viewport.
* Renamed the encoders and their corresponding factories to better describe their purpose.

#rb luke.bermingham
#jira none
#preflight 62c3919fc438da7f09fe0914
#fyi mattias.jansson, aidan.possemiers, david.hibbitts

[CL 20938453 by William Belcher in ue5-main branch]
2022-07-04 22:23:38 -04:00

99 lines
3.4 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.IO;
using System;
public class WebRTC : ModuleRules
{
protected string ConfigPath {get; private set; }
protected virtual bool bShouldUseWebRTC
{
get =>
Target.Platform.IsInGroup(UnrealPlatformGroup.Windows) ||
(Target.IsInPlatformGroup(UnrealPlatformGroup.Unix) && Target.Architecture.StartsWith("x86_64"));
}
private bool bWebRtcVersion96
{
get
{
return false
// || Target.Platform == UnrealTargetPlatform.Win64 // uncomment to enable WebRtc 96
;
}
}
public WebRTC(ReadOnlyTargetRules Target) : base(Target)
{
Type = ModuleType.External;
// WebRTC binaries with debug symbols are huge hence the Release binaries do not have any
// if you want to have debug symbols with shipping you will need to build with debug instead
if (Target.Configuration == UnrealTargetConfiguration.Shipping)
{
ConfigPath = "Release";
}
else
{
// The debug webrtc binares are not portable, so we only ship with the release binaries
// If you wanted, you would need to compile the webrtc binaries in debug and place the Lib and Include folder in the relevant location
// ConfigPath = "Debug";
ConfigPath = "Release";
}
if (bShouldUseWebRTC)
{
string WebRtcVersionPath = bWebRtcVersion96 ?
"WebRTC/4664" : // Branch head 4664 is Release 96
"WebRTC/4147"; // Branch head 4147 is Release 84
string WebRtcSdkPath = Target.UEThirdPartySourceDirectory + WebRtcVersionPath;
string VS2013Friendly_WebRtcSdkPath = Target.UEThirdPartySourceDirectory;
string PlatformSubdir = Target.Platform.ToString();
string IncludePath = Path.Combine(WebRtcSdkPath, "Include");
PublicSystemIncludePaths.Add(IncludePath);
string AbslthirdPartyIncludePath = Path.Combine(IncludePath, "third_party", "abseil-cpp");
PublicSystemIncludePaths.Add(AbslthirdPartyIncludePath);
if (Target.Platform.IsInGroup(UnrealPlatformGroup.Windows))
{
PublicDefinitions.Add("WEBRTC_WIN=1");
PlatformSubdir = "Win64"; // windows-based platform extensions can share this library
string LibraryPath = Path.Combine(WebRtcSdkPath, "Lib", PlatformSubdir, ConfigPath);
PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "webrtc.lib"));
// Additional System library
PublicSystemLibraries.Add("Secur32.lib");
// The version of webrtc we depend on, depends on an openssl that depends on zlib
AddEngineThirdPartyPrivateStaticDependencies(Target, "zlib");
AddEngineThirdPartyPrivateStaticDependencies(Target, "OpenSSL");
AddEngineThirdPartyPrivateStaticDependencies(Target, "libOpus");
}
else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
{
PublicDefinitions.Add("WEBRTC_LINUX=1");
PublicDefinitions.Add("WEBRTC_POSIX=1");
// This is slightly different than the other platforms
string LibraryPath = Path.Combine(WebRtcSdkPath, "Lib", PlatformSubdir, Target.Architecture, ConfigPath);
PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "libwebrtc.a"));
AddEngineThirdPartyPrivateStaticDependencies(Target, "OpenSSL");
AddEngineThirdPartyPrivateStaticDependencies(Target, "libOpus");
}
}
string WebRtcDefinitionVersion = bWebRtcVersion96 ? "96" : "84";
PublicDefinitions.Add("WEBRTC_VERSION=" + WebRtcDefinitionVersion);
PublicDefinitions.Add("ABSL_ALLOCATOR_NOTHROW=1");
}
}