Class MediaBlocksPipelineMaterializer
- 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 MediaBlocksPipelineMaterializerInheritance
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
descriptorMediaBlockDescriptor-
The block's descriptor, or null when it is unknown.
propertyNamestring-
The settings property name.
Returns
- bool
-
truewhen 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
valuestring-
The setting value.
Returns
- bool
-
truewhen 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
valuestring-
The raw setting value.
Returns
- bool
-
truewhen 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
documentMediaBlocksPipelineDocument-
The validated-or-not source document.
resolverIMediaBlockResourceResolver-
Resolves logical resource ids into live objects. Required when the document references resources.
baseDirectorystring-
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
pipelineMediaBlocksPipeline-
The target pipeline; existing blocks are not cleared.
documentMediaBlocksPipelineDocument-
The source document.
resolverIMediaBlockResourceResolver-
Resolves logical resource ids into live objects.
baseDirectorystring-
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
baseDirectorystring-
The directory the document was loaded from.
valuestring-
The relative value.
absolutestring-
The resolved absolute path, or null.
Returns
- bool
-
truewhen the value resolved.