Guest User

Untitled

a guest
Sep 30th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. // Copyright Epic Games, Inc. All Rights Reserved.
  2.  
  3. using System;
  4. using System.IO;
  5. using UnrealBuildTool;
  6.  
  7. public class GstLib : ModuleRules
  8. {
  9. public GstLib(ReadOnlyTargetRules Target) : base(Target)
  10. {
  11. Type = ModuleType.External;
  12.  
  13. LoadGstLib(Target);
  14. }
  15.  
  16. public bool LoadGstLib(ReadOnlyTargetRules Target)
  17. {
  18. string GstRoot = Environment.GetEnvironmentVariable("GSTREAMER_1_0_ROOT_MSVC_X86_64");
  19. bool isLibrarySupported = (GstRoot != null && Target.Platform == UnrealTargetPlatform.Win64);
  20.  
  21. if (isLibrarySupported)
  22. {
  23. // add Gstreamer libraries
  24. string[] GstLibs = Directory.GetDirectories(Path.Combine(GstRoot, "lib"), "*lib");
  25. foreach (string curLib in GstLibs)
  26. {
  27. PublicAdditionalLibraries.Add(curLib);
  28. }
  29.  
  30. // add Gstreamer include directories
  31. PublicIncludePaths.Add(Path.Combine(GstRoot, "include", "gstreamer-1.0"));
  32. PublicIncludePaths.Add(Path.Combine(GstRoot, "include", "glib-2.0"));
  33. PublicIncludePaths.Add(Path.Combine(GstRoot, "include", "libxml2"));
  34. PublicIncludePaths.Add(Path.Combine(GstRoot, "lib", "glib-2.0", "include"));
  35. PublicIncludePaths.Add(Path.Combine(GstRoot, "lib", "gstreamer-1.0", "include"));
  36.  
  37. // now add own library using the gstreamer thingies to decode on gpu
  38. PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "GstLib/lib/gst_lib.lib"));
  39. PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "GstLib/include"));
  40. }
  41.  
  42. return isLibrarySupported;
  43. }
  44. }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment