source: trunk/Utilities/DirectShowReferenceSource/Sample/RegisterSources/Program.cs @ 574

Last change on this file since 574 was 574, checked in by roman, 7 years ago

Binary update - registration as virtual source; C# code to register sources

File size: 1.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using System.Diagnostics;
7using AlaxInfoDirectShowReferenceSource;
8
9namespace 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            VideoSourceFilter filter = new VideoSourceFilter();
25            filter.Live = true;
26            filter.SetMediaType(1920, 1080,
27                //"{e436eb7e-524f-11ce-9f53-0020af0ba770}"); // RGB32
28                "{773c9ac0-3274-11d0-B724-00aa006c1A01}"); // ARGB32
29            filter.SetMediaTypeRate(25, 1); // 25 fps
30            SourceFilterRegistryItem item = registry.Register("Test Source", filter);
31        }
32    }
33}
Note: See TracBrowser for help on using the repository browser.