You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
UE-74862 : Reusable media encoder framework implementation
#rb Andriy.Tylychko [CL 10462307 by Rui Figueira in Main branch]
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
// Copyright 1998-2019 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user