Ejemplo n.º 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));
        }
Ejemplo n.º 3
0
        public MediaGraphRtspSource(string name, MediaGraphEndpoint endpoint) : base(name)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }

            Endpoint = endpoint;
            Type     = "#Microsoft.Media.MediaGraphRtspSource";
        }
Ejemplo n.º 4
0
        public MediaGraphExtensionProcessorBase(string name, IEnumerable <MediaGraphNodeInput> inputs, MediaGraphEndpoint endpoint, MediaGraphImage image) : base(name, inputs)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (inputs == null)
            {
                throw new ArgumentNullException(nameof(inputs));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (image == null)
            {
                throw new ArgumentNullException(nameof(image));
            }

            Endpoint = endpoint;
            Image    = image;
            Type     = "#Microsoft.Media.MediaGraphExtensionProcessorBase";
        }
Ejemplo n.º 5
0
        internal static MediaGraphRtspSource DeserializeMediaGraphRtspSource(JsonElement element)
        {
            Optional <MediaGraphRtspTransport> transport = default;
            MediaGraphEndpoint endpoint = default;
            string             type     = default;
            string             name     = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("transport"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    transport = new MediaGraphRtspTransport(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("endpoint"))
                {
                    endpoint = MediaGraphEndpoint.DeserializeMediaGraphEndpoint(property.Value);
                    continue;
                }
                if (property.NameEquals("@type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
            }
            return(new MediaGraphRtspSource(type, name, Optional.ToNullable(transport), endpoint));
        }
Ejemplo n.º 6
0
 internal MediaGraphRtspSource(string type, string name, MediaGraphRtspTransport?transport, MediaGraphEndpoint endpoint) : base(type, name)
 {
     Transport = transport;
     Endpoint  = endpoint;
     Type      = type ?? "#Microsoft.Media.MediaGraphRtspSource";
 }
Ejemplo n.º 7
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";
 }
Ejemplo n.º 8
0
        public MediaGraphGrpcExtension(string name, IEnumerable <MediaGraphNodeInput> inputs, MediaGraphEndpoint endpoint, MediaGraphImage image, MediaGraphGrpcExtensionDataTransfer dataTransfer) : base(name, inputs, endpoint, image)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (inputs == null)
            {
                throw new ArgumentNullException(nameof(inputs));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (image == null)
            {
                throw new ArgumentNullException(nameof(image));
            }
            if (dataTransfer == null)
            {
                throw new ArgumentNullException(nameof(dataTransfer));
            }

            DataTransfer = dataTransfer;
            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";
 }
        public MediaGraphHttpExtension(string name, IEnumerable <MediaGraphNodeInput> inputs, MediaGraphEndpoint endpoint, MediaGraphImage image) : base(name, inputs, endpoint, image)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (inputs == null)
            {
                throw new ArgumentNullException(nameof(inputs));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (image == null)
            {
                throw new ArgumentNullException(nameof(image));
            }

            Type = "#Microsoft.Media.MediaGraphHttpExtension";
        }