FRemoteSessionImageChannel

A channel that takes an image (created by an [IRemoteSessionImageProvider](API\Plugins\RemoteSession\Channels\IRemoteSessionImageProvider)), then sends it to the client (with a FRemoteSessionImageSender).

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

IRemoteSessionChannel

FRunnable

FRemoteSessionImageChannel

References

Module

RemoteSession

Header

/Engine/Plugins/Experimental/RemoteSession/Source/RemoteSession/Public/Channels/RemoteSessionImageChannel.h

Include

#include "Channels/RemoteSessionImageChannel.h"

Syntax

class FRemoteSessionImageChannel :
    public IRemoteSessionChannel,
    private FRunnable

Remarks

A channel that takes an image (created by an IRemoteSessionImageProvider), then sends it to the client (with a FRemoteSessionImageSender). On the client images are decoded into a double-buffered texture that can be accessed via GetHostScreen.

Variables

Name Description

Protected variable

FRunnableThread...

 

BackgroundThread

Protected variable

TWeakPtr< IBack...

 

Connection

Underlying connection

Protected variable

FCriticalSectio...

 

DecodedImageMutex

Protected variable

TSharedPtr< TAt...

 

DecodedTextureIndex

Protected variable

UTexture2D *...

 

DecodedTextures

Protected variable

FThreadSafeBool

 

ExitRequested

Protected variable

bool

 

HaveConfiguredImageProvider

Protected variable

TSharedPtr< IRe...

 

ImageProvider

Protected variable

TSharedPtr< FIm...

 

ImageSender

Image sender used by the channel

Protected variable

TArray< TUnique...

 

IncomingDecodedImages

Protected variable

TArray< TUnique...

 

IncomingEncodedImages

Protected variable

FCriticalSectio...

 

IncomingImageMutex

Protected variable

int32

 

LastDecodedImageIndex

Last processed decode image

Protected variable

int32

 

LastIncomingImageIndex

Last processed incoming image

Protected variable

FDelegateHandle

 

MessageCallbackHandle

So we can manage callback lifetimes properly

Protected variable

FRemoteSessionI...

 

ReceiveStats

Protected variable

ERemoteSessionC...

 

Role

Our role

Protected variable

FEvent *

 

ScreenshotEvent

Constructors

Destructors

Functions

Name Description

Protected function

void

 

CreateTexture

(
    const int32 InSlot,
    const int32 InWidth,
    const int32 InHeight
)

Creates a texture to receive images into

Protected function

void

 

ExitBackgroundThread()

Public function Const

UTexture2D &...

 

GetHostScreen()

Get the client Texture2D to display

Public function

TSharedPtr< ...

 

GetImageSender()

Return the image sender connected to the clients

Protected function

void

 

ProcessIncomingTextures()

Decode the incoming images on a dedicated thread

Protected function

void

 

ReceiveHostImage

(
    IBackChannelPacket& Message
)

Bound to receive incoming images

Public function

void

 

SetCompressQuality

(
    int32 InQuality
)

Set the jpg compression quality

Public function

void

 

SetFramebufferAsImageProvider()

Sets up an image provider that mirrors the games framebuffer.

Public function

void

 

SetImageProvider

Set the ImageProvider that will produce the images that will be sent to the client

Protected function

void

 

StartBackgroundThread()

Public function Static

const TCHAR ...

 

StaticType()

Begin IRemoteSessionChannel implementation

Overridden from IRemoteSessionChannel

Name Description

Public function Virtual Const

const TCHAR ...

 

GetType()

Public function Virtual

void

 

Tick

(
    const float InDeltaTime
)

Tick this channel

Overridden from FRunnable

Name Description

Protected function Virtual

uint32

 

Run()

Background thread for decoding incoming images

Classes

Name

Description

Protected struct

FImageData

Public class

FImageSender

A helper object responsible to take the raw data, encode it to jpg and send it to the client for the RemoteSessionImageChannel