You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Headers are updated to contain any missing #includes needed to compile and #includes are sorted. Nothing is removed. #ushell-cherrypick of 21065896 by bryan.sefcik #preflight 62d4b1a5a6141b6adfb0c892 #jira #ROBOMERGE-OWNER: Bryan.sefcik #ROBOMERGE-AUTHOR: bryan.sefcik #ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824) #ROBOMERGE-CONFLICT from-shelf [CL 21181076 by Bryan sefcik in ue5-main branch]
69 lines
2.1 KiB
C++
69 lines
2.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "HAL/Platform.h"
|
|
#include "Templates/Function.h"
|
|
#include "Templates/UnrealTemplate.h"
|
|
#include "VideoCommon.h"
|
|
#include "VideoDecoderAllocationTypes.h"
|
|
#include "VideoDecoderInput.h"
|
|
|
|
namespace AVEncoder
|
|
{
|
|
class FVideoDecoderInput;
|
|
class FVideoDecoderOutput;
|
|
|
|
class FVideoDecoder
|
|
{
|
|
public:
|
|
using CreateDecoderAllocationInterfaceCallback = TFunction<void(void* /*InOptions*/, void** /*InOutParamResult*/)>;
|
|
using ReleaseDecoderAllocationInterfaceCallback = TFunction<void(void* /*InOptions*/, void** /*InOutParamResult*/)>;
|
|
|
|
struct FInit
|
|
{
|
|
CreateDecoderAllocationInterfaceCallback CreateDecoderAllocationInterface;
|
|
ReleaseDecoderAllocationInterfaceCallback ReleaseDecoderAllocationInterface;
|
|
|
|
int32 Width;
|
|
int32 Height;
|
|
};
|
|
|
|
// --- setup
|
|
virtual bool Setup(const FInit& InInit) = 0;
|
|
// Shuts the decoder down AND destroys it. Do not store a pointer to this decoder in a smart pointer!
|
|
virtual void Shutdown() = 0;
|
|
|
|
enum class EDecodeResult
|
|
{
|
|
Success,
|
|
Failure
|
|
// TryAgainLater
|
|
};
|
|
virtual EDecodeResult Decode(const FVideoDecoderInput* InInput) = 0;
|
|
|
|
using OnDecodedFrameCallback = TFunction<void(const FVideoDecoderOutput* /*InDecodedFrame*/)>;
|
|
|
|
virtual void SetOnDecodedFrame(OnDecodedFrameCallback InCallback) { OnDecodedFrame = MoveTemp(InCallback); }
|
|
virtual void ClearOnDecodedFrame() { OnDecodedFrame = nullptr; }
|
|
|
|
protected:
|
|
FVideoDecoder() = default;
|
|
virtual ~FVideoDecoder();
|
|
|
|
protected:
|
|
bool CreateDecoderAllocationInterface();
|
|
void ReleaseDecoderAllocationInterface();
|
|
EFrameBufferAllocReturn AllocateOutputFrameBuffer(FVideoDecoderAllocFrameBufferResult* OutBuffer, const FVideoDecoderAllocFrameBufferParams* InAllocParams);
|
|
void* GetAllocationInterfaceMethods();
|
|
|
|
struct FPlatformDecoderAllocInterface;
|
|
|
|
OnDecodedFrameCallback OnDecodedFrame;
|
|
CreateDecoderAllocationInterfaceCallback CreateDecoderAllocationInterfaceFN;
|
|
ReleaseDecoderAllocationInterfaceCallback ReleaseDecoderAllocationInterfaceFN;
|
|
FPlatformDecoderAllocInterface* PlatformDecoderAllocInterface = nullptr;
|
|
};
|
|
}
|