コード例 #1
0
ファイル: DirectShow.cs プロジェクト: hoeness2/mcebuddy2
 public static void SetFormat(ref AMMediaType mt, ref VideoInfoHeader vih)
 {
     if (vih != null)
     {
         int cb = Marshal.SizeOf(vih);
         IntPtr _ptr = Marshal.AllocCoTaskMem(cb);
         try
         {
             Marshal.StructureToPtr(vih, _ptr, true);
             SetFormat(ref mt, _ptr, cb);
             if (mt != null)
             {
                 mt.formatType = FormatType.VideoInfo;
             }
         }
         finally
         {
             Marshal.FreeCoTaskMem(_ptr);
         }
     }
 }
コード例 #2
0
ファイル: DirectShow.cs プロジェクト: hoeness2/mcebuddy2
 public void SetFormat(VideoInfoHeader vih)
 {
     if (vih != null)
     {
         int cb = Marshal.SizeOf(vih);
         IntPtr _ptr = Marshal.AllocCoTaskMem(cb);
         try
         {
             Marshal.StructureToPtr(vih, _ptr, true);
             SetFormat(_ptr, cb);
             formatType = FormatType.VideoInfo;
         }
         finally
         {
             Marshal.FreeCoTaskMem(_ptr);
         }
     }
 }