2018-12-14 14:49:12 -05:00
|
|
|
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
2017-11-15 16:13:28 -05:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "UObject/ObjectMacros.h"
|
|
|
|
|
#include "UObject/Object.h"
|
2019-06-10 19:47:29 -04:00
|
|
|
|
|
|
|
|
#include "LiveLinkSourceFactory.h"
|
2018-09-04 16:35:02 -04:00
|
|
|
#include "Misc/FrameRate.h"
|
2019-06-10 19:47:29 -04:00
|
|
|
#include "Templates/SubclassOf.h"
|
2017-11-15 16:13:28 -05:00
|
|
|
|
|
|
|
|
#include "LiveLinkSourceSettings.generated.h"
|
|
|
|
|
|
2018-09-04 16:35:02 -04:00
|
|
|
UENUM()
|
|
|
|
|
enum class ELiveLinkSourceMode : uint8
|
|
|
|
|
{
|
2019-07-09 00:18:10 -04:00
|
|
|
//The source will be run in default mode.
|
|
|
|
|
//This mode will not attempt any type of interpolation, time synchronization,
|
|
|
|
|
//or other processing.
|
|
|
|
|
Default,
|
2018-09-04 16:35:02 -04:00
|
|
|
|
2019-07-09 00:18:10 -04:00
|
|
|
//The source will be run in interpolated mode.
|
|
|
|
|
//This mode will use FLiveLinkInterpolationSettings and is most useful
|
|
|
|
|
//when smooth animation is desired.
|
|
|
|
|
Interpolated,
|
2018-09-04 16:35:02 -04:00
|
|
|
|
2019-07-09 00:18:10 -04:00
|
|
|
//The source will be run in time synchronized mode.
|
|
|
|
|
//This mode will use FLiveLinkTimeSynchronizationSettings and is most useful
|
|
|
|
|
//when sources need to be synchronized with multiple other external inputs
|
|
|
|
|
//(such as video or other time synchronized sources).
|
|
|
|
|
//Don't use if the engine isn't setup with a Timecode provider.
|
|
|
|
|
TimeSynchronized,
|
2018-09-04 16:35:02 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
USTRUCT()
|
|
|
|
|
struct FLiveLinkTimeSynchronizationSettings
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
2019-06-10 19:47:29 -04:00
|
|
|
FLiveLinkTimeSynchronizationSettings() = default;
|
2018-09-04 16:35:02 -04:00
|
|
|
|
|
|
|
|
// The frame rate of the source.
|
|
|
|
|
// This should be the frame rate the source is "stamped" at, not necessarily the frame rate the source is sending.
|
|
|
|
|
// The source should supply this whenever possible.
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = Settings)
|
2019-06-10 19:47:29 -04:00
|
|
|
FFrameRate FrameRate = {60, 1};
|
|
|
|
|
|
|
|
|
|
// When evaluating: how far back from current timecode should we read the buffer (in frame number)
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = Settings)
|
|
|
|
|
int32 FrameDelay = 0;
|
2018-09-04 16:35:02 -04:00
|
|
|
};
|
|
|
|
|
|
2017-11-15 16:13:28 -05:00
|
|
|
USTRUCT()
|
|
|
|
|
struct FLiveLinkInterpolationSettings
|
|
|
|
|
{
|
2018-09-04 16:35:02 -04:00
|
|
|
GENERATED_BODY()
|
2017-11-15 16:13:28 -05:00
|
|
|
|
2019-06-10 19:47:29 -04:00
|
|
|
FLiveLinkInterpolationSettings() = default;
|
2017-11-15 16:13:28 -05:00
|
|
|
|
2018-09-25 10:11:35 -04:00
|
|
|
#if WITH_EDITORONLY_DATA
|
2018-11-19 10:12:17 -05:00
|
|
|
//UE_DEPRECATED(4.21, "Please use ULiveLinkSourceSettings::Mode to specify how the source will behave.")
|
2018-09-04 16:35:02 -04:00
|
|
|
UPROPERTY()
|
2019-06-10 19:47:29 -04:00
|
|
|
bool bUseInterpolation_DEPRECATED = false;
|
2018-09-25 10:11:35 -04:00
|
|
|
#endif
|
2017-11-15 16:13:28 -05:00
|
|
|
|
2019-06-10 19:47:29 -04:00
|
|
|
// When evaluating: how far back from current time should we read the buffer (in seconds)
|
2017-11-15 16:13:28 -05:00
|
|
|
UPROPERTY(EditAnywhere, Category = Settings)
|
2019-06-10 19:47:29 -04:00
|
|
|
float InterpolationOffset = 0.5f;
|
2017-11-15 16:13:28 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Base class for live link source settings (can be replaced by sources themselves)
|
|
|
|
|
UCLASS()
|
|
|
|
|
class LIVELINKINTERFACE_API ULiveLinkSourceSettings : public UObject
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
2019-06-10 19:47:29 -04:00
|
|
|
UPROPERTY(EditAnywhere, Category = "Settings")
|
2018-09-04 16:35:02 -04:00
|
|
|
ELiveLinkSourceMode Mode = ELiveLinkSourceMode::Default;
|
|
|
|
|
|
|
|
|
|
// Only used when Mode is set to Interpolated.
|
2017-11-15 16:13:28 -05:00
|
|
|
UPROPERTY(EditAnywhere, Category = "Interpolation Settings")
|
|
|
|
|
FLiveLinkInterpolationSettings InterpolationSettings;
|
|
|
|
|
|
2018-09-04 16:35:02 -04:00
|
|
|
// Only used when Mode is set to TimeSynchronized.
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = "Time Synchronization Settings")
|
|
|
|
|
FLiveLinkTimeSynchronizationSettings TimeSynchronizationSettings;
|
|
|
|
|
|
2019-06-10 19:47:29 -04:00
|
|
|
UPROPERTY(EditAnywhere, Category = "Settings", AdvancedDisplay)
|
|
|
|
|
FString ConnectionString;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(VisibleAnywhere, Category = "Settings", AdvancedDisplay)
|
|
|
|
|
TSubclassOf<ULiveLinkSourceFactory> Factory;
|
|
|
|
|
|
2018-09-04 16:35:02 -04:00
|
|
|
virtual void Serialize(FArchive& Ar) override;
|
2017-11-15 16:13:28 -05:00
|
|
|
};
|