aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Video/NativeMethods.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-01 16:40:13 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-01 16:40:13 +0200
commiteb2c264422b98458979bc96504ce8830a527d48c (patch)
tree2c2e0bcb908867759e7bea31dad0e21bd82f9cff /Software/Visual_Studio/Tango.Video/NativeMethods.cs
parenta89c18abf7175f76f8673c12dac35d1658209d4e (diff)
downloadTango-eb2c264422b98458979bc96504ce8830a527d48c.tar.gz
Tango-eb2c264422b98458979bc96504ce8830a527d48c.zip
Added Tango.Video project.
Implemented USB video device capture for developer module.
Diffstat (limited to 'Software/Visual_Studio/Tango.Video/NativeMethods.cs')
-rw-r--r--Software/Visual_Studio/Tango.Video/NativeMethods.cs66
1 files changed, 66 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Video/NativeMethods.cs b/Software/Visual_Studio/Tango.Video/NativeMethods.cs
new file mode 100644
index 000000000..5e01b3c39
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Video/NativeMethods.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Runtime.InteropServices.ComTypes;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Video.DirectShow
+{
+ internal sealed class NativeMethods
+ {
+ private NativeMethods() { }
+
+ [DllImport("ole32.dll")]
+#if USING_NET11
+ public static extern int CreateBindCtx(int reserved, out UCOMIBindCtx ppbc);
+#else
+ public static extern int CreateBindCtx(int reserved, out IBindCtx ppbc);
+#endif
+
+ [DllImport("ole32.dll")]
+#if USING_NET11
+ public static extern int MkParseDisplayName(UCOMIBindCtx pcb, [MarshalAs(UnmanagedType.LPWStr)] string szUserName, out int pchEaten, out UCOMIMoniker ppmk);
+#else
+ public static extern int MkParseDisplayName(IBindCtx pcb, [MarshalAs(UnmanagedType.LPWStr)] string szUserName, out int pchEaten, out IMoniker ppmk);
+#endif
+
+ [DllImport("oleaut32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
+ public static extern int OleCreatePropertyFrame(
+ [In] IntPtr hwndOwner,
+ [In] int x,
+ [In] int y,
+ [In, MarshalAs(UnmanagedType.LPWStr)] string lpszCaption,
+ [In] int cObjects,
+ [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.IUnknown)] object[] ppUnk,
+ [In] int cPages,
+ [In] IntPtr pPageClsID,
+ [In] int lcid,
+ [In] int dwReserved,
+ [In] IntPtr pvReserved
+ );
+
+ [DllImport("ole32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
+ public static extern int StgCreateDocfile(
+ [In, MarshalAs(UnmanagedType.LPWStr)] string pwcsName,
+ [In] STGM grfMode,
+ [In] int reserved,
+ [Out] out IStorage ppstgOpen
+ );
+
+ [DllImport("ole32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
+ public static extern int StgIsStorageFile([In, MarshalAs(UnmanagedType.LPWStr)] string pwcsName);
+
+ [DllImport("ole32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
+ public static extern int StgOpenStorage(
+ [In, MarshalAs(UnmanagedType.LPWStr)] string pwcsName,
+ [In] IStorage pstgPriority,
+ [In] STGM grfMode,
+ [In] IntPtr snbExclude,
+ [In] int reserved,
+ [Out] out IStorage ppstgOpen
+ );
+
+ }
+}