-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial push of AJAMedia plugin for 4.23. SDK ntv2sdkwin_15.2.0.4
- Loading branch information
Patrick Boutot
committed
Aug 16, 2019
1 parent
49796cf
commit 9febb69
Showing
56 changed files
with
6,133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"FileVersion" : 3, | ||
|
||
"FriendlyName" : "AJA Media Player", | ||
"Version" : 2, | ||
"VersionName" : "2.0", | ||
"CreatedBy" : "Epic Games Inc", | ||
"CreatedByURL" : "http://epicgames.com", | ||
"MarketplaceURL" : "com.epicgames.launcher://ue/marketplace/content/91088fb17fb04b6b9eda41aaf8fda21e", | ||
"Description" : "Implements input and output using AJA Capture cards.", | ||
"Category" : "Media Players", | ||
"CanContainContent" : true, | ||
"EnabledByDefault" : false, | ||
"IsBetaVersion": false, | ||
|
||
"Modules" : | ||
[ | ||
{ | ||
"Name" : "AjaMedia", | ||
"Type" : "Runtime", | ||
"LoadingPhase" : "Default", | ||
"WhitelistPlatforms" : [ "Win64" ] | ||
}, | ||
{ | ||
"Name": "AjaMediaOutput", | ||
"Type" : "Runtime", | ||
"LoadingPhase" : "Default", | ||
"WhitelistPlatforms" : [ "Win64" ] | ||
}, | ||
{ | ||
"Name" : "AjaMediaFactory", | ||
"Type" : "Editor", | ||
"LoadingPhase" : "PostEngineInit", | ||
"WhitelistPlatforms" : [ "Win64" ] | ||
}, | ||
{ | ||
"Name" : "AjaMediaFactory", | ||
"Type": "RuntimeNoCommandlet", | ||
"LoadingPhase" : "PostEngineInit", | ||
"WhitelistPlatforms" : [ "Win64" ] | ||
}, | ||
{ | ||
"Name" : "AjaMediaEditor", | ||
"Type" : "Editor", | ||
"LoadingPhase" : "PostEngineInit", | ||
"WhitelistPlatforms" : [ "Win64" ] | ||
} | ||
], | ||
"Plugins" : | ||
[ | ||
{ | ||
"Name" : "MediaIOFramework", | ||
"Enabled" : true | ||
} | ||
] | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[CoreRedirects] | ||
|
||
; 4.22 | ||
+EnumRedirects=(OldName="EAjaMediaOutputPixelFormat", ValueChanges=(("PF_8BIT_ARGB", "PF_8BIT_YUV"), ("PF_10BIT_RGB", "PF_10BIT_YUV"))) | ||
+EnumRedirects=(OldName="EAjaMediaSourceColorFormat", ValueChanges=(("BGRA", "YUV2_8bit"), ("BGR10", "YUV_10bit"))) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Epic Games | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved. | ||
|
||
using System.IO; | ||
|
||
namespace UnrealBuildTool.Rules | ||
{ | ||
using System.IO; | ||
|
||
public class AjaMedia : ModuleRules | ||
{ | ||
public AjaMedia(ReadOnlyTargetRules Target) : base(Target) | ||
{ | ||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; | ||
|
||
DynamicallyLoadedModuleNames.AddRange( | ||
new string[] { | ||
"Media", | ||
}); | ||
|
||
PrivateDependencyModuleNames.AddRange( | ||
new string[] { | ||
"AJA", | ||
"Core", | ||
"CoreUObject", | ||
"Engine", | ||
"MediaIOCore", | ||
"MediaUtils", | ||
"Projects", | ||
"TimeManagement", | ||
"UtilityShaders" | ||
}); | ||
|
||
PrivateIncludePathModuleNames.AddRange( | ||
new string[] { | ||
"Media", | ||
}); | ||
|
||
PrivateIncludePaths.AddRange( | ||
new string[] { | ||
"AjaMedia/Private", | ||
"AjaMedia/Private/Aja", | ||
"AjaMedia/Private/Assets", | ||
"AjaMedia/Private/Player", | ||
"AjaMedia/Private/Shared", | ||
}); | ||
|
||
PublicDependencyModuleNames.AddRange( | ||
new string[] { | ||
"MediaAssets", | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved. | ||
|
||
#include "Aja.h" | ||
#include "AjaMediaPrivate.h" | ||
|
||
#include "Misc/FrameRate.h" | ||
#include "Interfaces/IPluginManager.h" | ||
#include "HAL/PlatformProcess.h" | ||
#include "Misc/Paths.h" | ||
|
||
//~ Static initialization | ||
//-------------------------------------------------------------------- | ||
void* FAja::LibHandle = nullptr; | ||
bool FAja::bCanForceAJAUsage = false; | ||
|
||
//~ Initialization functions implementation | ||
//-------------------------------------------------------------------- | ||
bool FAja::Initialize() | ||
{ | ||
#if AJAMEDIA_DLL_PLATFORM | ||
check(LibHandle == nullptr); | ||
|
||
#if AJAMEDIA_DLL_DEBUG | ||
const FString AjaDll = TEXT("AJAd.dll"); | ||
#else | ||
const FString AjaDll = TEXT("AJA.dll"); | ||
#endif //AJAMEDIA_DLL_DEBUG | ||
|
||
// determine directory paths | ||
FString AjaDllPath = FPaths::Combine(IPluginManager::Get().FindPlugin(TEXT("AjaMedia"))->GetBaseDir(), TEXT("/Binaries/ThirdParty/Win64")); | ||
FPlatformProcess::PushDllDirectory(*AjaDllPath); | ||
AjaDllPath = FPaths::Combine(AjaDllPath, AjaDll); | ||
|
||
if (!FPaths::FileExists(AjaDllPath)) | ||
{ | ||
UE_LOG(LogAjaMedia, Error, TEXT("Failed to find the binary folder for the AJA dll. Plug-in will not be functional.")); | ||
return false; | ||
} | ||
|
||
LibHandle = FPlatformProcess::GetDllHandle(*AjaDllPath); | ||
|
||
if (LibHandle == nullptr) | ||
{ | ||
UE_LOG(LogAjaMedia, Error, TEXT("Failed to load required library %s. Plug-in will not be functional."), *AjaDllPath); | ||
return false; | ||
} | ||
|
||
//Check if command line argument to force AJA card usage is there | ||
bCanForceAJAUsage = FParse::Param(FCommandLine::Get(), TEXT("forceajausage")); | ||
|
||
#if !NO_LOGGING | ||
AJA::SetLoggingCallbacks(&LogInfo, &LogWarning, &LogError); | ||
#endif // !NO_LOGGING | ||
return true; | ||
#else | ||
return false; | ||
#endif // AJAMEDIA_DLL_PLATFORM | ||
} | ||
|
||
bool FAja::IsInitialized() | ||
{ | ||
return (LibHandle != nullptr); | ||
} | ||
|
||
void FAja::Shutdown() | ||
{ | ||
#if AJAMEDIA_DLL_PLATFORM | ||
if (LibHandle != nullptr) | ||
{ | ||
#if !NO_LOGGING | ||
AJA::SetLoggingCallbacks(nullptr, nullptr, nullptr); | ||
#endif // !NO_LOGGING | ||
FPlatformProcess::FreeDllHandle(LibHandle); | ||
LibHandle = nullptr; | ||
} | ||
#endif // AJAMEDIA_DLL_PLATFORM | ||
} | ||
|
||
//~ Conversion functions implementation | ||
//-------------------------------------------------------------------- | ||
|
||
FTimecode FAja::ConvertAJATimecode2Timecode(const AJA::FTimecode& InTimecode, const FFrameRate& InFPS) | ||
{ | ||
return FTimecode(InTimecode.Hours, InTimecode.Minutes, InTimecode.Seconds, InTimecode.Frames, FTimecode::IsDropFormatTimecodeSupported(InFPS)); | ||
} | ||
|
||
//~ Log functions implementation | ||
//-------------------------------------------------------------------- | ||
void FAja::LogInfo(const TCHAR* InFormat, ...) | ||
{ | ||
#if !NO_LOGGING | ||
TCHAR TempString[1024]; | ||
va_list Args; | ||
|
||
va_start(Args, InFormat ); | ||
FCString::GetVarArgs(TempString, ARRAY_COUNT(TempString), InFormat, Args); | ||
va_end(Args); | ||
|
||
UE_LOG(LogAjaMedia, Log, TempString); | ||
#endif // !NO_LOGGING | ||
} | ||
|
||
void FAja::LogWarning(const TCHAR* InFormat, ...) | ||
{ | ||
#if !NO_LOGGING | ||
TCHAR TempString[1024]; | ||
va_list Args; | ||
|
||
va_start(Args, InFormat ); | ||
FCString::GetVarArgs(TempString, ARRAY_COUNT(TempString), InFormat, Args); | ||
va_end(Args); | ||
|
||
UE_LOG(LogAjaMedia, Warning, TempString); | ||
#endif // !NO_LOGGING | ||
} | ||
|
||
void FAja::LogError(const TCHAR* InFormat, ...) | ||
{ | ||
#if !NO_LOGGING | ||
TCHAR TempString[1024]; | ||
va_list Args; | ||
|
||
va_start(Args, InFormat ); | ||
FCString::GetVarArgs(TempString, ARRAY_COUNT(TempString), InFormat, Args); | ||
va_end(Args); | ||
|
||
UE_LOG(LogAjaMedia, Error, TempString); | ||
#endif // !NO_LOGGING | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved. | ||
|
||
#pragma once | ||
|
||
#include "CoreTypes.h" | ||
#include "Misc/App.h" | ||
#include "Misc/Timecode.h" | ||
#include "Misc/Timespan.h" | ||
|
||
namespace AJA | ||
{ | ||
struct FTimecode; | ||
} | ||
struct FFrameRate; | ||
|
||
class FAja | ||
{ | ||
public: | ||
static bool Initialize(); | ||
static bool IsInitialized(); | ||
static void Shutdown(); | ||
|
||
// Helpers | ||
static FTimecode ConvertAJATimecode2Timecode(const AJA::FTimecode& InTimecode, const FFrameRate& InFPS); | ||
|
||
static bool CanUseAJACard() { return (FApp::CanEverRender() || bCanForceAJAUsage); } | ||
|
||
private: | ||
static void LogInfo(const TCHAR* InFormat, ...); | ||
static void LogWarning(const TCHAR* InFormat, ...); | ||
static void LogError(const TCHAR* InFormat, ...); | ||
|
||
private: | ||
static void* LibHandle; | ||
static bool bCanForceAJAUsage; | ||
}; |
Oops, something went wrong.