Class VideoMixerSourceJsonConverter
- Assembly
- VisioForge.Core.dll
Reads and writes the sources of a video mixer, which are typed by the
VisioForge.Core.Types.X.Sources.IVideoMixerSource interface and so carry no CLR type of their own in JSON. The
concrete settings class is named by a $type property holding its simple type name.
public class VideoMixerSourceJsonConverter : JsonConverter<IVideoMixerSource>Inheritance
Inherited Members
Remarks
The name is resolved against a whitelist built by reflection - the loaded VisioForge assemblies' concrete implementations of VisioForge.Core.Types.X.Sources.IVideoMixerSource - so a document can never name an arbitrary type to instantiate.
Half of the source settings classes are compiled per platform, so a document written on Windows can name a source this build does not contain. That is reported as a JsonException, which the materializer already turns into an MBS043 naming the block, rather than a null source that would surface much later as a missing mixer pad.
JsonConverter<T> matches on the exact type by default, so the nested serialize/deserialize calls below - made against the concrete class - do not re-enter this converter.
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type VisioForge.Core.Types.X.Sources.IVideoMixerSource.
public override IVideoMixerSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)Parameters
readerUtf8JsonReader-
The reader.
typeToConvertType-
The type to convert.
optionsJsonSerializerOptions-
An object that specifies serialization options to use.
Returns
- IVideoMixerSource
-
The converted value.
Write(Utf8JsonWriter, IVideoMixerSource, JsonSerializerOptions)
Writes a specified value as JSON.
public override void Write(Utf8JsonWriter writer, IVideoMixerSource value, JsonSerializerOptions options)Parameters
writerUtf8JsonWriter-
The writer to write to.
valueIVideoMixerSource-
The value to convert to JSON.
optionsJsonSerializerOptions-
An object that specifies serialization options to use.