internal static VideoSink DeserializeVideoSink(JsonElement element) { string videoName = default; Optional <VideoCreationProperties> videoCreationProperties = default; string localMediaCachePath = default; string localMediaCacheMaximumSizeMiB = default; string type = default; string name = default; IList <NodeInput> inputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("videoName")) { videoName = property.Value.GetString(); continue; } if (property.NameEquals("videoCreationProperties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } videoCreationProperties = VideoCreationProperties.DeserializeVideoCreationProperties(property.Value); continue; } if (property.NameEquals("localMediaCachePath")) { localMediaCachePath = property.Value.GetString(); continue; } if (property.NameEquals("localMediaCacheMaximumSizeMiB")) { localMediaCacheMaximumSizeMiB = property.Value.GetString(); continue; } if (property.NameEquals("@type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <NodeInput> array = new List <NodeInput>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(NodeInput.DeserializeNodeInput(item)); } inputs = array; continue; } } return(new VideoSink(type, name, inputs, videoName, videoCreationProperties.Value, localMediaCachePath, localMediaCacheMaximumSizeMiB)); }
internal VideoSink(string type, string name, IList <NodeInput> inputs, string videoName, VideoCreationProperties videoCreationProperties, string localMediaCachePath, string localMediaCacheMaximumSizeMiB) : base(type, name, inputs) { VideoName = videoName; VideoCreationProperties = videoCreationProperties; LocalMediaCachePath = localMediaCachePath; LocalMediaCacheMaximumSizeMiB = localMediaCacheMaximumSizeMiB; Type = type ?? "#Microsoft.VideoAnalyzer.VideoSink"; }