コード例 #1
0
        public static MediaDevice[] GetAvailableMediaDevices()
        {
            DiscoveryClient discoveryClient = new DiscoveryClient(new UdpDiscoveryEndpoint(DiscoveryVersion.WSDiscoveryApril2005));
            FindCriteria    findCriteria    = new FindCriteria
            {
                Duration   = TimeSpan.FromSeconds(1),
                MaxResults = 15
            };

            findCriteria.ContractTypeNames.Add(new XmlQualifiedName("NetworkVideoTransmitter", @"http://www.onvif.org/ver10/network/wsdl"));

            FindResponse findResponse = discoveryClient.Find(findCriteria);

            List <MediaDevice> cameras = new List <MediaDevice>();

            foreach (var point in findResponse.Endpoints)
            {
                Uri uri = point.ListenUris.FirstOrDefault(u => u.HostNameType == UriHostNameType.IPv4);
                if (uri != null)
                {
                    string name = ONVIFAgent.GetDeviceInformation(uri);

                    cameras.Add(new MediaDevice(name, uri));
                }
            }
            return(cameras.ToArray());
        }
コード例 #2
0
ファイル: MediaDevice.cs プロジェクト: phychoz/TestOnvif
        public MediaDevice(string name, Uri uri)
        {
            MediaDeviceUri = uri;
            DisplayName    = name;

            mediaStream = new MediaStreamAgent(this);
            onvif       = new ONVIFAgent(this);
            //avProcessor = new AVProcessorAgent(this);

            Decoder = new AVDecoderAgent(this);
        }
コード例 #3
0
ファイル: MediaDevice.cs プロジェクト: Rukhlov/TestOnvif
        public MediaDevice(string name, Uri uri)
        {
            MediaDeviceUri = uri;
            DisplayName = name;

            mediaStream = new MediaStreamAgent(this);
            onvif = new ONVIFAgent(this);
            //avProcessor = new AVProcessorAgent(this);

            Decoder = new AVDecoderAgent(this);
        }
コード例 #4
0
        public object[] FindDevices()
        {
            mediaDeviceCollection = ONVIFAgent.GetAvailableMediaDevices();

            return(mediaDeviceCollection);
        }