Unreal Engine 4 Genvid Module¶
Introduction¶
The Genvid Module is a standard UE4 module which developers can drop in their UE4 game and very quickly get started with Genvid technologies.
In a way, it’s the high level parts of the GenvidPlugin. It provides a couple of predefined events and routines that you can use in Blueprint and/or your C++ code.
We highly recommend you use the GenvidPlugin and the Genvid Module together for many reasons:
- Dynamic loading/unloading of the Plugin.
- Easy On/Off switch for the Plugin.
- Automatic Audio/Video streaming.
- Predefined events and callback
- Blueprint script.
Details¶
-
UE4 Genvid Module
-
Genvid/Genvid.Build.cs
- Needed to integrate the Genvid Module inside the Unreal
- Engine build process.
-
Public folder
-
Genvid/Public/IGenvidModule.h
Class defining standard Unreal Engine module interface of the Plugin.
-
Genvid/Public/GenvidModule.h
Used for including Genvid Module classes definitions.
-
Genvid/Public/GenvidStreamer.h
- Implementation of the class events and streams accessible from C++
- and Blueprint.
-
Genvid/Public/GenvidJsonUtils.h
Utility class for JSON conversion.
-
Genvid/Public/GenvidTypes.h
- Used for specifying a mirror of types from the Genvid Native SDK
- (genvid.h).
-
Genvid/Public/GenvidWorldSettings.h
Class defining a specialization of AWorldSettings.
-
-
Private folder
-
Genvid/Public/GenvidPrivatePCH.h
- Used for specifying optional precompiled headers for faster
- compiles.
-
Genvid/Public/GenvidModule.cpp
Used for including Genvid module class definitions.
-
Genvid/Public/GenvidStreamer.cpp
- Implementation of the class events and streams accessible from C++
- and Blueprint.
-
Genvid/Public/GenvidJsonUtils.cpp
Utility class for JSON conversion.
-
Genvid/Public/GenvidTypes.cpp
- Used for specifying a mirror of types from the Genvid Native SDK
- (genvid.h).
-
Genvid/Public/GenvidWorldSettings.cpp
Class implementing a specialization of AWorldSettings.
-
-
-
class
UGenvidStreamer
¶ GenvidStreamer is the base class that allows you to create your own framework to manage streams, events, and commands.
AGenvidWorldSettings
automatically triggers the events section.UGenvidStreamer
automatically triggers the callback section. The properties are the data settingsUGenvidStreamer
uses.Events
-
virtual void
BeginPlay
()¶ Acts as a superset of the AActor BeginPlay. It’s the first function
AGenvidWorldSettings
calls.
-
void
Tick
(float deltaTime)¶ Acts as a superset of a tickable UObject. It’s called as long as the object is alive and it depends directly of
StreamingTickInterval
for the time interval.
-
virtual void
EndPlay
(const EEndPlayReason::Type EndPlayReason)¶ Acts as a superset of the AActor EndPlay. It’s the last function
AGenvidWorldSettings
calls.
-
virtual void
HandleMatchHasStarted
()¶ Triggered when entering into a match. It’s called after
BeginPlay()
and just before the match has started.
-
virtual void
HandleMatchHasEnded
()¶ Triggered when exiting a match. (Actors continue ticking.) It’s called just before
EndPlay()
when the match has ended.
Callbacks
-
void
OnGenvidEventCallback
(const FString &EventId, const FGenvidEventSummary &summary)¶ Triggered each time the server sends an event.
-
void
OnGenvidCommandCallback
(const FString &CommandId, const FString &fullCommand)¶ Triggered each time the server sends a command.
Properties
-
TArray<FString>
StreamsToCreate
¶ Array of stream IDs that contains all the streams you want to create.
-
TArray<FString>
EventsToSubscribe
¶ Array of event IDs that contains all the events you want to subscribe to.
-
TArray<FString>
CommandsToSubscribe
¶ - Array of command IDs that contains all the commands you want to subscribe
- to.
-
bool
bIsStreaming
¶ Read-only variable for reporting if the streaming is running.
-
float
StreamingTickInterval
¶ Sets the time interval of the ticking function.
-
bool
bCompressJsonString
¶ Compresses the data of your structure from JSON to ZIP.
-
virtual void
-
class
AGenvidWorldSettings
: public AWorldSettings¶ The class is a superset of AWorldSettings which splits streams in two parts.
The first part automatically manages the life cycle of the audio/video stream. The second part manages custom streams/events/commands of
UGenvidStreamer
objects.Before calling any
UGenvidStreamer
objects,AGenvidWorldSettings
automatically callsStartup()
. When the match has ended,AGenvidWorldSettings
automatically callsShutdown()
.You can modify the properties in the World Settings window of the editor.
Functions
-
bool
Startup
()¶ Dynamically loads the Genvid module and prepares the audio/video streams.
-
bool
Shutdown
()¶ Stops all audio and video capture and unloads the Genvid module.
Properties
-
bool
Enabled
¶ Enables or disables the Genvid SDK.
-
TArray<TSubclassOf<UGenvidStreamer>>
Streamer
¶ Container used to execute a Blueprint script.
More than one script can be used at the same time.
-
bool
bIsStreaming
¶ Read-only variable for reporting if the audio/video streams are running.
-
bool