// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "MetaHumanCaptureSource.h" #include "Async/EventSourceUtils.h" class IFootageIngestAPI; class FBaseCommandArgs; namespace UE::MetaHuman { struct METAHUMANCAPTURESOURCE_API FIngesterParams { FIngesterParams( EMetaHumanCaptureSourceType InCaptureSourceType, FDirectoryPath InStoragePath, FDeviceAddress InDeviceAddress, uint16 InDeviceControlPort, bool InShouldCompressDepthFiles, bool InCopyImagesToProject, float InMinDistance, float InMaxDistance, EMetaHumanCaptureDepthPrecisionType InDepthPrecision, EMetaHumanCaptureDepthResolutionType InDepthResolution ); EMetaHumanCaptureSourceType CaptureSourceType; FDirectoryPath StoragePath; FDeviceAddress DeviceAddress; uint16 DeviceControlPort; bool ShouldCompressDepthFiles; bool CopyImagesToProject; float MinDistance; float MaxDistance; EMetaHumanCaptureDepthPrecisionType DepthPrecision; EMetaHumanCaptureDepthResolutionType DepthResolution; }; class METAHUMANCAPTURESOURCE_API FIngester : public FCaptureEventSource { public: using FRefreshCallback = TManagedDelegate; using FGetTakesCallbackPerTake = TManagedDelegate; explicit FIngester(FIngesterParams InIngesterParams); virtual ~FIngester(); void SetParams(FIngesterParams InIngesterParams); bool CanStartup() const; bool CanIngestTakes() const; bool CanCancel() const; /** * @brief Startup the footage ingest API. Get information on the available takes based on the type of this Capture Source * @param bSynchronous If true, this will be a blocking function. Useful when initializing from blueprints or python */ void Startup(ETakeIngestMode InMode = ETakeIngestMode::Async); void Refresh(FRefreshCallback InCallback); void SetTargetPath(const FString& InTargetIngestDirectory, const FString& InTargetFolderAssetPath); void Shutdown(); bool IsProcessing() const; bool IsCancelling() const; void CancelProcessing(const TArray& InTakeIdList); int32 GetNumTakes() const; TArray GetTakeIds() const; bool GetTakeInfo(TakeId InTakeId, FMetaHumanTakeInfo& OutTakeInfo) const; bool GetTakes(const TArray& InTakeIdList, FGetTakesCallbackPerTake InCallback); TOptional GetProcessingProgress(TakeId InTakeId) const; FText GetProcessName(TakeId InTakeId) const; bool ExecuteCommand(class TSharedPtr InCommand); DECLARE_MULTICAST_DELEGATE_OneParam(FOnGetTakesFinished, const TArray& InTakes) FOnGetTakesFinished OnGetTakesFinishedDelegate; EMetaHumanCaptureSourceType GetCaptureSourceType() const; private: void ProxyEvent(TSharedPtr Event); TUniquePtr FootageIngestAPI; FIngesterParams Params; }; }