engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
AVEncoder::FVideoEncoder类 参考abstract

Base class for video encoders. 更多...

#include <AVEncoder.h>

Public 成员函数

virtual bool CopyTexture (FTexture2DRHIRef Texture, FTimespan CaptureTs, FTimespan Duration, FBufferId &OutBufferId, FIntPoint Resolution={0, 0})=0
 Copy the specified texture to an internal buffer. 更多...
 
virtual void Drop (FBufferId BufferId)=0
 Drops an internal buffer that was returned by CopyTexture. 更多...
 
virtual void Encode (FBufferId BufferId, bool bForceKeyFrame, uint32 Bitrate=0, TUniquePtr< AVEncoder::FEncoderVideoFrameCookie > Cookie=nullptr)=0
 Initiates the encoding of the given buffer. 更多...
 
virtual FVideoEncoderConfig GetConfig () const =0
 Return the current configuration
 
virtual const TCHAR * GetName () const =0
 Returns the name of the encoder. 更多...
 
virtual const TCHAR * GetType () const =0
 Returns just the codec type. 更多...
 
virtual bool Initialize (const FVideoEncoderConfig &Config)=0
 Initialize the encoder with the specified initial configuration
 
virtual void RegisterListener (IVideoEncoderListener &Listener)
 Register/Unregister listeners. 更多...
 
virtual bool SetParameter (const FString &Parameter, const FString &Value)=0
 Allows setting encoder parameters not exposed through FVideoEncoderConfig fields. 更多...
 
virtual void Shutdown ()=0
 Shutdown MUST be called before destroying the encoder
 

详细描述

Base class for video encoders.

注解
Threading model is still work in progress.

成员函数说明

◆ CopyTexture()

virtual bool AVEncoder::FVideoEncoder::CopyTexture ( FTexture2DRHIRef  Texture,
FTimespan  CaptureTs,
FTimespan  Duration,
FBufferId &  OutBufferId,
FIntPoint  Resolution = {0, 0} 
)
pure virtual

Copy the specified texture to an internal buffer.

This is a bit awkward, but it's somewhat required to account for how webrtc works (for PixelStreaming), where encoding a frame is a two step process : 1st - CopyTexture initiates a copy if the texture to the internal buffers, and returns an Id the caller can use to reference that internal buffer. 2nd - Either a Drop or Encode is required for each CopyTexture call, otherwise the respective internal buffer will stay

参数
TextureTexture to copy
CaptureTsCapture timestamp
DurationDelta time from the previous frame
OutBufferIdBuffer id on return
ResolutionIf {0,0}, the copy will be the same size as the passed texture. If not {0,0}, it will use that specified resolution marked as used.
注解
This MUST be called from the render thread

◆ Drop()

virtual void AVEncoder::FVideoEncoder::Drop ( FBufferId  BufferId)
pure virtual

Drops an internal buffer that was returned by CopyTexture.

This should be used with the application decides that it doesn't want to encode a frame that was already passed to CopyTexture. Once this is called on a valid buffer, do not use it again.

参数
BufferIdBuffer returned by a CopyTexture call

◆ Encode()

virtual void AVEncoder::FVideoEncoder::Encode ( FBufferId  BufferId,
bool  bForceKeyFrame,
uint32  Bitrate = 0,
TUniquePtr< AVEncoder::FEncoderVideoFrameCookie >  Cookie = nullptr 
)
pure virtual

Initiates the encoding of the given buffer.

Once this is called on a valid buffer, do not use it again.

参数
BufferIdBuffer returned by a CopyTexture call
bForceKeyFrameForce this frame to be encoded as a key frame
BitrateTarget bitrate at the moment this frame is sent to the encoder. This allows tweaking bitrate at runtime
CookieAllows storing custom per-frame state if the application needs it. This is returned back to the application when it receives the encoded frame.

◆ GetName()

virtual const TCHAR * AVEncoder::FVideoEncoder::GetName ( ) const
pure virtual

Returns the name of the encoder.

This normally specifies the codec, and sdk/hardware. E.g : "h264.nvenc", or "h264.amf"

◆ GetType()

virtual const TCHAR * AVEncoder::FVideoEncoder::GetType ( ) const
pure virtual

Returns just the codec type.

E.g: "h264"

◆ RegisterListener()

void AVEncoder::FVideoEncoder::RegisterListener ( IVideoEncoderListener &  Listener)
virtual

Register/Unregister listeners.

Most likely, you only need 1 listener per encoder, but supported several is needed due to some PixelStreaming peculiarities.

◆ SetParameter()

virtual bool AVEncoder::FVideoEncoder::SetParameter ( const FString &  Parameter,
const FString &  Value 
)
pure virtual

Allows setting encoder parameters not exposed through FVideoEncoderConfig fields.

What parameters are valid are encoder dependent. See FVideoEncoderConfig::Options for examples


该类的文档由以下文件生成: