MediaIO.EnableExperimentalScheduling
MediaIO.EnableExperimentalScheduling
#Overview
name: MediaIO.EnableExperimentalScheduling
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to send out frame in a separate thread. (Experimental)
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of MediaIO.EnableExperimentalScheduling is to control whether frame sending occurs in a separate thread within the Media IO Framework. This setting is part of the experimental scheduling feature in Unreal Engine’s media capture and output system.
This setting variable is primarily used in the Media IO Framework, which is part of Unreal Engine’s media system. Specifically, it’s used in the MediaIOCore module, which is responsible for handling media capture and output operations.
The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable with a default value of 1 (enabled). Developers can change this value at runtime using console commands or through configuration files.
The associated variable CVarMediaIOEnableExperimentalScheduling directly interacts with MediaIO.EnableExperimentalScheduling. They share the same value and purpose.
Developers should be aware that this is an experimental feature, as indicated by its name and description. It affects the threading model of frame processing in media capture operations. When enabled, it allows frame sending to occur in a separate thread, which could potentially improve performance but may also introduce new complexities or bugs.
Best practices when using this variable include:
- Testing thoroughly when enabling or disabling this feature, as it may affect the performance and stability of media capture operations.
- Monitoring performance metrics to determine if the experimental scheduling improves or degrades performance in your specific use case.
- Being prepared to disable this feature if any issues arise, given its experimental nature.
- Keeping up to date with Unreal Engine documentation and release notes, as experimental features may change or become stable in future versions.
Regarding the associated variable CVarMediaIOEnableExperimentalScheduling:
The purpose of CVarMediaIOEnableExperimentalScheduling is the same as MediaIO.EnableExperimentalScheduling - to control the experimental scheduling feature for frame sending in media capture operations.
This variable is used in the MediaIOCore module of the Media IO Framework. It’s primarily referenced in the UMediaCapture class, which handles media capture functionality.
The value of this variable is set through the TAutoConsoleVariable system, with a default value of 1 (enabled).
CVarMediaIOEnableExperimentalScheduling interacts directly with another console variable, CVarMediaIOScheduleOnAnyThread, in determining the thread usage for media capture operations.
Developers should be aware that this variable controls an experimental feature and its usage may impact the performance and behavior of media capture operations.
Best practices for using this variable are similar to those for MediaIO.EnableExperimentalScheduling, including thorough testing, performance monitoring, and staying informed about updates to the experimental feature.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Media/MediaIOFramework/Source/MediaIOCore/Private/MediaCapture.cpp:48
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarMediaIOEnableExperimentalScheduling(
TEXT("MediaIO.EnableExperimentalScheduling"), 1,
TEXT("Whether to send out frame in a separate thread. (Experimental)"),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarMediaIOScheduleOnAnyThread(
TEXT("MediaIO.ScheduleOnAnyThread"), 1,
TEXT("Whether to wait for resource readback in a separate thread. (Experimental)"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarMediaIOEnableExperimentalScheduling
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Media/MediaIOFramework/Source/MediaIOCore/Private/MediaCapture.cpp:47
Scope: file
Source code excerpt:
#define LOCTEXT_NAMESPACE "MediaCapture"
static TAutoConsoleVariable<int32> CVarMediaIOEnableExperimentalScheduling(
TEXT("MediaIO.EnableExperimentalScheduling"), 1,
TEXT("Whether to send out frame in a separate thread. (Experimental)"),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarMediaIOScheduleOnAnyThread(
TEXT("MediaIO.ScheduleOnAnyThread"), 1,
#Loc: <Workspace>/Engine/Plugins/Media/MediaIOFramework/Source/MediaIOCore/Private/MediaCapture.cpp:487
Scope (from outer to inner):
file
function bool UMediaCapture::UseExperimentalScheduling
Source code excerpt:
bool UMediaCapture::UseExperimentalScheduling() const
{
return GRHISupportsMultithreading && CVarMediaIOEnableExperimentalScheduling.GetValueOnAnyThread() == 1;
}
bool UMediaCapture::UseAnyThreadCapture() const
{
return GRHISupportsMultithreading
&& CVarMediaIOEnableExperimentalScheduling.GetValueOnAnyThread()
&& CVarMediaIOScheduleOnAnyThread.GetValueOnAnyThread()
&& SupportsAnyThreadCapture();
}
bool UMediaCapture::UpdateSceneViewport(TSharedPtr<FSceneViewport>& InSceneViewport)
{
#Loc: <Workspace>/Engine/Plugins/Media/MediaIOFramework/Source/MediaIOCore/Private/MediaCapture.cpp:782
Scope (from outer to inner):
file
function void UMediaCapture::CaptureImmediate_RenderThread
Source code excerpt:
}
// If CVarMediaIOEnableExperimentalScheduling is enabled, it means that a sync point pass was added, and the ready frame processing will be done later
if (!UseExperimentalScheduling())
{
if (TSharedPtr<FCaptureFrame> NextPending = FrameManager->PeekNextPending<FCaptureFrame>())
{
UE_LOG(LogMediaIOCore, Verbose, TEXT("[%s - %s] - Processing pending frame %d"), *MediaOutputName, *FThreadManager::GetThreadName(FPlatformTLS::GetCurrentThreadId()), NextPending ? NextPending->FrameId : -1);
ProcessReadyFrame_RenderThread(Args.GraphBuilder.RHICmdList, this, NextPending);