Files
UnrealEngineUWP/Engine/Source/Programs/PixelStreaming/WebServers/SignallingWebServer/modules/httpsClient.js

95 lines
2.2 KiB
JavaScript
Raw Normal View History

Copying //UE4/Dev-Enterprise to //UE4/Dev-Main (Source: //UE4/Dev-Enterprise @ 4341740) #lockdown Nick.Penwarden #rb none ============================ MAJOR FEATURES & CHANGES ============================ Change 4280523 by Patrick.Boutot Add option in AjaCustomTimeStep to wait until the frame to be ready. Previously, the frame was there but not yet processed so it was possible that it was not ready by the time we wanted to read it. It won't work with interlaced because the 2 fields are processed at the same time. In interlaced, will get a 30fps behaviour when we actually want a 60fps. Fix bug that didn't set and reset bIsOwned properly when it was first initialized as not owned. Change 4280526 by Patrick.Boutot Add accessor to get the leaf media source or output. Change 4280624 by Patrick.Boutot Add timecode acessor to media samples Change 4280626 by Patrick.Boutot Rework the timing for AJA Media Player. Previously, we took the timing of the frame. That was a bad idea because if 2 incomings video frames were coming a the same time, you would only show one. Making the buffering system useless. That affects the Custom Time Step since it was waiting for the interrupt signal and in some behavior we would like the frame to be ready to be used by UE. Same the timecode in the MediaSample because we may not used it to stamps the frame. Change 4283022 by Patrick.Boutot [EditorScriptingUtilitites] Check folder names invalid characters separatly from the object's name. #jira UE-59886, UE-62333 Change 4283112 by Patrick.Boutot Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime. Rename TimemanagemenetEditor module names. Change 4283426 by JeanLuc.Corenthin Fix crash with FBX file #jira UE-62501 Change 4284940 by Patrick.Boutot A widget that let you select a single permutation from a list. It groups the values into categories and removes duplicates inside that category. Change 4285471 by Patrick.Boutot Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime. Change 4286925 by Patrick.Boutot [AJA] Add support to read LTC from the reference In. Add more detail on video format and the device. MediaSource use the Permutations Selection widget to select his mode and device. Remove debugging option to trigger an AJA custom time step and timecode provider. Remove the UYVY pixel option from AJA. It's better do to the conversion on the AJA card that on the GPU. Change the tooltip and category for some AjaMediaSource properties. Change 4287026 by Julien.StJean Modifed the file STimeCodeProviderTab.cpp to fix the position of a SComboButton that wasn't properly place. Change 4287663 by Jon.Nabozny Add timecode messages into nDisplay, and sync those between Master and Slave Change 4287884 by Jon.Nabozny Create a TimecodeProvider for SystemTime and introduce a notion for DefaultTimecodeProvider in Engine. Change 4288050 by Jon.Nabozny Rework the TimeSynchronization implementation for usability and functionality. Change 4288283 by Jon.Nabozny Fixed swapped MetaClass and DisplayName options on UEngine::DefaultTimecodeProviderClassName; Change 4288352 by Jon.Nabozny Set TimecodeProviderClassName and DefaultTimecodeProviderClassName in BaseEngine.ini Change 4288378 by Jon.Nabozny Fixup some issues in TimecodeSynchronizer where code was reset improperly due to multiple unshelves / resolves. Change 4288394 by Jon.Nabozny Add TimeSync functionality into LiveLink. Also add test cases for this. This should allow us to easily synchronize multiple LiveLink sources together, as well as synchronize those to anything else using the sync system (Relies on CL-4235417) Change 4288899 by Patrick.Boutot Fix initialization order of FMediaIOCorePlayerBase variables Change 4289157 by Patrick.Boutot Allow the user to change the source of a capture without stopping the current capture. [AJA] AjaMediaCapture, add support for UpdateSceneViewport & UpdateRenderTarget @made by julien.stjean Change 4291328 by Jon.Nabozny Report the Skeleton Guid with TimeSyncData and track sync state in LiveLinkTimeSynchronizationSource. This prevents a crash that can happen if a source is quickly cleared and reset before the next tick of Time Synchronization. Change 4296294 by Jon.Nabozny Fixup errors when TimecodeProviderClassName is empty. It's valid to leave this empty. Change 4297122 by Patrick.Boutot Media Profile with timecode provider & custom time step Change 4301855 by Austin.Crismore Fix for movment scaling and virtual joystick controls. Movement scaling in for truck and dolly is locked to the world xy plane, and virtual joysticks use their own method for movement scaling now. #jira UE-61762, UE-62187 Change 4301856 by Austin.Crismore Virtual sequence level controller now listens to on object spawned, so that it can intercept the camera actor and disable attatching to HMD to prevent camera movement that isn't from the level sequence #jira UE-61766 Change 4301860 by Austin.Crismore Fix for touch scrubbing. Added default values back in. Added logic to only allow scrubbing when touch focus was off. #jira UE-61865 Change 4302294 by Jamie.Dale Added functions to get your the localized spoken and subtitle text from a dialogue wave Change 4304393 by Jamie.Dale Added support for BlueprintAssignable properties in Python Change 4305852 by Jamie.Dale Removed hard-dependency between EditorScriptingUtilities and PythonScriptPlugin Backed-out changelist 4259264 and query Python availability based on whether anything is available to handle the command #jira UE-62318 Change 4308550 by Jamie.Dale Fixed crash when passing a null world to Python actor iterators Change 4311867 by Homam.Bahnassi Revit master material with exposed parameters matching the API when possible. Change 4314428 by Francis.Hurteau Made the usage of the bBuildDeveloperTools switch independent of the bCompileAgainstEngine switch. Changed bBuildDeveloperTools TargetRule in UnrealBuildTool to a nullable to keep the old behavior in case where bBuildDeveloperTools wasn't explicitly set in TargetRules Change 4315134 by Jamie.Dale Defer editable text focus selection until mouse-up to allow the user to make an initial selection #jira UE-58086 Change 4318615 by Johan.Duparc EditorFactories: consistent return values after asset import. Change 4322459 by Jamie.Dale Made SequencerScripting an Editor plugin as it depends on PythonScriptPlugin which is an Editor plugin This was causing issues at runtime when SequencerScripting was enabled, as it failed to load PythonScriptPlugin (which hadn't been built). Change 4323341 by Francis.Hurteau Implement proper message bus protocol version negociation with static nodes Change 4323733 by Francis.Hurteau Fix VR Pausing Sequence Scrubbing just setting playback speed to 0.0 Change 4324319 by Jamie.Dale Exposed transactions to Blueprints Change 4325847 by Alistair.White Copying //Tasks/UE4/Private-PixelStreaming@4325566 to Dev-Enterprise-Minimal (//UE4/Dev-Enterprise-Minimal) This adds the new experimental PixelStreaming plugin to allow streaming of an Unreal client's audio & video stream to a browser through the WebRTC protocol to support new uses for enterprise customers. Change 4326282 by Simon.Tourangeau nDisplay native present handler Change 4326581 by Jamie.Dale Replacing FDateTime with int64 Ticks value to workaround UE-63485 Change 4326599 by Homam.Bahnassi Moving texture coords outside UVEdit function to allow using different UV channels. Change 4333250 by Francis.Hurteau Small TFuture changes: * cleans up TFuture::Then with usage of TUniqueFunction * added TFuture::Reset to invalidate it and remove continuation from a future shared state Change 4333359 by Homam.Bahnassi Support scaling and rotating UVs around arbitrary pivot Change 4333566 by Johan.Duparc Expose ProxyLOD functionalities to Scripting #jira UEENT-1788 Change 4333988 by Jamie.Dale Allow UHT to parse FText default parameter values INVTEXT, NSLOCTEXT, LOCTABLE, and FText::GetEmpty() are supported. LOCTEXT isn't as it relies on an external macro that is known to C++ but not to UHT (NSLOCTEXT can easily be used instead). Change 4335020 by Francis.Hurteau Uncomment MessageBus::Send deprecation notice for 4.21 Update MessageBus Send usage to new API Change 4335195 by JeanMichel.Dignard Add a SetLodFromStaticMesh script utility function #jira UEENT-1789 Change 4335231 by Anousack.Kitisa Added functions to generate planar, cylindrical, box UV mapping. #jira UEENT-1598 Change 4335373 by Jamie.Dale Cleaned up some places creating empty literal texts Change 4335458 by Jamie.Dale Allow UHT to parse FText() as an alias of FText::GetEmpty() when processing default values Change 4335875 by Max.Chen Sequencer: Clear RF_Transient on pasted tracks/sections #jira UE-63537 Change 4336497 by Johan.Duparc ProxyLOD: Fix progress bar issue - removed duplicated code - removed duplicated LongTask object #jira UEENT-1788 Change 4336723 by Jamie.Dale Ensure that Python generated types create their CDO at the correct point #jira UE-62895 Change 4340594 by Ben.Marsh Fix manifest being invalidated when building two enterprise targets in a row. Fixes CIS error. #jira UE-63644 [CL 4342443 by JeanMichel Dignard in Main branch]
2018-09-04 16:35:02 -04:00
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
var querystring = require('querystring')
const https = require('https');
const assert = require('assert');
function cleanUrl(aUrl){
let url = aUrl;
if(url.startsWith("https://"))
url = url.substring("https://".length);
return url
}
function createOptions(requestType, url){
let index = url.indexOf('/');
let urlParts = url.split('/', 2)
return {
hostname: (index === -1) ? url.substring(0) : url.substring(0, index),
port: 443,
path: (index === -1) ? '' : url.substring(index),
method: requestType,
timeout: 30000,
};
}
function makeHttpsCall(options, aCallback, aError){
//console.log(JSON.stringify(options));
const req = https.request(options, function(response){
let data = '';
//console.log('statusCode:', response.statusCode);
//console.log('headers:', response.headers);
// A chunk of data has been received.
response.on('data', (chunk) => {
data += chunk;
});
// The whole response has been received. Print out the result.
response.on('end', () => {
if(typeof aCallback != "undefined")
aCallback(response, data);
});
});
req.on('timeout', function () {
console.log("Request timed out. " + (options.timeout / 1000) + " seconds expired");
// Source: https://github.com/nodejs/node/blob/master/test/parallel/test-http-client-timeout-option.js#L27
req.destroy();
});
req.on("error", (err) => {
if(typeof aError != "undefined") {
aError(err);
} else {
console.log("Error: " + err.message);
}
});
return req;
}
module.exports = class HttpClient {
get(aUrl, aCallback, aError) {
let url = cleanUrl(aUrl);
let options = createOptions('GET', url);
const req = makeHttpsCall(options, aCallback, aError);
req.end();
}
post(aUrl, body, aCallback, aError) {
let url = cleanUrl(aUrl);
let options = createOptions('POST', url);
let postBody = querystring.stringify(body);
//Add extra options for POST request type
options.headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': postBody.length
};
const req = makeHttpsCall(options, aCallback, aError);
req.write(postBody);
req.end();
}
}