Navigation
API > API/Plugins > API/Plugins/SharedMemoryMedia
Output Media for SharedMemory.
The pixels are captured into shared cross gpu textures, that a player can read. Inter-process communication happens via shared system memory. The metadata exchanged is documented in the FSharedMemoryMediaFrameMetadata structure. The shared memory can be located via a UniqueName that must match in the Media Output and corresponding Media Source settings.
It is mostly intended for use in nDisplay render nodes, which are designed to be frame-locked.
| Name | USharedMemoryMediaCapture |
| Type | class |
| Header File | /Engine/Plugins/Runtime/nDisplay/Source/SharedMemoryMedia/Public/SharedMemoryMediaCapture.h |
| Include Path | #include "SharedMemoryMediaCapture.h" |
Syntax
UCLASS (BlueprintType)
class USharedMemoryMediaCapture : public UMediaCapture
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UMediaCapture → USharedMemoryMediaCapture
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| NUMBUFFERS | int32 | Number of shared buffers | SharedMemoryMediaCapture.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bTextureReadyFenceBusy | std::atomic< bool > | Flags that the associated TextureReadyFence can be re-used. | SharedMemoryMediaCapture.h | |
| PlatformData | TSharedPtr< FSharedMemoryMediaPlatform, ESPMode::ThreadSafe > | Platform specific data or resources | SharedMemoryMediaCapture.h | |
| RunningTasksCount | std::atomic< int32 > | Counter of running tasks used to detect when to release resources | SharedMemoryMediaCapture.h | |
| SharedCrossGpuTextureGuids | FGuid | Guids associated with the cross gpu textures in use. | SharedMemoryMediaCapture.h | |
| SharedCrossGpuTextures | FTextureRHIRef | Shared Cross Gpu Textures. The texture exchange happens using these. | SharedMemoryMediaCapture.h | |
| SharedMemory | FPlatformMemory::FSharedMemoryRegion * | Shared RAM used for IPC between media capture and player | SharedMemoryMediaCapture.h | |
| TextureReadyFences | FGPUFenceRHIRef | Fence for an async task to know when the cross gpu texture has the data to be shared | SharedMemoryMediaCapture.h |
Functions
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddCopyToSharedGpuTexturePass
(
FRDGBuilder& GraphBuilder, |
SharedMemoryMediaCapture.h | ||
void AddCopyToSharedGpuTexturePass
(
FRDGBuilder& GraphBuilder, |
Adds to the graph builder the copy from the input texture to the shared gpu texture that corresponds to the current frame number | SharedMemoryMediaCapture.h | |
void AddInvertAlphaConversionPass
(
FRDGBuilder& GraphBuilder, |
SharedMemoryMediaCapture.h | ||
void AddInvertAlphaConversionPass
(
FRDGBuilder& GraphBuilder, |
Adds a pass to invert the alpha of the texture | SharedMemoryMediaCapture.h |
Overridden from UMediaCapture
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual EMediaCaptureResourceType GetCustomOutputResourceType() |
SharedMemoryMediaCapture.h | ||
virtual FIntPoint GetCustomOutputSize
(
const FIntPoint& InSize |
For custom conversion, methods that need to be overridden | SharedMemoryMediaCapture.h | |
virtual bool InitializeCapture() |
SharedMemoryMediaCapture.h | ||
virtual void OnCustomCapture_RenderingThread
(
FRDGBuilder& GraphBuilder, |
SharedMemoryMediaCapture.h | ||
virtual bool ShouldCaptureRHIResource() |
SharedMemoryMediaCapture.h | ||
virtual void StopCaptureImpl
(
bool bAllowPendingFrameToBeProcess |
SharedMemoryMediaCapture.h | ||
virtual bool SupportsAnyThreadCapture() |
SharedMemoryMediaCapture.h |