1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | using System.Diagnostics; |
---|
6 | using AlaxInfoIpVideoSource; |
---|
7 | |
---|
8 | namespace RegisterJpegVideoSourceFilter |
---|
9 | { |
---|
10 | class Program |
---|
11 | { |
---|
12 | [STAThread] |
---|
13 | static void Main(string[] args) |
---|
14 | { |
---|
15 | JpegVideoSourceFilterRegistry registry = new JpegVideoSourceFilterRegistry(); |
---|
16 | foreach (JpegVideoSourceFilterRegistryItem item in registry) |
---|
17 | Console.WriteLine(string.Format("{0} - {1}", item.InstanceName, item.FriendlyName)); |
---|
18 | Console.WriteLine("-- Before Registration --"); |
---|
19 | JpegVideoSourceFilter filter = new JpegVideoSourceFilter(); |
---|
20 | // NOTE: Registration and Unregistration requires administrative access and elevated permissions |
---|
21 | filter.Location = "http://192.168.88.21/nph-mjpeg.cgi"; |
---|
22 | filter.Width = 1280; |
---|
23 | filter.Height = 960; |
---|
24 | registry.Register("Test Camera", filter); |
---|
25 | Console.WriteLine("-- After Registration --"); |
---|
26 | foreach (JpegVideoSourceFilterRegistryItem item in registry) |
---|
27 | Console.WriteLine(string.Format("{0} - {1}", item.InstanceName, item.FriendlyName)); |
---|
28 | Console.WriteLine("-- Before Unregistration --"); |
---|
29 | //registry["Test Camera"].Unregister(); |
---|
30 | Console.WriteLine("-- After Unregistration --"); |
---|
31 | foreach (JpegVideoSourceFilterRegistryItem item in registry) |
---|
32 | Console.WriteLine(string.Format("{0} - {1}", item.InstanceName, item.FriendlyName)); |
---|
33 | } |
---|
34 | } |
---|
35 | } |
---|