TimecodeProviderClassName

TimecodeProviderClassName

#Overview

name: TimecodeProviderClassName

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of TimecodeProviderClassName is to specify the class name of the TimecodeProvider to be used by the Unreal Engine. This setting variable is primarily used for the engine’s timecode system, which is crucial for synchronizing various aspects of the game or application, particularly in scenarios involving media playback, networking, or precise timing requirements.

This setting variable is primarily relied upon by the Unreal Engine’s core engine module. It’s referenced in the Engine class (UEngine) and is used during engine initialization and configuration.

The value of this variable is set in the engine configuration files. It can be modified through the project settings in the Unreal Editor, specifically under the Engine - Timecode category.

TimecodeProviderClassName interacts with other variables such as bGenerateDefaultTimecode, GenerateDefaultTimecodeFrameRate, and GenerateDefaultTimecodeFrameDelay. These variables collectively control the behavior of the engine’s timecode system.

Developers must be aware that changing this variable will affect the entire engine’s timecode provision. It’s crucial to ensure that the specified class is a valid UTimecodeProvider subclass. If an invalid class name is provided, the engine will log an error and fall back to using no timecode provider.

Best practices when using this variable include:

  1. Ensure the specified class exists and is properly implemented before setting it.
  2. Consider the performance implications of the chosen TimecodeProvider, especially for different target platforms.
  3. Test thoroughly after changing this setting, as it can affect various engine systems relying on accurate timing.
  4. If no specific timecode provider is needed, consider using the default system time provider or leaving it unset and relying on bGenerateDefaultTimecode for basic timecode generation.
  5. Be cautious when changing this setting at runtime, as it may affect ongoing operations that rely on consistent timecode provision.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:199, section: [/Script/Engine.Engine]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/Engine.h:1521

Scope (from outer to inner):

file
class        class UEngine : public UObject , public FExec

Source code excerpt:

	/** Set TimecodeProvider when the engine is started. */
	UPROPERTY(config, EditAnywhere, Category=Timecode, meta=(MetaClass="/Script/Engine.TimecodeProvider", DisplayName="Timecode Provider"))
	FSoftClassPath TimecodeProviderClassName;

	/**
	 * Generate a default timecode from the computer clock when there is no timecode provider.
	 * On desktop, the system time will be used and will behave as if a USystemTimecodeProvider was set.
	 * On console, the high performance clock will be used. That may introduce drift over time.
	 * If you wish to use the system time on console, set the timecode provider to USystemeTimecodeProvider.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:3017

Scope (from outer to inner):

file
function     static void LoadTimecodeProvider

Source code excerpt:

static void LoadTimecodeProvider(UEngine* Engine)
{
	if (Engine->TimecodeProviderClassName.IsValid())
{
		if (UClass* TimecodeProviderClass = Engine->TimecodeProviderClassName.TryLoadClass<UTimecodeProvider>())
	{
			UTimecodeProvider* NewTimecodeProvider = NewObject<UTimecodeProvider>(Engine, TimecodeProviderClass);
			if (!Engine->SetTimecodeProvider(NewTimecodeProvider))
		{
				UE_LOG(LogEngine, Warning, TEXT("InitializeTimecodeProvider - Failed to intialize TimecodeProvider '%s'."), *NewTimecodeProvider->GetPathName());
			}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:3030

Scope (from outer to inner):

file
function     static void LoadTimecodeProvider

Source code excerpt:

		{
			Engine->SetTimecodeProvider(nullptr);
			UE_LOG(LogEngine, Error, TEXT("Engine config value TimecodeProviderClassName '%s' is not a valid class name."), *Engine->TimecodeProviderClassName.ToString());
		}
	}
	else if (Engine->bGenerateDefaultTimecode)
	{
		FName ObjectName = MakeUniqueObjectName(Engine, USystemTimeTimecodeProvider::StaticClass(), "DefaultTimecodeProvider");
		USystemTimeTimecodeProvider* NewTimecodeProvider = NewObject<USystemTimeTimecodeProvider>(Engine, ObjectName);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:19264

Scope (from outer to inner):

file
function     void UEngine::PostEditChangeProperty

Source code excerpt:

	{
		FName PropertyName = PropertyChangedEvent.GetPropertyName();
		if (PropertyName == GET_MEMBER_NAME_CHECKED(UEngine, TimecodeProviderClassName)
			|| PropertyName == GET_MEMBER_NAME_CHECKED(UEngine, bGenerateDefaultTimecode)
			|| PropertyName == GET_MEMBER_NAME_CHECKED(UEngine, GenerateDefaultTimecodeFrameRate)
			|| PropertyName == GET_MEMBER_NAME_CHECKED(UEngine, GenerateDefaultTimecodeFrameDelay))
		{
			// Only reload the timecode provider if the current was created by the engine
			UTimecodeProvider* CurrentTimecodeProvider = GetTimecodeProvider();