Files
aurel cordonnier 50944fd712 Merge UE5/RES @ 16162155 to UE5/Main
This represents UE4/Main @ 16130047 and Dev-PerfTest @ 16126156

[CL 16163576 by aurel cordonnier in ue5-main branch]
2021-04-29 19:32:06 -04:00

73 lines
996 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
namespace AVEncoder
{
struct FVideoConfig
{
FString Codec;
uint32 Width;
uint32 Height;
uint32 Framerate;
uint32 Bitrate;
};
struct FAudioConfig
{
FString Codec;
uint32 Samplerate;
uint32 NumChannels;
uint32 Bitrate;
};
enum class EPacketType
{
Audio,
Video,
Invalid
};
struct FMediaPacket
{
EPacketType Type;
FTimespan Timestamp;
FTimespan Duration;
TArray<uint8> Data;
union
{
struct
{
bool bKeyFrame;
int32 Width;
int32 Height;
uint32 FrameAvgQP;
uint32 Framerate;
} Video;
struct
{
} Audio;
};
explicit FMediaPacket(EPacketType TypeIn)
{
Type = TypeIn;
if (Type == EPacketType::Audio)
{
}
else if (Type == EPacketType::Video)
{
FMemory::Memzero(Video);
}
}
bool IsVideoKeyFrame() const
{
return (Type == EPacketType::Video && Video.bKeyFrame) ? true : false;
}
};
}