예제 #1
0
        public static void MFSetBlob(IMFAttributes p, Guid g, object o)
        {
            HResult hr;
            int     iSize = Marshal.SizeOf(o);

            byte[] b = new byte[iSize];

            GCHandle h = GCHandle.Alloc(b, GCHandleType.Pinned);

            try
            {
                IntPtr ip = h.AddrOfPinnedObject();

                Marshal.StructureToPtr(o, ip, false);
            }
            finally
            {
                h.Free();
            }
            hr = p.SetBlob(g, b, iSize);
            MFError.ThrowExceptionForHR(hr);
        }
예제 #2
0
        public static void MFSetBlob(IMFAttributes p, Guid g, object o)
        {
            int hr;
            int iSize = Marshal.SizeOf(o);
            byte[] b = new byte[iSize];

            GCHandle h = GCHandle.Alloc(b, GCHandleType.Pinned);
            try
            {
                IntPtr ip = h.AddrOfPinnedObject();

                Marshal.StructureToPtr(o, ip, false);
            }
            finally
            {
                h.Free();
            }
            hr = p.SetBlob(g, b, iSize);
            MFError.ThrowExceptionForHR(hr);
        }
예제 #3
0
 public HResult SetBlob(Guid guidKey, byte[] pBuf, int cbBufSize)
 {
     return(m_Attribs.SetBlob(guidKey, pBuf, cbBufSize));
 }