Class D3D12FisheyeDewarpBlock
- Assembly
- VisioForge.Core.dll
Direct3D 12 block that dewarps a fisheye image on the GPU into an equirectangular, panorama or perspective view, set by VisioForge.Core.Types.X.VideoEffects.D3D12FisheyeDewarpSettings.Projection. The view (rotation, field of view, region of interest, viewport) can be changed while the pipeline runs: change VisioForge.Core.MediaBlocks.VideoProcessing.D3D12FisheyeDewarpBlock.Settings and call VisioForge.Core.MediaBlocks.VideoProcessing.D3D12FisheyeDewarpBlock.Update. The output has the input's size, format and frame rate; add a resize block after it for another size. The block moves frames to and from the GPU itself: its input and its output each take system, D3D11 or D3D12 memory, whichever the neighbouring block uses, and D3D12 memory on the block's own adapter passes through without a copy on both sides. Requires a Direct3D 12 capable GPU. VisioForge.Core.MediaBlocks.OpenCV.CVDewarpBlock is the CPU alternative. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals.
public class D3D12FisheyeDewarpBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
D3D12FisheyeDewarpBlock(D3D12FisheyeDewarpSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.VideoProcessing.D3D12FisheyeDewarpBlock class.
public D3D12FisheyeDewarpBlock(D3D12FisheyeDewarpSettings settings)Parameters
settingsD3D12FisheyeDewarpSettings-
The dewarping settings.
Exceptions
- ArgumentNullException
-
settingsisnull.
Properties
Input
Gets the input.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets the inputs.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets the outputs.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets the dewarping settings. They are applied when the block is built, and again by VisioForge.Core.MediaBlocks.VideoProcessing.D3D12FisheyeDewarpBlock.Update.
public D3D12FisheyeDewarpSettings Settings { get; }Property Value
Type
Gets the type.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds the block.
public override bool Build()Returns
- bool
-
trueif successful,falseotherwise.
CleanUp()
Releases the GStreamer elements and resets the build state.
public void CleanUp()Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
GetCore()
Gets the core BaseElement wrapper.
public BaseElement GetCore()Returns
- BaseElement
-
The BaseElement wrapper of the upload, dewarp and download elements.
GetElement()
Gets the underlying GStreamer d3d12fisheyedewarp element. VisioForge.Core.MediaBlocks.VideoProcessing.D3D12FisheyeDewarpBlock.Update writes only the settings that changed since its own last write, so a property set directly on this element is not restored by an VisioForge.Core.MediaBlocks.VideoProcessing.D3D12FisheyeDewarpBlock.Update that leaves that setting unchanged.
public Element GetElement()Returns
- Element
-
The d3d12fisheyedewarp element, or
nullbefore the block is built.
IsAvailable()
Determines whether this media block is available. Correct NuGet SDK redist should be included into your project. It does not check for a Direct3D 12 GPU: a missing device is reported as a pipeline error on start.
public static bool IsAvailable()Returns
- bool
-
trueif this media block is available; otherwise,false.
Update()
Applies the current VisioForge.Core.MediaBlocks.VideoProcessing.D3D12FisheyeDewarpBlock.Settings to the running dewarper. The element takes them one property at a time, so a frame rendered during the call may show part of the change; the next one shows all of it. VisioForge.Core.Types.X.VideoEffects.D3D12FisheyeDewarpSettings.AdapterIndex is not changed after the block is built. Before the block is built it only checks the settings: the build applies them, the adapter as it is when the build starts.
public bool Update()Returns
- bool
-
trueif the settings were applied, or are valid and the block is not running;falseif they are invalid, with the cause reported as a pipeline error once the block is in a pipeline.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Associates this block with a pipeline.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The pipeline.