Пример #1
0
 internal MediaGraphExtensionProcessorBase(string type, string name, IList <MediaGraphNodeInput> inputs, MediaGraphEndpoint endpoint, MediaGraphImage image, MediaGraphSamplingOptions samplingOptions) : base(type, name, inputs)
 {
     Endpoint        = endpoint;
     Image           = image;
     SamplingOptions = samplingOptions;
     Type            = type ?? "#Microsoft.Media.MediaGraphExtensionProcessorBase";
 }
        internal static MediaGraphCognitiveServicesVisionExtension DeserializeMediaGraphCognitiveServicesVisionExtension(JsonElement element)
        {
            MediaGraphEndpoint endpoint = default;
            MediaGraphImage    image    = default;
            Optional <MediaGraphSamplingOptions> samplingOptions = default;
            string type = default;
            string name = default;
            IList <MediaGraphNodeInput> inputs = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("endpoint"))
                {
                    endpoint = MediaGraphEndpoint.DeserializeMediaGraphEndpoint(property.Value);
                    continue;
                }
                if (property.NameEquals("image"))
                {
                    image = MediaGraphImage.DeserializeMediaGraphImage(property.Value);
                    continue;
                }
                if (property.NameEquals("samplingOptions"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    samplingOptions = MediaGraphSamplingOptions.DeserializeMediaGraphSamplingOptions(property.Value);
                    continue;
                }
                if (property.NameEquals("@type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("inputs"))
                {
                    List <MediaGraphNodeInput> array = new List <MediaGraphNodeInput>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MediaGraphNodeInput.DeserializeMediaGraphNodeInput(item));
                    }
                    inputs = array;
                    continue;
                }
            }
            return(new MediaGraphCognitiveServicesVisionExtension(type, name, inputs, endpoint, image, samplingOptions.Value));
        }
Пример #3
0
 internal MediaGraphGrpcExtension(string type, string name, IList <MediaGraphNodeInput> inputs, MediaGraphEndpoint endpoint, MediaGraphImage image, MediaGraphSamplingOptions samplingOptions, MediaGraphGrpcExtensionDataTransfer dataTransfer, string extensionConfiguration) : base(type, name, inputs, endpoint, image, samplingOptions)
 {
     DataTransfer           = dataTransfer;
     ExtensionConfiguration = extensionConfiguration;
     Type = type ?? "#Microsoft.Media.MediaGraphGrpcExtension";
 }
 internal MediaGraphHttpExtension(string type, string name, IList <MediaGraphNodeInput> inputs, MediaGraphEndpoint endpoint, MediaGraphImage image, MediaGraphSamplingOptions samplingOptions) : base(type, name, inputs, endpoint, image, samplingOptions)
 {
     Type = type ?? "#Microsoft.Media.MediaGraphHttpExtension";
 }