FFrameGrabber

Class responsible for resolving render target data for a specific viewport in an efficient manner Internally, the class uses a fixed array of resolution surfaces, and dispatches rendering commands to resolve the viewport render target into a specific index into this array.

Choose your operating system:

Windows

macOS

Linux

References

Module

MovieSceneCapture

Header

/Engine/Source/Runtime/MovieSceneCapture/Public/FrameGrabber.h

Include

#include "FrameGrabber.h"

Syntax

class FFrameGrabber

Remarks

Class responsible for resolving render target data for a specific viewport in an efficient manner Internally, the class uses a fixed array of resolution surfaces, and dispatches rendering commands to resolve the viewport render target into a specific index into this array. This means we can resolve the render target data without having to wait, or flush rendering commands.

Constructors

Name Description

Public function

FFrameGrabber

(
    TSharedRef< FSceneViewport > Viewpo...,
    FIntPoint DesiredBufferSize,
    EPixelFormat InPixelFormat,
    uint32 NumSurfaces
)

Construct this frame grabber

Destructors

Name Description

Public function

~FFrameGrabber()

Destructor

Functions

Name Description

Public function

void

 

CaptureThisFrame

(
    FFramePayloadPtr Payload
)

Instruct the frame grabber capture this frame, when it receives an event from slate

Public function

TArray< FCap...

 

GetCapturedFrames()

Retrieve any frames we may have captured

Public function Const

bool

 

HasOutstandingFrames()

Check whether we have any outstanding frames or not

Public function Const

bool

 

IsCapturingFrames()

Check whether we're capturing frames or not

Protected function

void

 

OnBackBufferReadyToPresentCallback

(
    SWindow& SlateWindow,
    const FTexture2DRHIRef& BackBuffer
)

Callback for when a backbuffer is ready for reading (called on render thread)

Protected function

void

 

OnFrameReady

(
    int32 SurfaceIndex,
    FColor* ColorBuffer,
    int32 Width,
    int32 Height
)

Called when the specified surface index has been locked for reading with the render target data (called on render thread)

Public function

void

 

Shutdown()

Shut down this grabber, ensuring that any threaded operations are finished

Public function

void

 

StartCapturingFrames()

Instruct the frame grabber to start capturing frames

Public function

void

 

StopCapturingFrames()

Stop capturing frames

Enums

Name

Description

Private enum

EFrameGrabberState

The current state of the grabber