internal override void Refresh()
 {
     _input    = null;
     _preview  = null;
     _encoding = null;
     base.Refresh();
 }
        /// <summary>
        /// Creates an instance of ChannelInputData class from an instance of ChannelInput.
        /// </summary>
        /// <param name="input">Channel Input to copy into newly created instance.</param>
        public ChannelInputData(ChannelInput input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            KeyFrameInterval  = input.KeyFrameInterval;
            StreamingProtocol = input.StreamingProtocol.ToString();
            AccessControl     = input.AccessControl == null
                ? null
                : new ChannelAccessControlData(input.AccessControl);

            if (input.Endpoints != null)
            {
                Endpoints = input.Endpoints
                            .Select(e => e == null ? null : new ChannelEndpointData(e))
                            .ToList();
            }
        }
Пример #3
0
        /// <summary>
        /// Creates an instance of ChannelCreationOptions class.
        /// </summary>
        /// <param name="name">Name of the channel to be created</param>
        /// <param name="inputStreamingProtocol">the Streaming Protocol of the channel input</param>
        /// <param name="inputIPAllowList">the IP allow list for the channel input access control</param>
        public ChannelCreationOptions(
            string name,
            StreamingProtocol inputStreamingProtocol,
            IEnumerable <IPRange> inputIPAllowList)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException("name");
            }
            if (inputIPAllowList == null)
            {
                throw new ArgumentNullException("inputIPAllowList");
            }

            Name  = name;
            Input = new ChannelInput
            {
                StreamingProtocol = inputStreamingProtocol,
                AccessControl     = new ChannelAccessControl
                {
                    IPAllowList = (inputIPAllowList as IList <IPRange>) ?? inputIPAllowList.ToList()
                }
            };
        }