Table of Contents

Class MediaBlocksPipelineMaterializer

Namespace
VisioForge.Core.MediaBlocks.Serialization
Assembly
VisioForge.Core.dll

Materializes a VisioForge.Core.MediaBlocks.Serialization.MediaBlocksPipelineDocument into a live VisioForge.Core.MediaBlocks.MediaBlocksPipeline through the block catalog: settings are bound from JSON, host resources are resolved, blocks are created and connected following the documented pad id convention (input/output main pads, input:N/output:N indexed pads). Relative file paths inside settings resolve against a base directory when given.

public static class MediaBlocksPipelineMaterializer

Inheritance

Inherited Members

Methods

IsInputAssetProperty(MediaBlockDescriptor, string)

Part of the persistence contract a JSON pipeline host needs, and public on purpose: a host with its own file dialogs has to agree with the SDK on which values are document paths.

Whether a settings property names a file the block reads. Two shapes qualify: a model or dictionary path, whatever the block is, and any path-like property of a source. Everything else is treated as an output, because a block that is not a sink can still write one - an encoder's own output filename is the case that proves it - and demanding that an output already exist refuses to build a perfectly good pipeline.

public static bool IsInputAssetProperty(MediaBlockDescriptor descriptor, string propertyName)

Parameters

descriptor MediaBlockDescriptor

The block's descriptor, or null when it is unknown.

propertyName string

The settings property name.

Returns

bool

true when the property names an input asset.

IsRootedSafe(string)

IsPathRooted(String) without the throw. On net461/net472 it rejects a value containing | " < >, and the callers are reached from a public API documented to return diagnostics rather than propagate. An unusable string is not rooted.

public static bool IsRootedSafe(string value)

Parameters

value string

The setting value.

Returns

bool

true when the value names an absolute path.

LooksLikeRelativePath(string)

Whether a setting value is a document-relative file path rather than an endpoint. Three shapes are not: one that names its scheme ("srt://:8888/", which does not even parse as an absolute URI), a bare host ("192.168.1.22:554/live.sdp"), and anything rooted. This is the single rule the persistence layer applies - preflight validation and path rewriting both go through it, and so should a host that needs to ask the same question.

public static bool LooksLikeRelativePath(string value)

Parameters

value string

The raw setting value.

Returns

bool

true when the value is a relative path.

Materialize(MediaBlocksPipelineDocument, IMediaBlockResourceResolver, string)

Materializes the document into a new pipeline.

public static MediaBlocksPipelineMaterializationResult Materialize(MediaBlocksPipelineDocument document, IMediaBlockResourceResolver resolver = null, string baseDirectory = null)

Parameters

document MediaBlocksPipelineDocument

The validated-or-not source document.

resolver IMediaBlockResourceResolver

Resolves logical resource ids into live objects. Required when the document references resources.

baseDirectory string

Directory that relative file paths in settings resolve against, or null.

Returns

MediaBlocksPipelineMaterializationResult

The materialization result with the pipeline, mapping and diagnostics.

MaterializeInto(MediaBlocksPipeline, MediaBlocksPipelineDocument, IMediaBlockResourceResolver, string)

Materializes the document into an existing pipeline instance.

public static MediaBlocksPipelineMaterializationResult MaterializeInto(MediaBlocksPipeline pipeline, MediaBlocksPipelineDocument document, IMediaBlockResourceResolver resolver = null, string baseDirectory = null)

Parameters

pipeline MediaBlocksPipeline

The target pipeline; existing blocks are not cleared.

document MediaBlocksPipelineDocument

The source document.

resolver IMediaBlockResourceResolver

Resolves logical resource ids into live objects.

baseDirectory string

Directory that relative file paths in settings resolve against, or null.

Returns

MediaBlocksPipelineMaterializationResult

The materialization result; on failure the caller is responsible for clearing the pipeline.

TryResolveAgainst(string, string, out string)

Resolves a document-relative path against the document's folder. False when the two do not combine into a usable path - the old frameworks throw NotSupportedException for a value such as "models\v1:2\y.onnx" - in which case the value is left exactly as the document wrote it and the validator reports it missing.

public static bool TryResolveAgainst(string baseDirectory, string value, out string absolute)

Parameters

baseDirectory string

The directory the document was loaded from.

value string

The relative value.

absolute string

The resolved absolute path, or null.

Returns

bool

true when the value resolved.