1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | using System.Threading.Tasks; |
---|
6 | using System.Diagnostics; |
---|
7 | using AlaxInfoDirectShowReferenceSource; |
---|
8 | |
---|
9 | namespace RegisterSources |
---|
10 | { |
---|
11 | class Program |
---|
12 | { |
---|
13 | static void UnregisterAll(VideoSourceFilterRegistry registry) |
---|
14 | { |
---|
15 | Debug.Assert(registry != null); |
---|
16 | foreach(SourceFilterRegistryItem item in registry) |
---|
17 | item.Unregister(); |
---|
18 | } |
---|
19 | [STAThread] |
---|
20 | static void Main(string[] args) |
---|
21 | { |
---|
22 | VideoSourceFilterRegistry registry = new VideoSourceFilterRegistry(); |
---|
23 | UnregisterAll(registry); |
---|
24 | int width = 1920, height = 1080; |
---|
25 | //int width = 640, height = 480; |
---|
26 | VideoSourceFilter filter = new VideoSourceFilter(); |
---|
27 | filter.Live = true; |
---|
28 | filter.SetMediaType( |
---|
29 | //width, height, |
---|
30 | width, -height, |
---|
31 | //"{e436eb7e-524f-11ce-9f53-0020af0ba770}"); // RGB32 |
---|
32 | "{773c9ac0-3274-11d0-B724-00aa006c1A01}"); // ARGB32 |
---|
33 | //filter.SetMediaTypeRate(50, 1); // 50 fps |
---|
34 | filter.SetMediaTypeRate(25, 1); // 25 fps |
---|
35 | SourceFilterRegistryItem item; |
---|
36 | //item = registry.Register("Reference Source", filter); |
---|
37 | item = registry.Register("Test (Bottom to Top ARGB32)", filter); |
---|
38 | filter.SetMediaType( |
---|
39 | width, height, |
---|
40 | //width, -height, |
---|
41 | //"{e436eb7e-524f-11ce-9f53-0020af0ba770}"); // RGB32 |
---|
42 | "{773c9ac0-3274-11d0-B724-00aa006c1A01}"); // ARGB32 |
---|
43 | item = registry.Register("Test (Top to Bottom ARGB32)", filter); |
---|
44 | } |
---|
45 | } |
---|
46 | } |
---|