You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#UE-139207 #rb simon.therriault #preflight 61f46b10241aeec8656320df #ROBOMERGE-AUTHOR: geoffrey.douglas #ROBOMERGE-SOURCE: CL 18780098 in //UE5/Release-5.0/... via CL 18780850 via CL 18781348 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472) [CL 18781651 by geoffrey douglas in ue5-main branch]
71 lines
2.6 KiB
C++
71 lines
2.6 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "UObject/Object.h"
|
|
#include "UObject/ObjectMacros.h"
|
|
|
|
#include "LiveLinkRole.h"
|
|
#include "LiveLinkTypes.h"
|
|
#include "Templates/SubclassOf.h"
|
|
|
|
#include "LiveLinkFrameInterpolationProcessor.generated.h"
|
|
|
|
|
|
/**
|
|
* Information about the interpolation that was done
|
|
* Used to give some cues to the caller about what's happened
|
|
*/
|
|
struct FLiveLinkInterpolationInfo
|
|
{
|
|
/** Distance in seconds between expected evaluation time and newest sample */
|
|
float ExpectedEvaluationDistanceFromNewestSeconds;
|
|
|
|
/** Distance in seconds between expected evaluation time and oldest sample */
|
|
float ExpectedEvaluationDistanceFromOldestSeconds;
|
|
|
|
/** Frame indices interpolated between */
|
|
int32 FrameIndexA = INDEX_NONE;
|
|
int32 FrameIndexB = INDEX_NONE;
|
|
|
|
/** Whether sampling was done below our oldest sample */
|
|
bool bUnderflowDetected = false;
|
|
|
|
/** Whether interpolation point was above our newest sample */
|
|
bool bOverflowDetected = false;
|
|
};
|
|
|
|
|
|
/**
|
|
* Basic object to interpolate live link frames
|
|
* Inherit from it to do custom blending for your data type
|
|
* @note It can be called from any thread
|
|
*/
|
|
class LIVELINKINTERFACE_API ILiveLinkFrameInterpolationProcessorWorker
|
|
{
|
|
public:
|
|
virtual TSubclassOf<ULiveLinkRole> GetRole() const = 0;
|
|
|
|
virtual void Interpolate(double InTime, const FLiveLinkStaticDataStruct& InStaticData, const TArray<FLiveLinkFrameDataStruct>& InSourceFrames, FLiveLinkSubjectFrameData& OutBlendedFrame, FLiveLinkInterpolationInfo& OutInterpolationInfo) = 0;
|
|
virtual void Interpolate(const FQualifiedFrameTime& InTime, const FLiveLinkStaticDataStruct& InStaticData, const TArray<FLiveLinkFrameDataStruct>& InSourceFrames, FLiveLinkSubjectFrameData& OutBlendedFrame, FLiveLinkInterpolationInfo& OutInterpolationInfo) = 0;
|
|
};
|
|
|
|
|
|
/**
|
|
* Basic object to interpolate live link frames
|
|
* Inherit from it to do custom blending for your data type
|
|
* @note It can only be used on the Game Thread. See ILiveLinkFrameInterpolationProcessorWorker for the any thread implementation.
|
|
*/
|
|
UCLASS(Abstract, editinlinenew, ClassGroup = (LiveLink))
|
|
class LIVELINKINTERFACE_API ULiveLinkFrameInterpolationProcessor : public UObject
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
using FWorkerSharedPtr = TSharedPtr<ILiveLinkFrameInterpolationProcessorWorker, ESPMode::ThreadSafe>;
|
|
|
|
virtual TSubclassOf<ULiveLinkRole> GetRole() const PURE_VIRTUAL(ULiveLinkFrameInterpolationProcessor::GetFromRole, return TSubclassOf<ULiveLinkRole>(););
|
|
virtual FWorkerSharedPtr FetchWorker() PURE_VIRTUAL(ULiveLinkFrameInterpolationProcessor::FetchWorker, return FWorkerSharedPtr(););
|
|
};
|