Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
improve build configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
wongfei committed Nov 9, 2021
1 parent df1e581 commit dfd04d1
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 138 deletions.
8 changes: 8 additions & 0 deletions Plugins/GStreamer/Config/FilterPlugin.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[FilterPlugin]
; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and
; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively.
;
; Examples:
; /README.txt
; /Extras/...
; /Binaries/ThirdParty/*.dll
6 changes: 0 additions & 6 deletions Plugins/GStreamer/GStreamer.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,5 @@
"LoadingPhase": "PostEngineInit",
"WhitelistPlatforms": [ "Win64" ]
}
],
"Plugins": [
{
"Name": "GStreamerLoader",
"Enabled": true
}
]
}
28 changes: 15 additions & 13 deletions Plugins/GStreamer/Source/GStreamer/GStreamer.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ public class GStreamer : ModuleRules
public GStreamer(ReadOnlyTargetRules Target) : base(Target)
{
DefaultBuildSettings = BuildSettingsVersion.V2;
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PCHUsage = PCHUsageMode.NoPCHs; // UseExplicitOrSharedPCHs;
bUseUnity = false;
bEnableUndefinedIdentifierWarnings = false;

PublicDependencyModuleNames.AddRange(
Expand All @@ -18,26 +19,27 @@ public GStreamer(ReadOnlyTargetRules Target) : base(Target)
"RHI",
"RenderCore",
"Slate",
"SlateCore",
"GStreamerLoader"
"SlateCore"
}
);

if (Target.Platform == UnrealTargetPlatform.Win64)
{
const string GStreamerRoot = @"C:\dev\gstreamer_dev\1.0\msvc_x86_64"; // path to gstreamer development package

PublicIncludePaths.Add(Path.Combine(GStreamerRoot, "include"));
PublicIncludePaths.Add(Path.Combine(GStreamerRoot, "include", "gstreamer-1.0"));
PublicIncludePaths.Add(Path.Combine(GStreamerRoot, "include", "glib-2.0"));
PublicIncludePaths.Add(Path.Combine(GStreamerRoot, "lib", "glib-2.0", "include"));
PublicLibraryPaths.Add(Path.Combine(GStreamerRoot, "lib"));
PrivateIncludePaths.Add(Path.Combine(GStreamerRoot, "include"));
PrivateIncludePaths.Add(Path.Combine(GStreamerRoot, "include", "gstreamer-1.0"));
PrivateIncludePaths.Add(Path.Combine(GStreamerRoot, "include", "glib-2.0"));
PrivateIncludePaths.Add(Path.Combine(GStreamerRoot, "lib", "glib-2.0", "include"));

PublicAdditionalLibraries.Add("glib-2.0.lib");
PublicAdditionalLibraries.Add("gobject-2.0.lib");
PublicAdditionalLibraries.Add("gstreamer-1.0.lib");
PublicAdditionalLibraries.Add("gstvideo-1.0.lib");
PublicAdditionalLibraries.Add("gstapp-1.0.lib");
var GStreamerLibPath = Path.Combine(GStreamerRoot, "lib");
PublicSystemLibraryPaths.Add(GStreamerLibPath);

PublicAdditionalLibraries.Add(Path.Combine(GStreamerLibPath, "glib-2.0.lib"));
PublicAdditionalLibraries.Add(Path.Combine(GStreamerLibPath, "gobject-2.0.lib"));
PublicAdditionalLibraries.Add(Path.Combine(GStreamerLibPath, "gstreamer-1.0.lib"));
PublicAdditionalLibraries.Add(Path.Combine(GStreamerLibPath, "gstvideo-1.0.lib"));
PublicAdditionalLibraries.Add(Path.Combine(GStreamerLibPath, "gstapp-1.0.lib"));

PublicDelayLoadDLLs.Add("glib-2.0-0.dll");
PublicDelayLoadDLLs.Add("gobject-2.0-0.dll");
Expand Down
16 changes: 14 additions & 2 deletions Plugins/GStreamer/Source/GStreamer/Private/GStreamerModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
#include "SharedUnreal.h"
#include "Runtime/Core/Public/Misc/Paths.h"

#if PLATFORM_WINDOWS
#include "Windows/AllowWindowsPlatformTypes.h"
#include <windows.h>
#include "Windows/HideWindowsPlatformTypes.h"
#endif

DEFINE_LOG_CATEGORY(LogGStreamer);

class FGStreamerModule : public IGStreamerModule
Expand All @@ -25,7 +31,7 @@ static FString GetGstRoot()

void FGStreamerModule::StartupModule()
{
GST_LOG_DBG(TEXT("StartupModule"));
UE_LOG(LogGStreamer, Display, TEXT("GStreamerModule::StartupModule"));

INIT_PROFILER;

Expand All @@ -37,7 +43,13 @@ void FGStreamerModule::StartupModule()
{
UE_LOG(LogGStreamer, Display, TEXT("GSTREAMER_ROOT: \"%s\""), *RootPath);
BinPath = FPaths::Combine(RootPath, TEXT("bin"));
if (!FPaths::DirectoryExists(BinPath))
if (FPaths::DirectoryExists(BinPath))
{
SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
//SetDllDirectoryW(*BinPath);
AddDllDirectory(*BinPath);
}
else
{
UE_LOG(LogGStreamer, Error, TEXT("Directory not found: \"%s\""), *BinPath);
BinPath = "";
Expand Down
21 changes: 0 additions & 21 deletions Plugins/GStreamerLoader/GStreamerLoader.uplugin

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 5 additions & 0 deletions _precompile.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set "ENGINE_DIR=C:\dev\UE_4.26"
set "PROJECT_DIR=C:\dev\ue4-gstreamer"
set "BUILD_DIR=C:\dev\ue4-gstreamer\Build"

call "%ENGINE_DIR%\Engine\Build\BatchFiles\RunUAT.bat" BuildPlugin -Plugin="%PROJECT_DIR%\Plugins\GStreamer\GStreamer.uplugin" -Package="%BUILD_DIR%\Plugins\GStreamer" -TargetPlatforms=Win64 -Rocket -precompile -VS2019 -StrictIncludes

0 comments on commit dfd04d1

Please sign in to comment.