You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Brings over the necessary engine changes for embedding UE4 mobile as a dylib/so in native mobile app - Various changes for facial animation, screen recording, others - ARKit and ARCore plugins were removed, as deemed "not ready" #rb many people #ROBOMERGE-OWNER: ryan.vance #ROBOMERGE-AUTHOR: josh.adams #ROBOMERGE-SOURCE: CL 5201138 via CL 5203024 via CL 5226277 #ROBOMERGE-BOT: DEVVR (Main -> Dev-VR) [CL 5244512 by josh adams in Dev-VR branch]
57 lines
1.5 KiB
C++
57 lines
1.5 KiB
C++
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameplayMediaEncoderSample.h"
|
|
#include "GameplayMediaEncoderCommon.h"
|
|
|
|
struct FVideoEncoderConfig
|
|
{
|
|
uint32 Width;
|
|
uint32 Height;
|
|
uint32 Framerate;
|
|
uint32 Bitrate;
|
|
|
|
FVideoEncoderConfig()
|
|
: Width(0)
|
|
, Height(0)
|
|
, Framerate(0)
|
|
, Bitrate(0)
|
|
{}
|
|
};
|
|
|
|
class FBaseVideoEncoder
|
|
{
|
|
public:
|
|
using FOutputSampleCallback = TFunction<bool(const FGameplayMediaEncoderSample&)>;
|
|
|
|
explicit FBaseVideoEncoder(const FOutputSampleCallback& OutputCallback);
|
|
virtual ~FBaseVideoEncoder() {}
|
|
|
|
const FVideoEncoderConfig& GetConfig() const
|
|
{ return Config; }
|
|
|
|
virtual bool Initialize(const FVideoEncoderConfig& Config);
|
|
bool GetOutputType(TRefCountPtr<IMFMediaType>& OutType);
|
|
virtual bool Process(const FTexture2DRHIRef& Texture, FTimespan Timestamp, FTimespan Duration) = 0;
|
|
|
|
// is called from same thread as `Process()`
|
|
// dynamically changes bitrate in runtime to adjust to available bandwidth
|
|
virtual bool SetBitrate(uint32 Bitrate) = 0; // has impl despite being "pure"
|
|
|
|
// is called from same thread as `Process()`
|
|
// dynamically changes framerate in runtime to adjust to available bandwidth
|
|
virtual bool SetFramerate(uint32 Framerate) = 0; // has impl despite being "pure"
|
|
|
|
virtual bool Start() = 0;
|
|
virtual void Stop() = 0;
|
|
protected:
|
|
FOutputSampleCallback OutputCallback;
|
|
FVideoEncoderConfig Config;
|
|
TRefCountPtr<IMFMediaType> OutputType;
|
|
uint64 InputCount = 0;
|
|
uint64 OutputCount = 0;
|
|
};
|
|
|