Files
UnrealEngineUWP/Engine/Source/Runtime/AVEncoder/Private/AVEncoderCommon.h
Juan Canada 2ecf4f9708 Merging //UE4/Dev-Main@10877709 to Dev-RenderPlat-Staging(//UE4/Dev-Rendering)
#rnx
#rb none

[CL 10895568 by Juan Canada in Dev-RenderPlat-Staging branch]
2020-01-07 13:45:01 -05:00

77 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Stats/Stats.h"
#include "Logging/LogMacros.h"
#include "RHIStaticStates.h"
#include "HAL/ThreadSafeBool.h"
#include "HAL/ThreadSafeCounter.h"
#include "HAL/Thread.h"
#include "HAL/Event.h"
#include "Misc/ScopeExit.h"
#include "ShaderCore.h"
#include "ProfilingDebugging/CsvProfiler.h"
#include "RHI.h"
#include "RHIResources.h"
#include "ScreenRendering.h"
#include "CommonRenderResources.h"
DECLARE_LOG_CATEGORY_EXTERN(LogAVEncoder, Log, All);
CSV_DECLARE_CATEGORY_EXTERN(AVEncoder);
namespace AVEncoder
{
template<typename F>
inline void ExecuteRHICommand(F&& Functor)
{
FRHICommandList& RHICmdList = FRHICommandListExecutor::GetImmediateCommandList();
if (RHICmdList.Bypass())
{
Functor();
}
else
{
FRHICOMMAND_MACRO(FLocalRHICommand)
{
F Functor;
FLocalRHICommand(F InFunctor)
: Functor(MoveTemp(InFunctor))
{}
void Execute(FRHICommandListBase& CmdList)
{
Functor();
}
};
new (RHICmdList.AllocCommand<FLocalRHICommand>()) FLocalRHICommand(Functor);
}
}
// Settings specific to
struct FH264Settings
{
enum ERateControlMode
{
ConstQP,
VBR,
CBR
};
int QP = 20;
ERateControlMode RcMode = ERateControlMode::CBR;
};
bool ReadH264Setting(const FString& Name, const FString& Value, FH264Settings& OutSettings);
void ReadH264Settings(const TArray<TPair<FString, FString>>& Options, FH264Settings& OutSettings);
void CopyTextureImpl(const FTexture2DRHIRef& Src, FTexture2DRHIRef& Dst, FRHIGPUFence* GPUFence);
}