Пример #1
0
        public RtspSource(string name, string sourceLocation, NetworkCredential credential = null, AuthenticationSchemes authType = AuthenticationSchemes.None, Rtsp.RtspClient.ClientProtocolType?rtpProtocolType = null, int bufferSize = RtspClient.DefaultBufferSize, Sdp.MediaType?specificMedia = null, TimeSpan?startTime = null, TimeSpan?endTime = null, bool perPacket = false)
            : this(name, new Uri(sourceLocation), credential, authType, rtpProtocolType, bufferSize, specificMedia.HasValue ? LinqExtensions.Yield(specificMedia.Value) : null, startTime, endTime, perPacket)
        {
            //Check for a null Credential and UserInfo in the Location given.
            if (credential == null && !string.IsNullOrWhiteSpace(m_Source.UserInfo))
            {
                RtspClient.Credential = UriExtensions.ParseUserInfo(m_Source);

                //Remove the user info from the location
                RtspClient.CurrentLocation = new Uri(RtspClient.CurrentLocation.AbsoluteUri.Replace(RtspClient.CurrentLocation.UserInfo + (char)ASCII.AtSign, string.Empty).Replace(RtspClient.CurrentLocation.UserInfo, string.Empty));
            }
        }