Table of Contents

Class VR360ProcessorBlock

Namespace
VisioForge.Core.MediaBlocks.VideoProcessing
Assembly
VisioForge.Core.dll

VR360 processor block that enables real-time rendering and manipulation of 360-degree video content. Supports equirectangular and equiangular cubemap projection formats. The processor uses Direct3D 11 for hardware-accelerated rendering of the spherical projection. Implements VisioForge.Core.Types.IVRVideoControl for unified VR camera control.

public class VR360ProcessorBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IVRVideoControl

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

VR360ProcessorBlock(D3D11VR360RendererSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.VideoProcessing.VR360ProcessorBlock class.

public VR360ProcessorBlock(D3D11VR360RendererSettings settings)

Parameters

settings D3D11VR360RendererSettings

The initial renderer settings.

Properties

FieldOfView

Gets or sets the field of view (FOV) of the VR camera in degrees. This controls the zoom level or how much of the scene is visible.

public float FieldOfView { get; set; }

Property Value

float

Input

Gets the primary input pad for this media block.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets the collection of input pads for this media block.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Mode

Gets or sets the current VR projection mode.

public VRMode Mode { get; set; }

Property Value

VRMode

Output

Gets the primary output pad for this media block.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets the collection of output pads for this media block.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Pitch

Gets or sets the pitch (up/down rotation) of the VR camera in degrees.

public float Pitch { get; set; }

Property Value

float

Roll

Gets or sets the roll (tilt) of the VR camera in degrees.

public float Roll { get; set; }

Property Value

float

Settings

Gets or sets the VR360 renderer settings that control viewport orientation and field of view. For backwards compatibility. Prefer using VisioForge.Core.Types.IVRVideoControl properties directly.

public D3D11VR360RendererSettings Settings { get; set; }

Property Value

D3D11VR360RendererSettings

Type

Gets or sets the functional type of this media block (source, sink, effect, encoder, etc.). This property must be overridden in derived classes to specify the block's role in the pipeline.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Exceptions

NotImplementedException

Thrown when the derived class has not implemented this property.

NotImplementedException

Thrown when the derived class has not implemented the setter.

Yaw

Gets or sets the yaw (left/right rotation) of the VR camera in degrees.

public float Yaw { get; set; }

Property Value

float

Methods

Build()

Builds and initializes this media block, creating any necessary GStreamer elements and configuring them. This method must be overridden in derived classes to implement block-specific initialization logic.

public override bool Build()

Returns

bool

true if the block was successfully built; otherwise, false.

CleanUp()

Performs cleanup of VR360 processor resources.

public void CleanUp()

Dispose(bool)

Releases unmanaged and - optionally - managed resources. Override this method in derived classes to implement block-specific cleanup logic.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks

An override must call its CleanUp() only under disposing. VisioForge.Core.MediaBlocks.MediaBlock.Finalize reaches this method with false, and a block's CleanUp() releases GstSharp wrappers - which takes GStreamer locks and can block - on the finalizer thread, which must never do either. A block that is never disposed leaves its elements to the pipeline that owns them; that is what their toggle refs are for. base.Dispose(disposing) stays outside the guard, because the latch below has to be set on both paths. The one carve-out is a block holding a resource nothing else can release - a device handle, say, which no pipeline owns and no toggle ref reclaims; such a block may run its CleanUp() on the finalizer path, guarded against throwing, and has to say why at the call site (see AndroidUVCSourceBlock). GitHub issue #958.

GetCore()

Gets the core video sample grabber element.

public BaseElement GetCore()

Returns

BaseElement

GetElement()

Gets the raw GStreamer element.

public Element GetElement()

Returns

Element

GetPausedFrame()

Gets the last processed frame with VR360 projection applied.

public VideoFrameX GetPausedFrame()

Returns

VideoFrameX

IsAvailable()

Determines whether VR360 processing is available on the current system.

public static bool IsAvailable()

Returns

bool

IsModeSupported(VRMode)

Checks if a specific VR mode is supported by the implementing component (e.g., video block, effect, or renderer).

public bool IsModeSupported(VRMode mode)

Parameters

mode VRMode

The VisioForge.Core.Types.VRMode to check for support.

Returns

bool

true if the mode is supported; otherwise, false.

Update()

Updates the VR360 rendering parameters in real-time from VisioForge.Core.MediaBlocks.VideoProcessing.VR360ProcessorBlock.Settings. For backwards compatibility. Prefer using VisioForge.Core.Types.IVRVideoControl property setters.

public void Update()

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Associates this MediaBlock with a pipeline and initializes its internal context. This method is called automatically when the block is added to a pipeline, providing access to shared resources and pipeline-wide configuration.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The MediaBlocksPipeline instance that will manage this block.

SettingsChanged

Occurs when any of the VR control settings (Yaw, Pitch, Roll, FieldOfView, Mode) have changed.

public event EventHandler<EventArgs> SettingsChanged

Event Type

EventHandler<EventArgs>